/* Europa — page layer over stage.css. Tokens first, then sections in page order. */
:root {
  --canvas: #0c0f14;
  --surface: #131820;
  --surface-2: #19202a;
  --line: #242d3a;
  --line-2: #2f3a4a;
  --ink: #eef2f7;
  --ink-soft: #a3aebd;
  --ink-faint: #7b8697;
  --accent: #3a66f0;
  --accent-hi: #7fa2ff;
  --accent-ink: #ffffff;
  --video: #7fa2ff;
  --audio: #e8b25c;
  --usb: #b99cff;
  --network: #6fc7c0;
  --font-display: "Geist", system-ui, sans-serif;
  --font-text: "Geist", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;
  --wrap: 1180px;
  --t-3xl: clamp(2.6rem, 1.3rem + 4.6vw, 5.2rem);
  --t-2xl: clamp(2rem, 1.2rem + 2.8vw, 3.6rem);
  --t-xl: clamp(1.45rem, 1.1rem + 1.2vw, 2.1rem);
}

body { background: var(--canvas); }
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; }
.skip:focus { left: 8px; z-index: 100; background: var(--ink); color: var(--canvas); padding: 8px 12px; }
h1, h2, h3 { font-weight: 600; }
h1 { letter-spacing: -0.045em; line-height: 0.98; }
h2 { letter-spacing: -0.035em; line-height: 1.02; }
h3 { font-size: 1.12rem; letter-spacing: -0.01em; line-height: 1.3; }
.soft { color: var(--ink-soft); }
.kicker, .doc-k, .styles-k, .tag, .status, .side-k { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }

/* buttons & links */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px;
  border-radius: 10px; background: var(--accent); color: var(--accent-ink); font: 500 0.95rem/1 var(--font-text);
  text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: background .2s var(--ease), transform .2s var(--ease); }
.btn:hover { background: #2f58dc; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn.ghost:hover { border-color: var(--ink-faint); }
.btn.lg { min-height: 52px; padding: 0 26px; font-size: 1rem; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 0.88rem; }
.link { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line-2); padding-bottom: 3px; font-weight: 500; }
.link:hover { border-color: var(--ink); }

/* nav */
.nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--canvas) 86%, transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.nav-in { display: flex; align-items: center; gap: var(--s6); min-height: 68px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 1.18rem; letter-spacing: -0.02em; }
.nav nav { display: flex; gap: var(--s6); margin-left: var(--s5); }
.nav nav a { color: var(--ink-soft); text-decoration: none; font-size: 0.92rem; }
.nav nav a:hover { color: var(--ink); }
.nav-cta { margin-left: auto; display: flex; gap: var(--s3); }
.nav-cta .btn { min-height: 38px; font-size: 0.88rem; padding: 0 16px; }

/* 1 · hero */
.hero { padding-block: clamp(56px, 9vh, 104px) clamp(64px, 10vh, 120px); }
.hero-grid { display: grid; gap: clamp(40px, 5vw, 72px); }
.hero-copy { max-width: 860px; }
.status { display: inline-flex; align-items: center; gap: 8px; margin-bottom: var(--s6); }
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-hi); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-hi) 22%, transparent); }
.hero h1 { font-size: var(--t-3xl); max-width: 11.5em; }
.lede { margin-top: var(--s6); font-size: var(--t-lg); line-height: 1.5; color: var(--ink-soft); max-width: 36em; }
.actions { display: flex; align-items: center; gap: var(--s6); margin-top: var(--s7); flex-wrap: wrap; }

.demo { margin: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden;
  box-shadow: 0 30px 80px -40px #000, 0 1px 0 #ffffff08 inset; }
.demo-bar, .demo-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding: 12px 18px; }
.demo-bar { border-bottom: 1px solid var(--line); }
.demo-bar .crumb { font-size: 0.86rem; color: var(--ink-soft); } .demo-bar .crumb b { color: var(--ink); font-weight: 500; }
.demo-foot { border-top: 1px solid var(--line); }
.demo-foot p { font-size: 0.88rem; color: var(--ink-soft); }
.demo-body { display: grid; grid-template-columns: 1fr 240px; }
.demo-canvas { padding: 14px; overflow: hidden; }
.demo-bom { border-left: 1px solid var(--line); padding: 18px; background: var(--surface-2); }
.demo-bom ul { list-style: none; margin: 14px 0 0; padding: 0; }
.demo-bom li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.demo-bom li b { font-family: var(--font-mono); font-weight: 500; }
.bom-foot { margin-top: 14px; font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-soft); }
.flash { animation: flash .6s var(--ease); }
@keyframes flash { 0% { color: var(--accent-hi); } 100% { color: inherit; } }

/* schematic drawing */
.schem { width: 100%; height: auto; display: block; font-family: var(--font-mono); }
.schem .gridline { stroke: #ffffff07; stroke-width: 1; }
.schem .box { fill: #161d27; stroke: var(--line-2); stroke-width: 1.2; }
.schem .did { fill: var(--accent-hi); font-size: 11px; letter-spacing: 0.06em; }
.schem .dname { fill: var(--ink); font: 500 14.5px var(--font-text); }
.schem .pname { fill: var(--ink-soft); font-size: 10.5px; letter-spacing: 0.03em; transform: translateY(5px); transition: transform .3s var(--ease); }
.schem .ptype { fill: var(--ink-faint); font-size: 9.5px; opacity: 0; transition: opacity .3s var(--ease); }
.schem .pin { fill: var(--line-2); }
.schem .wire path { fill: none; stroke-width: 2; stroke-linejoin: round; }
.schem .wire.video path, .schem .wire.video .dot { stroke: var(--video); fill: var(--video); } .schem .wire.video path { fill: none; }
.schem .wire.audio path, .schem .wire.audio .dot { stroke: var(--audio); fill: var(--audio); } .schem .wire.audio path { fill: none; }
.schem .wire.usb path, .schem .wire.usb .dot { stroke: var(--usb); fill: var(--usb); } .schem .wire.usb path { fill: none; }
.schem .wire.network path, .schem .wire.network .dot { stroke: var(--network); fill: var(--network); } .schem .wire.network path { fill: none; }
.schem .wlabel { fill: var(--ink); font-size: 10.5px; font-weight: 500; }
.schem .port.unused { display: none; }
.schem.show-types .pname { transform: translateY(0); }
.schem.show-types .ptype { opacity: 1; }
.schem.show-unused .port.unused { display: inline; }
.schem.show-unused .port.unused .pname { fill: var(--ink-faint); }
.schem.hide-labels .wlabel { opacity: 0; }
.schem .wlabel { transition: opacity .3s var(--ease); }

/* hero demo: second display arrives */
.hero-schem .add2 { opacity: 0; transition: opacity .4s var(--ease); }
.demo.two .hero-schem .add2 { opacity: 1; }
.demo.two .hero-schem .wire.add2 path { animation: draw .9s var(--ease) both; }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.hero-schem .wire path { stroke-dasharray: 1; }

/* 2 · documents (pan) */
.docs .stage { display: grid; grid-template-rows: auto 1fr auto; align-content: center; padding-block: 104px 28px; }
.docs-head { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s8); align-items: end; margin-bottom: var(--s7); }
.docs-head h2 { font-size: var(--t-2xl); }
.docs-head p { color: var(--ink-soft); font-size: 1.05rem; }
.rail { align-items: stretch; height: auto; padding-left: max(var(--gutter), calc((100vw - var(--wrap)) / 2)); gap: 20px; }
.doc { flex: 0 0 clamp(290px, 30vw, 400px); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px;
  display: flex; flex-direction: column; gap: 16px; height: min(460px, 52svh); overflow: hidden; }
.doc pre { margin: 0; font: 12.5px/1.75 var(--font-mono); color: var(--ink-soft); white-space: pre; overflow: hidden; }
.doc pre .s { color: var(--accent-hi); } .doc pre .c { color: var(--ink-faint); }
.doc table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.doc th { text-align: left; font: 500 0.7rem var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); padding: 0 8px 8px 0; border-bottom: 1px solid var(--line-2); }
.doc td { padding: 8px 8px 8px 0; border-bottom: 1px solid var(--line); color: var(--ink-soft); }
.doc td:first-child { color: var(--ink); font-family: var(--font-mono); font-size: 0.76rem; }
.doc-schem .thumb { background: #10151c; border-radius: 8px; padding: 6px; }
.thumb-schem .wlabel, .thumb-schem .pname { display: none; }
.doc-proposal .page { background: #e9edf3; color: #1b2230; border-radius: 6px; padding: 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.page .p-title { font-weight: 600; font-size: 1.1rem; } .page .p-sub { font-size: 0.8rem; color: #5a6475; margin-bottom: 8px; }
.page .p-h { font-size: 0.72rem; font-weight: 600; margin-top: 8px; text-transform: uppercase; letter-spacing: 0.06em; }
.page .line { display: block; height: 6px; border-radius: 3px; background: #c6cdd8; } .page .line.short { width: 60%; }
.page .p-fig { height: 70px; border-radius: 4px; background: linear-gradient(90deg, #c6cdd8 0 30%, transparent 30% 35%, #c6cdd8 35% 65%, transparent 65% 70%, #c6cdd8 70%); opacity: .7; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; font-size: 0.9rem; }
.checks li { display: flex; gap: 10px; align-items: baseline; color: var(--ink-soft); }
.checks li::before { font-family: var(--font-mono); width: 1.2em; flex: none; }
.checks .ok::before { content: "✓"; color: var(--network); }
.checks .warn::before { content: "!"; color: var(--audio); font-weight: 700; text-align: center; }
.note { margin-top: 14px; font-size: 0.8rem; color: var(--ink-faint); }

/* 3 · peak (pin): the drawing is drawn by the scroll */
.peak .stage { display: grid; align-items: center; padding-top: 68px; }
.peak-grid { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: clamp(32px, 4vw, 64px); align-items: center; }
.peak h2 { font-size: var(--t-2xl); margin-top: var(--s4); }
.peak-copy > p:not(.kicker) { margin-top: var(--s5); color: var(--ink-soft); }
.styles { margin-top: var(--s7); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.styles-k { width: 100%; margin-bottom: 4px; }
.toggle { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--ink-soft);
  font: 500 0.86rem var(--font-text); cursor: pointer; transition: all .2s var(--ease); }
.toggle[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); border-color: var(--accent-hi); }
.peak-fig { margin: 0; }
.drawing { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.peak-fig figcaption { margin-top: 10px; font-size: 0.8rem; color: var(--ink-faint); }
/* each wire draws over its own slice of the hold; labels land after */
.peak-schem .wire path { stroke-dasharray: 1; stroke-dashoffset: calc(1 - clamp(0, (var(--pin, 1) * 1.45 - 0.05) * 8 - var(--i), 1)); }
.peak-schem .wire .dot, .peak-schem .wire .wlabel { opacity: clamp(0, (var(--pin, 1) * 1.45 - 0.05) * 8 - var(--i) - 0.7, 1); }
.peak-schem .dev { opacity: clamp(0.25, var(--pin, 1) * 12, 1); }
.ss-reduced .peak-schem .wire path { stroke-dashoffset: 0; }
.ss-reduced .peak-schem .wire .dot, .ss-reduced .peak-schem .wire .wlabel, .ss-reduced .peak-schem .dev { opacity: 1; }

/* 4 · detail (reveal) */
.detail .stage { display: grid; grid-template-rows: auto auto; align-content: center; gap: var(--s6); padding-block: 88px 32px; }
.detail-head { display: grid; grid-template-columns: 1.1fr 1fr; gap: var(--s8); align-items: end; }
.detail-head h2 { font-size: var(--t-2xl); }
.detail-head p { color: var(--ink-soft); }
.compare { position: relative; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden;
  width: min(100%, calc(60svh * 1040 / 500 + 26px)); margin-inline: auto; }
.compare .layer { padding: 12px; }
.compare .layer.build { position: absolute; inset: 0; background: var(--surface); }
.compare .seam { position: absolute; top: 0; bottom: 0; left: calc(var(--pin, 0) * 100%); width: 2px; background: var(--accent-hi); box-shadow: 0 0 24px var(--accent-hi); }
.side-k { position: absolute; top: 14px; padding: 4px 8px; border-radius: 6px; background: #0c0f14cc; }
.side-k.left { left: 14px; opacity: clamp(0, var(--pin, 0) * 5 - 0.2, 1); }
.side-k.right { right: 14px; opacity: clamp(0, (1 - var(--pin, 0)) * 5 - 0.2, 1); }
.concept-schem .did, .concept-schem .port, .concept-schem .wlabel, .concept-schem .dot { display: none; }
.concept-schem .box { fill: #131a23; stroke-dasharray: 5 4; }
.concept-schem .wire path { stroke-dasharray: 6 6; opacity: .75; }
.build-schem .pname { transform: translateY(0); } .build-schem .ptype { opacity: 1; }
.build-schem .port.unused { display: inline; } .build-schem .port.unused .pname { fill: var(--ink-faint); }

/* 5 · workflow */
.workflow { padding-block: clamp(96px, 16vh, 180px) clamp(64px, 10vh, 120px); }
.split-head { display: grid; grid-template-columns: 1.1fr 1fr; gap: var(--s8); align-items: end; margin-bottom: var(--s8); }
.split-head h2 { font-size: var(--t-2xl); }
.split-head p { color: var(--ink-soft); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.steps li { padding: var(--s6) var(--s6) 0 0; }
.steps li + li { padding-left: var(--s6); border-left: 1px solid var(--line); }
.steps .n { font: 500 0.8rem var(--font-mono); color: var(--accent-hi); }
.steps h3 { margin-top: var(--s4); }
.steps p { margin-top: var(--s3); color: var(--ink-soft); font-size: 0.95rem; }

/* 6 · open ground */
.ground { padding-block: clamp(56px, 9vh, 104px); }
.h-sm { font-size: var(--t-xl); max-width: 20em; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: var(--s7); }
.card { display: flex; gap: 18px; padding: 28px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: inherit; text-decoration: none;
  transition: border-color .2s var(--ease), transform .2s var(--ease); }
.card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.card img, .card svg { flex: none; border-radius: 8px; }
.card p { margin-top: var(--s3); color: var(--ink-soft); font-size: 0.95rem; }
.card .go { display: inline-block; margin-top: var(--s5); font-weight: 500; font-size: 0.92rem; }
.card.pantry .go { color: #ffc88c; } .card.avos .go { color: #8fe1f2; }
.card .go::after { content: " ↗"; }

/* 7 · close */
.close { padding-block: clamp(80px, 14vh, 160px); }
.close-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--s9); align-items: end; padding: clamp(32px, 5vw, 64px);
  border-radius: 20px; border: 1px solid var(--line-2); background: radial-gradient(120% 140% at 0% 0%, #1d2a44 0%, var(--surface) 60%); }
.close h2 { font-size: var(--t-2xl); }
.close-grid > div > p { margin-top: var(--s5); color: var(--ink-soft); }
.signup label { display: block; font-size: 0.86rem; color: var(--ink-soft); margin-bottom: 8px; }
.field { display: flex; gap: 8px; }
.field input { flex: 1; min-width: 0; min-height: 48px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: #0e131a; color: var(--ink); font: 1rem var(--font-text); }
.field input:focus { outline: 2px solid var(--accent-hi); outline-offset: 1px; }
.field .btn { min-height: 48px; }
.hp { position: absolute; left: -5000px; }
.form-note { margin-top: 10px; font-size: 0.82rem; color: var(--ink-soft); }
.form-note.ok { color: var(--network); } .form-note.err { color: #ff9b8a; }

/* footer */
.foot { border-top: 1px solid var(--line); padding-block: 28px; }
.foot-in { display: flex; align-items: center; gap: var(--s7); }
.foot nav { display: flex; gap: var(--s6); }
.foot nav a { color: var(--ink-soft); text-decoration: none; font-size: 0.9rem; }
.foot nav a:hover { color: var(--ink); }
.foot p { margin-left: auto; font-size: 0.85rem; color: var(--ink-faint); }

/* ── phone ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .nav nav { display: none; }
  .nav-cta .btn.ghost { display: none; }
  .docs-head, .detail-head, .split-head, .close-grid, .pair { grid-template-columns: 1fr; gap: var(--s5); }
  .peak-grid { grid-template-columns: 1fr; gap: var(--s5); }
  .steps { grid-template-columns: 1fr 1fr; }
  .steps li:nth-child(3) { border-left: 0; padding-left: 0; }
  .steps li:nth-child(n+3) { margin-top: var(--s6); }
}
@media (max-width: 700px) {
  .demo-body { grid-template-columns: 1fr; }
  .demo-bom { border-left: 0; border-top: 1px solid var(--line); }
  .demo-bom ul { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; }
  .demo-foot { flex-direction: column; align-items: stretch; }
  .demo-foot .btn { width: 100%; }
  /* the drawings stay whole: scroll sideways inside their frame, never cropped */
  .drawing, .compare, .demo-canvas { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .peak-schem, .concept-schem, .build-schem { min-width: 720px; }
  .hero-schem { min-width: 560px; }
  .compare .layer.build { width: max-content; }
  .peak h2 { font-size: var(--t-xl); }
  .peak-copy > p:not(.kicker) { font-size: 0.95rem; }
  .styles { margin-top: var(--s5); }
  .steps { grid-template-columns: 1fr; }
  .steps li, .steps li + li { border-left: 0; padding-left: 0; }
  .steps li + li { margin-top: var(--s6); border-top: 1px solid var(--line); }
  .field { flex-direction: column; }
  .card { flex-direction: column; padding: 22px; }
  .foot-in { flex-wrap: wrap; gap: var(--s5); }
  .foot p { margin-left: 0; width: 100%; }
}
[data-act="flow"] { padding-inline: 0; }

/* wide drawings must never widen their grid: they scroll inside their own frame */
.stage { min-width: 0; }
.docs .stage, .detail .stage { grid-template-columns: minmax(0, 1fr); }
.peak-grid > *, .detail-head > *, .docs-head > *, .split-head > *, .close-grid > * { min-width: 0; }
@media (max-width: 900px) {
  .peak-grid, .detail-head, .docs-head { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .docs .stage { padding-top: 88px; }
  .docs-head h2 { font-size: var(--t-xl); }
  .docs-head p { font-size: 0.95rem; }
  .doc { height: min(420px, 50svh); }
  .detail-head h2 { font-size: var(--t-xl); }
  .detail-head p { font-size: 0.95rem; }
}

/* the style toggles win over the scroll-driven drawing */
.peak-schem.hide-labels .wire .wlabel { opacity: 0 !important; }
.aside { display: block; margin-top: 10px; font-size: 0.8rem; color: var(--ink-faint); }
/* the rail sits in the middle of the held frame, not at the top with a gap below */
.docs .stage { grid-template-rows: auto auto; align-content: center; }
