/* =========================================================================
   stylesheet — warm paper, quiet type, unhurried motion.
   All system fonts on purpose (nothing loads from anywhere else).
   ========================================================================= */

:root{
  --ink:#26221c;         /* body text */
  --ink-soft:#4a443b;    /* secondary body text */
  --muted:#928878;       /* meta, captions */
  --faint:#b4aa99;       /* the quietest text */
  --paper:#faf6ef;       /* page */
  --paper-warm:#f3ede2;  /* panels, code, tags */
  --rule:#e6ddcd;        /* hairlines */
  --accent:#b4551f;      /* terracotta */
  --accent-soft:#d9834a;

  --measure:40rem;       /* the text column */
  --gutter:clamp(20px, 6vw, 40px);

  /* the easing everything uses — slow out, no bounce */
  --ease:cubic-bezier(.16,1,.3,1);
}

*{ box-sizing:border-box; }

html{
  scroll-behavior:smooth;
  -webkit-text-size-adjust:100%;
}

body{
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font:17px/1.75 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
       "Helvetica Neue", Arial, sans-serif;
  font-synthesis-weight:none;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

a{
  color:var(--accent);
  text-decoration-color:rgba(180,85,31,.3);
  text-underline-offset:3px;
  transition:color .3s var(--ease), text-decoration-color .3s var(--ease);
}
a:hover{ color:var(--accent-soft); text-decoration-color:currentColor; }
a:visited{ color:var(--accent); }

img{ max-width:100%; height:auto; display:block; border-radius:10px; }

::selection{ background:rgba(180,85,31,.16); }

:focus-visible{
  outline:2px solid var(--accent);
  outline-offset:3px;
  border-radius:4px;
}

/* =========================================================================
   shell
   ========================================================================= */

#shell{
  max-width:var(--measure);
  margin:0 auto;
  padding:0 var(--gutter);
}

/* =========================================================================
   banner — large, calm, lots of air above and below
   ========================================================================= */

#banner{
  padding:clamp(64px,14vh,132px) 0 clamp(36px,7vh,60px);
}

#banner h1{
  margin:0;
  font-size:clamp(38px,8.5vw,58px);
  font-weight:600;
  line-height:1.04;
  letter-spacing:-.035em;
}
#banner h1 a{
  color:var(--ink);
  text-decoration:none;
  transition:opacity .4s var(--ease);
}
#banner h1 a:hover{ opacity:.55; }

#banner .sub{
  margin-top:18px;
  max-width:32rem;
  font-size:18px;
  line-height:1.6;
  color:var(--muted);
  letter-spacing:-.01em;
}

#banner .est{
  margin-bottom:20px;
  font-size:12px;
  font-weight:500;
  letter-spacing:.13em;
  text-transform:uppercase;
  color:var(--faint);
}

/* the banner drifts up and fades as you scroll past it.
   progressive enhancement — does nothing at all where unsupported. */
@supports (animation-timeline:scroll()){
  @media (prefers-reduced-motion:no-preference){
    #banner{
      animation:banner-drift linear both;
      animation-timeline:scroll();
      animation-range:0 70vh;
    }
    @keyframes banner-drift{
      to{ opacity:0; transform:translateY(-28px); }
    }
  }
}

/* =========================================================================
   nav — sticky, translucent, blurred
   ========================================================================= */

/* a floating pill that detaches from the page as you scroll past the banner */
#nav{
  position:sticky;
  top:14px;
  z-index:50;
  display:flex;
  width:fit-content;
  align-items:center;
  gap:2px;
  margin-left:-7px;
  padding:6px 7px;
  border:1px solid transparent;
  border-radius:100px;
  font-size:15px;
  letter-spacing:-.01em;
  background:transparent;
  transition:background-color .45s var(--ease), border-color .45s var(--ease),
             box-shadow .45s var(--ease);
}
/* the frosted panel only materialises once the pill lifts off the banner —
   backdrop-filter blurs even at zero alpha, so it lives here, not above */
#nav.stuck{
  background:rgba(250,246,239,.82);
  -webkit-backdrop-filter:saturate(180%) blur(18px);
  backdrop-filter:saturate(180%) blur(18px);
  border-color:var(--rule);
  box-shadow:0 6px 26px rgba(38,34,28,.08);
}

#nav a{
  padding:5px 12px;
  border-radius:100px;
  color:var(--muted);
  text-decoration:none;
  transition:color .3s var(--ease), background-color .3s var(--ease);
}
#nav a:hover{ color:var(--ink); background:rgba(38,34,28,.055); }
#nav a.on{ color:var(--ink); font-weight:500; }

/* the old separators are decoration this design doesn't need */
#nav .sep{ display:none; }

/* =========================================================================
   main
   ========================================================================= */

#main{ padding:clamp(48px,9vh,80px) 0 0; }

/* =========================================================================
   reveal on scroll
   Elements start low and faint; site.js adds .in as they enter the viewport.
   Content is JS-rendered anyway, so there is no no-JS case to guard.
   ========================================================================= */

.reveal{
  opacity:0;
  transform:translateY(22px);
  transition:opacity .85s var(--ease), transform .85s var(--ease);
  transition-delay:var(--d,0ms);
}
.reveal.in{ opacity:1; transform:none; }

@media (prefers-reduced-motion:reduce){
  html{ scroll-behavior:auto; }
  .reveal{ opacity:1; transform:none; transition:none; }
}

/* =========================================================================
   posts
   ========================================================================= */

.post{
  padding-bottom:clamp(72px,13vh,120px);
}
.post + .post{
  padding-top:clamp(72px,13vh,120px);
  border-top:1px solid var(--rule);
}

.post h2{
  margin:0;
  font-size:clamp(27px,5.2vw,35px);
  font-weight:600;
  line-height:1.16;
  letter-spacing:-.028em;
}
.post h2 a{
  color:var(--ink);
  text-decoration:none;
  transition:color .3s var(--ease);
}
.post h2 a:hover{ color:var(--accent); }

.post .meta{
  margin-top:14px;
  font-size:14px;
  line-height:1.7;
  color:var(--muted);
  letter-spacing:-.005em;
}
.post .meta b{
  font-weight:500;
  color:var(--faint);
}

.post .body{
  margin-top:30px;
  color:var(--ink-soft);
  font-size:17.5px;
  line-height:1.78;
}
.post .body p{ margin:0 0 1.35em; }
.post .body p:last-child{ margin-bottom:0; }
.post .body img{ margin:2em 0; }
.post .body b{ color:var(--ink); font-weight:600; }
.post .body code{
  padding:2px 6px;
  border-radius:5px;
  background:var(--paper-warm);
  font:14.5px/1 ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

/* runs of Japanese text render a size up so they stay legible */
.post .body .jp, .box .inner .jp{
  font-size:1.09em;
  font-family:"Hiragino Kaku Gothic ProN","Hiragino Sans","Yu Gothic",
              "Noto Sans JP", sans-serif;
  letter-spacing:.01em;
}

.post .foot{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
  margin-top:32px;
  font-size:14px;
}

.tag{
  padding:4px 12px;
  border-radius:100px;
  background:var(--paper-warm);
  color:var(--muted);
  font-size:13px;
  text-decoration:none;
  transition:background-color .3s var(--ease), color .3s var(--ease);
}
.tag:hover{ background:#ebe2d3; color:var(--ink); }

.post .foot > a:not(.tag){
  margin-left:auto;
  color:var(--faint);
  text-decoration:none;
}
.post .foot > a:not(.tag):hover{ color:var(--accent); }

/* =========================================================================
   generic page box — no longer a box, just a section
   ========================================================================= */

.box{ padding-bottom:clamp(56px,10vh,96px); }

.box > h2{
  margin:0 0 30px;
  font-size:clamp(27px,5.2vw,35px);
  font-weight:600;
  line-height:1.16;
  letter-spacing:-.028em;
}

.box .inner{
  color:var(--ink-soft);
  font-size:17.5px;
  line-height:1.78;
}
.box .inner p{ margin:0 0 1.35em; }
.box .inner p:last-child{ margin-bottom:0; }
.box .inner b{ color:var(--ink); font-weight:600; }

#more{ padding-bottom:clamp(72px,13vh,120px); }
#more .inner{ text-align:left; }
#more a{
  display:inline-block;
  font-size:16px;
  text-decoration:none;
  transition:transform .4s var(--ease);
}
#more a:hover{ transform:translateX(4px); }

.postnav{
  display:flex;
  gap:20px;
  justify-content:space-between;
  flex-wrap:wrap;
  padding-top:40px;
  border-top:1px solid var(--rule);
  font-size:16px;
}
.postnav a{
  max-width:20rem;
  text-decoration:none;
  letter-spacing:-.01em;
  transition:opacity .3s var(--ease);
}
.postnav a:hover{ opacity:.62; }

.sub-note{ color:var(--muted); }

hr.dots{
  height:1px;
  border:0;
  margin:2em 0;
  background:var(--rule);
}

/* =========================================================================
   empty state
   ========================================================================= */

.empty{
  color:var(--muted);
  line-height:1.8;
}
.empty b{
  display:block;
  margin-bottom:6px;
  color:var(--ink);
  font-size:18px;
  font-weight:600;
}

/* =========================================================================
   archive
   ========================================================================= */

#archive-note{
  margin:0 0 40px !important;
  font-size:15px;
  color:var(--muted);
}

.arc-month{
  margin:52px 0 6px;
  font-size:12px;
  font-weight:600;
  letter-spacing:.13em;
  text-transform:uppercase;
  color:var(--faint);
}
.arc-month:first-child{ margin-top:0; }

ul.arc{ list-style:none; margin:0; padding:0; }
ul.arc li{
  border-bottom:1px solid var(--rule);
}
ul.arc li a{
  display:block;
  padding:17px 0;
  color:var(--ink);
  font-size:18px;
  line-height:1.4;
  letter-spacing:-.018em;
  text-decoration:none;
  transition:color .3s var(--ease), padding-left .4s var(--ease);
}
ul.arc li a:hover{ color:var(--accent); padding-left:9px; }
ul.arc .d{
  display:block;
  margin-top:3px;
  color:var(--faint);
  font-size:14px;
  letter-spacing:0;
}

/* =========================================================================
   footer breathing room at the bottom of every page
   ========================================================================= */

#shell::after{
  content:"";
  display:block;
  height:clamp(64px,12vh,120px);
}

/* =========================================================================
   small screens
   ========================================================================= */

@media (max-width:520px){
  body{ font-size:16px; }
  #banner .sub{ font-size:16.5px; }
  .post .body, .box .inner{ font-size:16.5px; }
  #nav{ font-size:14.5px; gap:2px; }
  #nav a{ padding:5px 9px; }
  ul.arc li a{ font-size:17px; }
}
