:root {
  --night: #1A1426;
  --deep: #251C35;
  --line: #3B2F4E;
  --gold: #F2B45A;
  --gold-soft: #F8D9A0;
  --dawn: #FAF1E1;
  --ink: #1E2340;
  --ink-soft: #4A5170;
  --ether: #8FA6E0;
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "Martian Mono", ui-monospace, Menlo, Consolas, monospace;
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --measure: 36rem;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--dawn); color: var(--ink); font: 400 1.125rem/1.65 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-weight: 500; text-wrap: balance; }
p, ol, ul, pre { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

.nav { position: fixed; inset: 0 0 auto; z-index: 10; display: flex; justify-content: space-between; align-items: center; padding: 1.1rem var(--gutter); color: #EADFCB; transition: color .4s, background-color .4s; }
.nav.scrolled { background: rgba(26, 20, 38, .92); }
.nav.on-light { color: var(--ink); background: rgba(250, 241, 225, .94); }
.wordmark { font-variation-settings: "wdth" 125; font-weight: 600; font-size: 1.2rem; letter-spacing: .04em; text-decoration: none; }
.nav nav { display: flex; gap: clamp(.9rem, 2.5vw, 2rem); }
.nav nav a { font-size: .95rem; text-decoration: none; opacity: .85; }
.nav nav a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }

/* Hero */
.hero { position: relative; overflow: hidden; min-height: 100vh; background: radial-gradient(70% 80% at 72% 52%, #3B2A3A 0%, var(--night) 70%); color: #EADFCB; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 2rem; padding: 6rem var(--gutter) 4rem; }
.codefall { position: absolute; inset: 0; display: flex; gap: 3rem; padding: 0 var(--gutter); font: 400 .78rem/1.9 var(--mono); color: var(--gold); opacity: .1; white-space: pre; pointer-events: none; -webkit-mask-image: linear-gradient(transparent, #000 25%, #000 70%, transparent); mask-image: linear-gradient(transparent, #000 25%, #000 70%, transparent); }
.codefall .col { animation: rise 90s linear infinite; }
.codefall .col:nth-child(2) { animation-duration: 120s; margin-top: -12rem; }
.codefall .col:nth-child(3) { animation-duration: 105s; margin-top: -5rem; }
.codefall .col:nth-child(4) { animation-duration: 135s; margin-top: -18rem; }
@keyframes rise { to { transform: translateY(-50%); } }
.hero-text, .orbit { position: relative; }
.hero h1 { font-variation-settings: "wdth" 125; font-weight: 300; font-size: clamp(2.4rem, 5.2vw, 4.75rem); line-height: 1.04; color: #fff; }
.lede { margin-top: 1.75rem; max-width: var(--measure); font-size: 1.25rem; line-height: 1.55; }
.links { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 1.5rem; }
.links a { font-weight: 500; color: var(--gold); text-underline-offset: 6px; }
.orbit { width: 100%; max-width: 38rem; height: auto; justify-self: center; }
.pulse { stroke-dasharray: 3 14; animation: inflow 2.6s linear infinite; }
@keyframes inflow { to { stroke-dashoffset: 34; } }

/* Inside a Phanite */
.inside { background: var(--night); color: #EADFCB; padding: clamp(4rem, 9vw, 7rem) var(--gutter); }
.inside h2, .conductor h2, .close h2 { font-variation-settings: "wdth" 120; font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.08; color: #fff; }
.inside-intro p { margin-top: 1.25rem; max-width: 40rem; }
.inside-body { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 3rem; margin-top: 3rem; }
.inside-figure { position: sticky; top: 9vh; align-self: start; order: 2; }
#flow-svg { display: block; width: 100%; height: auto; max-height: 34vh; }
.inside-figure .manifest { font-size: .74rem; line-height: 1.65; }
.inside-steps { list-style: none; padding: 0; order: 1; }
.inside-steps li { min-height: 62vh; display: flex; flex-direction: column; justify-content: center; gap: .5rem; max-width: 28rem; opacity: .32; transition: opacity .5s; }
.inside-steps li.active { opacity: 1; }
.inside-steps h3 { font-variation-settings: "wdth" 115; font-size: 1.65rem; color: #fff; }

.manifest { font: 400 .8rem/1.75 var(--mono); background: var(--deep); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.2rem; overflow-x: auto; color: #EADFCB; margin-top: 1rem; }
.manifest .ln { display: block; opacity: .32; transition: opacity .4s, background-color .4s; padding: 0 .4rem; margin: 0 -.4rem; border-radius: 4px; }
.manifest .ln.on { opacity: 1; background: rgba(242, 180, 90, .1); }
.k { color: var(--gold); }
.c { color: #9A8BA8; }
.s { color: var(--ether); }
.ok { color: #8FD6B4; }

.node > rect { fill: var(--deep); stroke: var(--line); stroke-width: 1.5; transition: fill .4s, stroke .4s; }
.node text { fill: #C9BBA8; font: 500 13.5px var(--font); }
.node.on > rect { fill: #3A2B33; stroke: var(--gold); }
.node.on text { fill: #fff; }
.edge { fill: none; stroke: #5B4A66; stroke-width: 1.5; }
.edge-label { fill: #9A8BA8; font: 400 11px var(--mono); }
.layer { opacity: 0; transition: opacity .5s; }
.layer.on { opacity: 1; }

/* Assembly */
.assemble, .phanites { padding: clamp(4rem, 9vw, 7rem) var(--gutter); }
.assemble h2, .phanites h2 { font-variation-settings: "wdth" 125; font-weight: 400; font-size: clamp(2rem, 4.4vw, 3.5rem); line-height: 1.05; }
.intro { margin-top: 1rem; max-width: var(--measure); color: var(--ink-soft); }
.conductor .intro, .close p { color: #D8CCB8; }
.assemble-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; align-items: center; margin-top: 3rem; }
.manifest.light { background: #fff; border-color: #EAD9BB; color: var(--ink); margin-top: 0; }
.manifest.light .ln { opacity: 1; }
.manifest.light .k { color: #A0621B; }
.manifest.light .c { color: #8A8FA6; }
.manifest.light .s { color: #3C55A5; }
#product-svg { width: 100%; height: auto; }

/* Conductor */
.conductor { background: linear-gradient(180deg, var(--night), #2A1E33); color: #EADFCB; padding: clamp(4rem, 9vw, 7rem) var(--gutter); }
.conduct { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; margin-top: 3rem; position: relative; }
.card { background: var(--deep); border: 1px solid var(--line); border-radius: 12px; padding: 1.25rem 1.4rem 1.5rem; }
.card h3 { font-variation-settings: "wdth" 115; font-size: 1.15rem; color: var(--gold); margin-bottom: .9rem; }
.prompt p { font-size: 1.15rem; line-height: 1.55; color: #fff; }
.mini .ln { display: block; }
.mini { font: 400 .74rem/1.75 var(--mono); color: #EADFCB; white-space: pre-wrap; }
.checks { list-style: none; padding: 0; display: grid; gap: .8rem; }
.checks li { display: grid; grid-template-columns: 1.4rem 1fr; gap: .5rem; line-height: 1.45; }
.checks li::before { content: ""; width: 1.1rem; height: 1.1rem; margin-top: .15rem; border-radius: 50%; background: #8FD6B4 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%231A1426' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/80% no-repeat; }

/* Catalog */
.phanites { background: #fff; }
.legend { display: flex; gap: 1rem; margin: 1.75rem 0 1.5rem; flex-wrap: wrap; }
.tag { font-size: .9rem; padding: .25rem .7rem; border-radius: 6px; }
.tag.now { background: #F8E7C8; color: #5C3A10; }
.tag.next { border: 1.5px dashed #D2B27E; color: var(--ink-soft); }
.catalog { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: .9rem; }
.ph { border-radius: 12px; padding: 1.2rem 1.3rem 1.3rem; display: flex; flex-direction: column; gap: .4rem; }
.ph.now { background: #F8E7C8; }
.ph.next { border: 1.5px dashed #D2B27E; }
.ph .id { font: 400 .78rem var(--mono); color: #8A5A1E; }
.ph h3 { font-variation-settings: "wdth" 115; font-size: 1.35rem; }
.ph p { font-size: .97rem; line-height: 1.5; color: var(--ink-soft); }
.ph pre { margin-top: .6rem; font: 400 .7rem/1.7 var(--mono); color: var(--ink); opacity: .45; white-space: pre; overflow: hidden; }

/* Close */
.close { background: radial-gradient(110% 120% at 85% 100%, #24305C 0%, var(--night) 65%); color: #EADFCB; padding: clamp(5rem, 11vw, 9rem) var(--gutter); }
.close p { margin-top: 1.5rem; max-width: var(--measure); font-size: 1.2rem; }
.cta { display: inline-block; margin-top: 2rem; padding: .85rem 1.4rem; border-radius: 8px; background: var(--gold); color: var(--night); font-weight: 600; text-decoration: none; }
.cta:hover { background: #fff; }

.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding: 1.5rem var(--gutter); background: var(--night); color: #A99BB5; font-size: .9rem; border-top: 1px solid var(--line); }
.footer a { margin-left: 1.25rem; }
.footer p:first-child a, .footer p:last-child a:first-child { margin-left: 0; }

@media (max-width: 1000px) {
  .conduct { grid-template-columns: 1fr; }
  .assemble-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 7rem; }
  .orbit { max-width: 20rem; }
  .codefall .col:nth-child(n+3) { display: none; }
  .inside-body { grid-template-columns: 1fr; }
  .inside-figure { top: 4rem; order: 0; background: var(--night); z-index: 2; padding-bottom: .5rem; }
  .inside-figure .manifest { max-height: 9.5rem; overflow: hidden; font-size: .68rem; margin-top: .5rem; }
  .inside-steps li { min-height: 45vh; }
  .nav nav a:nth-child(2) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .codefall .col { animation: none; }
  .pulse { display: none; animation: none; }
  .inside-steps li, .manifest .ln, .layer, .nav { transition: none; }
}
