/* ==========================================================================
   Debato — official site
   Palette and type follow the Android app: navy, coral, cream, Playfair
   headings. Hand-written CSS, no framework, so the whole stylesheet is a few
   KB and the pages render without waiting on anything.
   ========================================================================== */

:root {
  --navy:        #15233A;
  --navy-soft:   #1E3356;

  /* Three coral tokens, not one. The brand colour is #E8543A, but at that
     value white-on-coral is 3.65:1 and coral-on-cream is 3.32:1 — both under
     the 4.5 that WCAG AA asks for body-sized text. So the brand value stays
     for decorative use, and the two places the colour has to carry text get
     shades dark enough to read. */
  --coral:       #E8543A;   /* brand; decorative accents, focus ring */
  --coral-btn:   #CC4A33;   /* solid button fill: white label at 4.57:1 */
  --coral-dark:  #B03E29;   /* button hover */
  --coral-text:  #C14630;   /* coral used AS text on cream: 4.57:1 */
  --blue:        #0076F4;
  --red:         #FE1519;
  --green:       #10B981;

  --bg:          #F7F4EF;   /* app's BgCream */
  --surface:     #FFFFFF;
  --surface-alt: #FFFBF5;
  --border:      #E8E2D9;   /* app's DividerColor */

  --text:        #15233A;
  --text-2:      #5A6473;
  --text-3:      #69707C;

  --radius:      18px;
  --radius-sm:   12px;
  --radius-pill: 999px;
  --shadow:      0 1px 2px rgba(21,35,58,.04), 0 8px 24px rgba(21,35,58,.06);
  --shadow-lg:   0 2px 4px rgba(21,35,58,.05), 0 20px 48px rgba(21,35,58,.10);

  /* The dark navy band. Its own tokens, because the band is a surface with
     light text on it in BOTH themes — it must not follow the page's text
     colour, and it must not be driven by --navy, which is a brand colour. */
  --band-bg:     #15233A;
  --band-text:   #FFFFFF;
  --band-body:   #BFCADA;
  --band-link:   #FFB9A8;

  --maxw:        1120px;
  --gutter:      20px;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #101A2B;
    --surface:     #16233A;
    --surface-alt: #1A2A44;
    --border:      #26344F;
    --text:        #F2F5FA;
    --text-2:      #A9B4C7;
    --text-3:      #7D8899;

    /* --navy is NOT redefined here. It is a background in every place it is
       used — the skip link, the step numbers and the band — so flipping it to
       a light colour turned the band into white text on a white card. */

    /* The page itself is navy in dark mode, so the band is lifted a few steps
       to stay a distinct surface rather than dissolving into the background. */
    --band-bg:     #1C2F4D;

    /* Coral text goes the other way here: the shade that reads on cream is
       too dark on navy, so it is lightened instead. 4.52:1 on a card. */
    --coral-text:  #EB6750;

    --shadow:      0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.28);
    --shadow-lg:   0 2px 4px rgba(0,0,0,.35), 0 20px 48px rgba(0,0,0,.42);
  }
}

/* ── base ───────────────────────────────────────────────────────────────── */

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 700; line-height: 1.18; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 6vw, 3.4rem); }
h2 { font-size: clamp(1.65rem, 4vw, 2.3rem); }
h3 { font-size: 1.2rem; }
p  { margin: 0 0 1em; }

a { color: var(--coral-text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--coral-dark); }

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

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

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 0 0 var(--radius-sm) 0;
}
.skip:focus { left: 0; color: #fff; }

.eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--coral-text); margin-bottom: .7rem;
}
.lede { font-size: 1.1rem; color: var(--text-2); max-width: 62ch; }

section { padding: clamp(52px, 8vw, 92px) 0; }
.section-head { max-width: 62ch; margin-bottom: clamp(28px, 4vw, 44px); }

/* ── buttons ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  font-family: var(--sans); font-weight: 700; font-size: 1rem; line-height: 1;
  padding: 15px 26px; border-radius: var(--radius-pill); border: 1.5px solid transparent;
  text-decoration: none; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--coral-btn); color: #fff; box-shadow: 0 6px 18px rgba(232,84,58,.28); }
.btn-primary:hover { background: var(--coral-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--text-3); background: var(--surface); }
.btn-sm { padding: 11px 20px; font-size: .92rem; }

.btn svg { flex: none; }

/* ── header ─────────────────────────────────────────────────────────────── */

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; gap: 18px; min-height: 68px; }

.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--text); font-weight: 700; }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.brand span { font-family: var(--serif); font-size: 1.32rem; letter-spacing: -.01em; }

.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a {
  color: var(--text-2); text-decoration: none; font-size: .95rem; font-weight: 500;
  padding: 9px 13px; border-radius: var(--radius-sm);
}
.nav a:hover { color: var(--text); background: var(--surface); }
/* `.nav a` outranks `.btn-primary` on specificity, which quietly repainted
   the header button's label in muted body grey — 1.74:1 on coral. These two
   put it back and stop the hover rule stripping it again. */
.nav a.btn-primary, .nav a.btn-primary:hover { color: #fff; background: var(--coral-btn); }
.nav a.btn-primary:hover { background: var(--coral-dark); }
.nav .btn { margin-left: 8px; }

/* The nav links collapse on phones; the Play button is the one thing that
   must survive, so it stays outside the collapsing group. */
@media (max-width: 760px) {
  .nav a:not(.btn) { display: none; }
}

/* ── hero ───────────────────────────────────────────────────────────────── */

.hero { padding-top: clamp(36px, 6vw, 68px); padding-bottom: 0; overflow: hidden; }
.hero .wrap { display: grid; gap: clamp(28px, 5vw, 56px); align-items: center; }
@media (min-width: 900px) { .hero .wrap { grid-template-columns: 1.05fr .95fr; } }

.hero h1 { margin-bottom: .35em; }
.hero h1 .accent { color: var(--coral); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.hero-points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 10px; }
.hero-points li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-2); font-size: .98rem; }
.hero-points svg { flex: none; margin-top: 3px; color: var(--green); }

.hero-shot { position: relative; justify-self: center; max-width: 340px; width: 100%; }
.hero-shot img { border-radius: 22px; box-shadow: var(--shadow-lg); }
.hero-shot::after {
  content: ""; position: absolute; inset: -14% -22% auto auto; width: 62%; aspect-ratio: 1;
  background: radial-gradient(circle, rgba(232,84,58,.22), transparent 70%);
  z-index: -1;
}

/* ── cards and grids ────────────────────────────────────────────────────── */

.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(265px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.card h3 { margin-bottom: .35em; }
.card p { color: var(--text-2); margin: 0; font-size: .97rem; }

.card-icon {
  width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
  font-size: 1.25rem; margin-bottom: 14px; background: var(--surface-alt); border: 1px solid var(--border);
}

/* debate types */
.type-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.type {
  display: flex; gap: 13px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px 18px;
}
.type .emoji { font-size: 1.3rem; line-height: 1.3; flex: none; }
.type strong { display: block; font-size: .98rem; }
.type span { color: var(--text-2); font-size: .89rem; }

/* ── screenshot gallery ─────────────────────────────────────────────────── */

.shots {
  display: grid; grid-auto-flow: column; grid-auto-columns: 232px; gap: 18px;
  overflow-x: auto; padding: 6px 0 20px; scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
.shots > figure { scroll-snap-align: center; margin: 0; }
.shots img { border-radius: 18px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.shots figcaption { margin-top: 10px; font-size: .86rem; color: var(--text-3); text-align: center; }

/* Edge-to-edge scrolling on phones reads as "there is more here" better than
   a cramped grid does. */
@media (max-width: 760px) {
  .shots { margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
}

/* On a wide screen a sideways scroller just looks like cards cut off at the
   edge, so it becomes an ordinary wrapping grid with everything in view. */
@media (min-width: 1000px) {
  .shots {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-template-columns: repeat(4, 1fr);
    overflow-x: visible;
    gap: 22px;
  }
}

/* ── steps ──────────────────────────────────────────────────────────────── */

.steps { counter-reset: step; display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.step::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--navy); color: var(--bg); font-weight: 700; font-size: .95rem; margin-bottom: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .step::before { background: var(--coral); color: #fff; }
}

/* ── band ───────────────────────────────────────────────────────────────── */

.band {
  background: var(--band-bg);
  color: var(--band-text);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: clamp(30px, 5vw, 48px);
}
.band h2 { color: var(--band-text); }
.band p  { color: var(--band-body); }
.band a:not(.btn) { color: var(--band-link); }

/* A navy band on a navy page needs an edge to read as a separate surface. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .band { border-color: #2C4166; }
}

/* ── support ────────────────────────────────────────────────────────────── */

.contact-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 20px; }
.mail {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--surface); border: 1px solid var(--border);
  padding: 11px 16px; border-radius: var(--radius-pill); font-size: .95rem;
  text-decoration: none; color: var(--text);
}
.mail:hover { color: var(--text); border-color: var(--text-3); }

/* ── footer ─────────────────────────────────────────────────────────────── */

.site-footer { border-top: 1px solid var(--border); padding: 40px 0 56px; margin-top: 20px; }
.footer-grid { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-start; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-links a { color: var(--text-2); text-decoration: none; font-size: .94rem; }
.footer-links a:hover { color: var(--coral-text); text-decoration: underline; }
.footer-note { color: var(--text-3); font-size: .86rem; margin: 22px 0 0; }

/* ── legal pages ────────────────────────────────────────────────────────── */

.legal { max-width: 760px; }
.legal h1 { margin-bottom: .25em; }
.legal .updated { color: var(--text-3); font-size: .92rem; margin-bottom: 2.4em; }
.legal h2 { font-size: 1.42rem; margin-top: 2.1em; scroll-margin-top: 90px; }
.legal h3 { font-size: 1.05rem; margin-top: 1.6em; font-family: var(--sans); font-weight: 700; }
.legal ul, .legal ol { padding-left: 1.25em; margin: 0 0 1.2em; }
.legal li { margin-bottom: .5em; color: var(--text-2); }
.legal p { color: var(--text-2); }
.legal strong { color: var(--text); }

.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 2.4em; }
.toc p { font-weight: 700; color: var(--text); margin: 0 0 .6em; font-size: .92rem; text-transform: uppercase; letter-spacing: .06em; }
.toc ol { margin: 0; padding-left: 1.2em; columns: 2; column-gap: 28px; }
.toc li { margin-bottom: .35em; break-inside: avoid; }
.toc a { color: var(--text-2); text-decoration: none; font-size: .94rem; }
.toc a:hover { color: var(--coral-text); text-decoration: underline; }
@media (max-width: 620px) { .toc ol { columns: 1; } }

.callout {
  background: var(--surface-alt); border: 1px solid var(--border);
  border-left: 3px solid var(--coral); border-radius: var(--radius-sm);
  padding: 16px 20px; margin: 1.5em 0;
}
.callout p:last-child { margin-bottom: 0; }

.data-table { width: 100%; border-collapse: collapse; margin: 1.2em 0 1.8em; font-size: .94rem; }
.data-table th, .data-table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.data-table th { font-weight: 700; color: var(--text); background: var(--surface-alt); }
.data-table td { color: var(--text-2); }
.data-table tr:last-child td { border-bottom: none; }
/* Tables are the one thing that cannot reflow below ~420px, so it scrolls. */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── 404 ────────────────────────────────────────────────────────────────── */
.center-page { min-height: 62vh; display: grid; place-items: center; text-align: center; }
