/* 星历 Ephemeris
   Night sky and candle gold from 客星手记, ultramarine from 情報・処方箋,
   paper for the pages you read rather than watch. */

@font-face {
  font-family: "Star Serif SC";
  src: url("/assets/fonts/star-serif-sc.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces-latin-opsz-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2013-2014, U+2018-201F, U+2026;
}
@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces-latin-opsz-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2013-2014, U+2018-201F, U+2026;
}

:root {
  --night: #0f1630;
  --night-2: #18224a;
  --ultra: #2649a3;
  --star: #f1ede2;
  --frost: #9aa3c0;
  --gold: #e2b66b;
  --paper: #ece9e1;
  --ink: #141b33;
  --ink-soft: #545b70;
  --line-dark: rgb(241 237 226 / 0.16);
  --line-light: #cdc9be;

  --display: "Fraunces", "Star Serif SC", "Noto Serif SC", "Songti SC", serif;
  --serif: "Star Serif SC", "Noto Serif SC", "Songti SC", "STSong", serif;
  --sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;

  --gutter: clamp(16px, 4vw, 56px);
  --timeline-h: 40px;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}
body {
  margin: 0;
  background: var(--night);
  color: var(--star);
  font: 1rem / 1.8 var(--sans);
  padding-bottom: var(--timeline-h);
  text-rendering: optimizeLegibility;
}
img,
video {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
}
p {
  margin: 0;
}
h1,
h2,
h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.2;
}
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 30;
  background: var(--star);
  color: var(--night);
  padding: 8px 14px;
}
.skip:focus {
  top: 12px;
}

/* ── header ─────────────────────────────────────────────── */
.top {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px var(--gutter);
  transition: background-color 0.3s ease;
}
.top.solid {
  background: rgb(15 22 48 / 0.92);
  backdrop-filter: blur(8px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand svg {
  width: 28px;
  height: 28px;
  overflow: visible;
}
.brand ellipse {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
}
.brand .sun {
  fill: var(--gold);
}
.brand .body {
  fill: var(--star);
}
.brand-zh {
  font-family: var(--serif);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.08em;
}
.brand-en {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.0625rem;
  color: var(--frost);
}
.top nav {
  display: flex;
  gap: clamp(16px, 2.6vw, 36px);
  font-size: 0.875rem;
}
.top nav a {
  text-decoration: none;
  padding-block: 4px;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.25s ease;
}
.top nav a:hover,
.top nav a[aria-current] {
  background-size: 100% 1px;
}
.top nav {
  align-items: center;
}
.top nav .book {
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--star);
  color: var(--night);
  font-weight: 600;
  transition: background-color 0.2s ease;
}
.top nav .book:hover {
  background: var(--gold);
}

/* ── hero: the reel through a viewfinder ───────────────── */
.hero {
  position: relative;
  height: calc(100svh - var(--timeline-h));
  min-height: 560px;
  overflow: hidden;
  isolation: isolate;
}
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to top, rgb(15 22 48 / 0.92) 0%, rgb(15 22 48 / 0.35) 42%, rgb(15 22 48 / 0) 62%),
    linear-gradient(to bottom, rgb(15 22 48 / 0.6), rgb(15 22 48 / 0) 22%);
}
.viewfinder {
  position: absolute;
  inset: 84px var(--gutter) 28px;
  pointer-events: none;
}
.viewfinder i {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 0 solid rgb(241 237 226 / 0.7);
}
.viewfinder i:nth-child(1) {
  top: 0;
  left: 0;
  border-width: 1.5px 0 0 1.5px;
}
.viewfinder i:nth-child(2) {
  top: 0;
  right: 0;
  border-width: 1.5px 1.5px 0 0;
}
.viewfinder i:nth-child(3) {
  bottom: 0;
  left: 0;
  border-width: 0 0 1.5px 1.5px;
}
.viewfinder i:nth-child(4) {
  bottom: 0;
  right: 0;
  border-width: 0 1.5px 1.5px 0;
}
.slate {
  position: absolute;
  top: 108px;
  right: calc(var(--gutter) + 24px);
  display: grid;
  justify-items: end;
  gap: 2px;
  text-align: right;
  font-size: 0.8125rem;
  line-height: 1.5;
  text-shadow: 0 1px 8px rgb(15 22 48 / 0.8);
}
.slate .tc {
  font-family: var(--display);
  font-variant-numeric: tabular-nums lining-nums;
  font-size: 1.75rem;
  font-weight: 300;
  color: var(--gold);
  line-height: 1.1;
}
.slate .work {
  font-family: var(--serif);
  font-size: 1rem;
}
.slate .src {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--frost);
}
.slate .note {
  color: var(--frost);
}
.reel-toggle {
  margin-top: 8px;
  background: none;
  border: 1px solid rgb(241 237 226 / 0.5);
  color: var(--star);
  font: inherit;
  padding: 2px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.reel-toggle:hover {
  border-color: var(--star);
}
.hero-title {
  position: absolute;
  left: calc(var(--gutter) + 24px);
  right: calc(var(--gutter) + 24px);
  bottom: 52px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 48px;
}
/* The wordmark: two heavy characters with the Latin name set small and
   italic beside them, like a catalogue name next to a star's common name. */
.mark {
  display: flex;
  align-items: flex-end;
  gap: 0.18em;
  font-size: clamp(5rem, 15vw, 15rem);
  line-height: 0.82;
  font-weight: 900;
  letter-spacing: 0.02em;
}
.mark-en {
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: 0.22em;
  letter-spacing: 0;
  line-height: 1;
  color: var(--gold);
  padding-bottom: 0.32em;
  font-variation-settings: "opsz" 144;
}
.hero-side {
  display: grid;
  justify-items: start;
  gap: 20px;
  padding-bottom: 0.4em;
}
.hero-cta {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--night);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease;
}
.hero-cta:hover {
  background: var(--star);
}
.tagline {
  max-width: 22em;
  font-family: var(--serif);
  font-size: clamp(1.0625rem, 0.9rem + 0.6vw, 1.375rem);
  line-height: 1.7;
  padding-bottom: 0.4em;
}

/* ── shared section scaffolding: 12 columns ────────────── */
main > section {
  padding: clamp(72px, 10vw, 152px) var(--gutter);
}
.index-head {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px 24px;
  align-items: baseline;
  margin-bottom: clamp(32px, 5vw, 64px);
}
.index-head h2 {
  grid-column: 1 / span 5;
  font-size: clamp(2.25rem, 1.5rem + 3vw, 4rem);
  font-weight: 800;
}
.index-head p {
  grid-column: 7 / span 6;
  max-width: 34em;
  color: var(--frost);
}
.more {
  display: inline-block;
  margin-top: 40px;
  font-family: var(--serif);
  font-size: 1.125rem;
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
  padding-bottom: 4px;
}
.more:hover {
  color: var(--gold);
}

/* intro */
.intro {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 32px 24px;
  align-items: end;
}
.statement {
  grid-column: 1 / span 7;
  font-family: var(--serif);
  font-size: clamp(1.75rem, 1rem + 2.6vw, 3.25rem);
  line-height: 1.4;
  font-weight: 600;
  text-wrap: balance;
}
/* Three real numbers, set like readings in an almanac. */
.traction {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: clamp(24px, 4vw, 56px) 0 0;
  border-top: 1px solid var(--line-dark);
}
.traction div {
  padding: 24px 24px 0 0;
}
.traction div + div {
  padding-left: 24px;
  border-left: 1px solid var(--line-dark);
}
.traction dt {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(2.5rem, 1.6rem + 3vw, 4.5rem);
  line-height: 1;
  color: var(--gold);
  font-variant-numeric: lining-nums;
  font-variation-settings: "opsz" 144;
}
.traction dt small {
  margin-left: 0.12em;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 0.4em;
}
.traction dd {
  margin: 10px 0 0;
  color: var(--frost);
}
.aside {
  grid-column: 9 / span 4;
  max-width: 24em;
  justify-self: end;
  color: var(--frost);
  font-size: 0.9375rem;
}

/* The work index, set as an almanac table. */
.almanac {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums lining-nums;
}
.almanac thead th {
  text-align: left;
  font-weight: 400;
  font-size: 0.8125rem;
  color: var(--frost);
  padding: 0 16px 14px 0;
  border-bottom: 1px solid var(--star);
}
.almanac td,
.almanac tbody th {
  text-align: left;
  padding: 22px 16px 22px 0;
  border-bottom: 1px solid var(--line-dark);
  vertical-align: baseline;
  font-weight: 400;
  color: var(--frost);
}
.almanac .num {
  text-align: right;
  padding-right: 0;
}
.almanac .date {
  font-family: var(--display);
  font-size: 1.0625rem;
  white-space: nowrap;
  width: 16%;
}
.almanac tbody th {
  width: 36%;
}
.almanac tbody th > * {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 1rem + 1.8vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--star);
  text-decoration: none;
}
.almanac tbody th a::after {
  content: "";
  position: absolute;
  inset: 0;
}
.almanac tbody tr {
  position: relative;
  transition: background-color 0.2s ease;
}
.almanac tbody tr:hover,
.almanac tbody tr:focus-within {
  background: var(--night-2);
}
.almanac tbody tr:hover th > *,
.almanac tbody tr:focus-within th > * {
  color: var(--gold);
}
.peek {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 15;
  width: 320px;
  aspect-ratio: 16 / 9;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.92);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  background: var(--night);
  box-shadow: 0 18px 50px rgb(0 0 0 / 0.45);
}
.peek.portrait {
  width: 180px;
  aspect-ratio: 9 / 16;
}
.peek.on {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.peek video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Product: the one thing you can book. A bar ruler across the top, one
   tick per beat and a gold barline every four, as in a 4/4 edit. */
.product {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 40px 24px;
  align-items: end;
  background: var(--night-2);
}
.bars {
  position: absolute;
  inset: 0 0 auto;
  height: 18px;
  background:
    repeating-linear-gradient(to right, var(--gold) 0 1.5px, transparent 1.5px 96px),
    repeating-linear-gradient(to right, rgb(241 237 226 / 0.35) 0 1px, transparent 1px 24px);
  background-size: 100% 18px, 100% 9px;
  background-repeat: no-repeat;
  background-position: var(--gutter) 0, var(--gutter) 0;
}
.product-copy {
  grid-column: 1 / span 6;
}
.product h2 {
  font-size: clamp(2.25rem, 1.4rem + 3.4vw, 4.5rem);
  font-weight: 900;
  line-height: 1.15;
}
.product-copy p {
  margin-top: 24px;
  max-width: 28em;
  font-size: 1.0625rem;
  color: var(--frost);
}
.fine {
  margin-top: 28px;
  font-size: 0.875rem;
  color: var(--frost);
}
.product-steps {
  counter-reset: step;
  grid-column: 8 / span 5;
  margin: 0;
  padding: 0;
  list-style: none;
}
.product-steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 3rem 1fr;
  column-gap: 12px;
  padding: 20px 0;
  border-top: 1px solid var(--line-dark);
}
.product-steps li::before {
  content: counter(step);
  grid-row: span 2;
  font-family: var(--display);
  font-weight: 300;
  font-size: 2.5rem;
  line-height: 1;
  color: var(--gold);
  font-variation-settings: "opsz" 144;
}
.product-steps h3 {
  font-size: 1.25rem;
  font-weight: 800;
}
.product-steps p {
  margin-top: 4px;
  color: var(--frost);
  font-size: 0.9375rem;
}
.handle {
  font-size: 0.875rem;
  color: var(--frost);
}

/* Featured version switcher */
.feature {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 32px 24px;
  align-items: end;
  margin-top: clamp(80px, 10vw, 140px);
}
.feature-media {
  grid-column: 1 / span 8;
  margin: 0;
  aspect-ratio: 16 / 9;
  background: var(--night-2);
}
.feature-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.feature-text {
  grid-column: 9 / span 4;
}
.feature-text h3 {
  font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2.25rem);
  font-weight: 800;
}
.feature-text p {
  margin-top: 16px;
  color: var(--frost);
  min-height: 5.4em;
}
.versions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}
.versions button {
  font: inherit;
  font-size: 0.875rem;
  padding: 6px 16px;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  background: none;
  color: var(--star);
  cursor: pointer;
}
.versions button:hover {
  border-color: var(--star);
}
.versions button[aria-pressed="true"] {
  background: var(--star);
  border-color: var(--star);
  color: var(--night);
}
.rights {
  margin-top: clamp(56px, 7vw, 96px);
  max-width: 48em;
  font-size: 0.8125rem;
  color: var(--frost);
}

/* 客星手记 shelf */
.kexing {
  border-top: 1px solid var(--line-dark);
}
.shelf {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.shelf a {
  display: block;
  text-decoration: none;
}
.shelf img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.shelf a:hover img {
  transform: translateY(-8px);
}
.shelf .ep {
  display: block;
  margin-top: 12px;
  font-family: var(--display);
  font-style: italic;
  color: var(--gold);
}
.shelf .q {
  display: block;
  font-size: 0.875rem;
  line-height: 1.55;
}

/* Method, on paper */
.method {
  background: var(--paper);
  color: var(--ink);
}
.method .index-head p {
  color: var(--ink-soft);
}
.method :focus-visible {
  outline-color: var(--ultra);
}
.steps {
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--ink);
}
.steps li {
  counter-increment: step;
  display: flex;
  flex-direction: column;
  padding: 28px 24px 0 0;
}
.steps li + li {
  padding-left: 24px;
  border-left: 1px solid var(--line-light);
}
.steps li::before {
  content: counter(step);
  font-family: var(--display);
  font-weight: 300;
  font-size: 4rem;
  line-height: 1;
  color: var(--ultra);
  font-variation-settings: "opsz" 144;
  margin-bottom: 20px;
}
.steps h3 {
  font-size: 1.375rem;
  font-weight: 800;
}
.steps p {
  margin-top: 10px;
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--ink-soft);
}
.steps code {
  margin-top: auto;
  padding-top: 18px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ultra);
}

.links {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 32px;
}
.text-link {
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}
.text-link:hover {
  color: var(--gold);
}
.foot-links {
  display: flex;
  gap: 20px;
}
.foot-links a {
  text-decoration: none;
}
.foot-links a:hover {
  color: var(--star);
}

/* Plans: the same almanac table, with delivery time as the reading. */
.plans {
  border-top: 1px solid var(--line-dark);
}
.plan-table tbody th {
  width: 24%;
}
.plan-table tbody th > * {
  font-size: clamp(1.375rem, 1rem + 1.2vw, 2rem);
}
.plan-table td {
  color: var(--frost);
}
.plan-table .lead {
  font-family: var(--display);
  font-size: 1.25rem;
  color: var(--gold);
  white-space: nowrap;
}
.plan-table tbody tr:hover {
  background: none;
}
.plan-table tbody tr:hover th > * {
  color: var(--star);
}

/* Contact */
.contact {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 32px 24px;
  align-items: end;
  background: var(--ultra);
}
.contact h2 {
  grid-column: 1 / span 7;
  font-size: clamp(2.25rem, 1.4rem + 3.6vw, 4.75rem);
  font-weight: 900;
  line-height: 1.15;
}
.contact-side {
  grid-column: 9 / span 4;
}
.contact ul {
  margin: 14px 0 0;
  padding-left: 1.1em;
}
.cta {
  display: inline-block;
  margin: 28px 0 0;
  padding: 14px 26px;
  border-radius: 999px;
  background: var(--star);
  color: var(--night);
  font-weight: 600;
  text-decoration: none;
}
.cta:hover {
  background: var(--gold);
}

.foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 28px var(--gutter);
  font-size: 0.8125rem;
  color: var(--frost);
}

/* ── the edit timeline: one clip per section, playhead follows scroll ── */
.timeline {
  position: fixed;
  inset: auto 0 0;
  z-index: 20;
  height: var(--timeline-h);
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 7px var(--gutter);
  background: #0a1024;
  border-top: 1px solid var(--line-dark);
  font-size: 0.75rem;
}
.timeline[hidden] {
  display: none;
}
.timeline-tc {
  align-self: center;
  font-family: var(--display);
  font-variant-numeric: tabular-nums lining-nums;
  font-size: 0.875rem;
  color: var(--gold);
  min-width: 8.2em;
}
.timeline-track {
  position: relative;
  flex: 1;
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.timeline-track li {
  flex: var(--w, 1) 1 0;
  min-width: 0;
}
.timeline-track a {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 8px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-decoration: none;
  color: var(--frost);
  background: var(--night-2);
  border-radius: 2px;
}
.timeline-track a:hover {
  color: var(--star);
}
.timeline-track a[aria-current] {
  background: var(--ultra);
  color: var(--star);
}
.playhead {
  position: absolute;
  top: -7px;
  bottom: -7px;
  left: 0;
  width: 1.5px;
  background: var(--gold);
  pointer-events: none;
}
.playhead::before {
  content: "";
  position: absolute;
  top: 0;
  left: -4px;
  border: 5px solid transparent;
  border-top: 6px solid var(--gold);
}

/* ── case pages ─────────────────────────────────────────── */
.case-hero {
  position: relative;
  height: calc(88svh - var(--timeline-h));
  min-height: 520px;
  overflow: hidden;
  isolation: isolate;
}
.case-hero > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}
.case-hero.portrait > video {
  left: auto;
  right: var(--gutter);
  width: auto;
  height: 100%;
  aspect-ratio: 9 / 16;
}
.case-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to top, rgb(15 22 48 / 0.95), rgb(15 22 48 / 0.2) 55%, rgb(15 22 48 / 0) 75%),
    linear-gradient(to bottom, rgb(15 22 48 / 0.6), rgb(15 22 48 / 0) 22%);
}
.case-hero.portrait::after {
  background: linear-gradient(to right, var(--night) 35%, rgb(15 22 48 / 0) 70%);
}
.case-title {
  position: absolute;
  left: calc(var(--gutter) + 24px);
  right: calc(var(--gutter) + 24px);
  bottom: 52px;
}
.case-kicker {
  font-family: var(--display);
  font-style: italic;
  color: var(--gold);
  font-size: 1.125rem;
}
.case-kicker a {
  text-decoration: none;
}
.case-kicker a:hover {
  text-decoration: underline;
}
.case-title h1 {
  margin-top: 8px;
  font-size: clamp(3rem, 1.5rem + 7vw, 8.5rem);
  font-weight: 900;
  line-height: 1;
}
.case-title p {
  margin-top: 24px;
  max-width: 30em;
  font-family: var(--serif);
  font-size: clamp(1.0625rem, 0.9rem + 0.6vw, 1.375rem);
  line-height: 1.7;
}

/* End credits: roles right-aligned against names, around a centre line. */
.credits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 32px;
  row-gap: 10px;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(72px, 9vw, 128px) var(--gutter);
}
.credits dt {
  text-align: right;
  color: var(--frost);
  font-size: 0.875rem;
  padding-top: 0.2em;
}
.credits dd {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.0625rem;
}

.chapter {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
  padding: clamp(56px, 8vw, 112px) var(--gutter);
  border-top: 1px solid var(--line-dark);
}
.chapter.paper {
  background: var(--paper);
  color: var(--ink);
  border-top: 0;
}
.chapter.paper :focus-visible {
  outline-color: var(--ultra);
}
.chapter > h2 {
  grid-column: 1 / span 4;
  font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.75rem);
  font-weight: 800;
  line-height: 1.3;
}
.chapter > h2 small {
  display: block;
  margin-bottom: 14px;
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: 2.5rem;
  line-height: 1;
  color: var(--gold);
  font-variation-settings: "opsz" 144;
}
.chapter.paper > h2 small {
  color: var(--ultra);
}
.body {
  grid-column: 6 / span 6;
  max-width: 38em;
  font-size: 1.0625rem;
  line-height: 1.9;
}
.body p + p,
.body ul,
.body ol,
.body table,
.body dl {
  margin-top: 18px;
}
.body ul,
.body ol {
  padding-left: 1.2em;
}
.body li + li {
  margin-top: 8px;
}
.body h3 {
  margin: 40px 0 12px;
  font-size: 1.375rem;
  font-weight: 800;
}
.body code {
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--gold);
  overflow-wrap: anywhere;
}
.paper .body code {
  color: var(--ultra);
}
.body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
.body th,
.body td {
  text-align: left;
  vertical-align: top;
  padding: 12px 16px 12px 0;
  border-bottom: 1px solid var(--line-dark);
}
.paper .body th,
.paper .body td {
  border-color: var(--line-light);
}
.body th {
  font-weight: 600;
  white-space: nowrap;
}
.frames {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr));
  gap: 8px;
  margin: clamp(24px, 4vw, 48px) 0 0;
}
.frames img {
  width: 100%;
  height: auto;
  background: var(--night-2);
}
.frames figcaption {
  grid-column: 1 / -1;
  margin-top: 6px;
  font-size: 0.8125rem;
  color: var(--frost);
}
.paper .frames figcaption {
  color: var(--ink-soft);
}
.numbers {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 28px 0 0;
  border-top: 1px solid currentColor;
}
.numbers div {
  padding-top: 14px;
}
.numbers dt {
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.numbers dd {
  margin: 4px 0 0;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.75rem);
  line-height: 1;
  font-variant-numeric: lining-nums;
  font-variation-settings: "opsz" 144;
}
.next-case {
  position: relative;
  display: block;
  min-height: 52svh;
  padding: clamp(56px, 8vw, 112px) var(--gutter);
  overflow: hidden;
  isolation: isolate;
  text-decoration: none;
}
.next-case img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.next-case::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgb(15 22 48 / 0.6);
}
.next-case:hover img {
  transform: scale(1.03);
}
.next-case span {
  font-family: var(--display);
  font-style: italic;
  color: var(--gold);
}
.next-case strong {
  display: block;
  margin-top: 8px;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(2.5rem, 1.5rem + 5vw, 6.5rem);
  line-height: 1.05;
}

/* ── responsive ─────────────────────────────────────────── */
@media (max-width: 1080px) {
  .shelf {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    row-gap: 32px;
  }
  .steps {
    grid-template-columns: 1fr 1fr;
  }
  .steps li,
  .steps li + li {
    padding: 28px 20px 28px 0;
    border-left: 0;
    border-bottom: 1px solid var(--line-light);
  }
  .aside {
    grid-column: 1 / span 8;
  }
  .statement {
    grid-column: 1 / -1;
  }
  .traction div,
  .traction div + div {
    padding: 18px 12px 0 0;
    border-left: 0;
  }
  .feature-media {
    grid-column: 1 / -1;
  }
  .feature-text {
    grid-column: 1 / span 8;
  }
  .chapter > h2 {
    grid-column: 1 / -1;
  }
  .body {
    grid-column: 1 / span 10;
  }
}
@media (max-width: 760px) {
  :root {
    --timeline-h: 34px;
  }
  .top {
    padding-block: 14px;
  }
  .top nav a:not(.book) {
    display: none;
  }
  .brand-en {
    display: none;
  }
  .slate {
    top: 88px;
    right: calc(var(--gutter) + 16px);
  }
  .slate .note,
  .slate .src {
    display: none;
  }
  .hero::after {
    background:
      linear-gradient(to top, rgb(15 22 48 / 0.97) 0%, rgb(15 22 48 / 0.6) 34%, rgb(15 22 48 / 0) 58%),
      linear-gradient(to bottom, rgb(15 22 48 / 0.6), rgb(15 22 48 / 0) 22%);
  }
  .hero-title,
  .case-title {
    left: calc(var(--gutter) + 16px);
    right: calc(var(--gutter) + 16px);
    bottom: 40px;
  }
  .product-copy,
  .product-steps,
  .index-head h2,
  .index-head p,
  .aside,
  .feature-text,
  .contact h2,
  .contact-side,
  .chapter > h2,
  .body {
    grid-column: 1 / -1;
  }
  .almanac thead {
    display: none;
  }
  .almanac,
  .almanac tbody {
    display: block;
  }
  .almanac tbody tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 16px;
    padding: 20px 0;
    border-bottom: 1px solid var(--line-dark);
  }
  .almanac td,
  .almanac tbody th {
    display: block;
    width: auto;
    padding: 0;
    border: 0;
  }
  .almanac .date {
    grid-column: 1;
    grid-row: 1;
  }
  .almanac .num {
    grid-column: 2;
    grid-row: 1;
  }
  .almanac tbody th {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .almanac td:nth-of-type(2) {
    grid-column: 1;
    grid-row: 3;
  }
  .almanac td:nth-of-type(3) {
    grid-column: 2;
    grid-row: 3;
    text-align: right;
  }
  .plan-table td:nth-of-type(1) {
    grid-column: 1 / -1;
    grid-row: 3;
  }
  .plan-table td.lead {
    grid-column: 1;
    grid-row: 1;
  }
  .plan-table td.num {
    grid-column: 2;
    grid-row: 1;
  }
  .shelf {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .steps {
    grid-template-columns: 1fr;
  }
  .timeline {
    padding-block: 5px;
    gap: 8px;
  }
  .timeline-tc {
    font-size: 0.75rem;
    min-width: 7.6em;
  }
  .timeline-track a {
    padding: 0 6px;
    font-size: 0.6875rem;
  }
  .case-hero.portrait > video {
    right: 0;
    opacity: 0.55;
  }
  .credits {
    column-gap: 20px;
  }
  .frames {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .frames.portrait {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .numbers {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 18px;
  }
}
@media (hover: none) {
  .peek {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .shelf img,
  .next-case img,
  .peek {
    transition: none;
  }
  .shelf a:hover img,
  .next-case:hover img {
    transform: none;
  }
}

/* 404 */
.lost {
  min-height: 100svh;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 18px;
  padding: 0 var(--gutter);
}
.lost h1 {
  font-size: clamp(2.25rem, 1.4rem + 3.6vw, 4.5rem);
  font-weight: 900;
}
.lost p:not(.case-kicker) {
  color: var(--frost);
}
