/* AERU One. Concept by BOMA Designs. */
@font-face {
  font-family: "Inter Tight";
  src: url("/lab/_shared/fonts/inter-tight-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("fonts/geist-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #07080A;
  --bg-2: #0D0F13;
  --line: #1E2128;
  --grey-1: #5C626D;
  --grey-2: #A3A9B3;
  --ink: #F3F4F6;
  --accent: #C8FF2E;
  --m: 20px;
  --g: 12px;
  --d-size: clamp(56px, 16vw, 72px);
  --n-size: 36px;
  --mono: 10.5px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
@media (min-width: 820px) {
  :root {
    --m: 48px;
    --g: 24px;
    --d-size: clamp(96px, 9.5vw, 168px);
    --n-size: 64px;
    --mono: 11px;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html {
  background: var(--bg);
  scroll-snap-type: y proximity;
  overscroll-behavior-y: none;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
body {
  background: var(--bg);
  color: var(--grey-2);
  font: 400 15px/1.45 "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
:focus:not(:focus-visible) { outline: none; }

.mono {
  font: 400 var(--mono)/1.3 "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--grey-1);
}

.scroller { position: relative; height: 300vh; height: 300svh; }
.snap { position: absolute; left: 0; width: 1px; height: 1px; scroll-snap-align: start; }
.snap.s2 { top: 100vh; top: 100svh; }
.snap.s3 { top: 200vh; top: 200svh; }

.stage {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  container-type: size;
  isolation: isolate;
  background: var(--bg);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

#gl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: pan-y;
  opacity: 0;
  transition: opacity 500ms ease-out;
}
.ready #gl { opacity: 1; }
.xf #gl { opacity: 0; transition: opacity 120ms linear; }

/* hidden-focusable press control; placed over the object by JS while focused */
.press {
  position: absolute;
  left: 0; top: 0;
  width: 200px; height: 200px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.001;
}
.press:focus-visible { opacity: 1; outline-offset: 2px; }

/* chrome ----------------------------------------------------------------- */
.top {
  position: absolute;
  z-index: 3;
  left: var(--m); right: var(--m);
  top: calc(var(--safe-t) + 20px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}
.mark {
  display: flex; align-items: center;
  font: 600 15px/1 "Inter Tight", sans-serif;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.dot {
  width: 6px; height: 6px; margin-left: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.idx #idxCur { color: var(--accent); }

.prog {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  display: flex;
  gap: 6px;
  left: var(--m); right: var(--m);
  bottom: calc(var(--safe-b) + 6px);
  height: 1px;
}
.prog i { position: relative; flex: 1; background: var(--line); overflow: hidden; }
.prog b { position: absolute; inset: 0; background: var(--ink); transform-origin: 0 50%; transform: scaleX(0); }

.credit {
  position: absolute;
  z-index: 3;
  right: var(--m);
  bottom: calc(var(--safe-b) + 18px);
  pointer-events: none;
  white-space: nowrap;
  font-size: 10px;
}

/* chapters ---------------------------------------------------------------- */
.ch {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  visibility: hidden;
}
.ch.on, .ch.leaving { visibility: visible; }
.stack { position: absolute; left: var(--m); right: var(--m); bottom: calc(var(--safe-b) + 48px); display: flex; flex-direction: column; }

.ln { display: block; overflow: hidden; padding: 0.06em 0 0.05em; margin: -0.06em 0 -0.05em; }
.ln > span { display: block; transform: translateY(110%); opacity: 0; will-change: transform; }
.ch.on .ln > span { animation: lin 720ms var(--ease) calc(var(--i, 0) * 45ms) both; }
.ch.leaving .ln > span { animation: lout 260ms cubic-bezier(0.7, 0, 0.84, 0) both; }
@keyframes lin { from { transform: translateY(110%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes lout { from { transform: none; opacity: 1; } to { transform: translateY(-40%); opacity: 0; } }

.lb { margin-bottom: 14px; }
.hl {
  font: 560 var(--d-size)/0.9 "Inter Tight", sans-serif;
  letter-spacing: -0.045em;
  color: var(--ink);
  font-feature-settings: "ss01" 0;
}
.hl .ln { padding-bottom: 0.08em; margin-bottom: -0.08em; }
.body { font-size: 15px; line-height: 1.45; color: var(--grey-2); max-width: 34ch; text-wrap: pretty; }

.num {
  display: block;
  font: 500 var(--n-size)/1 "Inter Tight", sans-serif;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  white-space: nowrap;
}
.num small { font-size: 0.5em; font-weight: 500; letter-spacing: -0.01em; color: var(--grey-2); }
.cap { color: var(--grey-2); }
.specs { list-style: none; }
.specs li { border-top: 1px solid var(--line); }
.sp { display: flex; }

/* chapter 1 */
.c1 .stack { gap: 0; }
/* phone: the hint sits in the header row, centred, far from the object */
.c1 .hint { position: absolute; left: 50%; top: calc(var(--safe-t) + 22px); transform: translateX(-50%); white-space: nowrap; text-align: center; }
.c1 .h-a, .c1 .h-b { transition: opacity 400ms ease-out; }
.c1 .h-b { position: absolute; left: 0; right: 0; top: 0; opacity: 0; }
.c1 .hint.gone .h-a { opacity: 0; }
.c1 .hint.nice .h-b { opacity: 1; }
.c1 .hint .mob { display: inline; }
.c1 .hint .dsk { display: none; }
.c1 .body { margin-top: 18px; }
.c1 .blk { }
.cue {
  position: absolute;
  left: var(--m);
  bottom: calc(var(--safe-b) + 18px);
  font-size: 10px;
  white-space: nowrap;
  transition: opacity 400ms ease-out;
}
.cue.gone { opacity: 0; }

/* chapter 2 (phone) */
.specs li > .sp { display: flex; }   /* beats .ln > span so the row layout below applies */
.c2 .stack { gap: 20px; }
.c2 .specs li { padding: 10px 0 9px; }
.c2 .sp { justify-content: space-between; align-items: baseline; gap: 14px; width: 100%; }
.c2 .cap { text-align: right; }

/* chapter 3 (phone) */
.c3 .stack { gap: 22px; }
.c3 .specs { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--g); }
.c3 .specs li { padding-top: 12px; }
.c3 .sp { flex-direction: column; gap: 8px; }
.cta { display: flex; flex-direction: column; gap: 10px; margin-top: 2px; }
.ships { color: var(--grey-2); }
.btn {
  pointer-events: none;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 52px;
  padding: 0 28px;
  border-radius: 999px;
  background: var(--accent);
  color: #07080A;
  font: 600 15px/1 "Inter Tight", sans-serif;
  letter-spacing: 0;
  transition: transform 380ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ch.on .btn { pointer-events: auto; }
.btn:active { transform: scale(0.97); transition-duration: 90ms; }
.btn .ck { display: none; }
.btn.done .ck { display: block; }
.btn .ck path { stroke-dasharray: 16; stroke-dashoffset: 16; }
.btn.done .ck path { animation: draw 380ms var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* desktop ---------------------------------------------------------------- */
@media (min-width: 820px) {
  .stack { display: contents; }
  .credit { bottom: 24px; }
  .prog {
    left: auto; right: 22px; top: 50%; bottom: auto;
    width: 1px; height: 96px; margin-top: -48px;
    flex-direction: column; gap: 6px;
  }
  .prog b { transform-origin: 50% 0; transform: scaleY(0); }
  .ch { --col: calc((100cqw - 2 * var(--m) - 11 * var(--g)) / 12); }

  .blk { position: absolute; left: var(--m); font-size: var(--d-size); }
  .blk .lb { font-size: var(--mono); }

  .c1 .blk { bottom: calc(64px - 0.085em); width: calc(var(--col) * 8 + var(--g) * 7); }
  .c1 .body { position: absolute; right: var(--m); bottom: 64px; margin: 0; text-align: right; width: calc(var(--col) * 3 + var(--g) * 2); max-width: none; }
  .c1 .hint { left: var(--m); top: auto; bottom: 24px; transform: none; text-align: left; }
  .c1 .h-b { right: auto; }
  .c1 .hint .mob { display: none; }
  .c1 .hint .dsk { display: inline; }
  .cue { left: 50%; transform: translateX(-50%); bottom: 24px; }

  .c2 .blk { top: 17%; width: calc(var(--col) * 7 + var(--g) * 6); }
  .c2 .specs { position: absolute; left: var(--m); bottom: 56px; width: calc(var(--col) * 3 + var(--g) * 2); }
  .c2 .specs li { padding: 14px 0 12px; }
  .c2 .sp { flex-direction: column; align-items: flex-start; gap: 10px; }
  .c2 .cap { text-align: left; }

  .c3 .blk { bottom: calc(64px - 0.085em); width: calc(var(--col) * 9 + var(--g) * 8); }
  .c3 .specs { position: absolute; right: var(--m); top: 88px; display: flex; gap: 40px; }
  .c3 .specs li { padding-top: 14px; min-width: 120px; }
  .cta { position: absolute; right: var(--m); bottom: 56px; flex-direction: row; align-items: center; gap: 24px; margin: 0; }
  .btn { width: auto; min-width: 168px; min-height: 48px; }
}
@media (max-width: 819.98px) and (max-height: 719.98px) {
  :root { --d-size: clamp(44px, 14vw, 60px); --n-size: 30px; }
  .lb { margin-bottom: 10px; }
  .c1 .body { margin-top: 12px; }
  .c2 .stack { gap: 14px; }
  .c2 .specs li { padding: 8px 0 7px; }
  .c3 .stack { gap: 16px; }
  .c3 .cta { gap: 8px; }
  .btn { min-height: 48px; }
}
@media (max-width: 819.98px) {
  .c3 .cta { margin-bottom: 18px; }
  .c3 .stack { bottom: calc(var(--safe-b) + 44px); }
}

/* custom cursor ----------------------------------------------------------- */
.cur {
  position: fixed; left: 0; top: 0; z-index: 20;
  width: 28px; height: 28px; margin: -14px 0 0 -14px;
  border: 1px solid rgba(243, 244, 246, 0.6);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  will-change: transform;
  transition: width 220ms var(--ease), height 220ms var(--ease), margin 220ms var(--ease), background-color 200ms, border-color 200ms, opacity 200ms;
  display: none;
}
.cur-on .cur { display: block; }
.cur.vis { opacity: 1; }
.cur.obj { width: 10px; height: 10px; margin: -5px 0 0 -5px; background: var(--ink); border-color: var(--ink); }
.cur.ctl { width: 44px; height: 44px; margin: -22px 0 0 -22px; }
.cur.pull { width: 16px; height: 16px; margin: -8px 0 0 -8px; background: var(--accent); border-color: var(--accent); }
.cur span { position: absolute; left: calc(100% + 14px); top: 50%; margin-top: -7px; opacity: 0; transition: opacity 160ms; color: var(--ink); white-space: nowrap; }
.cur.obj span { opacity: 1; }
.cur.pull span { color: var(--accent); }
.cur-on, .cur-on * { cursor: none !important; }

/* no-webgl fallback -------------------------------------------------------- */
.fb { position: absolute; inset: 0; display: none; }
.no-gl .fb { display: block; }
.no-gl #gl { opacity: 0 !important; pointer-events: none; }
.fb-s {
  --fx: 50%; --fy: 40%; --ps: 1;
  position: absolute; left: var(--fx); top: var(--fy);
  translate: -50% -50%;
  opacity: 0; pointer-events: none;
  transition: opacity 450ms ease-out, transform 380ms cubic-bezier(0.34, 1.56, 0.64, 1);
  touch-action: pan-y;
}
.fb-s.pressed { --ps: 0.96; }
[data-chapter="1"] .fb-s.s1, [data-chapter="2"] .fb-s.s2, [data-chapter="3"] .fb-s.s3 { opacity: 1; pointer-events: auto; }
.fb-s.s1 {
  width: 70vmin; height: 70vmin; border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #FFFFFF 0%, #9AA3AE 34%, #1A1D24 88%);
  transform: scale(var(--ps));
}
.fb-s.s1::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; opacity: 0.35;
  background: conic-gradient(from 20deg, #9FB4FF, #E7A8FF, #FFE6A8, #A8FFF0, #9FB4FF);
  -webkit-mask: radial-gradient(circle, transparent 63%, #000 69%);
  mask: radial-gradient(circle, transparent 63%, #000 69%);
}
.fb-s.s2 {
  width: 62vmin; height: 62vmin; border-radius: 50%;
  background: conic-gradient(from 200deg, #FFFFFF, #9AA3AE, #1A1D24, #9AA3AE, #FFFFFF);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 26px), #000 calc(100% - 25px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 26px), #000 calc(100% - 25px));
  transform: perspective(900px) rotateX(62deg) scale(var(--ps));
}
.fb-s.s3 {
  width: 84vmin; height: 34vmin; border-radius: 999px;
  background: linear-gradient(180deg, #FFFFFF 0%, #9AA3AE 38%, #1A1D24 100%);
  transform: rotate(-14deg) scale(var(--ps));
}
.fb-s.s3::after {
  content: ""; position: absolute; inset: 0; border-radius: 999px; opacity: 0.35;
  background: conic-gradient(from 0deg, #9FB4FF, #E7A8FF, #FFE6A8, #A8FFF0, #9FB4FF);
  -webkit-mask: linear-gradient(#000, #000) content-box exclude, linear-gradient(#000, #000);
  mask: linear-gradient(#000, #000) content-box exclude, linear-gradient(#000, #000);
  padding: 3px;
}
[data-chapter="1"] .fb-s.s1 { --fx: 50%; --fy: 40%; }
[data-chapter="2"] .fb-s.s2 { --fx: 50%; --fy: 36%; }
[data-chapter="3"] .fb-s.s3 { --fx: 50%; --fy: 34%; }
@media (min-width: 820px) {
  [data-chapter="1"] .fb-s.s1 { --fx: 50%; --fy: 48%; width: 62vmin; height: 62vmin; }
  [data-chapter="2"] .fb-s.s2 { --fx: 62%; --fy: 50%; width: 58vmin; height: 58vmin; }
  [data-chapter="3"] .fb-s.s3 { --fx: 50%; --fy: 44%; width: 74vmin; height: 30vmin; }
}

/* reduced motion ----------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .dot { animation: none; }
  #gl { transition: opacity 120ms linear; }
  .ch.on .ln > span { animation: rin 200ms linear both; }
  .ch.leaving .ln > span { animation: rout 120ms linear both; }
  @keyframes rin { from { transform: none; opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes rout { from { transform: none; opacity: 1; } to { transform: none; opacity: 0; } }
  .btn, .btn:active { transition: none; }
  .btn:active { transform: scale(0.98); }
  .btn.done .ck path { animation: none; stroke-dashoffset: 0; }
  .fb-s { transition: opacity 240ms linear; }
}
