/* Close 1 site styles
   One stylesheet, no build step. Design tokens live in :root and are
   redefined for dark mode. Contrast ratios for these tokens are in README.md. */

/* ---------- Fonts (self-hosted Barlow, SIL OFL 1.1) ---------- */

@font-face {
  font-family: "Barlow";
  src: url("/fonts/Barlow-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Barlow";
  src: url("/fonts/Barlow-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Barlow Condensed";
  src: url("/fonts/BarlowCondensed-ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Barlow Semi Condensed";
  src: url("/fonts/BarlowSemiCondensed-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design tokens ---------- */

:root {
  color-scheme: light dark;

  /* Brand */
  --navy: #292768;
  --mint: #00c7be;           /* light mode: decoration only (2.1:1 on white) */

  /* Light scheme */
  --bg: #ffffff;
  --bg-end: #cff4f1;         /* soft mint at the bottom of the page */
  --text: #14132b;
  --text-secondary: #4a4964;
  --heading: var(--navy);
  --accent: var(--navy);     /* links, pill, text accents */
  --accent-on: #ffffff;
  --focus: var(--navy);
  --decor: var(--mint);      /* glows, borders, dots */
  --live: #ff3b30;
  --surface: rgb(255 255 255 / 0.9);
  --surface-solid: #fafafa;
  --outline: rgb(20 19 43 / 0.1);
  /* Hero glow, turned off (see .hero-media::before):
  --hero-glow: 0.55;
  --hero-glow-inset: 5% -12%;
  */

  /* Type */
  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Barlow Condensed", "Avenir Next Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-small: "Barlow Semi Condensed", "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --step-0: 1.0625rem;                                  /* 17px body */
  --step-small: 0.9375rem;                              /* 15px */
  --step-1: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);     /* card headings */
  --step-2: clamp(1.625rem, 1.3rem + 1.4vw, 2.25rem);   /* section headings */
  --step-hero: clamp(3rem, 1.6rem + 6vw, 6rem);         /* h1 */

  /* Layout */
  --gutter: clamp(1rem, 4vw, 2rem);
  --max: 72rem;
  --radius: 1.375rem;   /* 22px */
  --space: clamp(3.5rem, 2rem + 6vw, 6.5rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #07061a;             /* near-black at the top, matching the app */
    --bg-end: #201e50;         /* brand navy at the bottom */
    --text: #ffffff;
    --text-secondary: #c3c2dc;
    --heading: #ffffff;        /* navy is unreadable on the dark background */
    --accent: #63e6e2;
    --accent-on: #201e50;
    --focus: #63e6e2;
    --decor: #63e6e2;
    --live: #ff453a;
    --surface: rgb(42 42 51 / 0.6);
    --surface-solid: #1f1e33;
    --outline: rgb(255 255 255 / 0.1);
    /* Hero glow, turned off (see .hero-media::before):
    --hero-glow: 0.22;
    --hero-glow-inset: 15% 20%;
    */
  }
}

@media (min-width: 64rem) {
  :root {
    --step-0: 1.125rem; /* 18px */
  }
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image: linear-gradient(180deg, var(--bg) 0%, var(--bg) 25%, var(--bg-end) 100%);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--step-0);
  line-height: 1.55;
  overflow-wrap: break-word;
}

main {
  flex: 1;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--heading);
  line-height: 1.15;
  text-wrap: balance;
}

h2,
h3 {
  font-weight: 700;
}

p {
  margin: 0;
  text-wrap: pretty;
}

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

a {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 0.14em;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 0.25rem;
}

.container {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Skip link ---------- */

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: var(--accent-on);
  font-weight: 700;
  border-radius: 0.5rem;
  transform: translateY(-200%);
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: none;
  outline-color: var(--text);
}

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

.site-header .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-block: 0.25rem;
}

.brand img {
  width: 8.5rem;
  height: auto;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  min-width: 2.75rem;
  padding: 0.5rem 0.75rem;
  color: var(--text);
  text-decoration: none;
  border-radius: 999px;
}

.site-nav a:hover {
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--outline);
}

.site-nav a[aria-current="page"] {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
}

/* ---------- Cards ---------- */

/* No backdrop-filter here: the only thing behind a card is the page's smooth
   vertical gradient, so a blur is invisible, and WebKit blanks blurred layers
   for a moment every time their width changes (e.g. on window resize). */
.card {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--radius);
}

/* ---------- Hero ---------- */

.hero {
  padding-block: clamp(2rem, 1rem + 4vw, 4.5rem) var(--space);
}

.hero .container {
  display: grid;
  gap: clamp(2.5rem, 2rem + 3vw, 4rem);
  align-items: center;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--step-hero);
  line-height: 0.95;
  letter-spacing: -0.01em;
}

.hero-lede {
  margin-top: 1.25rem;
  max-width: 34rem;
  font-size: calc(var(--step-0) * 1.1);
  color: var(--text-secondary);
}

.hero-leagues {
  margin-top: 0.875rem;
  font-family: var(--font-small);
  font-size: var(--step-small);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* Non-interactive status pill. Deliberately an outline badge, not a filled
   button, so it doesn't read as something to press. */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
  padding: 0.5rem 1.125rem;
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.pill::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--decor);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--decor) 30%, transparent);
}

.fine-print {
  margin-top: 0.875rem;
  font-family: var(--font-small);
  font-size: var(--step-small);
  color: var(--text-secondary);
}

/* The mockup is a tall, narrow phone (1350×2760), so it's sized by height,
   not width. --hero-phone-h is the max height; width follows the aspect ratio. */
.hero-media {
  --hero-phone-h: min(36rem, 75svh);
  position: relative;
  justify-self: center;
}

/* Soft mint glow behind the phone, turned off for now. To bring it back,
   uncomment this rule and the --hero-glow variables in both :root blocks.
   Light mode uses the stronger, wider values so the glow shows on white.
.hero-media::before {
  content: "";
  position: absolute;
  inset: var(--hero-glow-inset);
  z-index: -1;
  border-radius: 50%;
  background: var(--decor);
  opacity: var(--hero-glow);
  filter: blur(60px);
}
*/

.hero-media img {
  position: relative;
  width: auto;
  height: var(--hero-phone-h);
}

/* Feature images: no shadows. Rectangular screenshots get rounded corners. */
.feature-media img {
  width: 100%;
  border-radius: var(--radius);
}

/* Transparent cutouts already have their own shape, so no rounding. */
.feature-media--cutout img {
  border-radius: 0;
}

/* Side by side: the phone sits flush under the header and the text is centered
   against it. The bottom keeps the standard section gap before the next card. */
@media (min-width: 55rem) {
  .hero {
    padding-block: 0 var(--space);
  }

  .hero .container {
    grid-template-columns: 1fr 1fr;
  }

  .hero-media {
    --hero-phone-h: clamp(32rem, 80svh, 46rem);
    justify-self: center;
  }
}

/* ---------- Sections ---------- */

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

.section h2 {
  font-size: var(--step-2);
}

.section-text {
  margin-top: 1rem;
  max-width: 40rem;
  color: var(--text-secondary);
}

/* No-ads statement: set straight on the page background, centered. */
.band {
  padding-block: clamp(1rem, 0.5rem + 2vw, 2rem);
  text-align: center;
}

.band h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 1.4rem + 2.5vw, 3.25rem);
  line-height: 1;
}

.band p {
  margin: 0.75rem auto 0;
  max-width: 40rem;
  color: var(--text-secondary);
}

/* Main feature: a card with the accent line, so it leads the feature cards. */
.feature-main {
  display: grid;
  gap: 2rem;
  align-items: center;
  padding: clamp(1.5rem, 1rem + 3vw, 3rem);
  border-top: 3px solid var(--decor);
}

.feature-main h2 {
  max-width: 20ch;
}

@media (min-width: 55rem) {
  .feature-main:has(.feature-media) {
    grid-template-columns: 1fr 1fr;
  }
}

/* Feature grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature-card {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 1.5rem;
}

.feature-card h2 {
  font-size: var(--step-1);
}

.feature-card p {
  color: var(--text-secondary);
}

.feature-card .feature-media {
  margin-top: auto;
  padding-top: 0.75rem;
}

/* Tip line (home page only) */
.tip {
  color: var(--text-secondary);
  text-align: center;
}

/* ---------- Content pages (support, privacy, 404) ---------- */

.page {
  padding-block: clamp(2rem, 1rem + 4vw, 4rem) var(--space);
}

.prose {
  max-width: 44rem;
}

.prose h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 1.8rem + 3vw, 4rem);
  line-height: 1;
}

.prose h2 {
  margin-top: 2.5rem;
  font-size: var(--step-1);
}

.prose p,
.prose ul {
  margin-top: 1rem;
}

.prose ul {
  padding-left: 1.25rem;
}

.prose li + li {
  margin-top: 0.5rem;
}

.prose .lede {
  margin-top: 1.25rem;
  color: var(--text-secondary);
}

.meta {
  font-family: var(--font-small);
  font-size: var(--step-small);
  color: var(--text-secondary);
}

/* ---------- FAQ ---------- */

.faq {
  margin-top: 1.25rem;
  display: grid;
  gap: 0.625rem;
}

.faq details {
  scroll-margin-top: 1rem;
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 2.75rem;
  padding: 1rem 1.25rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  border-radius: var(--radius);
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary:focus-visible {
  outline-offset: -3px;
}

/* Plus/minus indicator: shape changes, not just color. */
.faq summary::after {
  content: "";
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  background:
    linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat;
  color: var(--accent);
}

.faq details[open] > summary::after {
  background:
    linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat;
}

.faq .answer {
  padding: 0 1.25rem 1.25rem;
  color: var(--text-secondary);
}

.faq .answer p {
  margin: 0;
}

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 2.5rem;
  border-top: 1px solid var(--outline);
  font-family: var(--font-small);
  font-size: var(--step-small);
  color: var(--text-secondary);
}

.site-footer .container {
  display: grid;
  gap: 1rem;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

.footer-mark {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  box-shadow: 0 0 0 1px var(--outline);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-inline: 0.5rem;
}

.footer-links li:first-child a {
  padding-left: 0;
}

.site-footer p {
  max-width: 44rem;
}

/* ---------- 404 ---------- */

.not-found .button-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  margin-top: 1.5rem;
}

/* ---------- Preferences ---------- */

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

@media (forced-colors: active) {
  .card,
  .pill,
  .faq summary {
    border: 1px solid CanvasText;
  }

  .pill::before {
    forced-color-adjust: none;
    background: CanvasText;
  }

  .faq summary::after {
    forced-color-adjust: none;
    color: CanvasText;
  }

  :focus-visible {
    outline-color: Highlight;
  }
}
