@font-face {
  font-family: "Fira Code";
  src: url("./fonts/fira-code-v6.2.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink-0: #05070a;
  --ink-1: #090c11;
  --paper: #eef4f5;
  --muted: #929ea9;
  --cyan: #9deef7;
  --violet: #8d7df2;
  --hairline: #243038;
  --font-mono: "Fira Code", "SFMono-Regular", Consolas, monospace;
  --gutter: clamp(24px, 4vw, 64px);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  font-family: var(--font-mono);
  font-synthesis: none;
  scrollbar-color: #44515d var(--ink-0);
  scrollbar-width: thin;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--ink-0); color: var(--paper); }
::selection { background: var(--cyan); color: var(--ink-0); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ink-0); }
::-webkit-scrollbar-thumb { background: #44515d; border: 2px solid var(--ink-0); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

.site-shell {
  position: relative;
  isolation: isolate;
  overflow: clip;
  --pointer-x: 0;
  --pointer-y: 0;
  background: radial-gradient(ellipse at 50% 44%, #0a1419 0%, transparent 56%), var(--ink-0);
}

.hero {
  position: relative;
  min-height: 100svh;
  padding: max(28px, env(safe-area-inset-top)) var(--gutter) max(28px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 64px;
}

.grid-field {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: linear-gradient(#9deef708 1px, transparent 1px), linear-gradient(90deg, #9deef708 1px, transparent 1px);
  background-size: 88px 88px;
  mask-image: radial-gradient(ellipse at center, #0008, transparent 65%);
  transform: translate(calc(var(--pointer-x) * -4px), calc(var(--pointer-y) * -3px));
}

.topline, .footerline {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: .12em;
}
.topline { min-height: 54px; }
.footerline { padding-top: 20px; border-top: 1px solid var(--hairline); }
.brand-logo {
  display: block;
  width: 54px;
  height: 54px;
  padding: 4px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: #090c11cc;
  object-fit: contain;
  filter: drop-shadow(0 0 12px #9deef716);
}
.topline-status { display: flex; align-items: center; gap: 10px; }
.status-dot { width: 5px; height: 5px; background: var(--cyan); border-radius: 50%; box-shadow: 0 0 10px #9deef740; }

.motion-toggle {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-left: 2px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.motion-toggle[hidden] { display: none; }
.motion-toggle:hover { color: var(--cyan); border-color: var(--hairline); }
.motion-toggle:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; }
.motion-toggle:active { background: var(--hairline); }
.motion-toggle svg { fill: none; stroke: currentColor; stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }
.play-icon, .is-paused .pause-icon { display: none; }
.is-paused .play-icon { display: block; }

.circuit-stage {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  width: max(110%, 980px);
  max-width: 1600px;
  height: max(100%, 780px);
  left: 50%;
  top: 49%;
  transform: translate(-50%, -50%);
  mask-image: radial-gradient(ellipse at center, #000 24%, #000c 49%, transparent 76%);
}
.circuit-board {
  width: 100%;
  height: 100%;
  overflow: visible;
  transform: perspective(1200px) rotateX(calc(7deg + var(--pointer-y) * 1deg)) rotateY(calc(var(--pointer-x) * -1.4deg));
}
.circuit-plane, .circuit-pads, .circuit-components {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.circuit-plane-far {
  opacity: .045;
  stroke-width: 1.6;
  transform: translate(calc(-12px + var(--pointer-x) * -7px), calc(-18px + var(--pointer-y) * -5px));
  filter: blur(1px);
}
.circuit-plane-mid {
  opacity: .07;
  stroke-width: .8;
  transform: translate(calc(var(--pointer-x) * -16px), calc(var(--pointer-y) * -10px));
}
.circuit-foreground {
  transform: translate(calc(var(--pointer-x) * -30px), calc(var(--pointer-y) * -19px));
}
.circuit-plane-near { opacity: .16; stroke-width: 1; }
.circuit-plane-near [data-tone="violet"] { stroke: #b0a3f4; }
.circuit-pads { stroke-width: .9; stroke-opacity: .23; fill: var(--ink-0); }
.circuit-components { stroke-opacity: .13; fill: #090c1170; }
.circuit-signal { fill: none; stroke: var(--cyan); stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.signal-violet { stroke: #b0a3f4; }
.signal-core { stroke-width: 1.8; stroke-dasharray: .65 100; }
.signal-halo { stroke-width: 5; stroke-dasharray: 1.8 100; filter: url(#signal-bloom); opacity: .45; }

.hero-copy {
  position: relative;
  z-index: 1;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 64px 0 76px;
  transform: translate3d(calc(var(--pointer-x) * 5px), calc(var(--pointer-y) * 3px), 0);
}
.eyebrow {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
  letter-spacing: .3em;
}
.brand-title {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: .2em;
  margin: 0;
  font-size: clamp(38px, 6.9vw, 108px);
  font-weight: 350;
  letter-spacing: -.075em;
  line-height: 1.15;
  white-space: nowrap;
}
.io-mark { color: var(--cyan); font-weight: 400; }
.tagline {
  margin: 24px 0 0;
  color: #a5b2bb;
  font-size: clamp(13px, 1.15vw, 16px);
  font-weight: 400;
  line-height: 1.8;
  letter-spacing: -.035em;
}
.arrival {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 36px;
  padding: 9px 14px;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  background: #090c1180;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
  letter-spacing: .16em;
}
.arrival-line { width: 16px; height: 1px; background: var(--cyan); }

.footer-region { position: relative; z-index: 1; }
.code-note {
  width: calc(31ch + 2px);
  max-width: 100%;
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
  transform: translate(calc(var(--pointer-x) * 9px), calc(var(--pointer-y) * 5px));
}
.code-comment { display: block; margin-bottom: 3px; color: #73818e; font-size: 10px; }
.code-typing {
  display: block;
  width: calc(31ch + 2px);
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  border-right: 1px solid transparent;
  font: inherit;
}
.code-keyword { color: #a69bd5; }
.code-function { color: #96c4cc; }
@media (prefers-reduced-motion: no-preference) and (forced-colors: none) {
  [data-motion] .code-typing {
    animation: type-code 2.8s .8s steps(31, end) both, code-caret 2s 3.6s ease-in-out infinite;
  }
  [data-motion="paused"] .code-typing { animation-play-state: paused; }
}
@keyframes type-code { from { width: 0; border-right-color: var(--cyan); } to { width: calc(31ch + 2px); border-right-color: var(--cyan); } }
@keyframes code-caret { 0%, 100% { border-right-color: transparent; } 50% { border-right-color: #9deef780; } }

@media (max-width: 640px) {
  .hero { gap: 40px; }
  .topline, .footerline { font-size: 9px; letter-spacing: .05em; }
  .topline { min-height: 46px; }
  .brand-logo { width: 46px; height: 46px; padding: 3px; border-radius: 7px; }
  .circuit-stage { width: 900px; height: 100%; min-height: 720px; opacity: .8; }
  .circuit-plane-far, .circuit-components { display: none; }
  .hero-copy { padding: 48px 0; }
  .eyebrow { font-size: 9px; letter-spacing: .22em; margin-bottom: 24px; }
  .brand-title { flex-direction: column; align-items: center; gap: .12em; font-size: clamp(28px, 8.1vw, 52px); letter-spacing: -.06em; }
  .io-mark { font-size: .7em; }
  .tagline { margin-top: 28px; font-size: 12px; }
  .arrival { margin-top: 28px; }
  .footerline { gap: 12px; }
  .code-note { font-size: 10px; margin-bottom: 20px; }
  .code-comment { font-size: 9px; }
}

@media (max-height: 540px) and (min-width: 641px) {
  .hero { gap: 24px; }
  .hero-copy { padding: 24px 0; }
  .brand-title { font-size: clamp(38px, 6vw, 76px); }
  .eyebrow { margin-bottom: 16px; }
  .tagline, .arrival { margin-top: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  [data-circuit-signals], .motion-toggle { display: none; }
  .circuit-board, .circuit-plane-mid, .circuit-foreground, .hero-copy, .code-note, .grid-field { transform: none; }
}

@media (forced-colors: active) {
  .grid-field, .circuit-stage, .motion-toggle { display: none; }
  .brand-logo { border-color: CanvasText; background: Canvas; filter: none; }
  .arrival, .footerline { border-color: CanvasText; }
  .status-dot, .arrival-line { background: CanvasText; }
}
