/* ExaCalc website. One file, no fonts, no scripts. Colours are the app's (KeyPalette.brand, the icon's gold);
   every text/background pair below measures at least 4.5:1 (most 7:1 and more). */
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --surface: #f5f1fc;
  --line: #ddd3f2;
  --text: #1c1830;
  --muted: #4b4763;
  --brand: #6d28d9;      /* KeyPalette.brandStops.light */
  --brand-ink: #4c1d95;
  --hero: #3b0f7a;       /* KeyPalette.brandDeep, light */
  --hero-text: #ffffff;
  --hero-soft: #e9defc;
  --gold: #ffc524;
  --input: #0d5a92;
  --exact: #6d28d9;
  --result: #0f7a2a;
  --code-bg: #efe9fb;
  --shadow: 0 1px 2px rgba(28, 24, 48, .08), 0 8px 24px rgba(28, 24, 48, .10);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0a1c;
    --surface: #1a1230;
    --line: #34274f;
    --text: #f1edfa;
    --muted: #b8b0d0;
    --brand: #b99cff;      /* KeyPalette.brandStops.dark, lifted to read as text */
    --brand-ink: #c9a8ff;
    --hero: #2a0a5e;       /* KeyPalette.brandDeep, dark */
    --input: #7dc3ff;
    --exact: #b99cff;
    --result: #6ee08a;
    --code-bg: #241a3d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; height: auto; }

.wrap { max-width: 62rem; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--gold); color: #1c1830; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }

/* Header */
.site-head { background: var(--hero); color: var(--hero-text); }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--hero-text); text-decoration: none; font-weight: 700; font-size: 1.15rem; }
.brand img { width: 36px; height: 36px; border-radius: 8px; }
.site-head nav { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-left: auto; align-items: center; }
.site-head nav a { color: var(--hero-soft); text-decoration: none; padding: 6px 0; }
.site-head nav a:hover { color: var(--hero-text); text-decoration: underline; }
.site-head nav a[aria-current="page"] { color: var(--hero-text); font-weight: 600; border-bottom: 2px solid var(--gold); }
.site-head nav a.lang { border: 1px solid var(--hero-soft); border-radius: 999px; padding: 3px 12px; }
.site-head a:focus-visible { outline-color: var(--gold); }

/* Hero */
.hero { background: linear-gradient(180deg, var(--hero) 0%, var(--hero) 88%, var(--bg) 100%); color: var(--hero-text); padding: 28px 0 56px; text-align: center; }
.hero .icon { width: 128px; height: 128px; border-radius: 28px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.hero h1 { margin: 20px 0 8px; font-size: clamp(2rem, 8vw, 3.2rem); line-height: 1.1; }
.hero .lead { margin: 0 auto; max-width: 34rem; font-size: 1.15rem; color: var(--hero-soft); }
.badge { display: inline-block; margin-top: 22px; padding: 8px 18px; border-radius: 999px; background: var(--gold); color: #1c1830; font-weight: 700; }

/* Sections */
main { padding-bottom: 24px; }
section { padding: 36px 0 8px; }
h2 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 12px; }
h3 { font-size: 1.15rem; margin: 0 0 6px; }
p { margin: 0 0 14px; }
.muted { color: var(--muted); }

.zones { display: grid; gap: 12px; margin-top: 16px; }
.zone { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--c); border-radius: 12px; padding: 14px 16px; }
.zone h3 { color: var(--c); text-transform: uppercase; letter-spacing: .06em; font-size: .9rem; }
.zone p { margin: 0; }
.zone.input { --c: var(--input); }
.zone.exact { --c: var(--exact); }
.zone.result { --c: var(--result); }

.features { display: grid; gap: 16px; margin-top: 16px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.feature p:last-child { margin-bottom: 0; }
.feature code, .chain { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .95em; }
.chain { display: block; margin: 10px 0 0; padding: 10px 12px; background: var(--code-bg); border-radius: 8px; overflow-wrap: anywhere; }
.chain b { color: var(--brand-ink); }

.shots { display: grid; gap: 22px; margin-top: 16px; justify-items: center; }
.shots figure { margin: 0; max-width: 300px; width: 100%; }
.shot { overflow: hidden; border-radius: 22px; border: 1px solid var(--line); box-shadow: var(--shadow); background: #fff; }
/* The simulator's status bar is cropped off by the frame, not by the picture: 32 of 540 px. */
.shot img { display: block; width: 100%; margin-top: -5.9%; margin-bottom: 0; }
.shots figcaption { margin-top: 8px; font-size: .95rem; color: var(--muted); text-align: center; }

.nod { margin: 40px 0 0; text-align: center; color: var(--muted); font-size: .95rem; }

/* Text pages */
.page { max-width: 44rem; padding-top: 28px; }
.page h1 { font-size: clamp(1.8rem, 6vw, 2.4rem); line-height: 1.15; margin: 0 0 8px; }
.page h2 { margin-top: 30px; font-size: 1.3rem; }
.page ul { padding-left: 1.2rem; margin: 0 0 14px; }
.page li { margin-bottom: 6px; }
details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; margin: 0 0 10px; }
summary { cursor: pointer; padding: 13px 0; font-weight: 600; }
details[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 12px; }
details p:last-child { margin-bottom: 14px; }
kbd { font: inherit; font-weight: 600; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 0 6px; background: var(--code-bg); }

/* Footer */
.site-foot { border-top: 1px solid var(--line); margin-top: 40px; padding: 24px 0 40px; color: var(--muted); font-size: .95rem; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.site-foot p { margin: 0; }

@media (min-width: 720px) {
  body { font-size: 18px; }
  .zones { grid-template-columns: repeat(3, 1fr); }
  .features { grid-template-columns: 1fr 1fr; }
  .shots { grid-template-columns: repeat(3, 1fr); align-items: start; }
  .hero { padding: 48px 0 72px; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
