/* =============================================================
 * Drip Meter — marketing site styles
 *
 * Self-contained. Borrows BRAND TOKENS (accent, type scale, spacing, voice)
 * from design-system/colors_and_type.css but is its OWN marketing layout — the
 * design system is explicitly "not for a marketing landing page", so we reuse
 * token VALUES, not the product component CSS.
 *
 * No external requests at render time: a system-font stack (matching the app's
 * "defer to platform fonts" decision — nothing to host), self-hosted SVGs, no
 * web fonts, no JS. Mobile-first; one breakpoint.
 * ============================================================= */

:root {
  /* --- Accent (Deep Petrol, locked 2026-06-11) --------------------------
   * Mirrors design-system/colors_and_type.css --accent-600 AND the app's
   * core/theme BrandSeed.accent (Color(0xFF106078)). The three move in
   * lockstep — any future recolor updates all of them together: app
   * BrandSeed, the design-system token, this file (+ golden regen).
   * --------------------------------------------------------------------- */
  --accent: #106078;
  --accent-strong: #0a4f61;
  --on-accent: #fffdfa;

  /* Warm-neutral surfaces + foreground ramp (light) */
  --fg-1: #1f1915;
  --fg-2: #58514b;
  --fg-3: #8a8279;
  --bg-base: #fffdfa;
  --bg-sunken: #f2eee9;
  --border-1: #dcd7d0;

  /* Soft lift under the screenshot phones; overridden in dark mode. */
  --shot-shadow: rgba(31, 25, 21, 0.12);

  /* Draft / warning callout (restrained crimson family) */
  --warn-fg: #5a0e0c;
  --warn-bg: #ffe7e4;
  --warn-edge: #b24743;

  /* Single system-font stack — no web font fetched */
  --font-system: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Helvetica, Arial, sans-serif;

  /* Type scale (Apple-leaning, from the design system) */
  --t-13: 0.8125rem;
  --t-15: 0.9375rem;
  --t-17: 1.0625rem;
  --t-22: 1.375rem;
  --t-28: 1.75rem;
  --t-34: 2.125rem;

  /* Spacing (4px base) */
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;

  --radius-md: 12px;
  --measure: 70ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* "Candle-lit charcoal", warmed neutrals; accent lifts to carry on dark. */
    --accent: #5bc2d8;
    --accent-strong: #5bc2d8;
    --on-accent: #062a33;
    --fg-1: #f2eee9;
    --fg-2: #afaaa4;
    --fg-3: #6b645e;
    --bg-base: #15110d;
    --bg-sunken: #241e19;
    --border-1: #2e2723;
    --warn-fg: #ffe7e4;
    --warn-bg: #621817;
    --warn-edge: #f07f77;
    /* A faint warm-light glow reads as lift on the candle-lit-charcoal page,
       where the light-mode dark shadow would be invisible. */
    --shot-shadow: rgba(242, 238, 233, 0.1);
  }

  /* The badge SVGs hard-code a near-black fill that almost matches the dark page
     background, so add a hairline ring (fg-3 ≈ 3:1, the WCAG graphical-object
     floor) to keep the badge silhouette visible. Light mode needs nothing — the
     badge already sits at ~17:1 there. */
  .store-badge {
    border-radius: 10px;
    outline: 1px solid var(--fg-3);
    outline-offset: -1px;
  }
}

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

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

body {
  margin: 0;
  font-family: var(--font-system);
  font-size: var(--t-17);
  line-height: 1.5;
  color: var(--fg-1);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Accessible skip link — visible on focus only. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--on-accent);
  padding: var(--space-2) var(--space-4);
  border-radius: 0 0 var(--radius-md) 0;
  z-index: 10;
}
.skip-link:focus {
  left: 0;
}

a {
  color: var(--accent-strong);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  /* No border-radius here: it would mutate the focused element's OWN corners
     (e.g. flatten the skip link's 12px corner). A modern outline already
     follows each element's border-radius. */
}

/* The screenshot strip's box bleeds to the viewport edge (.shots cancels main's
   side padding), so the default +2px outline-offset would draw the focus ring
   off-screen and clip it on narrow widths. Inset it to keep it fully visible
   (WCAG 2.4.7). */
.shots-strip:focus-visible {
  outline-offset: -2px;
}

/* <main> is focusable only as the skip-link target (tabindex=-1), never a Tab
   stop, so suppress the ring it would otherwise get on that programmatic focus. */
main:focus {
  outline: none;
}

/* --- Header / footer ---------------------------------------------------- */

.site-header,
.site-footer {
  padding: var(--space-5) var(--space-5);
}

.site-header {
  border-bottom: 1px solid var(--border-1);
}

.brand {
  display: inline-flex;
}

.wordmark {
  display: block;
  height: 2.25rem;
  width: auto;
  color: var(--fg-1);
}

main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 64rem;
  margin: 0 auto;
  padding: var(--space-8) var(--space-5);
}

.site-footer {
  border-top: 1px solid var(--border-1);
  color: var(--fg-2);
  font-size: var(--t-15);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
}

.footer-contact {
  margin: 0;
}

/* --- Landing: hero ----------------------------------------------------- */

.hero {
  max-width: 42rem;
  margin-bottom: var(--space-10);
}

.hero h1 {
  font-size: var(--t-34);
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 0 0 var(--space-4);
}

.hero .lead {
  font-size: var(--t-22);
  color: var(--fg-2);
  margin: 0 0 var(--space-6);
  max-width: 38ch;
}

/* Store badges (placeholder pre-launch; see src/_data/marketing.js / README). */
.store-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.store-badge {
  height: 52px;
  width: auto;
}

.store-note {
  margin: var(--space-3) 0 0;
  font-size: var(--t-13);
  /* fg-2, not fg-3: at 13px this is body-size text and must clear AA (4.5:1);
     fg-3 is reserved for large-text / UI per the design system. */
  color: var(--fg-2);
}

/* --- Landing: screenshot strip (no-JS carousel) ------------------------ */

.shots {
  margin: 0 calc(-1 * var(--space-5)) var(--space-10);
}

.shots-strip {
  display: flex;
  gap: var(--space-5);
  margin: 0;
  padding: 0 var(--space-5);
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.shots-strip li {
  flex: 0 0 auto;
  scroll-snap-align: center;
}

.shots-strip img {
  display: block;
  width: 13rem;
  height: auto;
  filter: drop-shadow(0 8px 24px var(--shot-shadow));
}

/* --- Landing: three-up value props ------------------------------------- */

.value-props {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-10);
}

.value-prop {
  background: var(--bg-sunken);
  border-radius: var(--radius-md);
  padding: var(--space-6);
}

.value-prop h2 {
  font-size: var(--t-22);
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-2);
}

.value-prop p {
  margin: 0;
  color: var(--fg-2);
}

.closing {
  margin-top: var(--space-8);
}

.closing-links {
  font-size: var(--t-15);
  color: var(--fg-2);
}

/* --- Prose / legal pages ----------------------------------------------- */

.prose {
  max-width: var(--measure);
}

.prose h1 {
  font-size: var(--t-34);
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.prose h2 {
  font-size: var(--t-28);
  letter-spacing: -0.01em;
  margin-top: var(--space-8);
}
.prose h3 {
  font-size: var(--t-22);
  margin-top: var(--space-6);
}

.prose p,
.prose li {
  color: var(--fg-1);
}

.prose a {
  color: var(--accent-strong);
}

.prose table {
  border-collapse: collapse;
  width: 100%;
  margin: var(--space-5) 0;
  font-size: var(--t-15);
}
.prose th,
.prose td {
  border: 1px solid var(--border-1);
  padding: var(--space-2) var(--space-3);
  text-align: left;
  vertical-align: top;
}
.prose th {
  background: var(--bg-sunken);
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--bg-sunken);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* The first blockquote in each legal doc is the DRAFT banner. Render it as a
 * prominent warning callout — never hidden or softened. */
.legal blockquote {
  margin: 0 0 var(--space-6);
  padding: var(--space-4) var(--space-5);
  border-left: 4px solid var(--warn-edge);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: var(--warn-bg);
  color: var(--warn-fg);
}
.legal blockquote p {
  margin: 0;
  color: inherit;
}

/* FAQ: questions stay h2 for screen-reader heading navigation, sized down so
   ten of them read as a list rather than ten full section headers. */
.faq h2 {
  font-size: var(--t-22);
  margin-top: var(--space-8);
}
.faq-contact {
  margin-top: var(--space-10);
  color: var(--fg-2);
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* --- Wider viewports ---------------------------------------------------- */

@media (min-width: 48rem) {
  .site-header,
  .site-footer {
    padding-left: var(--space-10);
    padding-right: var(--space-10);
  }
  main {
    padding: var(--space-10) var(--space-10);
  }
  .hero {
    margin-top: var(--space-6);
  }
  .hero h1 {
    font-size: 3rem;
  }
  .value-props {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5);
  }
  .shots {
    margin-left: calc(-1 * var(--space-10));
    margin-right: calc(-1 * var(--space-10));
  }
  .shots-strip {
    padding-left: var(--space-10);
    padding-right: var(--space-10);
  }
  .shots-strip img {
    width: 15rem;
  }
}
