/* ==========================================================================
   ProofAlarm — marketing site
   One stylesheet for index.html, privacy.html, terms.html, support.html.
   Palette is locked: every colour below comes from a :root custom property.
   ========================================================================== */

/* --- Font ----------------------------------------------------------------
   Inter v20 latin subset, variable 400-700. One file covers every weight we
   use, so there is one preload and one request instead of four.
   ------------------------------------------------------------------------ */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/inter-latin-var.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Locked palette. No other colour values appear in this file. */
  --bg: #FBF8FF;
  --surface: #FFFFFF;
  --text-primary: #241934;
  --text-secondary: #776E8A;
  --disabled-label: #B0A8C2;
  --disabled-subtle: #C4BDD3;
  --border: #ECE5F7;
  --accent: #7C3AED;
  --text-on-accent: #FFFFFF;

  /* Spacing scale, 4px base. */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;

  --container: 1140px;
  --nav-h: 64px;
  --radius-card: 16px;
  --radius-pill: 999px;

  --section-y: clamp(56px, 7.5vw, 104px);
  --gutter: clamp(20px, 5vw, 32px);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Anchor targets clear the sticky nav. */
  scroll-padding-top: calc(var(--nav-h) + var(--s-4));
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    Helvetica, Arial, sans-serif;
  /* 500 rather than 400: Text Secondary on Background is 4.63:1, which passes
     AA but sits close enough to the floor that the extra weight is insurance. */
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, p, ul, ol, dl, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: inherit; }

button { font: inherit; color: inherit; }

/* --- Shared primitives ---------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Focus: 2px accent ring, 2px offset, on every interactive element. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: calc(-1 * var(--s-10));
  z-index: 100;
  padding: var(--s-3) var(--s-4);
  background: var(--accent);
  color: var(--text-on-accent);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 10px;
  transition: top 160ms ease;
}
.skip-link:focus-visible { top: var(--s-4); }

.section { padding-block: var(--section-y); }

.section-head { max-width: 42rem; margin-bottom: clamp(40px, 5vw, 64px); }

h2.section-title,
.section-title {
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-wrap: balance;
}

.section-sub {
  margin-top: var(--s-4);
  max-width: 68ch;
  color: var(--text-secondary);
  font-weight: 500;
}

.lede { max-width: 68ch; }

/* --- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-5);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--text-on-accent);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease;
}
.btn:hover { opacity: 0.92; }
.btn:active { transform: translateY(1px); }

.btn--nav { padding: 10px var(--s-4); font-size: 0.875rem; }

/* ==========================================================================
   Nav
   ========================================================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: rgba(251, 248, 255, 0.8);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  /* Border is transparent until scrolled past 20px (class added by main.js). */
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease;
}
.nav.is-scrolled { border-bottom-color: var(--border); }

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  height: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--text-primary);
}
.brand img { width: 28px; height: 28px; border-radius: 7px; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  padding-block: clamp(48px, 7vw, 104px) var(--section-y);
  /* The ambient glow is wider than its column. Clip it here so it can never
     add to the document's scroll width and push the page sideways. `clip`
     rather than `hidden` so no scroll container is created. */
  overflow-x: clip;
}

.hero__grid {
  display: grid;
  gap: clamp(48px, 6vw, 72px);
  align-items: center;
}

.hero__title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.hero__sub {
  margin-top: var(--s-5);
  max-width: 34rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-wrap: pretty;
}

.hero__actions { margin-top: clamp(32px, 4vw, 40px); }

.hero__note {
  margin-top: var(--s-5);
  max-width: 34rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ==========================================================================
   Store badges + "Coming soon" sticker
   Markup is built entirely by main.js (buildBadge) so flipping a store URL
   live is a one-line CONFIG change.
   ========================================================================== */
.badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  /* Wide enough that one badge's sticker never crowds the next badge. */
  gap: var(--s-6);
  row-gap: var(--s-5);
}

/* The badge itself. <a> when a URL exists, <span> when it does not. */
.badge {
  position: relative;
  display: inline-block;
  text-decoration: none;
  transition: transform 200ms ease;
}
.badge svg { height: 54px; width: auto; display: block; }

/* Live state: subtle 2% lift on hover. */
.badge--live:hover { transform: scale(1.02); }

/* Coming-soon state: full colour, full size, simply not interactive. */
.badge--soon { cursor: default; }

.badge__sticker {
  position: absolute;
  /* Most of the pill sits on the badge artwork; roughly a quarter of its
     width hangs past the corner, so it reads as stuck on rather than captioned. */
  top: -12px;
  right: -22px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  /* 2px Background-coloured border separates the pill from the dark badge. */
  border: 2px solid var(--bg);
  background: var(--accent);
  color: var(--text-on-accent);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
  white-space: nowrap;
  transform: rotate(-8deg);
  transform-origin: center;
  box-shadow: 0 2px 8px rgba(36, 25, 52, 0.18);
  /* It is a sticker. It does not animate. */
}

/* Inside the purple CTA band the pill would be purple-on-purple. Invert it. */
.badge__sticker--invert {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--surface);
  box-shadow: 0 2px 8px rgba(36, 25, 52, 0.24);
}

.badges--noscript {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ==========================================================================
   Device mockup - two overlapping iPhones
   .devices is the group that floats and tilts (one transform, written once
   per frame by main.js). Each phone keeps its own static rotation.
   ========================================================================== */
.hero__device {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1400px;
}

/* Ambient purple glow. Accent to transparent only - a permitted gradient.
   Animated on opacity/transform, never on filter or box-shadow. */
.device__glow {
  position: absolute;
  z-index: 0;
  width: min(130%, 560px);
  aspect-ratio: 1;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(124, 58, 237, 0.38) 0%,
    rgba(124, 58, 237, 0.18) 40%,
    rgba(124, 58, 237, 0) 70%
  );
}

.devices {
  position: relative;
  z-index: 1;
  width: min(100%, 445px);
  /* Tall enough for the front phone plus its downward offset and rotation. */
  aspect-ratio: 445 / 670;
  transform-style: preserve-3d;
}

.device {
  position: absolute;
  /* Dark bezel. */
  padding: 8px;
  border-radius: 42px;
  background: var(--text-primary);
  transform-style: preserve-3d;
}

/* Inner highlight along the top edge of the bezel. */
.device::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.26) 0%,
    rgba(255, 255, 255, 0.05) 3%,
    rgba(255, 255, 255, 0) 12%
  );
  pointer-events: none;
  z-index: 2;
}

/* Behind and to the left, rotated the other way, slightly smaller. */
.device--back {
  left: 0;
  top: 0;
  width: 58%;
  z-index: 1;
  transform: rotate(-9deg);
  box-shadow: 0 18px 40px rgba(36, 25, 52, 0.18);
}

/* In front, to the right, lower, larger, with the heavier shadow. */
.device--front {
  right: 0;
  bottom: 0;
  width: 65%;
  z-index: 2;
  transform: rotate(6deg);
  box-shadow: 0 28px 64px rgba(36, 25, 52, 0.26);
}

.device__screen {
  position: relative;
  width: 100%;
  /* Matches the source screenshots (1170x2532, iPhone 13 Pro). */
  aspect-ratio: 1170 / 2532;
  overflow: hidden;
  border-radius: 34px;
  background: var(--bg);
}

/* Dynamic Island, so the frames read as iPhones rather than generic slabs.
   These screenshots carry a real status bar, so the island sits in the gap
   between the clock and the status icons, exactly where the hardware is. */
.device__island {
  position: absolute;
  z-index: 3;
  top: 1.3%;
  left: 50%;
  transform: translateX(-50%);
  width: 30%;
  aspect-ratio: 3.4 / 1;
  border-radius: var(--radius-pill);
  background: var(--text-primary);
}

.device__shot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ==========================================================================
   How it works
   ========================================================================== */
.steps {
  display: grid;
  gap: clamp(32px, 4vw, 40px);
}

.step {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: var(--s-4);
}

.step__num {
  font-size: clamp(3.5rem, 7vw, 5.5rem);
  font-weight: 700;
  line-height: 0.85;
  letter-spacing: -0.04em;
  color: var(--disabled-label);
  font-variant-numeric: tabular-nums;
}

.step__title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.step__body {
  margin-top: var(--s-2);
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 500;
}

/* ==========================================================================
   Challenges
   ========================================================================== */
.challenges {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-4);
}

.challenge {
  padding: var(--s-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.challenge__icon { color: var(--accent); margin-bottom: var(--s-4); }
.challenge__icon svg { width: 28px; height: 28px; }

.challenge__title {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.challenge__body {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.5;
}

/* ==========================================================================
   Comparison table
   One real <table>. Desktop keeps the grid; mobile restacks each row into a
   card with paired values so nothing ever scrolls sideways.
   ========================================================================== */
.cmp-wrap { max-width: 800px; }

.cmp {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.cmp th, .cmp td { padding: var(--s-4); }

.cmp thead th {
  font-size: 0.9375rem;
  font-weight: 600;
  vertical-align: bottom;
}

.cmp__col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
  text-align: center;
}
.cmp__col img { width: 36px; height: 36px; border-radius: 9px; }
.cmp__col svg { width: 36px; height: 36px; color: var(--disabled-label); }

.cmp tbody th {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
}

.cmp tbody tr { border-top: 1px solid var(--border); }

.cmp tbody td { text-align: center; width: 22%; }

.mark { display: inline-grid; place-items: center; width: 24px; height: 24px; }
.mark svg { width: 20px; height: 20px; }
.mark--yes { color: var(--accent); }
.mark--no { color: var(--disabled-subtle); }

/* ==========================================================================
   FAQ — native details/summary, no JS
   ========================================================================== */
.faq { max-width: 800px; }

.faq details {
  border-bottom: 1px solid var(--border);
}
.faq details:first-of-type { border-top: 1px solid var(--border); }

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-5) 0;
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }

.faq summary svg {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
  transition: transform 200ms ease;
}
.faq details[open] summary svg { transform: rotate(180deg); }

.faq__answer {
  padding: 0 0 var(--s-5);
  max-width: 68ch;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 500;
}

/* ==========================================================================
   CTA band — full-bleed accent
   ========================================================================== */
.cta {
  overflow-x: clip;
  /* Permitted gradient: accent to itself at a different opacity. */
  background: linear-gradient(160deg, var(--accent) 0%, rgba(124, 58, 237, 0.88) 100%);
  color: var(--text-on-accent);
  padding-block: clamp(64px, 8vw, 112px);
  text-align: center;
}

.cta__title {
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.cta__sub {
  margin: var(--s-4) auto 0;
  max-width: 42rem;
  font-weight: 500;
  opacity: 0.92;
}

.cta .badges {
  margin-top: clamp(32px, 4vw, 44px);
  justify-content: center;
}

.cta .badges--noscript {
  margin-top: var(--s-6);
  color: var(--text-on-accent);
  opacity: 0.92;
}

/* Badge sticker inside the band needs the Background-coloured hairline gone. */
.cta .badge__sticker { border-color: var(--surface); }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  padding-block: var(--s-8);
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
}

.footer__brand { display: flex; align-items: center; gap: 10px; }
.footer__brand img { width: 28px; height: 28px; border-radius: 7px; }

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-5);
  font-weight: 500;
}
.footer__links a { text-decoration: none; }
.footer__links a:hover { color: var(--text-primary); text-decoration: underline; }

.footer__copy { font-weight: 500; }

/* ==========================================================================
   Legal / support pages
   ========================================================================== */
.doc { padding-block: clamp(48px, 6vw, 80px); }

.doc__inner { max-width: 720px; }

.doc h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.doc__meta {
  margin-top: var(--s-3);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.doc h2 {
  margin-top: var(--s-8);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.doc h3 {
  margin-top: var(--s-6);
  font-size: 1.0625rem;
  font-weight: 600;
}

.doc p, .doc li {
  margin-top: var(--s-4);
  color: var(--text-secondary);
  font-weight: 500;
  max-width: 68ch;
}

.doc ul { margin-top: var(--s-2); }
.doc li { position: relative; padding-left: var(--s-5); }
.doc li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--disabled-label);
}

.doc a { color: var(--accent); font-weight: 600; }

.doc__card {
  margin-top: var(--s-6);
  padding: var(--s-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}
.doc__card p:first-child { margin-top: 0; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  /* Mobile hero: text, buttons, then the device below them. */
  .hero__grid { justify-items: center; text-align: center; }
  .hero__sub, .hero__note { margin-inline: auto; }
  .hero__actions .badges { justify-content: center; }
  .hero__device { order: 2; width: 100%; }
  .devices { width: min(100%, 330px); }
}

/* The full app name does not fit beside the button on narrow screens.
   Below 600px the nav shows "Proof Alarm" alone. */
@media (max-width: 600px) {
  .brand__tag { display: none; }
}

@media (min-width: 901px) {
  .hero__grid {
    /* Asymmetric: text ~55%, device ~45%. */
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .challenges { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 767px) {
  /* Comparison table restacks: one card per row, values paired with labels. */
  .cmp, .cmp tbody, .cmp tr, .cmp th, .cmp td { display: block; }
  .cmp thead { display: none; }

  .cmp tbody tr {
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--surface);
    padding: var(--s-4);
    margin-bottom: var(--s-3);
  }

  .cmp tbody th {
    padding: 0 0 var(--s-3);
    font-weight: 600;
  }

  .cmp tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: auto;
    padding: 6px 0 0;
    text-align: left;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
  }
  /* The column name each value belongs to, injected from data-col. */
  .cmp tbody td::before { content: attr(data-col); }
}

@media (max-width: 520px) {
  /* Keeps both badges plus the sticker overhang on a single row at 320-520px. */
  .badge svg { height: 46px; }
  .badges { gap: var(--s-5); }
}

/* Below 360px two columns get too cramped to read; drop to one. */
@media (max-width: 359px) {
  .challenges { grid-template-columns: 1fr; }
}

@media (max-width: 400px) {
  .footer__inner { flex-direction: column; align-items: flex-start; }
}

/* ==========================================================================
   Motion
   Float + glow breathe are the only looping animations. Both run on
   transform/opacity only. The tilt and parallax are applied by main.js on
   top of these, via CSS custom properties, so there is one transform write
   per frame per element.
   ========================================================================== */
.devices,
.device__glow { transform: translate3d(0, 0, 0); }

@media (prefers-reduced-motion: no-preference) {
  /* The whole two-phone group floats as one piece, so the phones never
     drift apart from each other. */
  .devices {
    animation: float 6s ease-in-out infinite;
  }
  .device__glow {
    animation: breathe 7.3s ease-in-out infinite;
  }

  /* Pointer tilt and scroll parallax, composed with the float above.
     main.js sets --float-y / --tilt-x / --tilt-y / --par. */
  .devices.is-interactive {
    animation: none;
    transform:
      translate3d(0, var(--float-y, 0px), 0)
      rotateX(var(--tilt-x, 0deg))
      rotateY(var(--tilt-y, 0deg));
    transition: transform 400ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  .device__glow.is-interactive {
    animation: breathe 7.3s ease-in-out infinite;
    transform: translate3d(0, var(--par, 0px), 0);
  }
}

@keyframes float {
  0%, 100% { transform: translate3d(0, -6px, 0); }
  50%      { transform: translate3d(0, 6px, 0); }
}

@keyframes breathe {
  0%, 100% { opacity: 0.75; }
  50%      { opacity: 1; }
}

/* Everything off. The page is fully functional standing still. */
@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;
    scroll-behavior: auto !important;
  }
}
