/* Reef — waitlist landing
   palette: bg #0a0a0a · surface #141414 · border #2a2a2a · fg #f5f5f0
            muted #8a8a85 · accent #e8622c · glow #8f2412 #c0341c #e8622c #f2924a */

@font-face {
  font-family: "VT323";
  src: url("assets/fonts/vt323-regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("assets/fonts/space-grotesk-regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("assets/fonts/space-grotesk-medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}

:root {
  --bg: #0a0a0a;
  --fg: #f5f5f0;
  --fg-bright: #fff8ee;
  --muted: #8a8a85;
  --border: #2a2a2a;
  --accent: #e8622c;
  --amber: #f2924a;
  --pixel: "VT323", monospace;
  --sans: "Space Grotesk", system-ui, sans-serif;
  --dome-w: min(190vw, 880px);
  --dome-drop: 0.24;
}

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

html { height: 100%; }

body {
  min-height: 100vh;
  min-height: 100svh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- ambient light ---------- */

.scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

/* soft bloom radiating from the dome's apex */
.halo {
  position: absolute;
  left: 50%;
  bottom: calc(-1 * var(--dome-drop) * var(--dome-w));
  width: calc(1.6 * var(--dome-w));
  height: calc(1.6 * var(--dome-w));
  transform: translate(-50%, 50%);
  border-radius: 50%;
  mix-blend-mode: screen;
  background: radial-gradient(circle,
    rgba(255, 238, 214, 0.26) 0%,
    rgba(242, 146, 74, 0.14) 20%,
    rgba(192, 52, 28, 0.06) 38%,
    transparent 56%);
  animation: halo-breathe 12s ease-in-out infinite alternate;
  will-change: transform, opacity;
}

/* the orange liquid-glass half-circle */
.dome {
  --w: var(--dome-w);
  position: absolute;
  left: 50%;
  bottom: calc(-1 * var(--dome-drop) * var(--w));
  transform: translateX(-50%);
  width: var(--w);
  height: calc(var(--w) / 2);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  overflow: hidden;
  /* the outer surface is the specular rim: hot warm-white at the apex,
     cooling through orange to ember down the sides */
  background: linear-gradient(to bottom,
    rgba(255, 248, 236, 0.82) 0%,
    rgba(255, 200, 140, 0.7) 5%,
    rgba(232, 98, 44, 0.42) 16%,
    rgba(192, 52, 28, 0.17) 38%,
    rgba(143, 36, 18, 0.06) 68%,
    transparent 100%);
  box-shadow: 0 -2px 30px -4px rgba(255, 190, 130, 0.32);
}

/* glass body inset behind the rim: dark frosted, lit only near the apex */
.dome::before {
  content: "";
  position: absolute;
  inset: 2px 2px 0 2px;
  border-radius: inherit;
  background:
    radial-gradient(130% 100% at 50% 0%,
      rgba(255, 216, 172, 0.2) 0%,
      rgba(232, 98, 44, 0.08) 13%,
      rgba(28, 14, 10, 0.75) 38%,
      rgba(10, 10, 10, 0.99) 66%),
    linear-gradient(to bottom, rgba(14, 11, 10, 0.97), #0a0a0a);
  box-shadow: inset 0 2px 22px -2px rgba(255, 222, 184, 0.38);
}

/* frosted light caught inside the glass, just under the apex */
.dome::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 2%;
  width: 70%;
  height: 34%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(closest-side,
    rgba(255, 230, 198, 0.3) 0%,
    rgba(242, 146, 74, 0.1) 55%,
    transparent 100%);
  filter: blur(12px);
}

@keyframes halo-breathe {
  from { opacity: 0.85; transform: translate(-50%, 50%) scale(1); }
  to   { opacity: 1;    transform: translate(-50%, 50%) scale(1.05); }
}

@media (prefers-reduced-motion: reduce) {
  .halo { animation: none !important; }
}

/* ---------- page frame ---------- */

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  max-width: 42rem;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 1.4rem)
           calc(env(safe-area-inset-right, 0px) + 1.5rem)
           calc(env(safe-area-inset-bottom, 0px) + 1.1rem)
           calc(env(safe-area-inset-left, 0px) + 1.5rem);
}

.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.wordmark {
  font-family: var(--pixel);
  font-size: 2rem;
  line-height: 1;
  letter-spacing: 0.04em;
  /* warm-orange wave traveling through the letters, like the app's ShimmerText */
  background: linear-gradient(100deg,
    var(--fg) 0%, var(--fg) 38%,
    var(--amber) 46%, var(--accent) 50%, var(--amber) 54%,
    var(--fg) 62%, var(--fg) 100%);
  background-size: 320% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 14px rgba(232, 98, 44, 0.35));
  animation: shimmer 6s linear infinite;
}

@keyframes shimmer {
  from { background-position: 100% 0; }
  to   { background-position: -20% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .wordmark { animation: none; background-position: 100% 0; }
}

.status {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted);
  text-align: right;
}

/* ---------- hero ---------- */

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.2rem 0 2.6rem;
}

.hero-row {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.hero-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

/* mobile: keep the small print clear of the phone peeking in from the right */
@media (max-width: 899px) {
  :root { --dome-drop: 0.31; }
  .fine, .form-note { max-width: 52vw; }
  .founding { max-width: 52vw; }
}

.countdown {
  font-family: var(--pixel);
  font-size: 1.35rem;
  line-height: 1;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 1rem;
}

.countdown-num {
  color: var(--amber);
  text-shadow: 0 0 14px rgba(232, 98, 44, 0.45);
}

.promise {
  font-family: var(--pixel);
  font-weight: 400;
  font-size: clamp(2.75rem, 7vw + 1.4rem, 4.6rem);
  line-height: 1.06;
  letter-spacing: 0.015em;
  color: var(--fg);
  text-shadow: 0 0 22px rgba(255, 240, 220, 0.16);
}

.promise em {
  font-style: normal;
  color: var(--amber);
  text-shadow: 0 0 24px rgba(232, 98, 44, 0.45);
}

.support {
  margin-top: 1.25rem;
  font-size: clamp(0.98rem, 0.6vw + 0.85rem, 1.1rem);
  line-height: 1.55;
  color: var(--muted);
  max-width: 30rem;
}

/* the story line — meant to be seen, not whispered */
.students {
  margin-top: 1.15rem;
  font-family: var(--pixel);
  font-size: clamp(1.25rem, 1vw + 1rem, 1.5rem);
  line-height: 1.2;
  letter-spacing: 0.04em;
  color: var(--fg);
  text-shadow: 0 0 16px rgba(255, 240, 220, 0.2);
}

/* ---------- the glass form ---------- */

.join { margin-top: 1.7rem; }

.glass-form {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 0.4rem;
  padding: 0.4rem;
  border-radius: 999px;
  background: rgba(18, 16, 14, 0.34);
  border: 1px solid rgba(255, 243, 228, 0.2);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 236, 0.16),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35),
    0 18px 50px -18px rgba(0, 0, 0, 0.8);
  max-width: 27rem;
  transition: border-color 0.2s ease;
}

.glass-form:focus-within {
  border-color: rgba(255, 243, 228, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 236, 0.22),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35),
    0 18px 50px -18px rgba(0, 0, 0, 0.8),
    0 0 0 3px rgba(242, 146, 74, 0.18);
}

.glass-form input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--fg);
  font-family: var(--sans);
  font-size: 1rem;
  padding: 0.72rem 0.5rem 0.72rem 1.1rem;
  outline: none;
}

.glass-form input::placeholder { color: rgba(138, 138, 133, 0.85); }

.glass-form .hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.glass-form button {
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #140a06;
  font-family: var(--pixel);
  font-size: 1.45rem;
  line-height: 1;
  letter-spacing: 0.03em;
  padding: 0.55rem 1.5rem 0.62rem;
  cursor: pointer;
  transition: filter 0.15s ease, opacity 0.15s ease;
}

.glass-form button:hover { filter: brightness(1.1); }
.glass-form button:active { opacity: 0.85; }
.glass-form button:disabled { opacity: 0.55; cursor: default; }

.glass-form button:focus-visible {
  outline: 2px solid rgba(242, 146, 74, 0.8);
  outline-offset: 2px;
}

.fine { margin-top: 0.35rem; }

.offer {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 30rem;
}

.offer strong {
  font-weight: 500;
  color: var(--fg);
}

.offer-note { white-space: nowrap; }

.consent-note {
  margin-top: 0.55rem;
  max-width: 27rem;
  font-size: 0.72rem;
  line-height: 1.45;
  color: rgba(138, 138, 133, 0.88);
}

/* hottest-spots progress — dashed tail shows the waitlist continues */

.founding { margin-top: 0.9rem; max-width: 27rem; }

.founding-bar {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(3.75rem, 1fr);
  align-items: center;
  gap: 0.45rem;
  height: 3px;
}

.hottest-track {
  display: block;
  height: 3px;
  border-radius: 999px;
  background: rgba(245, 245, 240, 0.12);
  overflow: hidden;
}

.waitlist-tail {
  display: block;
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    rgba(245, 245, 240, 0.34) 0 5px,
    transparent 5px 10px
  );
}

.founding-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--amber));
  box-shadow: 0 0 10px rgba(232, 98, 44, 0.55);
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.founding-label {
  margin-top: 0.45rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.founding-label strong {
  font-weight: 500;
  color: var(--fg);
}

.form-note {
  margin-top: 0.55rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--muted);
  min-height: 1.3em;
  max-width: 30rem;
}

.form-note.is-error { color: var(--amber); }

/* ---------- joined state ---------- */

.joined { margin-top: 2.1rem; }

.joined-title {
  font-family: var(--pixel);
  font-size: 2.2rem;
  line-height: 1;
  color: var(--amber);
  text-shadow: 0 0 22px rgba(232, 98, 44, 0.45);
}

.joined-body {
  margin-top: 0.7rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 30rem;
}

/* ---------- phone mockup (real graph screenshot) ---------- */

.phone {
  border-radius: 44px;
  padding: 9px;
  background: linear-gradient(165deg, #1c1713, #0c0b0a 60%);
  border: 1px solid rgba(255, 243, 228, 0.16);
  /* photographed slightly from the side */
  transform: perspective(1400px) rotateY(-11deg) rotateX(2.5deg);
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 236, 0.12),
    inset -2px 0 3px -1px rgba(255, 220, 180, 0.18),
    inset 2px 0 3px -1px rgba(0, 0, 0, 0.6),
    -18px 34px 80px -28px rgba(232, 98, 44, 0.35),
    -10px 18px 44px -18px rgba(0, 0, 0, 0.85);
}

/* mobile: the phone leans in from the right edge, rising out of the dome —
   everything stays in one viewport, the glass form floats over its corner */
@media (max-width: 899px) {
  .phone {
    position: absolute;
    z-index: 0;
    right: max(-16vw, -72px);
    bottom: -2svh;
    width: min(48vw, 205px);
    transform: perspective(1400px) rotateY(-13deg) rotateX(2deg) rotate(-7deg);
  }
}

/* screen keeps the true phone aspect; the three screenshots crossfade */
.phone-screen {
  position: relative;
  aspect-ratio: 720 / 1451;
  border-radius: 36px;
  overflow: hidden;
  background: #0a0a0a;
}

/* subtle glass glare over the screen, sells the "photo of a device" look */
.phone-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(115deg,
    rgba(255, 246, 232, 0.065) 0%,
    rgba(255, 246, 232, 0.02) 30%,
    transparent 48%);
}

.phone-screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* contain, top-anchored: never clips the app UI — the seam is invisible
     because the app background is the same #0a0a0a as the screen */
  object-fit: contain;
  object-position: 50% 0;
  opacity: 0;
  animation: screen-cycle 18s ease-in-out infinite;
}

.phone-screen img:nth-child(1) { animation-delay: 0s; }
.phone-screen img:nth-child(2) { animation-delay: 6s; }
.phone-screen img:nth-child(3) { animation-delay: 12s; }

@keyframes screen-cycle {
  0%   { opacity: 0; }
  4%   { opacity: 1; }
  33%  { opacity: 1; }
  38%  { opacity: 0; }
  100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .phone-screen img { animation: none; }
  .phone-screen img:first-child { opacity: 1; }
}

.phone-island {
  position: absolute;
  z-index: 2;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 27%;
  height: 3.1%;
  border-radius: 999px;
  background: #060505;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

/* ---------- helpers ---------- */

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

/* ---------- small phones ---------- */

@media (max-width: 380px) {
  .wordmark { font-size: 1.75rem; }
  .glass-form button { padding-inline: 1.15rem; }
  .offer-note { white-space: normal; }
}

/* short viewports: sink the dome lower and allow honest scroll over clipping */
@media (max-height: 700px) {
  :root { --dome-drop: 0.32; }
}
@media (max-height: 560px) {
  .hero { padding: 1.4rem 0; }
  .join, .joined { margin-top: 1.4rem; }
}

/* desktop: two columns — copy left, phone right, dome lighting both */
@media (min-width: 900px) {
  :root { --dome-drop: 0.3; }
}

/* shorter desktop windows: sink the dome under the form */
@media (min-width: 900px) and (max-height: 800px) {
  :root { --dome-drop: 0.38; }
  .hero { padding-bottom: 3.4rem; }
}

@media (min-width: 900px) {

  .page { max-width: 66rem; }

  .hero-row {
    flex-direction: row;
    align-items: center;
    gap: clamp(2.5rem, 6vw, 5.5rem);
  }

  .hero-copy { flex: 1; }

  .phone {
    position: relative;
    align-self: center;
    flex-shrink: 0;
    width: clamp(220px, 30vh, 270px);
  }
}
