@font-face {
  font-family: Anton;
  src: url('assets/fonts/Anton-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url('assets/fonts/Inter-Variable.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}
:root {
  color-scheme: dark;
  font-family: Inter,Arial,sans-serif;
  background: #000307;
  color: #f5f8ff;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
button:focus-visible,a:focus-visible {
  outline: 3px solid #d5fbff;
  outline-offset: 7px;
}
button {
  touch-action: pan-y;
}
a {
  color: inherit;
}
#scene {
  position: relative;
  width: 100%;
  aspect-ratio: 1672/941;
  overflow: hidden;
  background: #000;
  isolation: isolate;
  touch-action: pan-y;
}
.stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 1672px;
  height: 941px;
  transform: scale(var(--scale,1));
  transform-origin: top left;
}
#energy {
  position: absolute;
  inset: 0;
  display: block;
  width: 1672px;
  height: 941px;
  pointer-events: none;
  user-select: none;
}
#energy {
  z-index: 4;
}
.header {
  position: absolute;
  z-index: 5;
  inset: 0;
  pointer-events: none;
}
.brand {
  position: absolute;
  top: 34px;
  left: 45px;
  font-size: 34px;
  font-weight: 650;
  letter-spacing: -1.6px;
  line-height: 1.2;
  text-decoration: none;
  pointer-events: auto;
}
.brand span {
  color: #7698c0;
  font-weight: 400;
}
.hero {
  position: absolute;
  z-index: 5;
  left: 45px;
  top: 213px;
}
h1 {
  margin: 0;
  font-family: Anton,Impact,sans-serif;
  font-weight: 400;
  letter-spacing: -3px;
  line-height: 1;
  text-transform: uppercase;
}
h1 span {
  display: block;
  transform-origin: left top;
  width: max-content;
}
.play {
  font-size: 184px;
  color: #fcfcfc;
  line-height: .96;
  transform: scaleX(1.04);
}
.overcharged {
  font-size: 164px;
  line-height: 1.05;
  color: #b6f2fa;
  transform: scaleX(.965);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
@media(max-width:760px) {
  #scene {
    aspect-ratio: auto;
    height: 1230px;
  }
  .stage {
    width: 100%;
    height: 100%;
    transform: none;
  }
  #energy {
    width: 100%;
    height: 100%;
  }
  .header .brand {
    left: 24px;
    top: 24px;
    font-size: 25px;
    letter-spacing: -1.2px;
  }
  .hero {
    left: 24px;
    right: 18px;
    top: 200px;
  }
  h1 {
    letter-spacing: -1px;
  }
  .play {
    font-size: 93px;
    line-height: 1;
  }
  .overcharged {
    font-size: clamp(48px,11.85vw,86px);
    line-height: 1.15;
    transform: none;
  }
}
@media(prefers-reduced-motion:reduce) {
  *,*::before {
    scroll-behavior: auto!important;
    transition: none!important;
  }
}
/* Static comparison pass 2: align ink bounds and the panel content origins. */
@media(min-width:761px) {
  .stage::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: radial-gradient(ellipse 850px 530px at 420px 820px,#0009 0%,#0005 48%,transparent 90%);
  }
  .hero {
    left: 48px;
  }
  .play {
    transform: translateY(14px) scaleX(1.015);
  }
  .overcharged {
    transform: translateY(2px) scaleX(.954);
  }
  .brand {
    letter-spacing: -1.25px;
    font-size: 35px;
  }
}
@media(min-width:761px) {
  .brand {
    transform: scaleX(1.018);
    transform-origin: left top;
  }
}
@media(max-width:760px) {
  .stage::after {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 510px;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(90deg,#000b,transparent 75%),linear-gradient(0deg,#000,transparent 45%);
  }
  .overcharged {
    font-size: clamp(52px,16.5vw,115px);
  }
}
/* Live renderer: the HTML remains stable while the emissive scene evolves. */
#energy { z-index: 2; mix-blend-mode: normal; }
#scene[data-renderer="fallback"] #energy,
#scene[data-renderer="loading"] #energy,
#scene[data-renderer="lost"] #energy { visibility: hidden; }
.reference-comparison { display:none; position:absolute; z-index:20; inset:0; width:100%; height:100%; object-fit:fill; pointer-events:none; }
#scene[data-comparison="reference"] .reference-comparison { display:block; }
#scene[data-comparison="reference"] .stage { pointer-events:none; }
.dev-comparison { position:fixed; z-index:100; bottom:14px; left:14px; max-width:calc(100vw - 28px); padding:12px 14px; border:1px solid #486481; border-radius:8px; background:#07111bef; color:#d2e8f7; font:12px Inter,sans-serif; box-shadow:0 3px 15px #0008; }
.dev-comparison button { padding:6px 10px; margin:0 6px 8px 0; background:#112e48; border:1px solid #486b90; border-radius:4px; }
.dev-comparison label { display:inline-flex; align-items:center; gap:4px; margin-right:10px; }
.dev-comparison details { margin-top:6px; }.dev-comparison summary { cursor:pointer; }
.dev-comparison p { margin:4px 0 8px; color:#8db0c9; }
.dev-fx { display:flex; flex-wrap:wrap; gap:8px; border-top:1px solid #34506a; padding-top:10px; margin-top:10px; }
.dev-fx label { display:flex; flex-direction:column; align-items:flex-start; gap:4px; }
.dev-fx input { width:125px; }
@media (max-width:760px) {
  /* Preserve a dark reading surface where the cropped corona meets the title. */
  #scene[data-renderer="webgl2"] .stage::after {
    z-index: 2;
    height: 480px;
    background: radial-gradient(ellipse 340px 145px at 110px 280px, #000b, #0006 55%, transparent 100%);
  }
  .brand span { color: #a7cde8; }
}

/* Optional parameter viewer lives outside the scene so its controls receive no tether tracking. */
.parameter-viewer {
  position: fixed; z-index: 110; left: 16px; bottom: 16px; width: 460px;
  max-width: calc(100vw - 24px); max-height: calc(100dvh - 32px); overflow: auto;
  color: #dfedf7; background: #081521f5; border: 1px solid #45627a;
  border-radius: 10px; box-shadow: 0 8px 28px #0009;
  font: 12px/1.4 Inter, system-ui, sans-serif; color-scheme: dark;
}
.parameter-viewer > summary {
  cursor: pointer; padding: 8px 14px; font-weight: 650;
  background: #101f2d; border-radius: 9px; user-select: none;
}
.parameter-viewer[open] > summary { border-radius: 9px 9px 0 0; border-bottom: 1px solid #2c4357; }
.parameter-viewer-hint { margin-left: 12px; color: #94afc3; font-size: 11px; font-weight: 400; }
.parameter-viewer-body { padding: 8px 14px; }
.parameter-viewer-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 18px; }
.parameter-viewer-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.parameter-viewer-label label { font-weight: 600; }
.parameter-viewer-label output { color: #a3e6fb; font-variant-numeric: tabular-nums; }
.parameter-viewer input[type="range"] { display: block; width: 100%; height: 23px; margin: 1px 0 0; accent-color: #82d1f4; cursor: pointer; }
.parameter-viewer-description { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.parameter-viewer-count { min-height: 17px; color: #bed5e5; margin: 5px 0; font-size: 11px; }
.parameter-viewer-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.parameter-viewer button {
  min-height: 30px; padding: 5px 10px; border: 1px solid #49647c; border-radius: 5px;
  background: #122b3d; color: #e1edf7; font: inherit; font-size: 11px; cursor: pointer;
}
.parameter-viewer button[aria-pressed="true"] { border-color: #9ddbf1; background: #20445b; }
.parameter-viewer :is(button, summary, input):focus-visible { outline: 2px solid #a6e4fa; outline-offset: 3px; }
.parameter-viewer-status { margin: 4px 0 0; color: #91aabe; font-size: 10px; }
@media (max-width: 760px) {
  .parameter-viewer { left: auto; right: 12px; bottom: 12px; width: 330px; max-height: calc(100dvh - 24px); }
  .parameter-viewer[open] > summary { position: sticky; top: 0; z-index: 1; }
  .parameter-viewer-fields { grid-template-columns: 1fr; gap: 10px; }
  .parameter-viewer input[type="range"] { height: 34px; }
  .parameter-viewer-description { position: static; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal; color: #92aabd; font-size: 11px; }
  .parameter-viewer button { min-height: 36px; }
}

.parameter-viewer-outer { margin: 0 0 3px; border-top: 1px solid #2c4357; }
.parameter-viewer-outer > summary { padding: 4px 0; color: #bfd6e7; cursor: pointer; font-weight: 600; }
.parameter-viewer-outer-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); padding-top: 5px; gap: 7px 12px; }
.parameter-viewer-outer-count { margin: 5px 0 0; color: #bed5e5; font-size: 11px; }
.parameter-viewer-outer-note { margin: 3px 0 6px; color: #91aabe; font-size: 10px; }
@media (max-width: 760px) {
  .parameter-viewer-outer-fields { grid-template-columns: 1fr; }
}

.parameter-viewer-group { margin: 6px 0 10px; border-top: 1px solid #2c4357; }
.parameter-viewer-group > summary { padding: 7px 0; color: #bfd6e7; cursor: pointer; font-weight: 600; }
.parameter-viewer-group .parameter-viewer-fields { padding: 3px 0 8px; }
.bezier-maker { padding: 8px; border: 1px solid #2c4357; border-radius: 6px; background: #06101a; }
.bezier-caption { display: flex; justify-content: space-between; color: #91aabe; font-size: 11px; }
.bezier-brightness { color: #a3e6fb; font-variant-numeric: tabular-nums; }
.bezier-editor { display: block; width: 100%; max-height: 210px; overflow: visible; touch-action: none; user-select: none; }
.bezier-grid { fill: none; stroke: #233748; stroke-width: 1; }
.bezier-guides { fill: none; stroke: #7094ad; stroke-width: 1; stroke-dasharray: 4 3; }
.bezier-curve { fill: none; stroke: #9be6ff; stroke-width: 2.5; }
.bezier-handle { cursor: grab; }
.bezier-handle:active { cursor: grabbing; }
.bezier-handle circle { fill: #153b53; stroke: #91dafa; stroke-width: 2; }
.bezier-handle text { fill: #bfd6e7; font-size: 10px; pointer-events: none; }
.bezier-marker { fill: #fff0b0; stroke: #f1c66e; stroke-width: 2; pointer-events: none; }
.bezier-coordinates { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.bezier-coordinates .parameter-viewer-label { gap: 0; font-size: 10px; }
.bezier-coordinates output { display: none; }
.bezier-coordinates input { box-sizing: border-box; width: 100%; min-height: 32px; margin-top: 3px; padding: 4px; border: 1px solid #49647c; border-radius: 4px; background: #122b3d; color: #e1edf7; font: inherit; }
.bezier-presets { margin-top: 9px; }
.bezier-handle:focus-visible circle { stroke: #fff0b0; stroke-width: 3; }
.bezier-handle:focus-visible { outline: none; }

/* Stable hit regions; only their inner optical surfaces move with the live scene clock. */
.hero h1,.hero h1 *, .brand,.brand * { user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
.has-surface-fx,.has-surface-fx * { user-select: none; -webkit-user-select: none; }
.overcharged { position: relative; }
.title-inner-current { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.has-surface-fx { background: transparent !important; box-shadow: none !important; }
.surface-motion { display: block; position: absolute; inset: 0; padding: inherit; transform-origin: 0 0; pointer-events: none; }
.surface-face { display: block; position: absolute; inset: 0; border-radius: inherit; transform: var(--panel-transform,none); transform-origin: 0 0; pointer-events: none; }
.surface-content { display: flex; position: relative; flex-direction: column; width: 100%; height: 100%; align-items: stretch; pointer-events: none; }
.surface-conduction { display: block; position: absolute; left: -24px; top: -24px; max-width: none; pointer-events: none; }
.tether-anchor { position: absolute; display: block; width: 0; height: 0; pointer-events: none; }
.surface-motion { border-radius: inherit; }
/* Decoration has no layout border, so selection cannot shift the shared local contact. */
.surface-face { border: 0 !important; }
.surface-face::before { content: ""; position: absolute; inset: 0; border: 1px solid #6d95b8; border-radius: inherit; pointer-events: none; }

/* An independent, lightweight identity covers initial GPU preparation. */
.loading-screen {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center; padding: 24px;
  background: radial-gradient(ellipse 340px 280px at 50% 46%, #07111b 0%, #020406 72%, #020406 100%);
  opacity: 1; visibility: visible;
  transition: opacity .32s ease-out, visibility 0s;
  user-select: none; -webkit-user-select: none;
}
.loading-screen[data-state="hidden"] {
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .32s ease-out, visibility 0s .32s;
}
.loading-identity {
  display: grid; justify-items: center; align-items: center;
  grid-template-rows: 118px 38px 30px 44px; width: min(290px, 100%);
  transform: translateY(-2vh);
}
.loading-io { display: block; width: 108px; height: 108px; overflow: visible; }
.loading-wordmark {
  color: #e7f2fa; font: 600 25px/1.2 Inter,Arial,sans-serif;
  letter-spacing: -1px; white-space: nowrap;
}
.loading-wordmark > span { color: #668eac; font-weight: 400; }
.loading-message { margin: 0; color: #74899b; font: 11px/1.5 Inter,Arial,sans-serif; letter-spacing: .3px; }
.loading-continue {
  align-self: end; border: 1px solid #304354; border-radius: 20px;
  padding: 7px 19px; background: #091018; color: #c6dce9; font-size: 11px;
}
.loading-continue:hover { border-color: #8ab4cf; background: #111e2a; }
.loading-continue[hidden] { display: none; }
.io-heart { animation: io-breathe 2.8s ease-in-out infinite; }
.io-current { animation: io-current 6s linear infinite; }
@keyframes io-breathe { 0%,100% { opacity: .65; } 50% { opacity: 1; } }
@keyframes io-current { to { stroke-dashoffset: -100; } }
.loading-screen[data-state="hidden"] .loading-io *,
.loading-screen[data-state="unavailable"] .loading-io * { animation-play-state: paused; }
.no-script-note { margin: 0; padding: 14px 24px; color: #a9c5d9; font-size: 13px; }
@media(hover:hover) and (pointer:fine) {
  #scene { cursor: url('assets/io-cursor.svg') 12 12, crosshair; }
  #scene button, #scene a,
  .loading-continue { cursor: url('assets/io-cursor-active.svg') 12 12, pointer; }
}
@media(prefers-reduced-motion:reduce) {
  .loading-io * { animation: none !important; }
  .loading-screen, .loading-screen[data-state="hidden"] { transition: none; }
}

/* The charged contour is drawn by the shared current material; the face stays dark. */
.has-surface-fx[data-surface-state="conducting"] .surface-face::before,
.has-surface-fx[data-surface-state="charged"] .surface-face::before { border-color: #5187bf75; border-width: 1px; }
/* Host-owned visibility policy; the control stays usable during loading. */
#io-toggle { position: fixed; right: 12px; top: 12px; z-index: 10000; padding: 8px 12px; border: 1px solid #687f94; border-radius: 6px; color: #dbeefe; background: #101d2a; font: 12px Inter, sans-serif; cursor: pointer; }
#io-toggle:focus-visible { outline: 2px solid #a7dfff; outline-offset: 3px; }
#scene[data-io="off"] #energy, #scene[data-io="off"] .surface-conduction, #scene[data-io="off"] .title-inner-current { display: none; }
/* Keep readable controls outside the renderer's fixed design-space stage. */
#scene > .hero { left: 2.87vw; top: 12.74vw; }
#scene > .hero .play { font-size: 11vw; }
#scene > .hero .overcharged { font-size: 9.81vw; }
#scene > .header .brand { left: 2.69vw; top: 2.03vw; font-size: clamp(24px,2.09vw,35px); min-height:44px; display:flex; align-items:center; }
.landing-actions { display:flex; flex-wrap:wrap; gap:16px; margin-top:32px; }
.landing-actions a { display:inline-flex; align-items:center; justify-content:center; min-width:132px; min-height:52px; padding:12px 24px; border:1px solid #adcfff; border-radius:9px; background:#06101c; color:#e6f7ff; text-decoration:none; font:600 18px/1.4 Inter,Arial,sans-serif; }
.landing-actions a:hover { background:#102b44; border-color:#e6f7ff; }
#io-toggle { min-height:44px; }
.download-status { width:min(720px,100%); margin:0 auto; padding:clamp(32px,8vw,100px) 24px; }
.download-status h1 { font:400 clamp(32px,6vw,56px)/1.15 Inter,Arial,sans-serif; letter-spacing:-1px; text-transform:none; }
.download-status p { color:#b8c9d8; line-height:1.7; }
@media(max-width:760px) {
  #scene { height: max(540px,100svh); }
  #scene > .hero { left:24px; right:18px; top:200px; }
  #scene > .hero .play { font-size:93px; }
  #scene > .hero .overcharged { font-size:clamp(48px,16.5vw,115px); }
  #scene > .header .brand { left:24px; top:24px; font-size:25px; }
  .landing-actions { gap:12px; margin-top:28px; }
  .landing-actions a { min-width:120px; padding:12px 18px; }
}
