/* Reyes — landing page (page-specific styles).
   Tokens + component classes come from ds/styles.css. This file carries the
   animations, hover states, and FAQ accordion behaviour the .dc component
   expressed through its DSL. */

html { scroll-behavior: smooth; }

/* ---------- Hero-only: single, vertically-centered screen ---------- */
.hero-only {
  position: relative; overflow: hidden;
  min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding: 48px 24px;
}
.hero-only__glow {
  position: absolute; left: 50%; top: 50%;
  width: 1100px; max-width: 150%; height: 760px;
  transform: translate(-50%, -50%);
  /* Extra intermediate stops + a longer fade-to-transparent tail smooth the
     radial transition so it doesn't step into a visible "line". Paired with the
     dither overlay below (.hero-only::after), which kills any residual banding. */
  background: radial-gradient(58% 50% at 50% 32%,
    rgba(123,140,247,0.20) 0%,
    rgba(139,132,244,0.13) 28%,
    rgba(155,123,240,0.085) 46%,
    rgba(96,86,168,0.035) 62%,
    rgba(11,12,17,0) 80%);
  pointer-events: none; z-index: 0;
  filter: blur(40px);
  --amb: 1; opacity: 1; animation: rGlow 8s var(--ease) infinite;
}
/* Faint static noise that dithers the glow so gradient banding (the intermittent
   "line") can't form. ~3.5% opacity — imperceptible as texture, but enough to
   break the smooth steps. Sits above the glow, below the sparks and content. */
.hero-only::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  pointer-events: none; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hero-only__spark {
  position: absolute; width: 2px; height: 2px; border-radius: 50%;
  background: var(--spark); z-index: 1;
  animation: rTwinkle 6s var(--ease) infinite;
}
.hero-only__inner {
  position: relative; z-index: 3;
  display: flex; flex-direction: column; align-items: center;
  max-width: 720px;
}
.hero-logo { display: block; border-radius: 16px; margin-bottom: 30px; }
.hero-only__title {
  font-size: clamp(40px, 6.4vw, 78px); line-height: 1; letter-spacing: -.04em;
  font-weight: 600; margin: 0; max-width: 14ch;
}
.hero-only__sub {
  font-size: 18px; line-height: 1.6; color: var(--text-muted);
  margin: 22px 0 0; max-width: 46ch;
}
.hero-only .dl-ring { margin-top: 36px; }

/* ---------- Sticky header: transparent at top, floating pill on scroll ---------- */
#site-header {
  position: sticky; top: 0; z-index: 50;
  padding-top: 0;
  transition: padding-top .32s var(--ease);
}
.nav-pill {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; padding-left: var(--gutter); padding-right: var(--gutter);
  border: 1px solid transparent; border-radius: 0;
  background: transparent; backdrop-filter: none; box-shadow: none;
  transition: height .32s var(--ease), background .32s var(--ease),
              border-color .32s var(--ease), border-radius .32s var(--ease),
              box-shadow .32s var(--ease), backdrop-filter .32s var(--ease);
}
.nav-brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.nav-logo { display: block; border-radius: 8px; }

/* Scrolled state — the bar detaches into a glassy floating pill */
#site-header.scrolled { padding-top: 12px; }
#site-header.scrolled .nav-pill {
  height: 56px;
  background: var(--surface-glass);
  backdrop-filter: var(--blur-glass);
  border-color: var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-md);
  padding-left: 18px; padding-right: 12px;
}
@media (prefers-reduced-transparency: reduce) {
  #site-header.scrolled .nav-pill { background: var(--surface); backdrop-filter: none; }
}

/* ---------- Signature animations ---------- */
@keyframes rGlow    { 0%,100% { opacity: calc(var(--amb,.8) * .66); } 50% { opacity: var(--amb,.8); } }
@keyframes rTwinkle { 0%,100% { opacity: .16; } 50% { opacity: .8; } }

@property --dl-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes dlSpin { to { --dl-a: 360deg; } }

/* Honour the OS "reduce motion" preference — kills every decorative loop. */
@media (prefers-reduced-motion: reduce) {
  [data-anim] { animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Download CTA (pill button, lifts on hover) ---------- */
.dl-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: #F2F0EC; color: #1D1D1F; border: 0; border-radius: 999px;
  font-family: var(--font-sans); font-weight: 550; letter-spacing: -.01em;
  cursor: pointer; transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.dl-btn,
.dl-btn:hover  { color: #1D1D1F; }   /* stay dark — these are <a>, override global a:hover */
.dl-btn:hover  { transform: translateY(-1px); }
.dl-btn:active { transform: translateY(0) scale(.99); }
.dl-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(123,140,247,.5); }
.dl-btn--sm  { height: 36px; padding: 0 16px; font-size: 14px; gap: 8px; }
.dl-btn--lg  { height: 54px; padding: 0 28px; font-size: 17px; }

/* Conic "starlight" border that wraps the large CTAs.
   Default: a faint hairline with ONE bright colored arc that drifts slowly
   around the perimeter. Hover: the whole border lights up + soft glow. */
.dl-ring { position: relative; display: inline-flex; border-radius: 999px; }
.dl-ring__glow,
.dl-ring__edge {
  position: absolute; border-radius: 999px; pointer-events: none;
  animation: dlSpin 8.5s linear infinite;   /* slow drift, ~30% faster */
}
/* The visible border: faint base with a bright cyan→indigo→pink arc.
   Baseline lifted + a soft glow so the default state reads clearly. */
.dl-ring__edge {
  inset: -1.5px; z-index: 1;
  background: conic-gradient(from var(--dl-a),
    rgba(255,255,255,.12) 0deg,
    rgba(255,255,255,.12) 150deg,
    #63E8E0 205deg,
    #6B7CF5 245deg,
    #9B7BF0 282deg,
    #F06BC8 318deg,
    rgba(255,255,255,.12) 360deg);
  filter: drop-shadow(0 0 4px rgba(123,140,247,.5));
  transition: background .35s var(--ease), inset .35s var(--ease), filter .35s var(--ease);
}
/* Soft halo — hidden until hover */
.dl-ring__glow {
  inset: -6px; z-index: 0; filter: blur(12px); opacity: 0;
  background: conic-gradient(from var(--dl-a), #63E8E0, #6B7CF5, #9B7BF0, #F06BC8, #63E8E0);
  transition: opacity .35s var(--ease);
}
/* Hover: full bright ring (border covers the whole button) + glow */
.dl-ring:hover .dl-ring__edge {
  inset: -2px;
  background: conic-gradient(from var(--dl-a), #74ECE4, #6B7CF5, #9B7BF0, #F06BC8, #74ECE4);
}
.dl-ring:hover .dl-ring__glow { opacity: .45; }
.dl-ring .dl-btn { position: relative; z-index: 2; }

/* ---------- FAQ accordion ---------- */
.faq-q {
  width: 100%; display: flex; align-items: center; gap: 20px; padding: 24px 2px;
  background: none; border: 0; cursor: pointer; text-align: left;
  color: var(--text); font-family: var(--font-sans);
}
.faq-num  { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); width: 34px; flex: none; }
.faq-text { flex: 1; font-size: 20px; font-weight: 550; letter-spacing: -.01em; }
.faq-sign { font-family: var(--font-mono); font-size: 24px; font-weight: 300; color: var(--accent); line-height: 1; width: 20px; text-align: center; }
.faq-a {
  padding: 0 2px 0 54px; max-width: 60ch; color: var(--text-muted);
  font-size: 16px; line-height: 1.65;
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .28s var(--ease), opacity .28s var(--ease), padding-bottom .28s var(--ease);
  opacity: 0;
}
.faq-a > div { overflow: hidden; }
.faq-item.is-open .faq-a { grid-template-rows: 1fr; opacity: 1; padding-bottom: 26px; }

/* ---------- CTA note (mobile only) ---------- */
.cta-note { display: none; }

@media (max-width: 768px) {
  .cta-note {
    display: block; margin: 16px 0 0;
    font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em;
    color: var(--text-faint);
  }
  .hero-only__title { font-size: clamp(36px, 9vw, 56px); }
  .hero-only__sub   { font-size: 16px; }
}

/* ---------- Email bottom sheet ---------- */
.sheet-scrim {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(5,6,10,.62); backdrop-filter: blur(4px);
  opacity: 0; transition: opacity .34s var(--ease);
}
.sheet-scrim.open { opacity: 1; }
.sheet-scrim[hidden] { display: none; }

/* hidden must win over the display:flex set below */
.sheet-form[hidden],
.sheet-success[hidden],
.sheet-error[hidden] { display: none; }

.sheet {
  position: relative; width: 100%; max-width: 460px;
  background: var(--surface); border: 1px solid var(--border); border-bottom: 0;
  border-radius: 24px 24px 0 0;
  padding: 28px 24px calc(30px + env(safe-area-inset-bottom));
  text-align: center;
  box-shadow: 0 -20px 60px rgba(0,0,0,.5);
  transform: translateY(100%); transition: transform .48s cubic-bezier(.16, 1, .3, 1);
}
.sheet-scrim.open .sheet { transform: translateY(0); }

.sheet-handle { width: 40px; height: 4px; border-radius: 999px; background: var(--border-strong); margin: 2px auto 16px; }
.sheet-close {
  position: absolute; top: 14px; right: 14px; width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 999px; background: transparent; color: var(--text-faint);
  cursor: pointer; transition: .18s var(--ease);
}
.sheet-close:hover { background: var(--surface-2); color: var(--text); }
.sheet-icon  { margin: 4px 0 16px; display: flex; justify-content: center; }
.sheet-title { font-size: 25px; font-weight: 600; letter-spacing: -.02em; margin: 0; }
.sheet-sub   { font-size: 15px; line-height: 1.55; color: var(--text-muted); margin: 10px auto 22px; max-width: 36ch; }

.sheet-form {
  display: flex; gap: 6px; align-items: center;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
  padding: 5px; transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.sheet-form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(123,140,247,.3); }
.sheet-form.invalid { border-color: var(--danger); animation: sheetShake .3s var(--ease); }
.sheet-input {
  flex: 1; min-width: 0; background: transparent; border: 0; outline: none;
  color: var(--text); font-family: var(--font-sans); font-size: 15px; padding: 11px 8px 11px 16px;
}
.sheet-input::placeholder { color: var(--text-faint); }
.sheet-send {
  flex: none; border: 0; cursor: pointer; border-radius: 999px;
  background: #F2F0EC; color: #1D1D1F;
  font-family: var(--font-sans); font-weight: 550; font-size: 14px; letter-spacing: -.01em;
  padding: 0 20px; height: 42px;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.sheet-send:hover  { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.sheet-send:active { transform: translateY(0) scale(.98); }
.sheet-send:disabled { opacity: .6; pointer-events: none; }
.sheet-error { color: var(--danger); font-size: 13px; margin: 12px 0 0; }
.sheet-success {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: rgba(95,211,163,.14); color: var(--success);
  border-radius: 14px; padding: 18px; font-weight: 550; font-size: 16px;
}

@keyframes sheetShake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-6px)} 60%{transform:translateX(6px)} }

/* Centred dialog (not a bottom sheet) on wider viewports */
@media (min-width: 560px) {
  .sheet-scrim { align-items: center; }
  .sheet { border-radius: 24px; border-bottom: 1px solid var(--border); transform: translateY(16px) scale(.96); }
  .sheet-scrim.open .sheet { transform: translateY(0) scale(1); }
  .sheet-handle { display: none; }
}
