/* BEYOND — private access
   One viewport. Near-black. One object. Less. */

@font-face{
  font-family:'Inter';
  font-style:normal;
  font-weight:200 500;
  font-display:block;
  src:url('fonts/inter-latin.woff2') format('woff2');
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root{
  --bg:#050506;
  --ink:#f2f1ee;                          /* warm white, 18:1 */
  --ink-soft:rgba(242,241,238,.66);       /* 7.6:1 */
  --ink-quiet:rgba(242,241,238,.52);      /* 5.1:1 */
  --ink-line:rgba(242,241,238,.38);       /* 3.2:1, non-text */
  --font:'Inter',system-ui,-apple-system,'Helvetica Neue',sans-serif;
  --orb:clamp(200px,min(44vh,52vw),520px); /* pre-JS value; main.js sets the real one */
  --track:.3em;
  --ease:cubic-bezier(.22,.61,.36,1);

  /* type scale: grows gently with the viewport, never past the luxury range */
  --fs-mark:clamp(11px,.15vw + 10px,12px);
  --fs-head:clamp(17px,.55vw + 13px,24px);
  --fs-line:clamp(14px,.3vw + 12.5px,17px);
  --fs-cta:clamp(11px,.15vw + 10.5px,12.5px);
  --fs-note:clamp(10.5px,.1vw + 10px,11.5px);

  /* rhythm: one family of gaps, all tied to the viewport height */
  --gap-head:clamp(12px,2vh,20px);       /* headline → explanation */
  --gap-brand:clamp(8px,1.4vh,14px);     /* explanation → brand line */
  --gap-gate:clamp(24px,4.4vh,48px);     /* copy → field */
  --gap-note:clamp(14px,2.2vh,20px);     /* cta → note */
}

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

/* the page is a fixed box: no page scrolling, on any device, in any frame */
html,body{
  position:fixed;top:0;right:0;bottom:0;left:0;
  width:100%;height:100%;
  overflow:hidden;
  overscroll-behavior:none;
}
html{background:var(--bg);-webkit-text-size-adjust:100%}
body{
  height:var(--vvh,100%);          /* from visualViewport (keyboard, browser chrome) */
  background:var(--bg);
  color:var(--ink);
  font-family:var(--font);
  font-weight:300;
  font-size:15px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* ── canvas: full viewport, behind everything ─────────────────────────── */
#orb-canvas{position:fixed;top:0;left:0;width:100%;height:100%;display:block;pointer-events:none;z-index:0}
html.no-webgl #orb-canvas{display:none}

/* ── wordmark ─────────────────────────────────────────────────────────── */
.wordmark{
  position:fixed;
  top:calc(28px + env(safe-area-inset-top));
  left:calc(32px + env(safe-area-inset-left));
  z-index:3;
  font-size:var(--fs-mark);font-weight:500;
  letter-spacing:.34em;
  color:var(--ink);
  transition:opacity 1.4s var(--ease);
}

/* ── stage ────────────────────────────────────────────────────────────── */
.stage{
  position:relative;z-index:1;
  height:100%;min-height:0;
  overflow-y:auto;overflow-x:hidden;
  overscroll-behavior:contain;
  display:grid;
  grid-template-rows:minmax(0,1fr) auto auto auto minmax(0,1fr);
  grid-template-areas:"." "orb" "copy" "gate" ".";
  justify-items:center;
  align-content:start;             /* the 1fr rows centre when there is room, collapse when not */
  padding:calc(64px + env(safe-area-inset-top)) 24px calc(36px + env(safe-area-inset-bottom));
}

.orb-slot{
  grid-area:orb;
  position:relative;
  width:var(--orb);height:var(--orb);
  margin-bottom:clamp(28px,5vh,56px);
  pointer-events:auto;             /* long-press target */
  touch-action:none;
  -webkit-tap-highlight-color:transparent;
  -webkit-user-select:none;user-select:none;
  -webkit-touch-callout:none;
}
.orb-slot.is-gone{height:0;margin-bottom:0;overflow:hidden;pointer-events:none}

/* fallback (no WebGL): a still, glass-like object */
.orb-fallback{
  position:absolute;top:0;right:0;bottom:0;left:0;border-radius:50%;
  opacity:0;
  transition:opacity 1.6s var(--ease);
  background:
    radial-gradient(circle at 38% 34%, rgba(255,255,255,.22) 0, rgba(255,255,255,.06) 18%, rgba(255,255,255,0) 40%),
    radial-gradient(circle at 50% 52%, rgba(214,220,232,.10) 0, rgba(214,220,232,.04) 34%, rgba(0,0,0,0) 50%),
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0) 60%, rgba(255,255,255,.05) 74%, rgba(255,255,255,0) 76%);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.09),
    inset -18px -22px 60px rgba(0,0,0,.65),
    inset 10px 14px 40px rgba(255,255,255,.05),
    0 0 90px rgba(190,200,220,.06);
}
.orb-fallback::after{
  content:"";position:absolute;left:-40%;right:-40%;top:50%;height:1px;
  background:linear-gradient(90deg,rgba(255,255,255,0),rgba(255,255,255,.9) 35%,rgba(255,255,255,.9) 65%,rgba(255,255,255,0));
  transform:rotate(-4deg);
  box-shadow:0 0 12px rgba(255,255,255,.35);
}
html.no-webgl .orb-fallback{opacity:1}

.orb-secret{
  position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);
  font-size:10px;font-weight:400;letter-spacing:.42em;text-indent:.42em;
  color:var(--ink);opacity:0;pointer-events:none;
  transition:opacity .9s var(--ease);
}
.orb-slot.is-held .orb-secret{opacity:.85;transition-delay:.5s}
/* the second layer: only for those who keep holding */
.orb-secret--deep{top:auto;bottom:22%;transform:translateX(-50%);font-size:9px;letter-spacing:.32em;text-indent:.32em;color:rgba(242,241,238,.6)}
.orb-slot.is-held .orb-secret--deep{opacity:0}
.orb-slot.is-held.is-deep .orb-secret--deep{opacity:.7;transition-delay:.4s}

/* ── copy ─────────────────────────────────────────────────────────────── */
.copy{grid-area:copy;text-align:center;max-width:36rem}
.headline{
  font-size:var(--fs-head);
  font-weight:400;
  letter-spacing:var(--track);text-indent:var(--track);
  line-height:1.2;
  color:var(--ink);
  margin-bottom:var(--gap-head);
}
.headline .ap{letter-spacing:.08em;margin-left:-.12em}   /* tracked caps: close the apostrophe gap */
.line{
  text-wrap:balance;
  max-width:34ch;margin-inline:auto;
  font-size:var(--fs-line);
  font-weight:340;
  letter-spacing:.01em;
  color:var(--ink-soft);
  line-height:1.65;
}
/* the brand line: same size, quieter than the explanation, its own beat */
.line--last{color:var(--ink-quiet);font-weight:300;letter-spacing:.02em;margin-top:var(--gap-brand)}

/* ── reveal choreography ──────────────────────────────────────────────── */
/* hidden only when JS runs (html.js); without JS the page is simply there */
html.js .wordmark{opacity:0}
html.js .headline,html.js .line,html.js .gate{
  opacity:0;transform:translateY(6px);
  transition:opacity 1.1s var(--ease),transform 1.3s var(--ease);
}
html.js.is-live .wordmark{opacity:1}
html.js.is-live .headline{opacity:1;transform:none;transition-delay:1.5s}
html.js.is-live #line-1{opacity:1;transform:none;transition-delay:1.85s}
html.js.is-live #line-2{opacity:1;transform:none;transition-delay:2.1s}
html.js.is-live .gate{opacity:1;transform:none;transition-delay:2.5s}
html.js.is-live .done .headline,html.js.is-live .done .line{opacity:1;transform:none;transition-delay:0s}

/* ── gate (the form) ──────────────────────────────────────────────────── */
.gate{
  grid-area:gate;
  width:min(100%,340px);
  margin-top:var(--gap-gate);
  display:flex;flex-direction:column;align-items:center;
}
.gate[hidden]{display:none}
.gate.is-leaving,.copy.is-leaving{
  opacity:0!important;transform:translateY(-4px)!important;pointer-events:none;
  transition:opacity .6s var(--ease),transform .8s var(--ease)!important;transition-delay:0s!important;
}

.field{position:relative;width:100%}
#email{
  width:100%;
  height:48px;
  background:transparent;
  border:0;border-radius:0;
  outline:none;
  color:var(--ink);
  font:inherit;
  font-size:16px;              /* iOS: no zoom */
  font-weight:300;
  letter-spacing:.02em;
  text-align:center;
  caret-color:rgba(242,241,238,.85);
  -webkit-appearance:none;appearance:none;
}
#email::placeholder{color:var(--ink-quiet);font-weight:300;letter-spacing:.02em;opacity:1;transition:color .5s var(--ease)}
#email:focus::placeholder{color:var(--ink-line)}
#email:-webkit-autofill,#email:-webkit-autofill:focus{
  -webkit-text-fill-color:var(--ink);
  -webkit-box-shadow:0 0 0 1000px var(--bg) inset;
  transition:background-color 9999s ease-out;
}
#email:autofill{-webkit-text-fill-color:var(--ink);box-shadow:0 0 0 1000px var(--bg) inset}
#email::selection{background:rgba(242,241,238,.22)}

/* the mirror: the same text, one span per character, beneath the native input.
   The input stays the input (focus, selection, autofill, IME); only its ink is
   handed to the mirror, where characters can arrive instead of appear. */
.mirror{
  position:absolute;top:0;right:0;bottom:0;left:0;
  display:flex;align-items:center;justify-content:center;
  pointer-events:none;overflow:hidden;
  font-size:16px;font-weight:300;letter-spacing:.02em;line-height:1;
  color:var(--ink);white-space:pre;
}
.field:not(.has-mirror) .mirror{visibility:hidden}
.mirror-text{position:relative;display:inline-block;white-space:pre}
.mirror-text span{display:inline-block;white-space:pre}
.mirror-text span.in{animation:charIn .26s var(--ease) both}
@keyframes charIn{
  from{opacity:0;transform:translateY(3px);text-shadow:0 0 10px rgba(255,255,255,.9)}
  60%{text-shadow:0 0 6px rgba(255,255,255,.35)}
  to{opacity:1;transform:none;text-shadow:0 0 0 rgba(255,255,255,0)}
}
.mirror-text span.out{animation:charOut .38s var(--ease) both}
@keyframes charOut{
  to{opacity:0;transform:translateY(-7px);text-shadow:0 0 12px rgba(255,255,255,1);filter:blur(1px)}
}
.caret{
  position:absolute;left:50%;top:50%;
  width:1px;height:18px;margin-top:-9px;
  background:rgba(242,241,238,.92);
  box-shadow:0 0 7px rgba(255,255,255,.55);
  opacity:0;
}
.field.is-focus .caret{animation:caretBlink 1.15s steps(1,end) infinite}
.field.is-focus.is-typing .caret{animation:none;opacity:1}
.field.has-range .caret{animation:none!important;opacity:0!important}
@keyframes caretBlink{0%,55%{opacity:1}56%,100%{opacity:0}}
.field.has-mirror #email{color:transparent;caret-color:transparent}
.field.native-caret .caret{display:none}
.field.native-caret.has-mirror #email{caret-color:rgba(242,241,238,.85)}
.field.has-mirror #email:-webkit-autofill,.field.has-mirror #email:-webkit-autofill:focus{-webkit-text-fill-color:transparent}
.field.has-mirror #email:autofill{-webkit-text-fill-color:transparent}

/* the line beneath the input: understated at rest, brighter on hover and focus */
.field-line{
  position:absolute;left:0;right:0;bottom:0;height:1px;
  background:var(--ink-line);
  transition:background-color .6s var(--ease),box-shadow .8s var(--ease);
}
.field:hover .field-line{background:rgba(242,241,238,.5)}
.field:focus-within .field-line{background:rgba(242,241,238,.72);box-shadow:0 0 18px rgba(255,255,255,.18)}

/* the CTA: text only. Presence grows with a valid address */
.cta{
  margin-top:2px;
  padding:10px 8px;
  background:transparent;
  border:0;border-radius:0;
  color:rgba(242,241,238,.6);
  font:inherit;font-size:var(--fs-cta);font-weight:500;
  letter-spacing:var(--track);text-indent:var(--track);
  cursor:pointer;
  transition:color .7s var(--ease),text-shadow .9s var(--ease),transform .4s var(--ease);
  -webkit-tap-highlight-color:transparent;
}
.cta:hover{color:var(--ink-soft)}
.cta:focus-visible{outline:1px solid rgba(242,241,238,.45);outline-offset:6px}
.gate.is-valid .cta{color:var(--ink);text-shadow:0 0 18px rgba(255,255,255,.28)}
.cta:active{transform:translateY(1px)}
.gate.is-sending .cta{color:rgba(242,241,238,.45);text-shadow:none;pointer-events:none}

.note{
  margin-top:var(--gap-note);
  font-size:var(--fs-note);font-weight:400;
  letter-spacing:.04em;
  color:rgba(242,241,238,.4);
}
.error{
  width:100%;
  min-height:1.2em;
  margin-top:2px;
  font-size:12px;font-weight:400;
  letter-spacing:.03em;
  text-align:center;
  color:var(--ink-soft);
  opacity:0;transition:opacity .5s var(--ease);
}
.error.is-on{opacity:1}

/* ── success ──────────────────────────────────────────────────────────── */
.done{grid-area:copy;text-align:center;max-width:36rem;outline:none;margin-top:var(--gap-gate)}
.done{opacity:0;transform:translateY(6px);transition:opacity 1.2s var(--ease),transform 1.4s var(--ease)}
.done[hidden]{display:none}
.done.is-in{opacity:1;transform:none}
.done .headline{margin-bottom:var(--gap-head)}
.serial{
  margin-top:clamp(16px,2.6vh,26px);
  font-size:var(--fs-note);font-weight:400;
  letter-spacing:.36em;text-indent:.36em;
  color:var(--ink-quiet);
  font-variant-numeric:tabular-nums;
  opacity:0;transition:opacity 1.2s var(--ease) .6s;
}
.serial.is-in{opacity:1}
/* bring one: a personal link, spoken once */
.bring{
  margin-top:clamp(18px,3vh,28px);
  display:flex;flex-direction:column;align-items:center;gap:6px;
  opacity:0;transition:opacity 1.2s var(--ease) 1.1s;
}
.bring[hidden]{display:none}
.bring.is-in{opacity:1}
.bring-label{font-size:var(--fs-note);letter-spacing:.04em;color:rgba(242,241,238,.4)}
.bring-link{
  background:transparent;border:0;padding:6px 8px;
  font:inherit;font-size:13px;font-weight:300;letter-spacing:.02em;
  color:var(--ink-soft);cursor:pointer;
  border-bottom:1px solid rgba(242,241,238,.22);
  transition:color .6s var(--ease),border-color .6s var(--ease);
  -webkit-tap-highlight-color:transparent;
}
.bring-link:hover{color:var(--ink);border-color:rgba(242,241,238,.5)}
.bring-link:focus-visible{outline:1px solid rgba(242,241,238,.45);outline-offset:4px}
.bring-link.is-copied{color:var(--ink);border-color:transparent}

/* ── high contrast ────────────────────────────────────────────────────── */
@media (forced-colors:active){
  .mirror,.caret{display:none}
  .field.has-mirror #email{color:inherit;caret-color:auto}
  #email{border-bottom:1px solid}
  .cta{border:1px solid}
}

/* ── mobile ───────────────────────────────────────────────────────────── */
@media (max-width:640px){
  .wordmark{top:calc(22px + env(safe-area-inset-top));left:22px;font-size:11px}
  .stage{padding:calc(72px + env(safe-area-inset-top)) 20px calc(32px + env(safe-area-inset-bottom))}
  .orb-slot{margin-bottom:24px}
  .headline{letter-spacing:.28em;text-indent:.28em}
  .line{max-width:30ch}
  .gate{width:100%;max-width:340px}
  #email{height:52px}
  .cta{padding:12px 8px}
}
@media (max-height:720px) and (min-width:641px){
  .stage{padding-top:calc(56px + env(safe-area-inset-top));padding-bottom:calc(36px + env(safe-area-inset-bottom))}
  .orb-slot{margin-bottom:clamp(18px,3vh,32px)}
  .cta{padding:8px}
}

/* ── reduced motion: everything is present, nothing moves ─────────────── */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{transition-duration:.01ms!important;animation:none!important}
  html.js .headline,html.js .line,html.js .gate,html.js .wordmark{opacity:1!important;transform:none!important;transition-delay:0s!important}
  .mirror{display:none}
}

/* ── the door ─────────────────────────────────────────────────────────── */
.stage--door{grid-template-rows:minmax(0,1fr) auto auto minmax(0,1fr);grid-template-areas:"." "orb" "key" "."}
.orb-slot--door{margin-bottom:0}
.key{grid-area:key;position:relative;height:40px;width:min(100%,340px);margin-top:clamp(20px,4vh,40px)}
.key-input{
  position:absolute;left:0;top:0;width:100%;height:100%;
  opacity:0;                     /* present, focusable, invisible: the object speaks for it */
  background:transparent;border:0;color:transparent;caret-color:transparent;
  font:inherit;font-size:16px;text-align:center;
  -webkit-appearance:none;appearance:none;
}
.key-input:focus-visible{outline:none}
.key-lines{
  position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);
  display:flex;gap:12px;align-items:center;
  opacity:0;transition:opacity 1.4s var(--ease);
  pointer-events:none;
}
html.is-waiting .key-lines,html.is-focus .key-lines,html.has-key .key-lines{opacity:1}
.key-lines i{
  display:block;width:1px;height:16px;
  background:rgba(242,241,238,.2);
  transition:background-color .28s var(--ease),box-shadow .5s var(--ease),transform .4s var(--ease);
}
.key-lines i.on{background:rgba(242,241,238,.95);box-shadow:0 0 8px rgba(255,255,255,.55);transform:scaleY(1.25)}
html.is-focus .key-lines i.next{animation:lineBlink 1.15s steps(1,end) infinite}
@keyframes lineBlink{0%,55%{background:rgba(242,241,238,.6)}56%,100%{background:rgba(242,241,238,.2)}}
html.is-trying .key-lines i.on{animation:lineTry .9s var(--ease) infinite}
@keyframes lineTry{50%{box-shadow:0 0 14px rgba(255,255,255,.9);transform:scaleY(1.5)}}
html.is-wrong .key-lines i{animation:lineOut .5s var(--ease) both}
html.is-locked .key-lines i{background:rgba(242,241,238,.08);box-shadow:none;transform:scaleY(.4);animation:none}
html.is-locked .key-hint{opacity:1;color:var(--ink-quiet);font-variant-numeric:tabular-nums;letter-spacing:.2em;text-indent:.2em}
@keyframes lineOut{30%{background:rgba(242,241,238,.95);box-shadow:0 0 10px rgba(255,255,255,.7)}100%{background:rgba(242,241,238,.2);box-shadow:none;transform:scaleY(.4)}}
html.is-open .key-lines i{background:rgba(242,241,238,1);box-shadow:0 0 14px rgba(255,255,255,.8);transform:translateY(-6px) scaleY(.2);transition:all .9s var(--ease)}
html.is-open .key-lines{opacity:0;transition:opacity .9s var(--ease) .5s}
.key-hint{
  position:absolute;left:0;right:0;top:calc(100% + 14px);
  text-align:center;
  font-size:var(--fs-cta);font-weight:500;letter-spacing:var(--track);text-indent:var(--track);
  color:var(--ink-quiet);
  opacity:0;transition:opacity 1.2s var(--ease);
}
html.is-waiting .key-hint{opacity:1}
html.has-key .key-hint,html.is-trying .key-hint,html.is-open .key-hint{opacity:0;transition-duration:.4s}
html.is-wrong .key-hint{opacity:1;color:var(--ink);transition-duration:.3s}
.door .wordmark{transition-delay:.6s}
