/* Fonts are served from our own server (no request to Google). Both are SIL OFL 1.1. */
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/assets/fonts/barlow-condensed-800-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/assets/fonts/barlow-condensed-800-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/dm-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/dm-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Landing — app brand (docs/brand.md): night navy, rubber red, court blue */
:root {
  color-scheme: dark;
  --bg: #0a0e18;
  --bg-deep: #070a12;
  --rubber: #d32f2f;
  --rubber-deep: #a82424;
  --rubber-glow: #ff4b4b;
  --court: #3d9bff;
  --court-soft: rgba(61, 155, 255, 0.18);
  --ink: #f4f7fb;
  --muted: #9aa8bc;
  --line: rgba(255, 255, 255, 0.08);
  --card: rgba(18, 24, 38, 0.78);
  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  --space: 8px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  background:
    radial-gradient(1000px 520px at 85% -10%, rgba(61, 155, 255, 0.18), transparent 55%),
    radial-gradient(720px 420px at 0% 18%, rgba(211, 47, 47, 0.16), transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  color: var(--ink);
  line-height: 1.6;
}

a {
  color: #8cc4ff;
  text-underline-offset: 0.15em;
}

a:hover {
  color: #c4e0ff;
}

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

.wrap {
  width: min(1040px, calc(100% - 2rem));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--court);
  color: #04101f;
  padding: 0.5rem 1rem;
  z-index: 100;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: calc(var(--space) * 2) 0;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(10, 14, 24, 0.84);
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: inherit;
  text-decoration: none;
  min-height: 44px;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.brand picture {
  display: contents;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1rem, 3.5vw, 1.35rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav {
  display: none;
  gap: 0.25rem 1.1rem;
  font-size: 0.92rem;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: color 0.2s ease;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--ink);
}

/* Scoped so .btn's display (declared later) can't re-show it on phones. */
.site-header .header-cta {
  display: none;
}

@media (min-width: 720px) {
  .nav {
    display: flex;
  }
  .site-header .header-cta {
    display: inline-flex;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 48px;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:focus-visible {
  outline: 2px solid var(--court);
  outline-offset: 3px;
}

.btn-primary {
  background: linear-gradient(180deg, #e53935, var(--rubber-deep));
  color: #fff;
  box-shadow: 0 10px 28px rgba(211, 47, 47, 0.32);
}

.btn-primary:hover {
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--ink);
}

.btn-sm {
  min-height: 40px;
  padding: 0.45rem 0.95rem;
  font-size: 0.88rem;
}

/* Hero — full-bleed composition */
.hero {
  padding: calc(var(--space) * 4) 0 calc(var(--space) * 7);
}

.hero-grid {
  display: grid;
  gap: calc(var(--space) * 4);
  align-items: center;
}

@media (min-width: 860px) {
  .hero-grid {
    grid-template-columns: 1.2fr 0.8fr;
    gap: calc(var(--space) * 5);
  }
}

.kicker {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--court);
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.75rem, 8vw, 4.75rem);
  line-height: 0.92;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.hero h1 .accent {
  color: var(--rubber-glow);
  text-shadow: 0 0 34px rgba(211, 47, 47, 0.35);
}

.hero-lead {
  margin: 1.15rem 0 1.6rem;
  max-width: 34rem;
  color: var(--muted);
  font-size: 1.08rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.25rem;
  margin-top: 1.35rem;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.9rem;
}

.hero-proof li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.hero-proof svg {
  width: 18px;
  height: 18px;
  color: var(--court);
  flex-shrink: 0;
}

.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  padding: 1rem 0;
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: 8% 0;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(61, 155, 255, 0.28), transparent 72%);
  filter: blur(8px);
}

.hero-visual .phone {
  width: min(300px, 70vw);
  position: relative;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-visual .phone {
    animation: float 6s ease-in-out infinite;
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(2deg);
  }
  50% {
    transform: translateY(-8px) rotate(2deg);
  }
}

/* Phone frame around real gameplay captures */
.phone {
  padding: 8px;
  border-radius: 34px;
  background: linear-gradient(160deg, #2a3244, #0d121c 40%, #1b2232);
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.08);
}

.phone img {
  width: 100%;
  border-radius: 27px;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  background: var(--bg);
}

/* Screenshot gallery — swipe on phones, row on desktop */
.gallery {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(62vw, 220px);
  gap: 1.1rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding: 0.5rem 0.25rem 1.25rem;
  margin: 0 -0.25rem;
  scrollbar-width: thin;
}

.shot {
  margin: 0;
  scroll-snap-align: start;
}

/* Wide screens: all six at once — no sideways scrolling with a mouse. */
@media (min-width: 900px) {
  .gallery {
    grid-auto-flow: row;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-columns: auto;
    gap: 2.25rem 1.5rem;
    overflow: visible;
  }

  .shot .phone {
    width: min(240px, 100%);
  }
}

.shot figcaption {
  margin-top: 0.8rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.shot figcaption strong {
  display: block;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Sections — anchor jumps clear the sticky header */
section[id] {
  scroll-margin-top: 84px;
}

.section {
  padding: calc(var(--space) * 7) 0;
  border-top: 1px solid var(--line);
}

.section-head {
  margin-bottom: calc(var(--space) * 4);
  max-width: 36rem;
}

.section h2 {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.35rem);
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.section-lead {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.cards {
  display: grid;
  gap: calc(var(--space) * 1.5);
}

@media (min-width: 720px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
  .cards-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.card {
  padding: 1.25rem 1.3rem;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

@media (prefers-reduced-motion: no-preference) {
  .card:hover {
    border-color: rgba(61, 155, 255, 0.35);
    transform: translateY(-2px);
  }
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 0.85rem;
  background: var(--court-soft);
  color: var(--court);
}

.card-icon svg {
  width: 22px;
  height: 22px;
}

.card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.steps {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem;
  align-items: start;
  padding: 1rem 1.1rem;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
}

.steps .num {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  background: var(--rubber);
  color: #fff;
}

.steps h3 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
}

.steps p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

/* FAQ — AEO */
.faq {
  display: grid;
  gap: 0.65rem;
}

.faq details {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 0.15rem 1rem;
}

.faq summary {
  cursor: pointer;
  list-style: none;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-weight: 700;
  font-size: 0.98rem;
}

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

.faq summary::after {
  content: "+";
  color: var(--court);
  font-size: 1.25rem;
  font-weight: 400;
}

.faq details[open] summary::after {
  content: "–";
}

.faq p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* CTA band */
.cta-band {
  margin: calc(var(--space) * 2) 0 calc(var(--space) * 8);
  padding: calc(var(--space) * 5) calc(var(--space) * 3);
  border-radius: 24px;
  text-align: center;
  background:
    radial-gradient(600px 220px at 50% 0%, rgba(211, 47, 47, 0.28), transparent 70%),
    radial-gradient(600px 220px at 50% 100%, rgba(61, 155, 255, 0.18), transparent 70%),
    #121826;
  border: 1px solid var(--line);
}

.cta-band h2 {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.cta-band p {
  margin: 0 auto 1.4rem;
  max-width: 28rem;
  color: var(--muted);
}

.cta-band .cta-row {
  justify-content: center;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: calc(var(--space) * 3) 0 calc(var(--space) * 4);
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  justify-content: space-between;
  align-items: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.footer-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--ink);
}

/* Legal / support docs */
.doc {
  padding: 1.5rem 0 3.5rem;
}

.doc h1 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.doc h2 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.05rem;
}

.doc p,
.doc li {
  color: var(--muted);
}

.doc ul {
  padding-left: 1.2rem;
}

/* ======================================================================
   Learn pages — lessons, quiz, hub, about
   Topic colours: rules = rubber red, skills = court blue, tournaments = gold.
   ====================================================================== */
:root {
  --gold: #f9c74f;
  --ink-soft: #d6deeb; /* body copy on the dark background, 11:1 */
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --out: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-topic="rules"] {
  --accent: #ff7a6e;
  --accent-soft: rgba(255, 122, 110, 0.14);
}
[data-topic="skills"] {
  --accent: #6ec0ff;
  --accent-soft: rgba(110, 192, 255, 0.14);
}
[data-topic="tournaments"] {
  --accent: var(--gold);
  --accent-soft: rgba(249, 199, 79, 0.14);
}
main {
  --accent: #6ec0ff;
  --accent-soft: rgba(110, 192, 255, 0.14);
}

/* Current page in the header */
.nav a[aria-current="page"] {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--rubber-glow);
}

/* Breadcrumbs */
.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  margin: 1.25rem 0 0.9rem;
  padding: 0;
  list-style: none;
  font-size: 0.88rem;
  color: var(--muted);
}
.crumbs li + li::before {
  content: "›";
  margin-right: 0.5rem;
}
.crumbs a {
  color: var(--muted);
  text-decoration: none;
}
.crumbs a:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* Chips */
/* Headings and body */
.doc h1,
.hub-hero h1 {
  margin: 0.15rem 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 6.5vw, 3.4rem);
  line-height: 1.02;
  text-transform: uppercase;
  letter-spacing: 0.015em;
}
.accent {
  color: var(--rubber-glow);
}
.doc h2 {
  position: relative;
  margin: 2.4rem 0 0.9rem;
  padding-bottom: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.6rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
/* The brand's thin electric-blue table-edge line, in the topic's colour. */
.doc h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 56px;
  height: 3px;
  background: var(--accent);
  border-radius: 3px;
}
.doc p,
.doc li {
  color: var(--ink-soft);
}
.lesson p,
.lesson li {
  font-size: 1.06rem;
  line-height: 1.7;
}

/* "In short" */
/* Key points: a ball bullet, easy to scan */
.sources {
  margin-top: 1.25rem;
  font-size: 0.9rem !important;
  color: var(--muted) !important;
}

/* Two columns on wide screens: article + sticky sidebar */
.lesson-layout {
  display: block;
}
@media (min-width: 960px) {
  .lesson-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 3rem;
    align-items: start;
  }
  .lesson-aside {
    position: sticky;
    top: 96px;
    margin-top: 1.5rem;
  }
}
.lesson-aside {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}
.aside-title {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.aside-list {
  display: grid;
  gap: 0.15rem;
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
  counter-reset: aside;
}
.aside-list li {
  counter-increment: aside;
  margin: 0;
}
.aside-list a,
.aside-list span {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 40px;
  padding: 0.25rem 0.4rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: 8px;
}
.aside-list a::before,
.aside-list span::before {
  content: counter(aside);
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}
.aside-list a:hover {
  background: rgba(255, 255, 255, 0.06);
}
.aside-list span[aria-current="page"] {
  color: var(--ink);
  font-weight: 700;
  background: var(--accent-soft);
}
.aside-list span[aria-current="page"]::before {
  color: #04101f;
  background: var(--accent);
}
.aside-link {
  font-size: 0.9rem;
  font-weight: 700;
}
/* Next / previous as big cards */
.lesson-nav {
  display: grid;
  gap: 0.75rem;
  margin: 2.25rem 0 1rem;
}
@media (min-width: 640px) {
  .lesson-nav {
    grid-template-columns: 1fr 1fr;
  }
}
/* ---- Quiz ---------------------------------------------------------------- */
.quiz-panel {
  margin: 2.5rem 0 0;
  padding: 1.4rem 1.4rem 1.6rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line);
  border-radius: 20px;
}
.quiz-panel h2 {
  margin-top: 0;
}
.quiz {
  display: grid;
  gap: 1rem;
}
.q {
  padding: 1.1rem 1.2rem;
  background: rgba(10, 14, 24, 0.6);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.q-title {
  margin: 0 0 0.25rem;
  color: var(--accent);
  font-size: 1.05rem;
}
.q-situation {
  margin: 0 0 0.6rem;
}
.q-prompt {
  margin: 0 0 0.75rem;
  color: var(--ink) !important;
  font-size: 1.15rem !important;
  font-weight: 700;
}
.q-options {
  display: grid;
  gap: 0.6rem;
  margin: 0 0 0.6rem;
  padding-left: 1.4rem;
}
.quiz-js .q-options {
  padding-left: 0;
  list-style: none;
}
.q-option {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  min-height: 52px;
  padding: 0.7rem 1rem;
  text-align: left;
  color: var(--ink);
  font: inherit;
  font-size: 1.02rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.2s var(--spring), border-color 0.15s ease, background-color 0.15s ease;
}
.q-letter {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.q-option:hover:not([aria-disabled="true"]),
.q-option:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateX(3px);
}
.q-option:active:not([aria-disabled="true"]) {
  transform: scale(0.98);
}
/* Right and wrong differ by border style and an icon, not colour alone. */
.q-option.is-right {
  border: 2px solid #6ddea0;
  background: rgba(109, 222, 160, 0.1);
  animation: pop 0.45s var(--spring);
}
.q-option.is-right .q-letter {
  color: #04101f;
  background: #6ddea0;
}
.q-option.is-right::after {
  content: "✓";
  margin-left: auto;
  color: #6ddea0;
  font-weight: 700;
}
.q-option.is-wrong {
  border: 2px dashed #ff7a6e;
  animation: wobble 0.36s ease-out;
}
.q-option.is-wrong::after {
  content: "✗";
  margin-left: auto;
  color: #ff7a6e;
  font-weight: 700;
}
.q-feedback {
  margin: 0.4rem 0 0;
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  animation: rise 0.3s var(--out) both;
}
.q-answer summary {
  cursor: pointer;
  color: var(--accent);
}

/* Quiz one-question-at-a-time (when JavaScript is on) */
.quiz-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.quiz-progress {
  margin: 0;
  color: var(--muted) !important;
  font-size: 0.85rem !important;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.quiz-dots {
  display: flex;
  gap: 6px;
}
.quiz-dots i {
  width: 10px;
  height: 10px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  transition: background-color 0.2s ease, transform 0.3s var(--spring);
}
.quiz-dots i.is-now {
  background: var(--accent);
  transform: scale(1.3);
}
.quiz-dots i.is-right {
  background: #6ddea0;
}
.quiz-dots i.is-wrong {
  background: #ff7a6e;
}
.quiz-next {
  justify-self: end;
  animation: rise 0.3s var(--out) both;
}
.quiz-result {
  display: grid;
  gap: 0.6rem;
  justify-items: center;
  padding: 1.6rem 1rem;
  text-align: center;
  background: linear-gradient(135deg, var(--accent-soft), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--line);
  border-radius: 18px;
  animation: pop 0.5s var(--spring) both;
}
.quiz-result .score-big {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 3rem;
  line-height: 1;
}
.quiz-result p {
  margin: 0;
}
.quiz-result .cta-row {
  justify-content: center;
}
.burst {
  position: relative;
  width: 0;
  height: 0;
  pointer-events: none;
}
.burst i {
  position: absolute;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 50%;
  opacity: 0;
  animation: spark 0.8s 0.15s var(--out) both;
}
.burst i:nth-child(3n + 1) {
  background: #6ec0ff;
}
.burst i:nth-child(3n + 2) {
  background: var(--rubber-glow);
}

/* ---- Hub ------------------------------------------------------------------ */
.hub-hero {
  display: grid;
  gap: 1.5rem;
  align-items: center;
  padding: 0.5rem 0 1.5rem;
}
@media (min-width: 860px) {
  .hub-hero {
    grid-template-columns: 1.3fr 0.7fr;
    gap: 3rem;
  }
}
.hub-lead {
  max-width: 56ch;
  margin: 0.25rem 0 1.25rem;
  color: var(--ink-soft);
  font-size: 1.15rem;
  line-height: 1.65;
}
.topic {
  margin: 2.5rem 0 0;
  padding: 1.6rem 1.4rem 0.6rem;
  background: linear-gradient(180deg, var(--accent-soft), transparent 70%);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 20px;
}
.topic h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.group-title {
  margin: 1.2rem 0 0.6rem;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.link-cards {
  display: grid;
  gap: 0.8rem;
  margin: 0 0 1.4rem;
  padding: 0;
  list-style: none;
}
@media (min-width: 640px) {
  .link-cards {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}
.link-card {
  display: grid;
  gap: 0.3rem;
  height: 100%;
  min-height: 44px;
  padding: 1rem 1.1rem;
  color: var(--ink);
  text-decoration: none;
  background: rgba(10, 14, 24, 0.65);
  border: 1px solid var(--line);
  border-radius: 16px;
  transition: transform 0.25s var(--spring), border-color 0.2s ease, box-shadow 0.25s ease;
}
.link-card:hover,
.link-card:focus-visible {
  color: var(--ink);
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}
.link-card-title {
  font-size: 1.08rem;
  font-weight: 700;
}
.link-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.3rem;
}
/* ---- About ------------------------------------------------------------------ */
.doc-wide .lesson > p,
.doc-wide p {
  max-width: none;
}
.name-grid {
  display: grid;
  gap: 0.7rem;
  margin: 0;
}
@media (min-width: 560px) {
  .name-grid {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  }
}
.name-tile {
  padding: 0.9rem 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: transform 0.25s var(--spring), border-color 0.2s ease;
}
.name-tile:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}
.name-tile dt {
  color: var(--ink);
  font-size: 1.12rem;
  font-weight: 700;
}
.name-tile dd {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.timeline {
  position: relative;
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0 0 0 0.2rem;
  list-style: none;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 6.5rem;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 2px;
  background: linear-gradient(var(--accent), transparent);
}
.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 5.4rem 1fr;
  gap: 2.2rem;
  margin: 0;
}
.timeline li::after {
  content: "";
  position: absolute;
  left: 6.15rem;
  top: 0.6rem;
  width: 0.7rem;
  height: 0.7rem;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.timeline-year {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 1.15rem;
  text-align: right;
  white-space: nowrap;
}
@media (max-width: 559px) {
  .timeline::before {
    left: 5.4rem;
  }
  .timeline li {
    grid-template-columns: 4.6rem 1fr;
    gap: 1.6rem;
  }
  .timeline li::after {
    left: 5.05rem;
  }
}

/* ---- Motion: things rise in, nothing flashes ------------------------------ */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes pop {
  0% {
    transform: scale(0.94);
  }
  60% {
    transform: scale(1.03);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes wobble {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-6px);
  }
  50% {
    transform: translateX(5px);
  }
  75% {
    transform: translateX(-3px);
  }
}
@keyframes spark {
  0% {
    opacity: 1;
    transform: rotate(var(--a)) translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: rotate(var(--a)) translateY(-90px) scale(0.3);
  }
}
.doc > *,
.hub-hero-copy > *,
.topic,
.link-cards li,
.lesson-aside > * {
  animation: rise 0.5s var(--out) both;
}
.doc > *:nth-child(2) {
  animation-delay: 0.05s;
}
.doc > *:nth-child(3) {
  animation-delay: 0.1s;
}
.doc > *:nth-child(4) {
  animation-delay: 0.15s;
}
.link-cards li:nth-child(2) {
  animation-delay: 0.05s;
}
.link-cards li:nth-child(3) {
  animation-delay: 0.1s;
}
.link-cards li:nth-child(4) {
  animation-delay: 0.15s;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .burst {
    display: none;
  }
}

/* Authored display rules must never win over the hidden attribute. */
[hidden] {
  display: none !important;
}

/* No box inside a box: the questions sit directly on the quiz panel. */
.quiz-panel .q {
  padding: 0;
  background: transparent;
  border: 0;
}

/* Home page "Learn" cards: the heading is the link, styled like the other cards. */
.card h3 a {
  color: inherit;
  text-decoration: none;
}
.card h3 a:hover,
.card h3 a:focus-visible {
  color: #8cc4ff;
  text-decoration: underline;
}

/* ======================================================================
   Calmer learn pages: content first, little chrome
   ====================================================================== */
.lead {
  margin: 0.25rem 0 1.25rem !important;
  color: var(--ink) !important;
  font-size: 1.3rem !important;
  line-height: 1.55 !important;
}
.updated {
  margin: 2.5rem 0 0;
  color: var(--muted) !important;
  font-size: 0.82rem !important;
}
.app-note {
  margin: 2.5rem 0 0.5rem;
  color: var(--muted);
  text-align: center;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  text-decoration: none;
}
.nav-link:hover,
.nav-link:focus-visible {
  color: var(--ink);
  text-decoration: underline;
}
.lesson-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}
.plain-list {
  display: grid;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding-left: 1.2rem;
}

/* Sidebar: just the list of lessons in this topic */
.lesson-aside {
  display: block;
  margin-top: 2rem;
}
.lesson-aside .aside-title {
  margin: 0 0 0.4rem;
}

/* Hub */
.hub-hero {
  display: block;
  max-width: 44rem;
  padding: 1rem 0 0.5rem;
}
.hub-lead {
  margin: 0.25rem 0 1.25rem;
  color: var(--ink-soft);
  font-size: 1.25rem;
  line-height: 1.55;
}
.topic {
  margin: 2.75rem 0 0;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
}
.topic h2 {
  display: inline-block;
  margin: 0 0 1rem;
  padding-bottom: 0.45rem;
  border-bottom: 3px solid var(--accent);
}
.group-title {
  margin: 1.4rem 0 0.6rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.link-card {
  align-content: space-between;
  min-height: 92px;
  gap: 0.6rem;
  background: var(--card);
}
.link-card:hover,
.link-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: none;
}
.link-card-foot {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}
.link-card:hover .link-card-foot {
  color: var(--accent);
}

.doc h1 {
  margin-bottom: 0.85rem;
}

/* Legal pages */
.legal h2 {
  margin-top: 2rem;
}
.legal h3 {
  margin: 1.25rem 0 0.4rem;
  color: var(--ink);
  font-size: 1.05rem;
}
.legal p,
.legal li {
  max-width: 70ch;
  color: var(--ink-soft);
  line-height: 1.7;
}
.legal ul {
  display: grid;
  gap: 0.4rem;
  padding-left: 1.2rem;
}
.legal code {
  padding: 0.05rem 0.35rem;
  font-size: 0.9em;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}
.legal .updated {
  margin: 0 0 1.5rem;
}
.legal-table {
  width: 100%;
  margin: 0.5rem 0 1rem;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.legal-table th,
.legal-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
}
.legal-table thead th {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.legal-table tbody th {
  color: var(--ink);
  white-space: nowrap;
}
.footer-address {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}
