/*
 * JJ Checklist marketing site styles.
 *
 * Modeled on Deco Captain's site (www/decocaptain/styles.css) so the two
 * read as one family:
 *   - Brand gradient (checkmark green, top → bottom), exactly the app
 *     hero's: ios/JJChecklist/Hero/JJHeroBackground.swift, with nothing
 *     drawn over it. It was tuned in OKLCH to Deco Captain's lightness:
 *     light runs from L 0.68 / C 0.256 / h 142 to L 0.38 / C 0.162 / h 145;
 *     dark uses Deco Captain's dark lightness and chroma at the same hues
 *     and ends at 70% of the height.
 *   - White logo at ~0.92 alpha with a soft drop shadow, still (no motion),
 *     sized and spaced against the wordmark as in the app hero.
 *   - Rounded-design semibold wordmark (system-ui-rounded).
 *   - Glass pill with translucent fill, hairline stroke, and backdrop blur
 *     for the "Coming soon" call-out.
 *   - No bubble field: a closed-circuit rebreather doesn't bubble.
 */

:root {
  color-scheme: light dark;

  /* Brand gradient stops (dark). The sRGB fallbacks are the P3 stops
     gamut-mapped as CSS Color 4 specifies (OKLCH chroma reduction);
     browsers that support Display P3 get the exact stops from the
     @supports block below. */
  --brand-top: #042e02;
  --brand-bottom: #000900;
  --brand-end: 70%;

  /* Accent highlights / link color. */
  --brand-light-green: #8ee676;
  --brand-deep-green: #23731a;

  --text: rgba(255, 255, 255, 0.94);
  --muted: rgba(255, 255, 255, 0.66);
  --faint: rgba(255, 255, 255, 0.42);

  /* Glass-pill surface: matches the iOS `.glass` button-style chrome. */
  --glass-fill: rgba(255, 255, 255, 0.08);
  --glass-fill-strong: rgba(255, 255, 255, 0.14);
  --glass-stroke: rgba(255, 255, 255, 0.18);
  --glass-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 8px 30px rgba(0, 0, 0, 0.35);

  /* Logo glow, the green counterpart of Deco Captain's cyan glow. */
  --logo-glow: rgba(142, 230, 118, 0.16);

  /* Link / back-link color used by legal-page.html and the support page. */
  --accent: var(--brand-light-green);

  /* The wordmark's size; the logo is sized from it. */
  --wordmark-size: clamp(40px, 6vw, 64px);
}

/* Light mode: the icon's light gradient, full height. Foreground stays
   white, as on Deco Captain's site. */
@media (prefers-color-scheme: light) {
  :root {
    --brand-top: #00bb00;
    --brand-bottom: #005500;
    --brand-end: 100%;
    --text: rgba(255, 255, 255, 0.98);
    --muted: rgba(255, 255, 255, 0.86);
    --faint: rgba(255, 255, 255, 0.68);
    --glass-fill: rgba(255, 255, 255, 0.16);
    --glass-stroke: rgba(255, 255, 255, 0.3);
    --glass-shadow:
      0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 8px 22px rgba(0, 48, 0, 0.24);
    --logo-glow: rgba(255, 255, 255, 0.1);
  }
}

/* Exact icon colors (Display P3). */
@supports (color: color(display-p3 0 0 0)) {
  :root {
    --brand-top: color(display-p3 0.06954 0.17736 0.03399);
    --brand-bottom: color(display-p3 0.0031 0.0329 0.00196);
  }

  @media (prefers-color-scheme: light) {
    :root {
      --brand-top: color(display-p3 0.28915 0.72181 0.10837);
      --brand-bottom: color(display-p3 0.02454 0.32967 0.00038);
    }
  }
}

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

html,
body {
  margin: 0;
}

body {
  min-height: 100svh;
  padding: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  font-family:
    ui-rounded, -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  text-align: center;
  line-height: 1.45;
  position: relative;
  overflow-x: hidden;
  background-color: var(--brand-bottom);
  background-image: linear-gradient(
    180deg,
    var(--brand-top) 0%,
    var(--brand-bottom) var(--brand-end)
  );
  background-attachment: fixed;
}

/* ──────────────────────────────────────────────────────────────────
   Hero
   ────────────────────────────────────────────────────────────────── */

.wrap {
  position: relative;
  z-index: 1;
  max-width: 44rem;
  margin: 0 auto;
  padding: 32px 24px 96px;
}

/* Vertically centers within the body grid's 1fr row and stacks the
   logo / wordmark / subtitle / pill in a flex column. */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  align-self: center;
  justify-self: center;
}

/* White fill at ~0.92 alpha + a soft drop shadow approximates the
   icon's translucent layers on the brand gradient. The layers don't
   overlap, so their order doesn't change the look.

   Proportions follow the app hero (JJLogoMetrics, AIDocumentHero): the
   icon's 155 pt canvas over a 38 pt wordmark, so that canvas is 155/38 of
   the wordmark's size here. The loop's canvas is 1334/1024 as wide, so
   its seven corrugations a side reach past the mask without clipping. */
.logo-mark {
  width: calc(var(--wordmark-size) * 155 / 38 * 1334 / 1024);
  height: calc(var(--wordmark-size) * 155 / 38);
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.35))
    drop-shadow(0 0 18px var(--logo-glow));
}

.logo-mark .logo-fill {
  fill: rgba(255, 255, 255, 0.92);
}

/* The logo's canvas leaves 0.22 of its height empty below the mask, more
   than the hero's whole gap, so the wordmark tucks up into it. The app
   hero's gap from the bottom of the logo to the top of the letters is
   0.72 of the wordmark size (27 pt at 38 pt); the negative top margin
   (beyond the flex gap) reproduces it. */
.wordmark {
  margin: calc(-18px - 0.35em) 0 0;
  font-family:
    ui-rounded, -apple-system, BlinkMacSystemFont, "SF Pro Rounded", system-ui,
    sans-serif;
  font-weight: 600;
  /* No tracking: the app's wordmark has none, and the logo's width is
     matched to the wordmark's. */
  letter-spacing: 0;
  line-height: 1.05;
  font-size: var(--wordmark-size);
  color: rgba(255, 255, 255, 0.96);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
}

.subtitle {
  margin: 0;
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--muted);
  max-width: 36rem;
  /* Split a wrapped subtitle into even lines, never one stranded word. */
  text-wrap: balance;
}

/* "Coming soon" pill: glass chip echoing the iOS `.glass` buttons. */
.soon {
  margin: 12px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--glass-stroke);
  background: var(--glass-fill);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.005em;
  box-shadow: var(--glass-shadow);
}

.soon .apple-glyph {
  width: 14px;
  height: 16px;
  display: inline-block;
  fill: currentColor;
  opacity: 0.92;
  flex-shrink: 0;
}

/* ──────────────────────────────────────────────────────────────────
   Footer
   ────────────────────────────────────────────────────────────────── */

footer {
  position: relative;
  z-index: 1;
  padding: 28px 16px 24px;
  text-align: center;
  font-size: 13px;
  color: var(--faint);
  line-height: 1.7;
}

/* Footer links read as plain text; the underline on hover / keyboard
   focus is the affordance. */
footer a {
  color: inherit;
  text-decoration: none;
}

footer a:hover,
footer a:focus-visible {
  text-decoration: underline;
}

footer .sep {
  margin: 0 6px;
  opacity: 0.55;
}

footer .fine-print {
  margin: 6px auto 0;
  max-width: 46rem;
  font-size: 12px;
}
