/* ==========================================================================
   ALRA landing page
   Black, white and light. Colour only appears as light from the ring.
   ========================================================================== */

/* Fonts: Inter + Inter Display, self-hosted (SIL OFL, see assets/fonts/OFL.txt) */
@font-face { font-family: "Inter"; src: url("../fonts/Inter-Regular.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter-Medium.woff") format("woff"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("../fonts/InterDisplay-Light.woff") format("woff"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("../fonts/InterDisplay-SemiBold.woff") format("woff"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  /* Palette (mirror these in assets/js/ring.js → COLORS) */
  --void: #000000;      /* page */
  --ion: #f4f2ff;       /* primary text, cool white */
  --haze: #8c88a3;      /* secondary text */
  --dim: #2e2b3d;       /* statements not yet reached */
  --line: rgb(255 255 255 / .10);
  --uv: #5b3bff;        /* deep blue-violet, from the board's LED glow */
  --plasma: #b85cff;    /* mid violet */
  --flare: #ff5fd2;     /* hot pink core, light only */

  --font-text: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Inter Display", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(20px, 5vw, 64px);
  --maxw: 1240px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--void);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--void);
  color: var(--ion);
  font-family: var(--font-text);
  font-size: 1.125rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0; }

:focus-visible { outline: 2px solid var(--plasma); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 999px;
  background: var(--ion); color: #000; font-weight: 500; text-decoration: none;
}
.skip:focus { top: 12px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.wrap { width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 1.5em;
  border: 1px solid var(--ion); border-radius: 999px;
  background: var(--ion); color: #000;
  font: 500 1rem/1 var(--font-text); letter-spacing: -.005em;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow .35s var(--ease), background-color .2s, border-color .2s, color .2s;
}
.btn-ghost { background: transparent; color: var(--ion); border-color: rgb(255 255 255 / .24); }
/* hover effects only where there is a real mouse, so they don't stick after a tap */
@media (hover: hover) {
  .btn:hover { box-shadow: 0 0 0 5px rgb(184 92 255 / .18), 0 0 36px rgb(184 92 255 / .38); }
  .btn-ghost:hover { border-color: var(--ion); box-shadow: none; }
  .nav-links a:hover { color: var(--ion); }
  .sound-toggle:hover { border-color: rgb(255 255 255 / .45); }
}
.btn-small { min-height: 38px; padding: 0 1.1em; font-size: .875rem; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; gap: 32px;
  height: 64px; padding-inline: var(--gutter);
  border-bottom: 1px solid transparent;
  transition: background-color .4s, border-color .4s, opacity 1s var(--ease);
}
.nav.is-scrolled {
  background: rgb(0 0 0 / .62);
  -webkit-backdrop-filter: saturate(150%) blur(18px);
  backdrop-filter: saturate(150%) blur(18px);
  border-bottom-color: var(--line);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 600; font-size: 1.125rem; letter-spacing: .02em;
  text-decoration: none;
}
.brand-ring { width: 20px; height: 20px; filter: drop-shadow(0 0 5px rgb(184 92 255 / .7)); }
.nav-links { display: flex; gap: 28px; margin-left: auto; font-size: .9375rem; color: var(--haze); }
.nav-links a { text-decoration: none; transition: color .2s; }

/* ---------- Hero ---------- */
.hero {
  --cx: 50vw;  /* set by ring.js: ring centre */
  --cy: 45vh;
  --r: 180px;  /* set by ring.js: ring radius */
  --pulse: 0;  /* set by ring.js: live glow 0..1 */
  position: relative; isolation: isolate; overflow: hidden;
  height: 100vh; height: 100svh; min-height: 560px;
}

/* back to front: wordmark (1), metal ring (2), light (3), text + button (4) */
.wordmark {
  position: absolute; left: var(--cx); top: var(--cy); z-index: 1;
  margin: 0; transform: translate(-50%, -52%);
  font-family: var(--font-display); font-weight: 600;
  font-size: calc(var(--r) * .4); line-height: 1; letter-spacing: -.01em;
  color: var(--ion); pointer-events: none; user-select: none; -webkit-user-select: none;
  text-shadow: 0 0 calc(var(--pulse) * 30px) rgb(184 92 255 / calc(var(--pulse) * .9));
}
.ring-canvas {
  position: absolute; z-index: 2; display: block;
  touch-action: pan-y; /* swipe sideways turns the ring, swipe up/down still scrolls */
  -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
}
.ring-canvas.is-dragging { cursor: grabbing !important; }
.hero-canvas {
  position: absolute; inset: 0; z-index: 3; display: block; width: 100%; height: 100%;
  pointer-events: none; mix-blend-mode: screen; /* light adds onto the metal */
}
.no-webgl .hero-canvas { mix-blend-mode: normal; }

.hero-foot {
  position: absolute; left: 0; right: 0; z-index: 4;
  top: calc(var(--cy) + var(--r) * 1.7);
  display: flex; flex-direction: column; align-items: center; gap: 26px;
  padding-inline: var(--gutter); text-align: center;
}
/* phones held sideways: ring left, text right */
.hero.is-landscape { min-height: 0; }
.hero.is-landscape .hero-foot {
  top: var(--cy); left: calc(var(--cx) + var(--r) * 1.8); right: var(--gutter);
  transform: translateY(-50%); align-items: flex-start; gap: 18px;
  padding: 0; text-align: left;
}
.tagline {
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(1.3125rem, 2.5vw, 2rem); line-height: 1.2; letter-spacing: -.01em;
  color: var(--ion);
}

.sound-toggle {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 44px; padding: 0 18px 0 15px;
  border: 1px solid rgb(255 255 255 / .18); border-radius: 999px;
  background: rgb(255 255 255 / .03); color: var(--ion);
  font: 500 .9375rem/1 var(--font-text); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .25s, background-color .25s, opacity 1s var(--ease);
}
.sound-toggle[aria-pressed="true"] { border-color: rgb(184 92 255 / .55); background: rgb(91 59 255 / .10); }
.sound-bars { display: inline-flex; align-items: center; gap: 3px; height: 16px; }
.sound-bars i {
  width: 3px; height: 16px; border-radius: 2px; background: currentColor;
  transform-origin: center; transform: scaleY(.25);
}
/* bar heights come from the live audio (set by ring.js) */
.sound-toggle[aria-pressed="true"] .sound-bars i { background: var(--plasma); }
.sound-bars i:nth-child(1) { transform: scaleY(var(--b0, .25)); }
.sound-bars i:nth-child(2) { transform: scaleY(var(--b1, .45)); }
.sound-bars i:nth-child(3) { transform: scaleY(var(--b2, .3)); }
.sound-bars i:nth-child(4) { transform: scaleY(var(--b3, .2)); }

/* Intro choreography (only when JS runs) */
.js .nav, .js .sound-toggle { opacity: 0; }
.js.intro-done .nav, .js.intro-done .sound-toggle { opacity: 1; }

.js .wordmark { opacity: 0; filter: blur(12px); transition: opacity 1.1s var(--ease), filter 1.3s var(--ease); }
.js .is-lit .wordmark { opacity: 1; filter: blur(0); }

.js .tagline {
  opacity: 0;
  background: linear-gradient(100deg, var(--ion) 0 38%, #fff 45%, #dcbcff 50%, #fff 55%, var(--ion) 62% 100%);
  background-size: 280% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  transition: opacity .9s var(--ease) .3s;
}
.js .is-lit .tagline { opacity: 1; animation: sweep 2s var(--ease) .35s both; }
@keyframes sweep { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ---------- Vision statements ---------- */
.vision { position: relative; height: 340vh; }
.vision-sticky {
  position: sticky; top: 0;
  display: flex; align-items: center;
  height: 100vh; height: 100svh;
}
.statements {
  width: min(100% - 2 * var(--gutter), var(--maxw)); margin: 0 auto; padding: 0;
  list-style: none; display: grid; gap: clamp(14px, 2.6vh, 30px);
}
.statement {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 19rem);
  align-items: baseline; column-gap: 2.5rem;
}
.statement-line {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2.5rem, 7.4vw, 6.25rem); line-height: 1.02; letter-spacing: -.035em;
  color: var(--dim);
  transition: color .6s var(--ease), text-shadow .6s var(--ease);
}
.statement-soft .statement-line { font-weight: 300; letter-spacing: -.03em; }
.statement-sub {
  color: var(--haze); font-size: 1.0625rem; line-height: 1.5;
  opacity: 0; transform: translateY(8px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.statement.is-active .statement-line { color: var(--ion); text-shadow: 0 0 44px rgb(184 92 255 / .38); }
.statement.is-active .statement-sub { opacity: 1; transform: none; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(96px, 13vw, 180px); }

.section-head {
  display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between;
  gap: 20px 48px; margin-bottom: clamp(44px, 6vw, 80px);
}
.section-title {
  margin: 0;
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2.25rem, 5vw, 3.75rem); line-height: 1.04; letter-spacing: -.032em;
}
.section-intro { max-width: 26em; color: var(--haze); }

/* Design → board */
.build-section { padding-top: clamp(40px, 6vw, 80px); }
.build { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 72px); }
.build-item { margin: 0; }
.build-item:nth-child(2) { margin-top: clamp(0px, 11vw, 170px); }
.build-item img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: contain;
  -webkit-mask-image: radial-gradient(closest-side, #000 60%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 60%, transparent 100%);
}
.build-item figcaption { margin-top: 8px; padding-inline: 4%; }
.build-line {
  display: block;
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(1.75rem, 3.3vw, 2.75rem); line-height: 1.1; letter-spacing: -.02em;
}
.build-note { display: block; max-width: 28em; margin-top: 10px; color: var(--haze); }

/* Progress */
.steps {
  margin: 0; padding: 0; list-style: none;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px;
}
.step { position: relative; padding-top: 26px; border-top: 1px solid rgb(255 255 255 / .14); }
.step.is-done { border-top-color: rgb(244 242 255 / .75); }
.step.is-now { border-top: 0; }
.step.is-now::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, var(--uv), var(--plasma) 55%, var(--flare));
  box-shadow: 0 0 18px rgb(184 92 255 / .6);
}
.step-state { display: inline-flex; align-items: center; gap: 9px; font-size: .875rem; color: var(--haze); }
.step.is-now .step-state { color: var(--ion); }
.step.is-now .step-state::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--plasma); animation: ping 2.2s ease-out infinite;
}
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgb(184 92 255 / .6); }
  70%, 100% { box-shadow: 0 0 0 10px rgb(184 92 255 / 0); }
}
.step h3 {
  margin: 14px 0 8px;
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.5rem; line-height: 1.15; letter-spacing: -.02em;
}
.step p { color: var(--haze); font-size: 1rem; max-width: 22em; }

/* Pilots */
.pilots-grid {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 96px); align-items: start;
}
.pilots-title { font-size: clamp(2.5rem, 6vw, 4.75rem); }
.pilots-body p { max-width: 32em; margin-bottom: 1.1em; color: var(--haze); }
.pilots-body .lead { color: var(--ion); font-size: 1.3125rem; line-height: 1.45; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding-block: 56px 72px; color: var(--haze); font-size: .9375rem; }
.footer-grid { display: grid; grid-template-columns: auto 1fr auto; gap: 18px 48px; align-items: baseline; }
.footer-brand { font-family: var(--font-display); font-weight: 600; font-size: 1.125rem; letter-spacing: .02em; color: var(--ion); }
.footer-founders { max-width: 36em; }
.footer a { color: var(--ion); text-decoration: none; }
.footer a:hover { text-decoration: underline; text-underline-offset: 3px; }
.footer-links { display: flex; gap: 22px; }
.fineprint { grid-column: 1 / -1; font-size: .8125rem; color: #67637a; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 44px; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav { gap: 16px; }
  .nav-links { display: none; }
  .nav .btn-small { margin-left: auto; }
  .statement { grid-template-columns: 1fr; row-gap: 8px; }
  .statement-sub { font-size: 1rem; max-width: 26em; }
  .build { grid-template-columns: 1fr; }
  .build-item:nth-child(2) { margin-top: 0; }
  .pilots-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 1.0625rem; }
  .steps { grid-template-columns: 1fr; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .vision { height: auto; }
  .vision-sticky { position: static; height: auto; padding-block: clamp(96px, 13vw, 180px); }
  .statement .statement-line { color: var(--ion); }
  .statement .statement-sub { opacity: 1; transform: none; }
  .js .tagline { animation: none !important; color: var(--ion); background: none; }
  .step.is-now .step-state::before { animation: none; }
  .js .wordmark { filter: none; }
}
