/* ==========================================================================
   24 — landing page styles
   Ember design system (dark-first). Tokens mirror docs/BRAND_GUIDE.md exactly.
   No inline styles anywhere (strict CSP: style-src 'self'). Text is never muted with
   opacity — use --text-muted. On-accent text is --on-accent-ink, never white.
   ========================================================================== */

/* ---- Self-hosted fonts (OFL woff2, latin subset, variable) --------------- */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---- Design tokens ------------------------------------------------------- */
:root {
  /* Ember surfaces (warm charcoal, dark canonical) */
  --charcoal-root: #141210;
  --charcoal-1: #1e1a16;
  --charcoal-2: #29231d;
  --charcoal-3: #342c24;
  --border: #322b24;

  /* The flame */
  --accent: #ff7729;
  --accent-hot: #ff745b;
  --accent-glow: #ffa478;
  --on-accent-ink: #1a1410; /* text/icons ON a flame surface — NEVER white */

  /* Semantic (fixed) */
  --danger: #e4572e;
  --success: #e8b04b;
  --ash: #a0968d;

  /* Text */
  --text: #f7f1ea;
  --text-muted: #a89e93; /* a real token — never opacity-muted */

  /* Typography */
  --font-display: "Bricolage Grotesque", -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Spacing — 4pt grid (mirrors theme.ts) */
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 12px;
  --sp-lg: 16px;
  --sp-xl: 20px;
  --sp-2xl: 24px;
  --sp-3xl: 32px;
  --sp-4xl: 40px;
  --sp-5xl: 48px;
  --sp-6xl: 72px;
  --sp-7xl: 104px;

  /* Radii */
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-2xl: 40px;
  --r-full: 9999px;

  --maxw: 1080px;
  --transition: 0.7s cubic-bezier(0.22, 1, 0.36, 1);

  /* Radial time arc geometry: r=140 in a 300x300 viewBox → circumference 2·π·140. */
  --arc-circumference: 879.65;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--charcoal-root);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Warm ember bloom anchored at the top, fading into charcoal. */
  background-image:
    radial-gradient(120% 60% at 50% -10%, rgba(255, 119, 41, 0.16), rgba(20, 18, 16, 0) 60%),
    radial-gradient(90% 50% at 85% 8%, rgba(255, 164, 120, 0.08), rgba(20, 18, 16, 0) 55%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0;
}

p {
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

/* ---- Focus + skip link (a11y) -------------------------------------------- */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: var(--sp-sm);
  z-index: 100;
  background: var(--accent);
  color: var(--on-accent-ink);
  padding: var(--sp-sm) var(--sp-lg);
  border-radius: var(--r-full);
  font-weight: 600;
}
.skip-link:focus {
  left: var(--sp-md);
}

/* ---- Layout -------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: var(--sp-xl);
}

section {
  padding-block: var(--sp-6xl);
}

.section-eyebrow {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: var(--sp-md);
}

.section-title {
  font-size: clamp(28px, 5vw, 40px);
  max-width: 20ch;
}

.section-lead {
  color: var(--text-muted);
  font-size: 18px;
  max-width: 56ch;
  margin-top: var(--sp-lg);
}

/* ---- Header -------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(20, 18, 16, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: var(--sp-md);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  background: var(--accent);
  color: var(--on-accent-ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 24px rgba(255, 164, 120, 0.35);
}
.wordmark:hover {
  text-decoration: none;
}

/* ---- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-sm);
  min-height: 52px;
  padding: 0 var(--sp-2xl);
  border-radius: var(--r-full);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: var(--on-accent-ink);
  box-shadow: 0 6px 30px rgba(255, 119, 41, 0.35);
}
.btn-primary:hover {
  background: var(--accent-glow);
  text-decoration: none;
  box-shadow: 0 8px 38px rgba(255, 164, 120, 0.5);
}
.btn-primary:active {
  transform: scale(0.98);
}
.btn-header {
  min-height: 44px;
  padding: 0 var(--sp-xl);
  font-size: 15px;
}

/* ---- Hero ---------------------------------------------------------------- */
.hero {
  padding-block: var(--sp-6xl) var(--sp-6xl);
  text-align: center;
}
.hero .container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-arc {
  width: min(280px, 68vw);
  height: min(280px, 68vw);
  margin-bottom: var(--sp-3xl);
  position: relative;
  filter: drop-shadow(0 0 26px rgba(255, 164, 120, 0.4));
}
.hero-arc svg {
  width: 100%;
  height: 100%;
  display: block;
  transform: rotate(-90deg); /* start the ring at 12 o'clock */
}
.arc-track {
  fill: none;
  stroke: var(--border);
}
.arc-progress {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
}
.arc-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(56px, 16vw, 88px);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  text-shadow: 0 0 30px rgba(255, 119, 41, 0.45);
}

.hero-title {
  font-size: clamp(34px, 7vw, 60px);
  max-width: 15ch;
  margin-inline: auto;
}
.hero-subtitle {
  color: var(--text-muted);
  font-size: clamp(18px, 2.6vw, 22px);
  max-width: 40ch;
  margin: var(--sp-2xl) auto 0;
}
.hero-cta {
  margin-top: var(--sp-4xl);
}
.hero-note {
  margin-top: var(--sp-lg);
  color: var(--text-muted);
  font-size: 15px;
}

/* ---- How it works -------------------------------------------------------- */
.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-lg);
  margin-top: var(--sp-4xl);
}
.step {
  background: var(--charcoal-1);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  padding: var(--sp-2xl);
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-bottom: var(--sp-lg);
}
.step h3 {
  font-size: 21px;
  font-weight: 600;
}
.step p {
  margin-top: var(--sp-sm);
  color: var(--text-muted);
}

/* ---- Device previews ----------------------------------------------------- */
.previews {
  margin-top: var(--sp-5xl);
}
.previews-label {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: var(--sp-2xl);
}
.preview-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-2xl);
}
.device {
  width: 200px;
  border-radius: 28px;
  padding: 8px;
  background: var(--charcoal-2);
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}
.device img {
  width: 100%;
  height: auto; /* preserve the true 226:512 ratio — attrs reserve correct space (CLS) */
  display: block;
  border-radius: 22px;
}
.device figcaption {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: var(--sp-md) var(--sp-sm) var(--sp-xs);
}

/* ---- Safety pillar ------------------------------------------------------- */
.safety {
  background: var(--charcoal-1);
  border-block: 1px solid var(--border);
}
.qa-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-lg);
  margin-top: var(--sp-4xl);
}
.qa {
  background: var(--charcoal-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-2xl);
}
.qa h3 {
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  gap: var(--sp-md);
  align-items: baseline;
}
.qa h3::before {
  content: "Q";
  font-family: var(--font-display);
  color: var(--accent);
  font-size: 15px;
  letter-spacing: 0;
  flex: none;
}
.qa p {
  margin-top: var(--sp-md);
  color: var(--text-muted);
}

/* ---- Philosophy strip ---------------------------------------------------- */
.philosophy {
  text-align: center;
}
.philosophy-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--sp-3xl);
  max-width: 800px;
  margin-inline: auto;
}
.philosophy-list li {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(22px, 3.6vw, 30px);
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text);
}
.philosophy-list li + li {
  border-top: 1px solid var(--border);
  padding-top: var(--sp-3xl);
}
.philosophy-list .accent {
  color: var(--accent);
}

/* ---- Waitlist ------------------------------------------------------------ */
.waitlist {
  background:
    radial-gradient(80% 120% at 50% 0%, rgba(255, 119, 41, 0.12), rgba(20, 18, 16, 0) 60%),
    var(--charcoal-root);
  border-block: 1px solid var(--border);
}
.waitlist-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-4xl);
  align-items: start;
}
.waitlist-heading {
  font-size: clamp(28px, 5vw, 40px);
  max-width: 16ch;
}
.waitlist-value {
  color: var(--text-muted);
  font-size: 18px;
  margin-top: var(--sp-lg);
  max-width: 46ch;
}

.waitlist-form {
  margin-top: var(--sp-2xl);
}
.field-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--sp-sm);
}
.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-md);
}
.email-input {
  flex: 1 1 240px;
  min-height: 52px;
  padding: 0 var(--sp-xl);
  border-radius: var(--r-full);
  background: var(--charcoal-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
}
.email-input::placeholder {
  color: var(--text-muted);
}
.email-input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 119, 41, 0.28);
}

/* Honeypot — off-screen (NOT display:none), out of tab order, still submitted. */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  margin-top: var(--sp-lg);
  font-size: 15px;
  min-height: 1.4em;
}
.form-status.is-success {
  color: var(--success);
}
.form-status.is-error {
  color: var(--accent-hot);
}

.privacy-note {
  background: var(--charcoal-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-2xl);
  color: var(--text-muted);
  font-size: 15px;
}
.privacy-note strong {
  color: var(--text);
  font-weight: 600;
}

/* ---- Privacy section ----------------------------------------------------- */
.privacy dl {
  margin: var(--sp-2xl) 0 0;
  display: grid;
  grid-template-columns: 1fr; /* mobile: single column */
  gap: var(--sp-xl);
  max-width: 680px;
}
.privacy dt {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  color: var(--text);
  margin-bottom: var(--sp-xs);
}
.privacy dd {
  margin: 0;
  color: var(--text-muted);
}
.privacy dd a {
  color: var(--accent);
}
.privacy-tracking {
  margin-top: var(--sp-3xl);
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(22px, 3.4vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
  max-width: 22ch;
  margin-inline: auto;
}

/* ---- Footer -------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: var(--sp-3xl);
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-md);
}
.site-footer .copy {
  color: var(--text-muted);
  font-size: 14px;
}
.site-footer nav a {
  color: var(--text-muted);
  font-size: 14px;
}
.site-footer nav a:hover {
  color: var(--accent);
}

/* ---- Reveal-on-scroll (progressive enhancement) -------------------------
   Elements are FULLY VISIBLE by default so the page works with JS disabled.
   waitlist.js adds `is-armed` (only when motion is allowed) to hide them just
   before revealing on scroll; below-the-fold elements are off-screen when armed
   so no visible flash occurs. Reduced motion (below) forces them visible. */
.reveal {
  opacity: 1;
  transform: none;
  transition:
    opacity var(--transition),
    transform var(--transition);
}
.reveal.is-armed {
  opacity: 0;
  transform: translateY(22px);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Staggered reveal for the three "A look inside" phones. The delay applies only on
   the reveal-IN transition; the observer reveals each once then unobserves, so there
   is no re-animate on re-scroll. On desktop the three enter together and the delay
   supplies the stagger; on mobile they stack and stagger naturally as you scroll. */
.preview-row .device.reveal.is-visible:nth-child(2) {
  transition-delay: 0.12s;
}
.preview-row .device.reveal.is-visible:nth-child(3) {
  transition-delay: 0.24s;
}

/* Hero + arc entry animation (pure CSS, plays on load) */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes draw {
  from {
    stroke-dashoffset: var(--arc-circumference);
  }
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes glow-pulse {
  0%,
  100% {
    filter: drop-shadow(0 0 22px rgba(255, 164, 120, 0.35));
  }
  50% {
    filter: drop-shadow(0 0 34px rgba(255, 164, 120, 0.6));
  }
}

.hero-arc {
  animation: glow-pulse 5s ease-in-out infinite;
}
.arc-progress {
  stroke-dasharray: var(--arc-circumference);
  animation: draw 1.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.hero-anim {
  animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.hero-anim.d1 {
  animation-delay: 0.08s;
}
.hero-anim.d2 {
  animation-delay: 0.18s;
}
.hero-anim.d3 {
  animation-delay: 0.28s;
}

/* ---- Responsive ---------------------------------------------------------- */
@media (min-width: 720px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
  .qa-grid {
    grid-template-columns: 1fr 1fr;
  }
  .waitlist-inner {
    grid-template-columns: 1.15fr 0.85fr;
    gap: var(--sp-5xl);
  }
  .privacy dl {
    grid-template-columns: repeat(3, 1fr); /* desktop: the three triplets side by side */
    gap: var(--sp-3xl);
    max-width: none;
  }
  section {
    padding-block: var(--sp-7xl);
  }
}

/* ---- Reduced motion ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal,
  .reveal.is-armed {
    opacity: 1 !important;
    transform: none !important;
  }
  .arc-progress {
    stroke-dashoffset: 0 !important;
  }
}
