/* epoch0.org
   Palette named after Song and Ming porcelain glazes:
   天青 celadon ground, 月白 moon-white plates, 墨 ink, 霁蓝 cobalt accent. */

/* Self-hosted subsets containing only the glyphs this page uses.
   After editing any text, run: python3 tools/subset-fonts.py */
@font-face {
  font-family: "Noto Serif SC";
  src: url("../fonts/noto-serif-sc-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Noto Serif SC";
  src: url("../fonts/noto-serif-sc-300.woff2") format("woff2");
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("../fonts/eb-garamond.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("../fonts/eb-garamond-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("../fonts/dm-mono-300.woff2") format("woff2");
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("../fonts/dm-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --ground: #E5ECE9;
  --plate: #EDF2EF;
  --ink: #15202A;
  --slate: #55656B;
  --faint: #8E9D9D;
  --rule: rgba(21, 32, 42, .13);
  --rule-strong: rgba(21, 32, 42, .32);
  --accent: #1D4F91;
  --accent-wash: rgba(29, 79, 145, .09);

  --cjk: "Noto Serif SC", "Source Han Serif SC", "Source Han Serif", "Songti SC", "STSong", "SimSun", serif;
  --serif: "EB Garamond", "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
  --mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, "Noto Serif SC", monospace;

  --gutter: clamp(16px, 5vw, 72px);
  --max: 1240px;
  --nav-h: 60px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0C1316;
    --plate: #10191D;
    --ink: #D8E2DE;
    --slate: #8FA19D;
    --faint: #5A6A69;
    --rule: rgba(216, 226, 222, .12);
    --rule-strong: rgba(216, 226, 222, .3);
    --accent: #86ABE3;
    --accent-wash: rgba(134, 171, 227, .1);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #0C1316;
  --plate: #10191D;
  --ink: #D8E2DE;
  --slate: #8FA19D;
  --faint: #5A6A69;
  --rule: rgba(216, 226, 222, .12);
  --rule-strong: rgba(216, 226, 222, .3);
  --accent: #86ABE3;
  --accent-wash: rgba(134, 171, 227, .1);
  color-scheme: dark;
}

/* ---------- base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.9;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-autospace: normal;
  transition: background-color .5s ease, color .5s ease;
}

::selection { background: var(--accent); color: var(--ground); }

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 1.5px solid var(--accent);
  outline-offset: 4px;
}

p, h1, h2, blockquote, figure, dl, dd { margin: 0; }
cite { font-style: normal; }
sub { font-size: .62em; line-height: 0; vertical-align: -.28em; }

.m { font-family: "EB Garamond", serif; font-style: italic; font-size: 1.1em; letter-spacing: .01em; }
.m-display {
  display: block; margin: .5em 0 0; white-space: nowrap;
  font-family: "EB Garamond", serif; font-size: 1.3em; letter-spacing: .02em;
}
.m-display .m { font-size: 1em; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 50;
  padding: 8px 14px; background: var(--ink); color: var(--ground);
  font: 14px/1.4 var(--cjk);
}
.skip:focus { top: calc(env(safe-area-inset-top, 0px) + 12px); }

/* ---------- nav ---------- */

.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  padding-top: env(safe-area-inset-top, 0px);
}
.nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--ground);
  background: color-mix(in srgb, var(--ground) 84%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
  opacity: 0; transition: opacity .4s ease;
}
.nav.is-scrolled::before { opacity: 1; }

.nav-inner {
  max-width: var(--max); margin: 0 auto;
  height: var(--nav-h);
  padding-inline: var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.brand-mark { width: 24px; height: 24px; color: var(--accent); flex: none; }
.brand-word { font-family: "EB Garamond", serif; font-style: italic; font-size: 21px; letter-spacing: .01em; line-height: 1; }

.toc { display: flex; gap: 4px; }
.toc a {
  font-family: var(--cjk); font-size: 14px; line-height: 1;
  color: var(--slate); padding: 8px 9px; position: relative;
  transition: color .25s ease;
}
.toc a::after {
  content: ""; position: absolute; left: 50%; bottom: 0; width: 4px; height: 4px;
  margin-left: -2px; border-radius: 50%; background: var(--accent);
  transform: scale(0); transition: transform .3s ease;
}
.toc a:hover { color: var(--ink); }
.toc a[aria-current="true"] { color: var(--ink); }
.toc a[aria-current="true"]::after { transform: scale(1); }

.nav-end { display: flex; align-items: center; gap: 14px; }
.nav-blog {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .04em;
  color: var(--ink); padding: 7px 12px; border: 1px solid var(--rule-strong);
  transition: border-color .25s ease, color .25s ease, background-color .25s ease;
  white-space: nowrap;
}
.nav-blog:hover { border-color: var(--accent); color: var(--accent); }

.theme-toggle {
  width: 34px; height: 34px; padding: 0; display: grid; place-items: center;
  background: none; border: 1px solid transparent; border-radius: 50%;
  color: var(--slate); cursor: pointer;
  transition: color .25s ease, border-color .25s ease;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--rule-strong); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle circle { fill: none; stroke: currentColor; stroke-width: 1.3; }
.theme-toggle path { fill: currentColor; }

@media (max-width: 900px) { .toc { display: none; } }
@media (max-width: 420px) {
  .nav-blog { font-size: 11.5px; padding: 6px 9px; }
  .brand-word { font-size: 19px; }
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: min(94svh, 980px);
  display: grid; align-items: end;
  overflow: hidden; isolation: isolate;
}
@supports not (height: 1svh) { .hero { min-height: min(94vh, 980px); } }

.field {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; display: block;
}
.hero-veil {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 58% 52% at 18% 74%, color-mix(in srgb, var(--ground) 88%, transparent) 0%, color-mix(in srgb, var(--ground) 55%, transparent) 45%, transparent 75%),
    radial-gradient(ellipse 13% 36% at 84% 32%, color-mix(in srgb, var(--ground) 78%, transparent) 0%, transparent 100%),
    radial-gradient(ellipse 15% 16% at 84% 76%, color-mix(in srgb, var(--ground) 78%, transparent) 0%, transparent 100%),
    linear-gradient(to top, var(--ground) 0%, transparent 16%),
    linear-gradient(to bottom, color-mix(in srgb, var(--ground) 70%, transparent) 0%, transparent 14%);
}

.hero-inner {
  width: 100%; max-width: var(--max); margin: 0 auto;
  padding: calc(var(--nav-h) + 72px) var(--gutter) clamp(64px, 11vh, 128px);
}

.wordmark {
  display: flex; align-items: baseline;
  font-family: "EB Garamond", serif; font-style: italic; font-weight: 400;
  font-size: clamp(84px, 15vw, 212px);
  line-height: .86; letter-spacing: -.018em;
  color: var(--ink);
  margin-left: -.04em;
}
.wm-zero {
  position: relative; flex: none;
  width: .7em; height: .7em;
  margin-left: .08em;
  transform: translateY(.035em);
}
.wm-zero canvas {
  position: absolute; left: -18%; top: -18%;
  width: 136%; height: 136%; display: block;
}

.hero-lede {
  margin-top: clamp(44px, 6.5vh, 72px);
  font-family: var(--cjk); font-weight: 300;
  font-size: clamp(24px, 2.9vw, 38px); line-height: 1.4;
  letter-spacing: .08em;
}
.hero-sub {
  margin-top: 16px; max-width: 29em;
  font-size: 16.5px; line-height: 1.95; color: var(--slate);
  text-wrap: pretty;
}
.hero-cta {
  display: inline-flex; align-items: center; gap: 12px;
  margin-top: 32px; padding-bottom: 6px;
  font-family: var(--cjk); font-size: 15px; letter-spacing: .12em;
  color: var(--ink); border-bottom: 1px solid var(--rule-strong);
  transition: border-color .25s ease, color .25s ease;
}
.hero-cta:hover { color: var(--accent); border-color: var(--accent); }
.cta-arrow { font-family: var(--mono); display: inline-block; transition: transform .3s ease; }
.hero-cta:hover .cta-arrow { transform: translateY(3px); }

.verse {
  position: absolute;
  top: calc(var(--nav-h) + 56px);
  right: max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter)));
  writing-mode: vertical-rl;
  display: flex; gap: 22px;
  font-family: var(--cjk); font-weight: 400;
  font-size: 15px; line-height: 2.1; letter-spacing: .32em;
  color: var(--ink);
}
.verse p { opacity: .82; }
.verse cite {
  font-size: 12px; letter-spacing: .24em; color: var(--slate);
  padding-top: 3.2em;
}

.hud {
  position: absolute;
  right: max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter)));
  bottom: clamp(64px, 11vh, 128px);
  font-family: var(--mono); font-weight: 300; font-size: 11.5px; line-height: 1.7;
  color: var(--slate); text-align: right;
}
.hud-note { font-family: var(--cjk); font-size: 12px; letter-spacing: .08em; line-height: 1.9; margin-bottom: 14px; }
.hud dl { display: grid; gap: 1px; justify-content: end; }
.hud dl div { display: grid; grid-template-columns: 64px 76px; gap: 12px; }
.hud dt { color: var(--faint); letter-spacing: .08em; text-align: left; }
.hud dd { color: var(--ink); font-variant-numeric: tabular-nums; }

@media (max-width: 1080px) {
  .verse { font-size: 14px; }
}
@media (max-width: 860px) {
  .hero { min-height: auto; align-items: start; }
  .hero-inner { padding-top: calc(var(--nav-h) + 26vh); padding-bottom: 28px; }
  .verse {
    position: static; writing-mode: horizontal-tb; display: block;
    max-width: var(--max); margin: 0 auto; width: 100%;
    padding: 0 var(--gutter);
    font-size: 14px; letter-spacing: .12em; line-height: 2;
  }
  .verse br { display: none; }
  .verse cite { display: block; padding-top: 4px; font-size: 12px; }
  .hud {
    position: static; text-align: left;
    width: 100%; max-width: var(--max); margin: 0 auto;
    padding: 22px var(--gutter) 24px;
  }
  .hud-note { margin-bottom: 10px; }
  .hud dl { justify-content: start; grid-template-columns: repeat(2, auto); column-gap: 28px; }
  .hud dl div { grid-template-columns: 56px auto; }
  .hero-veil {
    background:
      linear-gradient(to top, var(--ground) 0%, color-mix(in srgb, var(--ground) 82%, transparent) 42%, transparent 72%),
      linear-gradient(to bottom, color-mix(in srgb, var(--ground) 70%, transparent) 0%, transparent 14%);
  }
}

/* ---------- shared type ---------- */

.eyebrow {
  display: flex; align-items: baseline; gap: 14px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--slate);
}
.eyebrow-cjk { font-family: var(--cjk); font-size: 15px; letter-spacing: 0; color: var(--ink); }

.prose { max-width: 33em; }
.prose p {
  margin: 0 0 1.05em;
  text-align: justify; text-justify: inter-character;
  hanging-punctuation: allow-end;
  line-break: strict;
}
.prose p:last-child { margin-bottom: 0; }

/* ---------- 式 ---------- */

.rule {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(88px, 13vh, 160px) var(--gutter) clamp(72px, 10vh, 120px);
}

.eq {
  display: flex; flex-wrap: wrap; align-items: flex-start;
  gap: 18px clamp(12px, 2.4vw, 40px);
  margin-top: clamp(28px, 5vh, 56px);
  font-family: "EB Garamond", serif; font-style: italic; font-weight: 400;
  font-size: clamp(46px, 8.6vw, 128px); line-height: 1.05;
}
.term { display: flex; flex-direction: column; }
.term .sym { white-space: nowrap; }
.term .sym sub { font-size: .42em; vertical-align: -.1em; margin-left: .04em; }
.term .L { font-style: italic; }
.term.op .sym { font-style: normal; }
.term .note {
  margin-top: 14px; padding-top: 10px; min-width: 5.5em;
  border-top: 1px solid var(--rule-strong);
  font-family: var(--cjk); font-style: normal; font-weight: 400;
  font-size: 14px; line-height: 1.6; letter-spacing: .06em;
  color: var(--slate);
}
.term .note b {
  display: block; margin-bottom: 4px;
  font-weight: 400; font-size: 30px; line-height: 1.2; letter-spacing: 0;
  color: var(--accent);
}
.term.key .sym { color: var(--accent); }
.term.key .note { border-top-color: var(--accent); }

.rule-body {
  display: grid; gap: clamp(36px, 5vw, 64px);
  margin-top: clamp(56px, 9vh, 104px);
}
.classic blockquote p {
  font-family: var(--cjk); font-weight: 300;
  font-size: clamp(24px, 2.7vw, 36px); line-height: 1.75; letter-spacing: .1em;
}
.classic em { font-style: normal; color: var(--accent); }
.classic figcaption {
  margin-top: 16px;
  font-family: var(--cjk); font-size: 13px; letter-spacing: .14em; color: var(--slate);
}
.rule-gloss .k { font-style: normal; color: var(--accent); }

@media (min-width: 980px) {
  .rule-body {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    column-gap: clamp(40px, 6vw, 96px);
    align-items: start;
  }
  .rule-body .classic { grid-column: 2; grid-row: 1 / span 2; padding-top: 4px; }
  .rule-body .rule-gloss { grid-column: 1; }
}

/* ---------- chapters ---------- */

.chapter, .coda {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(80px, 12vh, 150px) var(--gutter);
  display: grid; gap: 44px;
  position: relative;
}
.chapter::before, .coda::before {
  content: ""; position: absolute; top: 0;
  left: var(--gutter); right: var(--gutter);
  border-top: 1px solid var(--rule);
}

.ch-mark { display: flex; align-items: center; gap: 16px; }
.numeral {
  font-family: var(--cjk); font-weight: 300;
  font-size: 30px; line-height: 1;
  color: var(--accent);
}
.ch-mark::after {
  content: ""; order: 1; width: 28px; height: 1px; background: var(--rule-strong);
}
.ch-mark .ch-term { order: 2; }
.ch-term {
  font-family: var(--cjk); font-size: 14px; letter-spacing: .12em; color: var(--slate);
}
.ch-term i { font-family: "EB Garamond", serif; font-size: 17px; letter-spacing: .01em; margin-left: 4px; }

.ch-title {
  margin-top: 22px;
  font-family: var(--cjk); font-weight: 300;
  font-size: clamp(42px, 5.2vw, 68px); line-height: 1.2; letter-spacing: .08em;
  text-wrap: balance;
  display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
}

.epigraph { margin-top: 26px; }
.epigraph p {
  font-family: var(--cjk); font-weight: 400;
  font-size: 19px; line-height: 1.95; letter-spacing: .08em;
}
.epigraph cite {
  display: block; margin-top: 8px;
  font-family: var(--cjk); font-size: 13px; letter-spacing: .12em; color: var(--slate);
}
.epigraph cite::before { content: ""; display: inline-block; width: 22px; height: 1px; margin-right: 10px; vertical-align: .32em; background: var(--rule-strong); }

.ch-text .prose { margin-top: 40px; }

@media (min-width: 980px) {
  .chapter {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    column-gap: clamp(40px, 6vw, 96px);
    align-items: start;
  }
  .chapter .plate {
    position: sticky;
    top: calc(var(--nav-h) + 32px);
    margin-top: 10px;
  }
}

/* ---------- plates (figures) ---------- */

.plate {
  background: var(--plate);
  border: 1px solid var(--rule);
  min-width: 0;
}
.plate-stage { position: relative; aspect-ratio: 4 / 3; max-width: 100%; }
.plate-stage canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block; touch-action: pan-y;
}
.plate-tag, .plate-read, .plate-legend, .plate-verdict {
  position: absolute; pointer-events: none;
  font-family: var(--mono); font-weight: 300; font-size: 11.5px; line-height: 1.5;
}
.plate-tag {
  left: 16px; top: 14px;
  font-family: var(--cjk); font-weight: 400; font-size: 12.5px; letter-spacing: .2em; color: var(--slate);
}
.plate-read {
  right: 16px; top: 14px; text-align: right;
  color: var(--ink); font-variant-numeric: tabular-nums; white-space: pre;
}
.plate-verdict {
  left: 16px; bottom: 14px;
  font-family: var(--cjk); font-weight: 400; font-size: 14px; letter-spacing: .08em; color: var(--ink);
}
.plate-legend {
  left: 16px; top: 38px; display: grid; gap: 2px;
  font-family: var(--cjk); font-weight: 400; font-size: 12.5px; color: var(--slate);
}
.plate-legend .m { font-size: 1.12em; }
.plate-legend b { font-family: var(--mono); font-weight: 400; font-size: 11.5px; color: var(--ink); }
.lg { display: inline-flex; align-items: center; gap: 8px; }
.lg::before { content: ""; flex: none; display: inline-block; }
.lg-ink::before { width: 18px; height: 0; border-top: 1.5px solid var(--slate); }
.lg-acc::before { width: 18px; height: 0; border-top: 2px solid var(--accent); }
.lg-dot::before { width: 7px; height: 7px; border-radius: 50%; background: var(--ink); margin-inline: 5px 6px; }
.lg-ring::before { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--accent); margin-inline: 4px 6px; }

.plate figcaption {
  padding: 14px 16px 16px;
  border-top: 1px solid var(--rule);
  font-family: var(--cjk); font-size: 13.5px; line-height: 1.8; color: var(--slate);
}

.plate-ctrl {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px;
  padding: 14px 16px;
  border-top: 1px solid var(--rule);
}
.ctl {
  display: flex; align-items: center; gap: 14px;
  flex: 1 1 240px; min-width: 0;
  font-family: var(--mono); font-size: 12px; color: var(--slate);
}
.ctl-name { font-family: var(--cjk); font-size: 13px; color: var(--ink); white-space: nowrap; }
.ctl-name .m { font-size: 1.3em; }
.ctl-end { font-family: var(--cjk); font-size: 12.5px; letter-spacing: .06em; white-space: nowrap; }
.ctl-track { position: relative; flex: 1; min-width: 0; display: block; }
.ctl-val {
  min-width: 3.4em; text-align: right;
  font-family: var(--mono); font-size: 12.5px; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.ticks { position: absolute; left: 0; right: 0; top: 100%; height: 14px; }
.ticks span {
  position: absolute; left: calc(var(--at) * (100% - 14px) + 7px); top: -4px;
  transform: translateX(-50%);
  font-family: "EB Garamond", serif; font-style: italic; font-size: 12px; line-height: 1; color: var(--slate);
}
.ticks span::before {
  content: ""; position: absolute; left: 50%; top: -8px; width: 1px; height: 6px; background: var(--rule-strong);
}
[data-fig="step"] .plate-ctrl { padding-bottom: 24px; }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 26px; margin: 0; background: transparent; cursor: pointer;
  display: block;
}
input[type="range"]::-webkit-slider-runnable-track { height: 1px; background: var(--rule-strong); }
input[type="range"]::-moz-range-track { height: 1px; background: var(--rule-strong); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; margin-top: -6.5px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--plate);
  box-shadow: 0 0 0 1px var(--accent);
  transition: transform .2s ease;
}
input[type="range"]::-moz-range-thumb {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--plate);
  box-shadow: 0 0 0 1px var(--accent);
}
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.2); }
input[type="range"]:focus-visible { outline-offset: 2px; }

.ctl-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
  font-family: var(--cjk); font-size: 13px; letter-spacing: .08em; line-height: 1;
  color: var(--ink); background: transparent;
  border: 1px solid var(--rule-strong); padding: 9px 14px; cursor: pointer;
  transition: border-color .2s ease, color .2s ease, background-color .2s ease;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn[aria-pressed="true"] { background: var(--accent-wash); border-color: var(--accent); color: var(--accent); }

.ctl-wide { flex-basis: 100%; }
.meters { flex: 1 1 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; }
.meter {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  font-family: var(--cjk); font-size: 12.5px; color: var(--slate);
}
.meter i { display: block; height: 3px; background: var(--rule); position: relative; overflow: hidden; }
.meter b { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--ink); transition: width .25s ease; }
.meter + .meter b { background: var(--accent); }
.meter output { font-family: var(--mono); font-size: 12px; color: var(--ink); min-width: 3.6em; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .meters { grid-template-columns: 1fr; } }

/* ---------- coda ---------- */

.coda-art { position: relative; aspect-ratio: 1; max-width: min(100%, 520px); width: 100%; }
.enso-large { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.hexagram {
  display: inline-grid; gap: 6px; width: 34px; flex: none;
}
.hexagram i { display: block; height: 4px; background: var(--ink); }
.hexagram i.yin { background: linear-gradient(to right, var(--ink) 0 41%, transparent 41% 59%, var(--ink) 59% 100%); }

@media (min-width: 980px) {
  .coda {
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    column-gap: clamp(40px, 6vw, 96px);
    align-items: center;
  }
  .coda .ch-text { grid-column: 2; grid-row: 1; }
  .coda-art { grid-column: 1; grid-row: 1; justify-self: center; }
}
@media (max-width: 979px) {
  .coda-art { max-width: 420px; justify-self: center; }
}

/* ---------- next epoch ---------- */

.next {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(24px, 4vh, 48px) var(--gutter) clamp(88px, 14vh, 160px);
}
.next-link {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end;
  gap: 8px 24px;
  padding: clamp(28px, 4vw, 44px) 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--rule-strong);
  color: var(--ink);
}
.next-eyebrow {
  grid-column: 1 / -1;
  font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--slate);
}
.next-host {
  grid-column: 1;
  font-family: "EB Garamond", serif; font-style: italic; font-weight: 400;
  font-size: clamp(44px, 8.4vw, 112px); line-height: 1; letter-spacing: -.01em;
  overflow-wrap: anywhere;
  transition: color .3s ease;
}
.next-desc {
  grid-column: 1;
  font-family: var(--cjk); font-size: 15px; letter-spacing: .06em; color: var(--slate);
  margin-top: 10px;
}
.next-arrow {
  grid-column: 2; grid-row: 2 / span 2; align-self: center;
  font-family: var(--mono); font-size: clamp(28px, 4vw, 48px); line-height: 1; color: var(--accent);
  transition: transform .35s ease;
}
.next-link:hover .next-host { color: var(--accent); }
.next-link:hover .next-arrow { transform: translate(6px, -6px); }

/* ---------- footer ---------- */

.foot { border-top: 1px solid var(--rule); }
.foot-inner {
  max-width: var(--max); margin: 0 auto;
  padding: 36px var(--gutter) calc(36px + env(safe-area-inset-bottom, 0px));
  display: grid; grid-template-columns: auto 1fr auto; gap: 16px 40px; align-items: baseline;
  font-size: 13px; color: var(--slate);
}
.foot-rule { font-family: "EB Garamond", serif; font-size: 18px; color: var(--ink); white-space: nowrap; }
.foot-rule .m { font-size: 1em; }
.foot-colophon { font-family: var(--cjk); letter-spacing: .04em; line-height: 1.8; }
.foot-meta { display: flex; gap: 18px; font-family: var(--mono); font-size: 12px; letter-spacing: .06em; }
@media (max-width: 760px) {
  .foot-inner { grid-template-columns: 1fr; }
}

/* ---------- motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
