/* ============================================================
   CUTIE NAILS — Base
   Reset, typography, layout primitives, buttons, badges, the
   brand-kit blob and phone frame, reveal animation, the trial
   offer switch, and the reduced-motion guard.

   Loaded by every page. Requires tokens.css.
   No raw colour literals below — see the note in tokens.css.
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text-primary);
  background: var(--surface-page);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

:where(a) { color: inherit; }

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

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -60px;
  z-index: var(--z-overlay);
  background: var(--surface-card);
  color: var(--text-primary);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--text-base);
  transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus { top: var(--space-4); }

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

.section { padding: var(--space-section) 0; }
.section--sunk { background: var(--surface-sunk); }

.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 400;
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-display);
}

.section-sub {
  font-size: var(--text-md);
  color: var(--text-secondary);
  max-width: 52ch;
  line-height: var(--leading-normal);
}

/* ---------- Type helpers ---------- */
.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-base);
  text-decoration: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}
.btn:hover  { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* Solid Petal Pink, deliberately NOT brand-kit's gradient pill — that
   variant is authored for square social mockups where a CTA competes
   with photography. On the site a flat fill reads cleaner at small sizes. */
.btn--primary {
  background: var(--petal-pink);
  color: var(--text-primary);
  box-shadow: 0 4px 16px rgb(var(--pink-rgb) / 0.45);
}
.btn--primary:hover { box-shadow: 0 8px 24px rgb(var(--pink-rgb) / 0.6); }

.btn--ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid rgb(var(--plum-rgb) / 0.25);
}
.btn--ghost:hover {
  border-color: var(--petal-pink);
  background: rgb(var(--pink-rgb) / 0.06);
}

.btn--inverse {
  background: var(--surface-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
}

.btn--lg { padding: 15px var(--space-8); font-size: var(--text-md); }
.btn--sm { padding: 9px 18px; font-size: var(--text-sm); }
.btn__icon { width: 18px; height: 18px; flex-shrink: 0; }

/* ---------- Badge ---------- */
.badge {
  display: inline-block;
  width: fit-content;
  align-self: center;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--rose-gold);
  background: rgb(var(--rose-rgb) / 0.1);
  padding: 5px var(--space-4);
  border-radius: var(--radius-pill);
}

/* ---------- Soft background blob (from brand-kit.css) ----------
   Replaces the old section-background JPEG — same effect, zero bytes,
   sharper at every viewport, and driven by the tokens. */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  pointer-events: none;
}
.blob--pink { background: var(--petal-pink); }
.blob--lav  { background: var(--lavender-mist); }
.blob--rose { background: var(--rose-gold); }

.has-blobs { position: relative; overflow: hidden; isolation: isolate; }
.has-blobs > .blob { z-index: var(--z-base); }
.has-blobs > .container { position: relative; z-index: var(--z-raised); }

/* ---------- CSS phone frame (from brand-kit.css) ----------
   Token-driven, no image needed — which is why the marketing kit's
   iPhone frame PNG is never shipped here. */
.phone {
  position: relative;
  background: var(--deep-plum);
  border-radius: 48px;
  padding: 12px;
  box-shadow: var(--shadow-lg);
}
.phone__notch {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 34%;
  height: 22px;
  background: var(--deep-plum);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  z-index: 2;
}
.phone__screen {
  position: relative;
  overflow: hidden;
  border-radius: 38px;
  background: var(--surface-page);
  width: 100%;
  height: 100%;
}

/* ---------- Scroll reveal ----------
   Gated on .js, which js/site.js adds synchronously in <head>.
   With JavaScript disabled the class is never added, every rule here
   is inert, and all content renders at its final state. The observer
   only ever adds .is-visible — it never writes inline styles. */
.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .reveal--stagger > * { transition-delay: calc(var(--i, 0) * 60ms); }

/* ---------- Trial offer switch ----------
   Both copy variants ship in the markup; <html data-offer> picks one.
   Default is "none" until the App Store Connect + RevenueCat intro
   offers are live. See docs/trial-setup-runbook.md.
   NOTE: this cannot hide JSON-LD — FAQ answer 6 in the schema block
   needs a manual edit when flipping. */
[data-offer="none"]  .offer--trial    { display: none !important; }
[data-offer="trial"] .offer--standard { display: none !important; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

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