/* ==========================================================================
   @font-face, inlined
   Straight from Google Fonts, latin + latin-ext only, exactly the four faces
   this site uses. Inlining means the browser never has to reach
   fonts.googleapis.com, which removes a whole render-blocking origin hop
   (DNS + TLS + a round trip) before any font can start downloading — it goes
   direct to fonts.gstatic.com instead.

   These URLs carry version hashes. If a face ever stops loading, re-fetch and
   paste the latin blocks back in:
   https://fonts.googleapis.com/css2?family=Spectral:wght@300&family=Lato:ital,wght@0,400;0,700;1,400&family=JetBrains+Mono:wght@400&display=swap
   Every stack below has a system fallback, so a dead URL degrades rather than
   breaks.
   ========================================================================== */

/* latin-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/jetbrainsmono/v24/tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKxTNFOVk6OThhvAWV8.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/jetbrainsmono/v24/tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKxTOlOVk6OThhvA.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Lato';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/lato/v25/S6u8w4BMUTPHjxsAUi-qNiXg7eU0.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Lato';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/lato/v25/S6u8w4BMUTPHjxsAXC-qNiXg7Q.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/lato/v25/S6uyw4BMUTPHjxAwXiWtFCfQ7A.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/lato/v25/S6uyw4BMUTPHjx4wXiWtFCc.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/lato/v25/S6u9w4BMUTPHh6UVSwaPGQ3q5d0N7w.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/lato/v25/S6u9w4BMUTPHh6UVSwiPGQ3q5d0.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Spectral';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/spectral/v15/rnCs-xNNww_2s0amA9uSsG3PafaPWnIIMrY.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Spectral';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/spectral/v15/rnCs-xNNww_2s0amA9uSsG3BafaPWnII.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================================
   茶と和紙 — Tea & Paper
   A warm, quiet design system for ritvik1512.xyz

   Type    Spectral 300 (the name) · Lato (body) · JetBrains Mono (labels)
           Japanese uses system faces — 63 characters on this page would
           otherwise pull 15 Noto Sans JP subset files, about 290 KB
   Colour  warm ink on washi, 茶色 tea-brown accent
   Layout  gutter-rail grid — labels in a right-aligned rail, content in a spine

   THEME RESOLUTION
   js/site.js stamps data-scheme="light|dark" on <html> with the *resolved*
   theme, before first paint. Anything that has to differ per theme keys off
   that attribute — never off :not([data-theme=…]), which silently matches the
   un-stamped system-default state and leaks one theme's colours into the other.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  /* Families */
  --display: "Spectral", Iowan Old Style, Georgia, serif;
  --sans: "Lato", "Hiragino Sans", "Yu Gothic", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --jp: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic",
        "Noto Sans CJK JP", "Noto Sans JP", Meiryo, sans-serif;

  /* Type scale */
  --t-display: clamp(2rem, 5.25vw, 2.75rem);
  --t-lede: clamp(1.0625rem, 1.6vw, 1.125rem);
  --t-body: 1.0625rem;
  --t-small: 0.9375rem;
  --t-meta: 0.8125rem;
  --t-label: 0.8125rem;
  --t-micro: 0.6875rem;

  /* Rhythm */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4.5rem;
  --s-9: 7rem;

  /* Grid */
  --rail: 148px;
  --gutter: 40px;
  --measure: 40rem;

  /* Motion — short and crisp. Nothing here should feel like waiting. */
  --ease: cubic-bezier(0.2, 0.8, 0.3, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --quick: 120ms;
  --normal: 180ms;

  /* Palette — 昼 / light. Base is midday: the lightest the paper ever gets,
     still warm, never #fff. The bands below take it toward 焙じ茶 overnight. */
  --paper: #faf7f1;
  --paper-2: #fffdf9;
  --paper-3: #efe9dd;
  --rule: #e4ddcf;
  --rule-strong: #c9c0ad;
  --ink: #2e271f;
  --ink-strong: #1a1611;
  --ink-soft: #6e6455;
  --ink-faint: #6c6250;
  --cha: #7a5a40;        /* 茶色 — tea brown */
  --grain: 0.075;
  --grain-fibre: 0.05;
  --grain-blend: multiply;
}

/* Palette — 夜 / dark. Warm brown-black, no cold greys, no stark white. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #16130f;
    --paper-2: #1c1814;
    --paper-3: #262119;
    --rule: #322c23;
    --rule-strong: #4a4237;
    --ink: #d5cec2;
    --ink-strong: #ede6d9;
    --ink-soft: #948a7b;
    --ink-faint: #8a8071;
    --cha: #c9a183;
    --grain: 0.09;
    --grain-fibre: 0.055;
    --grain-blend: overlay;
  }
}

:root[data-theme="dark"] {
  --paper: #16130f;
  --paper-2: #1c1814;
  --paper-3: #262119;
  --rule: #322c23;
  --rule-strong: #4a4237;
  --ink: #d5cec2;
  --ink-strong: #ede6d9;
  --ink-soft: #948a7b;
  --ink-faint: #8a8071;
  --cha: #c9a183;
  --grain: 0.09;
  --grain-fibre: 0.055;
  --grain-blend: overlay;
}

/* Time-of-day tint, keyed off the RESOLVED scheme so a light band can never
   leak into a dark page. Only the paper moves — ink never does, and every
   band clears 4.5:1 against --ink-faint, the lightest thing set on it.

   day    11–17  base, above: the lightest, palest warm white
   dawn    5–11  a shade creamier
   dusk   17–21  the paper starts to warm
   night  21–5   very light 焙じ茶 — roasted, amber, easy at 2am        */
:root[data-scheme="light"][data-band="dawn"]  { --paper: #f8f4ec; --paper-2: #fefcf7; --paper-3: #eee8db; }
:root[data-scheme="light"][data-band="dusk"]  { --paper: #f5eee2; --paper-3: #e9e0cf; --rule: #e0d8c8; }
:root[data-scheme="light"][data-band="night"] { --paper: #f1e7d8; --paper-2: #faf2e6; --paper-3: #e5dac6;
                                                --rule: #dcd1bd; --rule-strong: #c6baa4; }

:root[data-scheme="dark"][data-band="dusk"]   { --paper: #1a1510; --paper-3: #2a2419; }
:root[data-scheme="dark"][data-band="night"]  { --paper: #120f0a; --paper-3: #221d15; }

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 200ms var(--ease-soft), color 200ms var(--ease-soft);
}



/* Washi, in two layers: a slow anisotropic fibre for the sheet, and a fine
   grain on top for the tooth. Both fixed and non-interactive. */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: var(--grain-blend);
}

body::before {
  z-index: 99;
  opacity: var(--grain-fibre);
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI2MDAiIGhlaWdodD0iNjAwIj48ZmlsdGVyIGlkPSJjIj48ZmVUdXJidWxlbmNlIHR5cGU9ImZyYWN0YWxOb2lzZSIgYmFzZUZyZXF1ZW5jeT0iMC4wMDYgMC4wMjIiIG51bU9jdGF2ZXM9IjQiIHN0aXRjaFRpbGVzPSJzdGl0Y2giLz48ZmVDb2xvck1hdHJpeCB0eXBlPSJzYXR1cmF0ZSIgdmFsdWVzPSIwIi8+PC9maWx0ZXI+PHJlY3Qgd2lkdGg9IjYwMCIgaGVpZ2h0PSI2MDAiIGZpbHRlcj0idXJsKCNjKSIvPjwvc3ZnPg==");
  background-size: 600px 600px;
}

body::after {
  z-index: 100;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNDAiIGhlaWdodD0iMTQwIj48ZmlsdGVyIGlkPSJuIj48ZmVUdXJidWxlbmNlIHR5cGU9ImZyYWN0YWxOb2lzZSIgYmFzZUZyZXF1ZW5jeT0iMC45IiBudW1PY3RhdmVzPSIzIiBzdGl0Y2hUaWxlcz0ic3RpdGNoIi8+PGZlQ29sb3JNYXRyaXggdHlwZT0ic2F0dXJhdGUiIHZhbHVlcz0iMCIvPjwvZmlsdGVyPjxyZWN0IHdpZHRoPSIxNDAiIGhlaWdodD0iMTQwIiBmaWx0ZXI9InVybCgjbikiLz48L3N2Zz4=");
  background-size: 140px 140px;
}

/* A wash of tea, not a block of colour. */
::selection { background: rgba(122, 90, 64, 0.22); }
:root[data-scheme="dark"] ::selection { background: rgba(201, 161, 131, 0.26); }

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul { list-style: none; padding: 0; }
[hidden] { display: none !important; }

:lang(ja) { font-family: var(--jp); }

/* --------------------------------------------------------------------------
   3. Links
   text-decoration, not a background gradient: it follows the text across line
   breaks, so a title that wraps to two lines gets an underline under the words
   rather than a rule across the whole column.
   Hover is a small warm step to --ink-strong. Nothing jumps to white.
   -------------------------------------------------------------------------- */

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: text-decoration-color var(--quick) var(--ease-soft),
              color var(--quick) var(--ease-soft);
}

a:hover,
a:focus-visible {
  color: var(--ink-strong);
  text-decoration-color: var(--cha);
}

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

/* --------------------------------------------------------------------------
   4. Layout — the gutter rail
   -------------------------------------------------------------------------- */

.page {
  max-width: calc(var(--rail) + var(--gutter) + var(--measure));
  margin: 0 auto;
  padding: var(--s-9) var(--s-6) var(--s-8);
}

.block {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  column-gap: var(--gutter);
  margin-bottom: var(--s-8);
}

.block > .col { grid-column: 2; min-width: 0; }

.rail {
  grid-column: 1;
  margin: 0;
  font-family: var(--mono);
  font-size: var(--t-label);
  font-weight: 400;
  letter-spacing: 0.005em;
  line-height: 1;
  color: var(--ink-faint);
  text-align: right;
  padding-top: 0.5em;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   5. Masthead
   -------------------------------------------------------------------------- */

.masthead .rail { padding-top: 0.75em; }

.stamp {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.7em;
  font-family: var(--mono);
  font-size: var(--t-micro);
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--ink-faint);
}

.zone {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3em;
}

/* The visitor's own zone is context; Tokyo is the one the page is about. */
.zone-local .place,
.zone-local .clock { color: var(--ink-faint); }

.stamp .place {
  font-size: 0.875rem;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}

.stamp .place .tz { color: var(--ink-faint); }

.stamp .clock {
  font-size: 0.8125rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.stamp .band {
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  color: var(--cha);
}

h1 {
  font-family: var(--display);
  font-size: var(--t-display);
  font-weight: 300;
  line-height: 1.12;
  letter-spacing: -0.012em;
  color: var(--ink-strong);
  text-wrap: balance;
  margin-bottom: var(--s-5);
}

.lede {
  font-size: var(--t-lede);
  line-height: 1.7;
  text-wrap: pretty;
  max-width: 34rem;
}

.lede em { font-style: italic; color: var(--ink-strong); }

.links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-5);
  margin-top: var(--s-6);
  font-family: var(--mono);
  font-size: var(--t-label);
  letter-spacing: 0.005em;
}

.links a { color: var(--ink-soft); }

.aside {
  margin-top: var(--s-5);
  color: var(--ink-soft);
}

.aside + .links { margin-top: var(--s-3); }

/* --------------------------------------------------------------------------
   6. Prose lists
   -------------------------------------------------------------------------- */

.notes li {
  position: relative;
  padding-left: var(--s-5);
  margin-bottom: var(--s-4);
  text-wrap: pretty;
}

.notes li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 12px;
  height: 1px;
  background: var(--rule-strong);
}

.notes li:last-child { margin-bottom: 0; }
.notes strong { font-weight: 700; color: var(--ink-strong); }

/* --------------------------------------------------------------------------
   7. Entries — bibliography rows
   Reading order: title · year, then authors, then venue as the closing tag.
   -------------------------------------------------------------------------- */

.entries li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: var(--s-4);
  align-items: baseline;
  padding: var(--s-4) var(--s-3);
  margin: 0 calc(var(--s-3) * -1);
  border-radius: 3px;
  border-bottom: 1px solid var(--rule);
  transition: background-color var(--quick) var(--ease-soft);
}

.entries li:first-child { border-top: 1px solid var(--rule); }
.entries li:hover { background: var(--paper-3); }

.entries .title {
  grid-column: 1;
  color: var(--ink-strong);
  font-weight: 700;
  line-height: 1.4;
}

.entries .year {
  grid-column: 2;
  font-family: var(--mono);
  font-size: var(--t-meta);
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.entries .meta {
  grid-column: 1 / -1;
  display: block;
  margin-top: var(--s-2);
  font-size: var(--t-small);
  line-height: 1.5;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.entries .venue {
  grid-column: 1 / -1;
  display: block;
  margin-top: var(--s-1);
  font-size: var(--t-meta);
  letter-spacing: 0.01em;
  color: var(--cha);
  text-wrap: pretty;
}

.entries .venue .en {
  color: var(--ink-faint);
  letter-spacing: 0;
}

.entries .me { color: var(--cha); font-weight: 700; }

/* "In another life" reads as a menu: the arrow steps out on hover. */
.things .title::after {
  content: "→";
  display: inline-block;
  margin-left: 0.5em;
  font-family: var(--mono);
  font-size: 0.75em;
  font-weight: 400;
  color: var(--rule-strong);
  transform: translateX(-3px);
  opacity: 0;
  transition: transform var(--normal) var(--ease), opacity var(--normal) var(--ease),
              color var(--normal) var(--ease);
}

.things li:hover .title::after {
  transform: translateX(0);
  opacity: 1;
  color: var(--cha);
}

/* --------------------------------------------------------------------------
   8. Colophon
   -------------------------------------------------------------------------- */

.colophon {
  margin-top: var(--s-9);
  padding-top: var(--s-5);
  border-top: 1px solid var(--rule);
}

.colophon .col {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-3) var(--s-5);
  font-family: var(--mono);
  font-size: var(--t-micro);
  letter-spacing: 0.01em;
  line-height: 1.8;
  color: var(--ink-soft);
}

/* --------------------------------------------------------------------------
   9. Theme switch
   -------------------------------------------------------------------------- */

.theme-toggle {
  position: fixed;
  top: var(--s-5);
  right: var(--s-5);
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.45em 0.85em;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper-2);
  background: color-mix(in srgb, var(--paper-2) 82%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-family: var(--mono);
  font-size: var(--t-micro);
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color var(--quick) var(--ease-soft), border-color var(--quick) var(--ease-soft);
}

.theme-toggle:hover { color: var(--ink-strong); border-color: var(--rule-strong); }
.theme-toggle:focus-visible { outline: 2px solid var(--cha); outline-offset: 3px; }
.theme-toggle .glyph { font-size: 0.875rem; letter-spacing: 0; color: var(--cha); }

/* --------------------------------------------------------------------------
   10. Motion — ink settling onto paper. Short, then done.
   -------------------------------------------------------------------------- */

@keyframes settle {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: none; }
}

.js [data-reveal] { opacity: 0; }

.js [data-reveal].is-in {
  animation: settle 300ms var(--ease) both;
  animation-delay: var(--delay, 0ms);
}

/* Failsafe: the inline head script flips this on after 3s, so a failed or
   blocked site.js can never leave the page blank. */
.reveal-all [data-reveal] {
  opacity: 1 !important;
  animation: none !important;
  transform: none !important;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal],
  .js [data-reveal].is-in { opacity: 1; animation: none; transform: none; }
  * { transition-duration: 1ms !important; }
}

/* --------------------------------------------------------------------------
   11. Narrow screens — the rail folds into a header above its content
   -------------------------------------------------------------------------- */

@media (max-width: 760px) {
  :root { --t-display: clamp(1.875rem, 8vw, 2.375rem); }

  .page { padding: var(--s-7) var(--s-5); }

  .block { grid-template-columns: minmax(0, 1fr); margin-bottom: var(--s-7); }
  .block > .col, .block > .rail { grid-column: 1; }

  .rail {
    text-align: left;
    padding-top: 0;
    margin-bottom: var(--s-4);
    padding-bottom: var(--s-2);
    border-bottom: 1px solid var(--rule);
  }

  .masthead .rail { border-bottom: none; padding-bottom: 0; margin-bottom: var(--s-5); }
  .stamp { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0.4em 0.9em; }
  .zone { flex-direction: row; align-items: baseline; gap: 0.45em; }

  .theme-toggle { top: var(--s-3); right: var(--s-3); }

  .entries li { grid-template-columns: minmax(0, 1fr); }
  .entries .year { grid-column: 1; margin-top: var(--s-1); }
}

/* --------------------------------------------------------------------------
   12. Print
   -------------------------------------------------------------------------- */

@media print {
  :root { --paper: #fff; --ink: #000; --ink-soft: #444; }
  body::before, body::after, .theme-toggle { display: none; }
  .page { max-width: none; padding: 0; }
  a { color: #000; text-decoration-color: #999; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.75em; color: #555; }
}
