:root {
  --paper: #f3ead8;
  --paper-deep: #e7d7b8;
  --sheet: #f7f0e2;
  --ink: #1a1612;
  --ink-soft: #3d352c;
  --muted: #6b6156;
  --rule: color-mix(in srgb, var(--ink) 22%, transparent);
  --cinnabar: #c23a2b;
  --seal: #a31621;
  --ok-ink: #1f4a32;
  --max: 1120px;
  --nav-h: 74px;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: clip;
  max-width: 100%;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Source Serif 4", "Noto Serif SC", "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  position: relative;
}

.paper {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 8% 0%, color-mix(in srgb, var(--cinnabar) 3.5%, transparent), transparent 55%),
    url("assets/paper.jpg") center / 860px repeat;
  opacity: 0.32;
  mix-blend-mode: multiply;
}

.wash {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: url("assets/hero-ink.jpg") 50% 18% / cover no-repeat;
  opacity: 0.3;
  mix-blend-mode: multiply;
}

.cinema {
  position: fixed;
  inset: 0;
  z-index: 45;
  pointer-events: none;
}

.vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 75% 70% at 50% 40%, transparent 45%, color-mix(in srgb, var(--ink) 22%, transparent) 100%),
    linear-gradient(180deg, color-mix(in srgb, var(--ink) 18%, transparent), transparent 14%, transparent 88%, color-mix(in srgb, var(--ink) 20%, transparent));
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.045;
  mix-blend-mode: multiply;
  background-image: url("assets/paper.jpg");
  background-size: 360px;
}

.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

main,
footer {
  position: relative;
  z-index: 1;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
.btn {
  font-family: inherit;
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 80;
  background: var(--cinnabar);
  color: var(--paper);
  padding: 8px 12px;
  font-weight: 600;
}

.skip:focus {
  top: 12px;
}

.wrap {
  position: relative;
  z-index: 1;
  width: min(var(--max), calc(100% - 40px));
  max-width: 100%;
  margin-inline: auto;
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.nav::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--rule);
  pointer-events: none;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(var(--max), calc(100% - 40px));
  margin-inline: auto;
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Cormorant Garamond", "Noto Serif SC", serif;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand img {
  width: 36px;
  height: 36px;
}

.brand-name {
  font-size: 1.35rem;
}

.brand-name span {
  color: var(--cinnabar);
  font-family: "Noto Serif SC", serif;
  font-weight: 700;
  margin-left: 6px;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--ink);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 7px;
  border: 1px solid var(--cinnabar);
  border-radius: 0;
  color: var(--cinnabar);
}

.nav-cta:hover {
  background: color-mix(in srgb, var(--cinnabar) 10%, transparent);
}

.menu-btn {
  display: none;
  background: var(--sheet);
  border: 1px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  min-width: 44px;
  height: 42px;
  padding: 0 10px;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: "Source Serif 4", serif;
}

/* Hero */
.hero {
  position: relative;
  min-height: calc(100svh - var(--nav-h));
  display: grid;
  place-items: center;
  overflow: visible;
  padding: 72px 0 96px;
}

html.shot .hero {
  min-height: auto;
}

.hero-bg {
  display: none;
}

.hero-blot {
  position: absolute;
  left: -8%;
  bottom: -8%;
  width: min(42vw, 420px);
  opacity: 0.2;
  mix-blend-mode: multiply;
  pointer-events: none;
  transform: rotate(-8deg);
  -webkit-mask-image: radial-gradient(ellipse 72% 70% at 48% 48%, #000 34%, transparent 72%);
  mask-image: radial-gradient(ellipse 72% 70% at 48% 48%, #000 34%, transparent 72%);
}

.hero-sheet {
  position: absolute;
  right: 3%;
  top: 8%;
  width: min(34vw, 380px);
  margin: 0;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.hero-sheet img {
  width: 100%;
  height: auto;
}

.hero-vertical {
  position: absolute;
  right: 2.2rem;
  top: 22%;
  writing-mode: vertical-rl;
  font-family: "Noto Serif SC", serif;
  letter-spacing: 0.45em;
  color: var(--cinnabar);
  font-size: 0.82rem;
  opacity: 0.85;
  margin: 0;
}

.plate {
  position: absolute;
  z-index: 0;
  margin: 0;
  pointer-events: none;
  width: min(12vw, 130px);
  mix-blend-mode: multiply;
}

.plate img,
.band-sheet img {
  width: 100%;
  height: auto;
  display: block;
}

.plate img {
  -webkit-mask-image: radial-gradient(ellipse 58% 62% at 50% 50%, #000 32%, transparent 70%);
  mask-image: radial-gradient(ellipse 58% 62% at 50% 50%, #000 32%, transparent 70%);
}

.plate-rocket-hero {
  left: 1.5%;
  bottom: 4%;
  width: min(12vw, 130px);
  opacity: 0.32;
}

.plate-sat-hero {
  right: 7%;
  bottom: 5%;
  width: min(22vw, 240px);
  opacity: 0.2;
}

section,
footer {
  overflow: visible;
}

.band {
  position: relative;
  padding: 96px 0 110px;
}

.band-bg {
  display: none;
}

.band-blot {
  position: absolute;
  z-index: 0;
  width: min(38vw, 380px);
  opacity: 0.16;
  mix-blend-mode: multiply;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 72% 70% at 48% 48%, #000 34%, transparent 72%);
  mask-image: radial-gradient(ellipse 72% 70% at 48% 48%, #000 34%, transparent 72%);
}

.blot-sw {
  left: -10%;
  bottom: -16%;
  transform: rotate(-8deg);
}

.blot-ne {
  right: -8%;
  top: -18%;
  transform: rotate(12deg);
}

.band-sheet {
  position: absolute;
  z-index: 0;
  margin: 0;
  mix-blend-mode: multiply;
  pointer-events: none;
  width: min(30vw, 320px);
  opacity: 0.42;
}

.band-sheet img {
  -webkit-mask-image: radial-gradient(ellipse 64% 64% at 50% 48%, #000 34%, transparent 72%);
  mask-image: radial-gradient(ellipse 64% 64% at 50% 48%, #000 34%, transparent 72%);
}

.sheet-right {
  right: 1%;
  top: 8%;
}

.sheet-left {
  left: -2%;
  top: 10%;
}

.plate-sw {
  left: 2%;
  bottom: 6%;
  opacity: 0.24;
}

.plate-se {
  right: 3%;
  bottom: 5%;
  opacity: 0.22;
}



.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 26px;
  min-width: 0;
}

.hero-inner::before {
  content: "理";
  position: absolute;
  left: min(42vw, 520px);
  top: -0.2em;
  font-family: "Ma Shan Zheng", "Noto Serif SC", serif;
  font-size: clamp(8rem, 22vw, 16rem);
  line-height: 1;
  color: var(--ink);
  opacity: 0.06;
  pointer-events: none;
  z-index: -1;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--cinnabar);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.74rem;
  font-weight: 600;
  font-family: "Source Serif 4", serif;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--cinnabar);
}

h1,
h2,
h3 {
  font-family: "Cormorant Garamond", "Noto Serif SC", serif;
  letter-spacing: -0.02em;
  line-height: 1.04;
  margin: 0;
  font-weight: 600;
}

.hero h1 {
  font-size: clamp(3.4rem, 8.4vw, 7.6rem);
  font-weight: 600;
  max-width: 13ch;
  color: var(--ink);
}

.hero h1 em {
  font-style: italic;
  color: var(--cinnabar);
}

.lede {
  max-width: 38rem;
  min-width: 0;
  color: var(--ink-soft);
  font-size: 1.18rem;
  line-height: 1.7;
  overflow-wrap: break-word;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 100%;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 0;
  font-weight: 600;
  cursor: pointer;
  max-width: 100%;
  transition: background 0.18s ease, color 0.18s ease;
}

.btn:hover {
  background: color-mix(in srgb, var(--ink) 4%, transparent);
}

.btn-primary {
  background: var(--cinnabar);
  color: #f8efe2;
}

.btn-primary:hover {
  background: var(--seal);
}

.btn-primary:focus-visible,
.btn-ghost:focus-visible,
.tab:focus-visible,
.copy:focus-visible,
.nav-links a:focus-visible,
.menu-btn:focus-visible {
  outline: 2px solid var(--cinnabar);
  outline-offset: 3px;
}

.btn-ghost {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}

.btn-ghost:hover {
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  color: var(--muted);
  font-size: 0.92rem;
}

.hero-meta strong {
  color: var(--ink);
  font-weight: 600;
  margin-right: 6px;
}

.hero-meta a {
  color: var(--cinnabar);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* Sections */
section {
  padding: 88px 0;
  position: relative;
  scroll-margin-top: calc(var(--nav-h) + 12px);
}

section.band {
  padding: 96px 0 110px;
}

footer.band {
  padding: 40px 0 52px;
}

.section-kicker {
  color: var(--cinnabar);
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  margin: 0 0 10px;
}

.section-title {
  font-size: clamp(2.2rem, 4.4vw, 3.4rem);
  max-width: 18ch;
  margin-bottom: 16px;
}

.section-title::after {
  content: "";
  display: block;
  width: 56px;
  height: 2px;
  margin-top: 14px;
  background: var(--cinnabar);
}

.section-copy {
  color: var(--muted);
  max-width: 42rem;
  min-width: 0;
}

.section-copy + .section-copy {
  margin-top: 1em;
}

.use-grid + .section-copy {
  margin-top: 28px;
}

.section-copy a {
  color: var(--cinnabar);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.ink-frame {
  position: relative;
  background: var(--sheet);
  border: 1px solid var(--ink);
  border-radius: 0;
}

.card {
  padding: 26px;
  min-width: 0;
  max-width: 100%;
}

/* Pillars */
.pillar-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr 0.85fr;
  gap: 18px;
  margin-top: 36px;
}

.pillar {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.seal {
  position: absolute;
  right: 16px;
  top: 16px;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  color: var(--cinnabar);
  font-family: "Noto Serif SC", serif;
  font-size: 1.35rem;
  border: 2px solid var(--cinnabar);
  box-shadow: inset 0 0 0 4px var(--cinnabar);
  opacity: 0.88;
}

.num {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  color: var(--cinnabar);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.pillar h3 {
  font-size: 1.7rem;
}

.pillar p {
  color: var(--muted);
  margin: 0;
}

.rule {
  margin-top: auto;
  font-size: 0.9rem;
  color: var(--ink);
  border-top: 1px dashed var(--rule);
  padding-top: 14px;
}

/* Code */
.code-panel {
  margin-top: 28px;
  box-shadow: inset 4px 0 0 var(--cinnabar);
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 12px 12px 0;
  overflow-x: auto;
  border-bottom: 1px dashed var(--rule);
}

.tab {
  background: none;
  border: 0;
  color: var(--muted);
  padding: 10px 14px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 0.95rem;
  font-family: "Source Serif 4", serif;
}

.tab[aria-selected="true"] {
  color: var(--cinnabar);
  box-shadow: inset 0 -2px 0 var(--cinnabar);
  font-style: italic;
}

.editor-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  color: var(--muted);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.78rem;
}

.copy {
  background: none;
  border: 1px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  padding: 6px 10px;
  cursor: pointer;
  font-family: "Source Serif 4", serif;
}

.copy:hover {
  border-color: var(--cinnabar);
  color: var(--cinnabar);
}

pre {
  margin: 0;
  padding: 8px 20px 24px;
  overflow: auto;
}

code,
.mono {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

.code-panel code {
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--ink);
}

.k { color: var(--ink); font-weight: 600; }
.fn { color: var(--ink-soft); }
.t { color: var(--ok-ink); }
.n { color: var(--cinnabar); }
.s { color: var(--ink-soft); }
.c { color: var(--muted); }
.o { color: var(--ink); }

.panel[hidden] {
  display: none;
}

/* Gate */
.gate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 32px;
}

.gate-ok h3,
.gate-no h3 {
  margin: 14px 0 8px;
  font-size: 1.7rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  font-family: "Source Serif 4", serif;
  border: 1px solid currentColor;
  border-radius: 0;
}

.chip-ok {
  color: var(--ok-ink);
}

.chip-no {
  color: var(--cinnabar);
}

.forbid-lead {
  margin: 28px 0 0;
  color: var(--muted);
  max-width: 42rem;
}

.forbid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.forbid code {
  border: 1px solid var(--rule);
  border-radius: 0;
  background: color-mix(in srgb, var(--sheet) 80%, white);
  padding: 6px 10px;
  font-size: 0.82rem;
  color: var(--cinnabar);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: var(--cinnabar);
}

/* Use */
.use-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 32px;
}

.use h3 {
  font-size: 1.35rem;
  margin: 10px 0 8px;
}

.use p {
  margin: 0;
  color: var(--muted);
}

/* Install */
.install-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 28px;
}

.install-grid + .term {
  margin-top: 16px;
}

.term {
  margin-top: 28px;
}

.term-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px dashed var(--rule);
  color: var(--muted);
  font-size: 0.85rem;
}

.dots {
  display: flex;
  gap: 6px;
}

.dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--rule);
  display: block;
}

.dots i:nth-child(1) { background: var(--cinnabar); }
.dots i:nth-child(2) { background: color-mix(in srgb, var(--cinnabar) 45%, var(--paper-deep)); }
.dots i:nth-child(3) { background: var(--ok-ink); }

.term pre {
  padding: 20px;
  color: var(--ink);
  font-size: 0.92rem;
  overflow-x: auto;
  white-space: pre;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

@media (max-width: 640px) {
  .term pre {
    font-size: 0.78rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
}

.prompt { color: var(--cinnabar); font-weight: 600; }

/* Status */
.status-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  margin-top: 28px;
}

.note {
  box-shadow: inset 4px 0 0 var(--cinnabar);
}

.note a {
  color: var(--cinnabar);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.status-action {
  margin: 16px 0 0;
}

.status-row .section-copy {
  margin: 0;
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 12px;
  margin-top: 32px;
}

.faq {
  padding: 0;
}

.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 26px;
  font-family: "Cormorant Garamond", "Noto Serif SC", serif;
  font-size: 1.35rem;
  font-weight: 600;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  float: right;
  color: var(--cinnabar);
  font-weight: 600;
}

.faq[open] summary::after {
  content: "–";
}

.faq p {
  margin: 0;
  padding: 0 26px 22px;
  color: var(--muted);
}

.faq a {
  color: var(--cinnabar);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* Footer */
footer {
  position: relative;
  border-top: 1px solid var(--rule);
  padding: 36px 0 48px;
  color: var(--muted);
}

.foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 28px 40px;
  flex-wrap: wrap;
}

.colophon {
  color: var(--ink);
  font-family: "Cormorant Garamond", "Noto Serif SC", serif;
  font-size: 1.25rem;
}

.foot-tag {
  margin: 6px 0 0;
  max-width: 28rem;
}

.foot a:hover {
  color: var(--cinnabar);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  align-items: center;
}

@media (max-width: 900px) {
  .pillar-grid,
  .use-grid,
  .gate-grid,
  .status-row,
  .install-grid {
    grid-template-columns: 1fr;
  }

  .menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav-inner {
    position: static;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 14px 20px 20px;
    background: var(--paper);
    border-bottom: 1.5px solid var(--ink);
    box-shadow: 0 16px 28px color-mix(in srgb, var(--ink) 12%, transparent);
    z-index: 70;
    gap: 4px;
  }

  .nav-links a {
    padding: 10px 12px;
  }

  .nav-links .nav-cta {
    justify-content: center;
    margin-top: 6px;
    filter: none;
  }

  .nav-links.open {
    display: flex;
  }

  .hero-sheet {
    width: min(42vw, 200px);
    right: -2%;
    top: 4%;
    opacity: 0.42;
  }

  .hero-vertical,
  .plate-rocket-hero,
  .plate-sat-hero,
  .band-sheet,
  .band-blot,
  .plate-sw,
  .plate-se {
    display: none;
  }



  section {
    padding: 64px 0;
  }
}

@media print {
  .hero {
    min-height: auto;
    padding: 48px 0;
  }
  .hero-blot,
  .hero-sheet,
  .menu-btn,
  .paper,
  .cinema,
  .machine,
  .plate,
  .lab {
    display: none !important;
  }
  .nav {
    position: static;
  }
  .btn-primary {
    box-shadow: none;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

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

@media (max-width: 640px) {
  html { font-size: 16px; }
  .wrap,
  .nav-inner { width: min(var(--max), calc(100% - 28px)); }
  .hero {
    padding: 40px 0 56px;
    min-height: auto;
  }
  .hero h1 {
    font-size: clamp(2.6rem, 13vw, 3.6rem);
  }
  .lede,
  .section-copy,
  .pillar p,
  .use p,
  .faq p {
    max-width: none;
    width: 100%;
  }
  .hero-inner {
    padding-right: 0;
    min-width: 0;
    width: 100%;
  }
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-meta {
    gap: 10px 16px;
  }
  .hero-sheet {
    display: none;
  }
  .hero-blot {
    width: 70vw;
    opacity: 0.12;
  }
  .hero-inner::before {
    left: auto;
    right: -8%;
    font-size: 8rem;
    opacity: 0.05;
  }
}
