/* Ferro demo page. Tokens first; everything else reads them. */
@font-face { font-family: "Space Grotesk"; src: url("fonts/space-grotesk-latin-wght-normal.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("fonts/dm-sans-latin-wght-normal.woff2") format("woff2"); font-weight: 100 1000; font-display: swap; }
:root {
  --bg: #08080a; --ink: #eceae4; --muted: #9a9ba2; --line: rgba(255, 255, 255, .09); --card: #111114; --chip: #1a1a1f;
  --accent: #ff4d2e; --fluid: #0d0d10;
  --r: 24px; --gap: 16px;
  --display: "Space Grotesk", system-ui, sans-serif; --body: "DM Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 var(--body); }
a { color: inherit; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 10px; z-index: 10; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 24px; padding: 12px clamp(16px, 4vw, 48px); background: rgba(8, 8, 10, .78); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { font: 700 22px/1 var(--display); text-decoration: none; letter-spacing: -0.03em; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.brand svg { width: 26px; height: 26px; color: var(--ink); }
.top nav { display: flex; gap: 22px; margin-left: auto; font-size: 15px; }
.top nav a { text-decoration: none; color: var(--muted); padding: 12px 0; }
.top nav a:hover { color: var(--ink); }
.cta { background: var(--ink); color: var(--bg); text-decoration: none; padding: 0 18px; border-radius: 999px; font-weight: 600; font-size: 15px; min-height: 44px; display: inline-flex; align-items: center; }
.cta:hover { background: #fff; }

.intro { padding: clamp(28px, 6vw, 80px) clamp(16px, 4vw, 48px) 28px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px 56px; align-items: end; }
.kicker { grid-column: 1 / -1; margin: 0; display: flex; align-items: center; gap: 10px; font: 600 13px/1 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.pip { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
h1 { margin: 0; font: 700 clamp(84px, 16vw, 230px)/.82 var(--display); letter-spacing: -0.065em;
  background: linear-gradient(180deg, #fff 0%, #cfd0d6 38%, #4a4b52 52%, #e9e9ee 64%, #7b7c84 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
h1 .dot { color: var(--accent); -webkit-text-fill-color: var(--accent); }
.lede { margin: 0 0 14px; font-size: clamp(18px, 1.6vw, 22px); color: var(--muted); max-width: 38ch; }

.play { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--gap); padding: 0 clamp(16px, 4vw, 48px) 56px; }
.stage { position: relative; height: min(78vh, 800px); min-height: 460px; border-radius: var(--r); overflow: hidden; background: #070708; box-shadow: inset 0 0 0 1px var(--line), 0 30px 80px rgba(0, 0, 0, .5); outline: none; }
.stage:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.poster, .stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.poster { object-fit: cover; transition: opacity .6s; }
.stage canvas { touch-action: none; cursor: crosshair; opacity: 0; transition: opacity .5s; -webkit-user-select: none; user-select: none; }
[data-ferro].f-live .stage canvas { opacity: 1; }
[data-ferro].f-live .poster { opacity: 0; }
.stage.f-power canvas { cursor: grabbing; }
.stage-reset { position: absolute; top: 14px; right: 14px; z-index: 2; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; background: rgba(20, 20, 24, .72); backdrop-filter: blur(10px); color: var(--ink); font: 600 14px var(--body); cursor: pointer; }
.stage-reset svg { width: 18px; height: 18px; }
.stage-reset:hover { background: rgba(40, 40, 46, .85); }
.hint { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); margin: 0; padding: 9px 16px; border-radius: 999px; background: rgba(236, 234, 228, .92); color: #111; font-size: 14px; font-weight: 500; white-space: nowrap; pointer-events: none; transition: opacity .5s; }
.hint.f-hide, .hint:empty { opacity: 0; }
.fallback { position: absolute; left: 16px; right: 16px; bottom: 16px; margin: 0; padding: 12px 16px; background: var(--card); border-radius: 12px; }
.read { position: absolute; left: 16px; bottom: 16px; right: 16px; display: flex; gap: 8px; flex-wrap: wrap; pointer-events: none; }
.read div { background: rgba(14, 14, 17, .66); backdrop-filter: blur(10px); border-radius: 14px; padding: 8px 12px; min-width: 104px; box-shadow: inset 0 0 0 1px var(--line); }
.read span { display: block; font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.read b { font: 600 20px/1.2 var(--display); font-variant-numeric: tabular-nums; }
.read i { font-style: normal; font-size: 13px; color: var(--muted); margin-left: 3px; }

.panel { background: var(--card); border-radius: var(--r); padding: 20px; box-shadow: inset 0 0 0 1px var(--line); display: flex; flex-direction: column; gap: 22px; align-self: start; }
.panel h2 { margin: 0 0 10px; font: 600 12px/1 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.swatches button { appearance: none; border: 0; cursor: pointer; min-height: 72px; border-radius: 14px; padding: 42px 2px 6px; font: 600 12px/1.15 var(--body); color: var(--ink); background: var(--chip); position: relative; }
.swatches button::before { content: ""; position: absolute; left: 50%; top: 9px; width: 28px; height: 28px; margin-left: -14px; border-radius: 50%; background: var(--s); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }
.swatches button[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--ink); }
.range { display: block; margin-bottom: 6px; font-size: 15px; }
.range span { display: flex; justify-content: space-between; }
.range output { font-variant-numeric: tabular-nums; color: var(--muted); }
input[type=range] { width: 100%; height: 44px; margin: 0; accent-color: var(--accent); }
.acts, .toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.toggles { margin-top: 8px; }
.acts button, .toggles button { appearance: none; border: 1px solid var(--line); cursor: pointer; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--chip); font: 600 14px var(--body); color: var(--ink); }
.acts button:hover, .toggles button:hover { background: #24242b; }
.acts button:first-child { background: var(--accent); border-color: var(--accent); color: #140400; }
.toggles button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.counts { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.counts div { background: var(--chip); border-radius: 12px; padding: 8px 12px; }
.counts dt { font-size: 12px; color: var(--muted); }
.counts dd { margin: 0; font: 600 15px/1.3 var(--display); font-variant-numeric: tabular-nums; }

.how, .faq { padding: 64px clamp(16px, 4vw, 48px); max-width: 1280px; }
.how h2, .faq h2 { font: 700 clamp(34px, 4.4vw, 56px)/1.02 var(--display); letter-spacing: -0.035em; margin: 0 0 32px; }
.cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.cols article { border-top: 1px solid var(--line); padding-top: 18px; }
.num { font: 600 13px var(--display); color: var(--accent); letter-spacing: .1em; }
.cols h3 { font: 600 21px/1.2 var(--display); margin: 8px 0 8px; }
.cols p { margin: 0; color: var(--muted); }
.facts { list-style: none; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.facts li { background: var(--card); border-radius: 16px; padding: 16px 18px; color: var(--muted); font-size: 15px; box-shadow: inset 0 0 0 1px var(--line); }
.facts b { display: block; font: 700 34px/1.1 var(--display); color: var(--ink); letter-spacing: -0.03em; }
.faq details { border-top: 1px solid var(--line); padding: 6px 0; max-width: 780px; }
.faq summary { cursor: pointer; font: 600 19px var(--display); min-height: 48px; display: flex; align-items: center; }
.faq p { margin: 0 0 14px; color: var(--muted); }
.foot { padding: 32px clamp(16px, 4vw, 48px) 48px; color: var(--muted); font-size: 15px; border-top: 1px solid var(--line); }
.foot a { color: var(--ink); }

@media (max-width: 1000px) {
  .play { grid-template-columns: 1fr; }
  .intro { grid-template-columns: 1fr; }
  .cols { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .top nav { display: none; }
  .cta { margin-left: auto; padding: 0 14px; font-size: 14px; }
  .stage { height: 62svh; min-height: 380px; border-radius: 18px; }
  .read { left: 10px; right: 10px; bottom: 10px; gap: 6px; }
  .read div { min-width: 0; padding: 6px 10px; flex: 1 1 0; }
  .read div:nth-child(n+3) { display: none; }
  .hint { font-size: 13px; white-space: normal; width: max-content; max-width: calc(100% - 32px); text-align: center; top: 70px; }
  .stage-reset { top: 10px; right: 10px; }
  .swatches { gap: 6px; }
  .swatches button { font-size: 12px; }
}
