@font-face { font-family: "Cormorant"; font-weight: 300; font-style: normal; font-display: swap; src: url("assets/fonts/cormorant-garamond-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant"; font-weight: 300; font-style: italic; font-display: swap; src: url("assets/fonts/cormorant-garamond-latin-300-italic.woff2") format("woff2"); }
@font-face { font-family: "Cormorant"; font-weight: 400; font-style: italic; font-display: swap; src: url("assets/fonts/cormorant-garamond-latin-400-italic.woff2") format("woff2"); }

:root {
  --bg: #07060a;
  --bg-2: #0e0c12;
  --ink: #ece4d6;
  --ink-2: #b3a996;
  --ink-3: #7d7465;
  --gold: #d9b26f;
  --gold-2: #ffe2aa;
  --line: rgba(217, 178, 111, 0.18);
  --serif: "Cormorant", "Cormorant Garamond", Georgia, "Songti SC", serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --pad: clamp(16px, 5vw, 72px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 300 clamp(18px, 1.25vw, 21px)/1.6 var(--serif);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--gold); text-decoration: none; border-bottom: 1px solid rgba(217, 178, 111, 0.35); transition: border-color .3s, color .3s; }
a:hover { color: var(--gold-2); border-color: var(--gold-2); }
em { font-style: italic; font-weight: 400; color: var(--gold); }
code { font-family: var(--mono); font-size: 0.78em; color: var(--gold-2); }
h1, h2, h3 { font-weight: 300; margin: 0; letter-spacing: -0.01em; }
img, video { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 1px solid var(--gold); outline-offset: 4px; }

.grain {
  position: fixed; inset: -50%; z-index: 50; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Top bar */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px var(--pad);
  font-size: 12px; letter-spacing: 0.32em;
  transition: background .4s;
}
.topbar.solid { background: linear-gradient(rgba(7, 6, 10, .92), rgba(7, 6, 10, 0)); }
.logo { color: var(--ink); border: 0; font-family: var(--serif); font-weight: 300; }
.logo i { color: var(--gold); font-style: normal; padding: 0 .2em; }
.toplink { color: var(--ink-2); border: 0; letter-spacing: .24em; text-transform: uppercase; font-size: 11px; }

/* Hero */
.hero {
  position: relative; min-height: 100svh; display: grid; place-items: center;
  padding: 120px var(--pad) 90px; overflow: hidden; isolation: isolate;
  --x: 50%; --y: 42%;
}
.hero-floor {
  position: absolute; left: -50%; right: -50%; bottom: -10%; height: 55%; z-index: -2;
  background-image:
    linear-gradient(rgba(217, 178, 111, .16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(217, 178, 111, .16) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(520px) rotateX(62deg);
  transform-origin: 50% 0;
  mask-image: linear-gradient(transparent, #000 30%, transparent 95%);
  -webkit-mask-image: linear-gradient(transparent, #000 30%, transparent 95%);
}
.hero-lamp {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(circle 38vmax at var(--x) var(--y), rgba(255, 214, 150, .13), rgba(255, 214, 150, .04) 40%, transparent 70%);
}
.hero-in { max-width: 980px; text-align: center; }
.eyebrow, .kicker {
  font-size: 12px; letter-spacing: .32em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 22px;
}
.hero h1 { font-size: clamp(56px, 10.5vw, 150px); line-height: .95; }
.hero h1 em { font-weight: 300; }
.lede { max-width: 640px; margin: 34px auto 0; color: var(--ink-2); font-size: clamp(19px, 1.6vw, 23px); }
.cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 40px; }
.btn {
  display: inline-block; padding: 12px 26px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink); font-size: 13px; letter-spacing: .22em; text-transform: uppercase;
  transition: border-color .3s, background .3s, color .3s;
}
.btn:hover { border-color: var(--gold); color: var(--gold-2); }
.btn-gold { background: var(--gold); color: #1a1408; border-color: var(--gold); }
.btn-gold:hover { background: var(--gold-2); color: #1a1408; }
.hero-hint {
  position: absolute; bottom: 28px; left: 0; right: 0; margin: 0; text-align: center;
  font-size: 11px; letter-spacing: .32em; text-transform: uppercase; color: var(--ink-3);
}

/* Shared section rhythm */
main > section, .stages { padding-left: var(--pad); padding-right: var(--pad); }
section h2, .stage h2 { font-size: clamp(36px, 4.6vw, 64px); line-height: 1.05; }

.origin { padding-top: 120px; padding-bottom: 60px; max-width: 980px; margin: 0 auto; text-align: center; }
.origin-text { font-size: clamp(24px, 2.6vw, 36px); line-height: 1.35; margin: 0; }

/* Stages */
.stages { list-style: none; margin: 0 auto; max-width: 1280px; padding-top: 40px; padding-bottom: 60px; }
.stage {
  display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(28px, 5vw, 80px); align-items: center;
  padding: clamp(60px, 9vw, 120px) 0; border-top: 1px solid var(--line);
}
.stage:nth-child(even) .stage-text { order: 2; }
.stage-n { font-size: 12px; letter-spacing: .32em; text-transform: uppercase; color: var(--gold); margin: 0 0 18px; }
.stage-n span { color: var(--ink-3); margin-left: 10px; }
.stage-text p:not(.stage-n) { color: var(--ink-2); margin: 22px 0 0; max-width: 34em; }
.ticks { list-style: none; padding: 0; margin: 24px 0 0; color: var(--ink-2); }
.ticks li { padding: 8px 0 8px 26px; border-bottom: 1px solid rgba(217, 178, 111, .08); position: relative; }
.ticks li::before { content: ""; position: absolute; left: 4px; top: 50%; width: 8px; height: 1px; background: var(--gold); }

.stage > *, .contents > * { min-width: 0; }
.stage-media { margin: 0; }
.stage-media figcaption { margin-top: 14px; font-size: 15px; font-style: italic; color: var(--ink-3); }
.frame img, .frame video { width: 100%; border-radius: 3px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .04); }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.duo video { grid-column: 1 / -1; }
.duo img { grid-column: 2; }
.duo figcaption { grid-column: 1; grid-row: 2; align-self: end; margin: 0 0 4px; }

.chat { max-width: 520px; justify-self: center; width: 100%; }
.msg { padding: 18px 22px; border-radius: 18px; margin-bottom: 14px; max-width: 80%; }
.msg p { margin: 2px 0 2px; font-size: clamp(24px, 2.4vw, 32px); font-family: "Songti SC", "Noto Serif SC", var(--serif); font-weight: 300; }
.msg small { color: var(--ink-3); font-style: italic; font-size: 15px; }
.who { font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: var(--ink-3); }
.msg-user { background: var(--bg-2); border: 1px solid rgba(255, 255, 255, .06); }
.msg-agent { margin-left: auto; background: rgba(217, 178, 111, .1); border: 1px solid var(--line); }
.msg-agent p { color: var(--gold-2); }

.checklist ul { list-style: none; margin: 0; padding: 26px 30px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 4px; }
.checklist li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid rgba(217, 178, 111, .08); }
.checklist li:last-child { border-bottom: 0; }
.checklist span { color: var(--ink-2); }
.checklist b { font-weight: 400; font-style: italic; color: var(--gold); }
.checklist b::before { content: "✓ "; font-style: normal; }

.term pre, .tree {
  margin: 0; padding: 26px 28px; background: #050407; border: 1px solid var(--line); border-radius: 4px;
  overflow-x: auto; font: 13px/1.75 var(--mono); color: var(--ink-2);
}
.term code, .tree code { color: inherit; font-size: inherit; }
.term .c, .tree .c { color: var(--ink-3); }
.term .p { color: var(--gold); }
.term .ok { color: #9fd49a; }

/* Rules */
.rules, .taste, .pitfalls, .install { max-width: 1280px; margin: 0 auto; padding-top: clamp(80px, 10vw, 140px); padding-bottom: 20px; }
.rule-list { counter-reset: r; list-style: none; padding: 0; margin: 50px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.rule-list li {
  counter-increment: r; padding: 26px 24px 30px 0; border-bottom: 1px solid var(--line);
  font-size: clamp(21px, 1.8vw, 26px); line-height: 1.3;
}
.rule-list li::before { content: counter(r, decimal-leading-zero); display: block; font-size: 12px; letter-spacing: .3em; color: var(--gold); margin-bottom: 10px; }

/* Taste */
.taste-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 50px; background: var(--line); border: 1px solid var(--line); }
.taste-grid > div { background: var(--bg); padding: 30px 28px 34px; }
.taste-grid h3 { font-size: 28px; font-style: italic; color: var(--gold); font-weight: 300; }
.taste-grid p { margin: 10px 0 0; color: var(--ink-2); }

/* Pitfalls as museum labels */
.labels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 50px; }
.label {
  background: #ede6d8; color: #1d1912; padding: 22px 24px 26px; border-radius: 2px;
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .9);
}
.label .y { margin: 0; font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: #8a6a32; }
.label h3 { font-size: 26px; line-height: 1.15; margin-top: 8px; }
.label .a { margin: 10px 0 0; font-style: italic; color: #4c4436; font-size: 17px; }
.label code { color: #6d4f1c; }

/* Contents */
.contents {
  max-width: 1280px; margin: 0 auto; padding-top: clamp(80px, 10vw, 140px);
  display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(28px, 5vw, 80px); align-items: center;
}
.contents-text p:not(.kicker) { color: var(--ink-2); margin-top: 22px; }

/* Install */
.install { text-align: center; padding-bottom: 40px; }
.tabs { display: inline-flex; gap: 6px; margin: 44px 0 26px; padding: 5px; border: 1px solid var(--line); border-radius: 999px; }
.tabs button {
  appearance: none; border: 0; background: transparent; color: var(--ink-2); cursor: pointer;
  padding: 9px 22px; border-radius: 999px; font: 300 13px var(--serif); letter-spacing: .2em; text-transform: uppercase;
}
.tabs button[aria-selected="true"] { background: var(--gold); color: #1a1408; }
.pane { max-width: 760px; margin: 0 auto; }
.cmd {
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 14px 14px 14px 22px; margin-bottom: 10px; background: #050407; border: 1px solid var(--line); border-radius: 4px;
}
.cmd code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font-size: 13px; color: var(--ink); scrollbar-width: none; }
.cmd code::-webkit-scrollbar { display: none; }
.copy {
  appearance: none; flex: none; cursor: pointer; border: 1px solid var(--line); background: transparent; color: var(--gold);
  border-radius: 999px; padding: 6px 14px; font: 300 12px var(--serif); letter-spacing: .2em; text-transform: uppercase;
}
.copy:hover { border-color: var(--gold); }
.note { color: var(--ink-3); font-style: italic; margin-top: 18px; }

/* Footer */
.foot { text-align: center; padding: clamp(90px, 12vw, 160px) var(--pad) 50px; }
.sig { font-size: clamp(22px, 2.2vw, 30px); margin: 0; }
.small { font-size: 14px; color: var(--ink-3); margin-top: 18px; }
.small a { color: var(--ink-2); border-color: rgba(255, 255, 255, .15); }

/* Reveal */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 1.1s ease, transform 1.1s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .stage, .contents { grid-template-columns: 1fr; }
  .stage:nth-child(even) .stage-text { order: 0; }
  .rule-list, .taste-grid, .labels { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .rule-list, .taste-grid, .labels { grid-template-columns: 1fr; }
  .duo { grid-template-columns: 1fr; }
  .duo img, .duo figcaption { grid-column: 1; grid-row: auto; }
  .term pre, .tree { font-size: 11.5px; padding: 20px 18px; }
  .msg { max-width: 92%; }
  .hero-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}
