/* Dear Visionary, the landing site (docs/site-brief.md). One page; the hero is the night sky before the light.
   The site has its own UI rules, not the app's ui-rules.md. The hero follows Maxime's Figma mockup (Dec 4): the sky is
   a window set into the off-white page with soft corners, so the immersion reads as deliberate rather than as a
   wallpaper; every word in it is IBM Plex Mono capitals at one size; the action is a plain lined rectangle (Co-Star in
   spirit). References: tolans.com and o-p-e-n.com. */
:root{
  --ground:#EEECE7;
  --ink:#29251F;
  --night:#080B1C;
  --night-2:#0E1230;
  --night-ink:#EEEAF3;
  --night-soft:#ABA3BC;
  --night-line:rgba(238,234,243,.5);
  --sans:"DM Sans",-apple-system,"Helvetica Neue",Arial,sans-serif;
  --mono:"IBM Plex Mono",ui-monospace,"SF Mono",Menlo,monospace;
  /* The wordmark's face. Swap this one value to try a dedicated wordmark typeface. */
  --wordmark-font:var(--mono);
  /* The window's inset from the page edge and its corner. Was 30px at 1440 wide and 10px on a phone; brought 10px closer to the edge
     (Maxime, Dec 4): 20px at 1440, 7px on a phone. */
  --inset:clamp(7px,1.39vw,22px);
  --corner:clamp(16px,1.75vw,26px);
  /* The one text size in the hero (Figma: 40 at 2x, so 20px at 1440 wide) and the gap between its parts. */
  --t:clamp(15px,1.39vw,22px);
  --gap:clamp(18px,1.95vw,30px);
  color-scheme:light;
}

*,*::before,*::after{box-sizing:border-box}
html,body{margin:0;padding:0}
body{background:var(--ground);color:var(--ink);font-family:var(--sans);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-tap-highlight-color:transparent;overflow-x:hidden}

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

/* ---------- Hero ---------- */
/* The window is drawn as a clip, not as a box: the sky's canvas always fills the whole screen and the window is the
   part of it shown, inset from the page edge with soft corners. On sign-up the clip opens to the edges (.hero.open),
   so the canvas is never resized while the window grows and the stars do not move. */
.hero{
  position:relative;height:100vh;height:100svh;min-height:360px;
  --it:max(var(--inset),env(safe-area-inset-top));
  --ir:max(var(--inset),env(safe-area-inset-right));
  --ib:max(var(--inset),env(safe-area-inset-bottom));
  --il:max(var(--inset),env(safe-area-inset-left));
}
.window{
  position:absolute;inset:0;color:var(--night-ink);color-scheme:dark;
  /* The sky's own gradient, shown until the first frame is drawn and if WebGL is unavailable. */
  background:linear-gradient(to bottom,#080B1C 0%,#0E1230 45%,#1C1D45 78%,#3A3260 100%);
  isolation:isolate;
  -webkit-clip-path:inset(var(--it) var(--ir) var(--ib) var(--il) round var(--corner));
  clip-path:inset(var(--it) var(--ir) var(--ib) var(--il) round var(--corner));
  transition:clip-path 1.4s cubic-bezier(.6,0,.2,1),-webkit-clip-path 1.4s cubic-bezier(.6,0,.2,1);
}
/* Signed up: the window opens to the whole screen. The words do not move. */
.hero.open .window{-webkit-clip-path:inset(0 round 0);clip-path:inset(0 round 0)}
.sky{position:absolute;inset:0;width:100%;height:100%;display:block;transition:opacity .6s ease}
/* Invited, just before the prototype opens: the stars dim away and the night stays (the window's gradient), so the
   prototype's stars can come back in the same night instead of jumping to a new pattern. */
.hero.dim .sky{opacity:0}

/* The words sit low in the sky, as in the mockup: the action ends about 12% of the window's height above its bottom
   edge. Measured from the window at rest, so they stay put while it opens. */
.hero-words{
  position:absolute;left:var(--il);right:var(--ir);bottom:calc(var(--ib) + (100% - var(--it) - var(--ib)) * .12);
  padding:0 16px;
  display:flex;flex-direction:column;align-items:center;gap:var(--gap);text-align:center;
}

.wordmark,.line{
  margin:0;font-family:var(--mono);font-size:var(--t);line-height:1.4;font-weight:400;
  letter-spacing:.02em;text-transform:uppercase;color:var(--night-ink);
}
.wordmark{font-family:var(--wordmark-font)}
.line{max-width:48ch;text-wrap:balance}

/* One action: a plain lined rectangle holding the field and its button. Square corners, no fill. */
.cta{
  position:relative;margin:0;width:min(420px,100%);
  display:flex;align-items:stretch;border:1px solid var(--night-line);border-radius:0;
  background:rgba(8,11,28,.25);
  -webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);
  transition:border-color .3s ease,opacity 1.2s ease;
}
.cta:focus-within{border-color:var(--night-ink)}
.cta input{
  appearance:none;-webkit-appearance:none;border:0;outline:none;border-radius:0;background:none;
  flex:1;min-width:0;height:50px;padding:0 16px;
  font:inherit;font-size:16px;font-weight:400;letter-spacing:-.005em;text-align:left;
  color:var(--night-ink);caret-color:var(--night-ink);
  transition:opacity .9s ease,transform .9s ease,filter .9s ease;
}
.cta input::placeholder{color:var(--night-soft);opacity:1}
.cta input:-webkit-autofill{-webkit-text-fill-color:var(--night-ink);transition:background-color 9999s ease 0s}

.cta button{
  appearance:none;-webkit-appearance:none;border:0;border-left:1px solid var(--night-line);border-radius:0;
  cursor:pointer;flex:none;padding:0 20px;background:none;color:var(--night-ink);
  font:inherit;font-size:16px;font-weight:400;letter-spacing:-.005em;white-space:nowrap;
  transition:background-color .25s ease,color .25s ease,opacity .6s ease;
}
.cta button:hover,.cta button:focus-visible{background:var(--night-ink);color:var(--night-2)}
.cta button:focus{outline:none}
.cta:focus-within button{border-left-color:var(--night-ink)}

.cta-error{
  position:absolute;left:0;right:0;top:100%;margin:12px 0 0;text-align:center;
  font-size:15px;line-height:1.4;color:var(--night-soft);
}

/* Sent: the typed address drifts up and dissolves into the sky; then the capsule goes. */
.cta.sending input{opacity:0;transform:translateY(-24px);filter:blur(3px)}
.cta.sending button{opacity:0}

/* Invited and sent: the name and the line fade, leaving only the sky, before the prototype opens in it. */
.hero-words{transition:opacity 1.2s ease}
.hero.leaving .hero-words{opacity:0}

/* Arrival: the sky is already there; the name fades in, then the lines, then the action. */
@keyframes rise{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes leave{from{opacity:1}to{opacity:0;visibility:hidden}}
.wordmark{animation:rise 1.4s ease .3s both}
.line{animation:rise 1.2s ease .9s both}
.line + .line{animation-delay:1.1s}
.cta{animation:rise 1.2s ease 1.4s both}
.cta.sent{animation:leave 1.2s ease both;pointer-events:none}

@media (prefers-reduced-motion: reduce){
  /* The window does not grow: it gives way to the full sky in a short cross-fade (site.js, a view transition). */
  .window{transition:none}
  ::view-transition-group(root){animation-duration:.6s}
  .wordmark,.line,.cta{animation:none}
  .cta.sent{animation:leave .6s ease both}
  .cta,.cta input,.cta button{transition:opacity .6s ease,background-color .25s ease,color .25s ease,border-color .3s ease}
  .cta.sending input{transform:none;filter:none}
}
