/* SayAlarm — sayalarm.app. Mobile-first, dark "night before dawn" theme. */
:root {
  --ink: #0e0b1a;
  --ink-2: #16122a;
  --text: #f4f1fb;
  --muted: rgba(244, 241, 251, .68);
  --faint: rgba(244, 241, 251, .45);
  --line: rgba(255, 255, 255, .09);
  --card: rgba(255, 255, 255, .045);
  --dawn: #ff735c;
  --amber: #ffb84d;
  --lilac: #9e85ff;
  --mint: #5cdbb8;
  --sky: #6b9eff;
  --rose: #ff7399;
  --sunrise: linear-gradient(135deg, var(--dawn), var(--amber));
  --round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --serif: "New York", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --radius: 26px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--amber); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; padding: .6rem 1rem; background: var(--amber); color: var(--ink); border-radius: 999px; font-weight: 700; }
.skip:focus { top: 1rem; }

/* ---------- Aurora backdrop ---------- */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora span { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; animation: drift 22s ease-in-out infinite alternate; }
.aurora span:nth-child(1) { width: 60vmax; height: 60vmax; left: -20vmax; top: -25vmax; background: var(--dawn); opacity: .32; }
.aurora span:nth-child(2) { width: 50vmax; height: 50vmax; right: -20vmax; top: 5vmax; background: var(--lilac); opacity: .2; animation-duration: 28s; animation-delay: -8s; }
.aurora span:nth-child(3) { width: 45vmax; height: 45vmax; left: 10vmax; bottom: -30vmax; background: var(--amber); opacity: .12; animation-duration: 32s; animation-delay: -14s; }
@keyframes drift { to { transform: translate3d(6vmax, 5vmax, 0) scale(1.12); } }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 72rem; margin: 0 auto; padding-inline: 1.25rem; }
section { padding-block: 4.5rem; }
.eyebrow { font: 700 .78rem/1 var(--round); letter-spacing: .16em; text-transform: uppercase; color: var(--amber); margin: 0 0 1rem; }
h1, h2, h3 { font-family: var(--round); letter-spacing: -.02em; margin: 0; }
h1 { font-size: clamp(2.5rem, 9vw, 4.6rem); line-height: 1.02; font-weight: 800; }
h2 { font-size: clamp(2rem, 6vw, 3.2rem); line-height: 1.08; font-weight: 800; }
h3 { font-size: 1.3rem; line-height: 1.25; font-weight: 700; }
p { color: var(--muted); margin: 0; }
.lead { font-size: clamp(1.08rem, 2.6vw, 1.25rem); max-width: 36rem; }
.center { text-align: center; margin-inline: auto; }
.section-head { max-width: 40rem; margin-bottom: 2.75rem; }
.section-head p { margin-top: 1rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(14, 11, 26, .62);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.site-header.scrolled { border-color: var(--line); }
.site-header .container { display: flex; align-items: center; gap: 1rem; height: 4rem; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none; font: 800 1.12rem var(--round); }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.nav-links { display: none; gap: 1.6rem; margin-left: auto; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: .95rem; font-weight: 500; transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.site-header .btn { margin-left: auto; padding: .55rem 1rem; font-size: .9rem; }
@media (min-width: 52rem) {
  .nav-links { display: flex; }
  .site-header .btn { margin-left: 1.25rem; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .95rem 1.5rem; border-radius: 999px;
  font: 700 1rem var(--round); text-decoration: none; white-space: nowrap;
  transition: transform .2s ease, box-shadow .3s ease, background .3s;
}
.btn-primary { background: var(--sunrise); color: var(--ink); box-shadow: 0 10px 40px -10px rgba(255, 115, 92, .7); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 50px -10px rgba(255, 115, 92, .85); }
.btn-ghost { color: var(--text); background: rgba(255, 255, 255, .07); border: 1px solid var(--line); }
.btn-ghost:hover { background: rgba(255, 255, 255, .12); }
.btn svg { width: 1.15em; height: 1.15em; }
.cta-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.fine { font-size: .88rem; color: var(--faint); margin-top: 1rem; }

/* ---------- Hero ---------- */
.hero { padding-top: 2.5rem; padding-bottom: 3rem; }
.hero .container { display: grid; gap: 3rem; align-items: center; }
.hero h1 .grad { background: var(--sunrise); -webkit-background-clip: text; background-clip: text; color: transparent; }
.speaking { margin: 1.6rem 0 1.4rem; min-height: 5.2rem; display: flex; gap: 1rem; align-items: center; }
.speaking .quote { font: italic 500 clamp(1.3rem, 4.4vw, 1.75rem)/1.3 var(--serif); color: var(--amber); }
.speaking .caret { display: inline-block; width: 2px; height: 1.1em; margin-left: 2px; vertical-align: -.15em; background: var(--amber); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.wave { display: flex; align-items: center; gap: 3px; height: 44px; flex: none; }
.wave i { display: block; width: 4px; height: 100%; border-radius: 3px; background: linear-gradient(var(--amber), var(--dawn)); transform-origin: center; animation: wave 1.2s ease-in-out infinite; }
.wave i:nth-child(3n)   { animation-delay: -.2s; animation-duration: 1s; }
.wave i:nth-child(3n+1) { animation-delay: -.5s; animation-duration: 1.4s; }
.wave i:nth-child(4n)   { animation-delay: -.8s; }
@keyframes wave { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }

.hero-visual { position: relative; display: flex; justify-content: center; padding: 1rem 0 2rem; }
.hero-visual .phone { width: min(78vw, 320px); animation: float 7s ease-in-out infinite; }
.hero-visual::before {
  content: ""; position: absolute; inset: 10% 5%; z-index: -1;
  background: radial-gradient(closest-side, rgba(92, 219, 184, .35), transparent); filter: blur(30px);
}
@keyframes float { 50% { transform: translateY(-14px) rotate(-.6deg); } }

.bubble {
  position: absolute; z-index: 2; display: flex; gap: .7rem; align-items: center;
  padding: .75rem 1rem; max-width: 15rem;
  background: rgba(30, 25, 50, .72); border: 1px solid rgba(255, 255, 255, .12); border-radius: 20px;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .8);
  font-size: .86rem; line-height: 1.3; color: var(--text);
  animation: bob 6s ease-in-out infinite;
}
.bubble b { display: block; font: 700 1rem var(--round); }
.bubble .dot { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 1rem; }
.bubble.one { left: 0; top: 52%; }
.bubble.two { right: 0; bottom: 6%; animation-delay: -3s; }
@keyframes bob { 50% { transform: translateY(-10px); } }

@media (min-width: 60rem) {
  .hero { padding-top: 4.5rem; }
  .hero .container { grid-template-columns: 1.1fr .9fr; }
  .bubble.one { left: -1rem; }
  .bubble.two { right: -1rem; }
}

/* ---------- Phone frame ---------- */
.phone {
  position: relative; padding: 9px; border-radius: 48px;
  background: linear-gradient(145deg, #2c2640, #121020);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08) inset, 0 40px 80px -30px rgba(0, 0, 0, .9), 0 0 60px -20px rgba(255, 115, 92, .35);
}
.phone img { border-radius: 40px; width: 100%; aspect-ratio: 1206 / 2622; object-fit: cover; background: var(--ink-2); }

/* ---------- Trust strip ---------- */
.strip { padding-block: 1.5rem; border-block: 1px solid var(--line); background: rgba(255, 255, 255, .02); }
.strip ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem 2rem; }
.strip li { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .95rem; }
.strip li::before { content: "✓"; color: var(--mint); font-weight: 800; }

/* ---------- How it works ---------- */
.how .grid { display: grid; gap: 3rem; align-items: center; }
.transcript {
  padding: 1.25rem 1.4rem; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line);
  font: 1.08rem/1.5 var(--serif); color: var(--text); min-height: 7.5rem;
}
.transcript .label { display: flex; align-items: center; gap: .5rem; font: 700 .72rem var(--round); letter-spacing: .14em; text-transform: uppercase; color: var(--dawn); margin-bottom: .6rem; }
.transcript .label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dawn); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.7); } }
.arrow { display: grid; place-items: center; margin: 1rem 0; color: var(--amber); font-size: 1.6rem; }
.alarm-list { display: grid; gap: .6rem; }
.alarm {
  display: flex; gap: 1rem; align-items: baseline; padding: .95rem 1.1rem; border-radius: 20px;
  background: color-mix(in srgb, var(--c) 12%, transparent); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
}
.alarm time { font: 800 1.25rem var(--round); font-variant-numeric: tabular-nums; min-width: 4.8rem; }
.alarm time small { font-size: .62em; opacity: .7; margin-left: .15em; }
.alarm q { font: italic 1.02rem var(--serif); color: var(--text); quotes: "“" "”"; }
.alarm .tag { margin-left: auto; color: var(--c); font-size: .8rem; font-weight: 700; white-space: nowrap; }
@media (max-width: 30rem) { .alarm .tag { display: none; } }
.how .phone { width: min(74vw, 300px); margin-inline: auto; }
@media (min-width: 60rem) { .how .grid { grid-template-columns: 1fr 1fr; } }

/* Staged demo (JS adds .play when visible) */
.js .alarm-list .alarm { opacity: 0; transform: translateY(14px) scale(.98); }
.js .demo.play .alarm-list .alarm { animation: pop .55s cubic-bezier(.2, .9, .3, 1.2) forwards; animation-delay: calc(var(--i) * 160ms + var(--start, 0ms)); }
@keyframes pop { to { opacity: 1; transform: none; } }

/* ---------- Features ---------- */
.feature { display: grid; gap: 2.5rem; align-items: center; padding-block: 2.5rem; }
.feature .phone { width: min(72vw, 290px); margin-inline: auto; }
.feature h3 { font-size: clamp(1.6rem, 4.5vw, 2.2rem); margin-bottom: 1rem; }
.feature ul { margin: 1.25rem 0 0; padding: 0; list-style: none; display: grid; gap: .6rem; }
.feature li { display: flex; gap: .7rem; color: var(--muted); }
.feature li::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: .6em; border-radius: 50%; background: var(--c, var(--amber)); box-shadow: 0 0 12px var(--c, var(--amber)); }
@media (min-width: 60rem) {
  .feature { grid-template-columns: 1fr 1fr; gap: 5rem; }
  .feature.flip .text { order: 2; }
}

/* ---------- Cards grid ---------- */
.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.card {
  position: relative; padding: 1.5rem; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line);
  transition: transform .35s ease, border-color .35s ease, background .35s ease;
}
.card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--c, var(--amber)) 45%, transparent); background: rgba(255, 255, 255, .06); }
.card .icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.35rem; margin-bottom: 1rem; background: color-mix(in srgb, var(--c, var(--amber)) 18%, transparent); }
.card h3 { font-size: 1.12rem; margin-bottom: .45rem; }
.card p { font-size: .96rem; }
.card q { display: block; margin-top: .9rem; font: italic .98rem var(--serif); color: var(--c, var(--amber)); }

/* ---------- Gallery ---------- */
.gallery {
  display: flex; gap: 1.25rem; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 1rem 1.25rem 2rem; margin-inline: auto; max-width: 90rem;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery figure { flex: none; width: min(62vw, 250px); margin: 0; scroll-snap-align: center; }
.gallery figcaption { text-align: center; margin-top: .9rem; font-size: .9rem; color: var(--muted); }
.gallery .phone { transition: transform .4s ease; }
.gallery figure:hover .phone { transform: translateY(-6px) rotate(-1deg); }
.gallery-hint { text-align: center; font-size: .85rem; color: var(--faint); }
@media (min-width: 60rem) { .gallery-hint { display: none; } .gallery { justify-content: safe center; } }

/* ---------- Pricing ---------- */
.plans { display: grid; gap: 1rem; max-width: 50rem; margin-inline: auto; }
@media (min-width: 44rem) { .plans { grid-template-columns: 1fr 1fr; } }
.plan { padding: 2rem; border-radius: 30px; background: var(--card); border: 1px solid var(--line); }
.plan.best { background: linear-gradient(160deg, rgba(255, 115, 92, .18), rgba(255, 184, 77, .06)); border-color: rgba(255, 184, 77, .45); }
.plan .price { font: 800 3rem/1 var(--round); margin: .8rem 0 .3rem; }
.plan .price small { font-size: 1rem; font-weight: 600; color: var(--muted); }
.plan ul { list-style: none; padding: 0; margin: 1.4rem 0 0; display: grid; gap: .55rem; }
.plan li { color: var(--muted); }
.plan li::before { content: "✓  "; color: var(--mint); font-weight: 800; }

/* ---------- Privacy band ---------- */
.band { border-radius: 34px; padding: clamp(2rem, 6vw, 3.5rem); background: linear-gradient(140deg, rgba(158, 133, 255, .16), rgba(92, 219, 184, .08)); border: 1px solid var(--line); display: grid; gap: 2rem; }
@media (min-width: 60rem) { .band { grid-template-columns: 1.2fr 1fr; align-items: center; } }
.band ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; }
.band li { display: flex; gap: .8rem; align-items: flex-start; color: var(--text); }
.band li span { flex: none; font-size: 1.2rem; }

/* ---------- FAQ ---------- */
.faq { max-width: 46rem; margin-inline: auto; display: grid; gap: .7rem; }
.faq details { border-radius: 20px; background: var(--card); border: 1px solid var(--line); transition: background .3s; }
.faq details[open] { background: rgba(255, 255, 255, .06); }
.faq summary { cursor: pointer; list-style: none; padding: 1.15rem 3rem 1.15rem 1.3rem; position: relative; font: 700 1.05rem var(--round); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 1.3rem; top: 50%; transform: translateY(-50%); font-size: 1.4rem; color: var(--amber); transition: transform .3s; }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { padding: 0 1.3rem 1.25rem; }

/* ---------- Final CTA ---------- */
.final { text-align: center; }
.final .wave { justify-content: center; margin: 0 auto 1.5rem; height: 60px; }
.final .cta-row { justify-content: center; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 2.5rem calc(2.5rem + env(safe-area-inset-bottom, 0px)); color: var(--faint); font-size: .92rem; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.site-footer .legal { flex-basis: 100%; font-size: .82rem; }

/* ---------- Prose pages (privacy, support) ---------- */
.prose { max-width: 44rem; margin: 0 auto; padding: 3rem 1.25rem 4rem; }
.prose h1 { font-size: clamp(2.2rem, 7vw, 3.2rem); margin-bottom: 1rem; }
.prose h2 { font-size: 1.35rem; margin: 2.4rem 0 .5rem; }
.prose p, .prose li { color: var(--muted); }
.prose p + p { margin-top: 1rem; }
.prose .updated { font-size: .9rem; color: var(--faint); margin-bottom: 1.5rem; }
.prose .quote { font: italic 500 1.5rem/1.35 var(--serif); color: var(--amber); margin: 1.5rem 0; }

/* ---------- Scroll reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .8, .2, 1); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .reveal, .js .alarm-list .alarm { opacity: 1 !important; transform: none !important; }
}
