/* ==========================================================================
   SkillNest — style.css
   --------------------------------------------------------------------------
   Sections in this file
   1.  BRAND TOKENS      <- change these to rebrand the whole site
   2.  BASE / RESET
   3.  LAYOUT HELPERS
   4.  BUTTONS
   5.  HEADER / NAVIGATION
   6.  HERO
   7.  SECTIONS, CARDS, STEPS, LISTS
   8.  FOOTER
   9.  CONTENT PAGES (prose, tables, forms)
   10. TYPING TOOL UI
   11. QUIZ TOOL UI
   12. UTILITIES
   13. RESPONSIVE (mobile-first: base = mobile)
   14. MOTION PREFERENCES
   ========================================================================== */


/* ==========================================================================
   1. BRAND TOKENS
   Everything visual about the brand lives here. Change these values and the
   whole site restyles itself. (The brand *name* lives in brand.js.)
   ========================================================================== */
:root {
  /* Fonts — system stack = zero downloads = fast first paint */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  /* Core palette */
  --navy: #0f1b3d;            /* deep navy — headings, footer, dark bands */
  --navy-2: #1a2a55;          /* softer navy for gradients */
  --blue: #2563eb;            /* primary action blue */
  --blue-dark: #1d4ed8;       /* blue hover */
  --blue-ink: #1e40af;        /* blue used for text (readable contrast) */
  --blue-soft: #e8f0fe;       /* pale blue background */
  --lavender: #7c5cff;        /* accent (large shapes / icons only) */
  --lavender-ink: #5b3fd6;    /* accent used for text on light backgrounds */
  --lavender-soft: #f4f1fe;   /* pale lavender background */
  --lavender-border: #e0d8fb;

  /* Neutrals */
  --white: #ffffff;
  --bg: #f5f7fb;              /* page background (light gray) */
  --bg-2: #eef1f8;            /* alternating section background */
  --surface: #ffffff;
  --text: #16203c;            /* body text */
  --text-muted: #566084;      /* secondary text (6:1 on white) */
  --border: #e3e8f2;
  --border-strong: #c9d3e6;

  /* Feedback colours */
  --ok: #0f7b52;
  --ok-bg: #e7f7f0;
  --ok-border: #bce7d5;
  --no: #b3261e;
  --no-bg: #fdeceb;
  --no-border: #f2c7c3;
  --warn-ink: #7a5200;
  --warn-bg: #fff6e5;
  --warn-border: #f0dcab;

  --focus: #2563eb;           /* focus ring colour */

  /* Shape, depth, size */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(15, 27, 61, .05), 0 6px 16px rgba(15, 27, 61, .05);
  --shadow-md: 0 10px 30px rgba(15, 27, 61, .10);
  --shadow-lg: 0 18px 45px rgba(15, 27, 61, .14);

  --maxw: 1140px;             /* content width */
  --header-h: 68px;
  --section-y: clamp(3.25rem, 8vw, 5.5rem);
}


/* ==========================================================================
   2. BASE / RESET
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1, h2, h3, h4 {
  margin: 0 0 .6rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--navy);
}

h1 { font-size: clamp(1.9rem, 5.5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3.6vw, 2.15rem); }
h3 { font-size: clamp(1.12rem, 2.4vw, 1.35rem); }
h4 { font-size: 1.02rem; }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

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

ul, ol { margin: 0 0 1rem; padding-left: 1.25rem; }
li { margin-bottom: .4rem; }

img, svg { max-width: 100%; }

button, input, select, textarea { font: inherit; color: inherit; }

/* Visible, consistent keyboard focus everywhere */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Light focus ring on dark sections */
.hero :focus-visible, .page-head :focus-visible, .section--navy :focus-visible,
.site-footer :focus-visible { outline-color: #fff; }

::selection { background: var(--lavender-soft); color: var(--navy); }


/* ==========================================================================
   3. LAYOUT HELPERS
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 20px;
}
.container--narrow { max-width: 820px; }

.section { padding-block: var(--section-y); }
.section--white { background: var(--white); }
.section--gray { background: var(--bg); }
.section--tint { background: var(--bg-2); }
.section--navy {
  background: linear-gradient(140deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff;
}
.section--navy h2, .section--navy h3 { color: #fff; }
.section--navy p { color: rgba(255, 255, 255, .82); }

/* Repeating section heading block */
.section-head { max-width: 700px; margin: 0 auto clamp(1.75rem, 4vw, 2.75rem); text-align: center; }
.section-head p { color: var(--text-muted); font-size: 1.05rem; }
.section--navy .section-head p { color: rgba(255, 255, 255, .82); }

.eyebrow {
  display: inline-block;
  margin: 0 0 .75rem;
  padding: .35rem .8rem;
  border-radius: var(--radius-pill);
  background: var(--lavender-soft);
  border: 1px solid var(--lavender-border);
  color: var(--lavender-ink);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.eyebrow--on-dark {
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .25);
  color: #fff;
}

.grid { display: grid; gap: clamp(1rem, 2.5vw, 1.5rem); }
.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
.grid--4 { grid-template-columns: 1fr; }


/* ==========================================================================
   4. BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 48px;           /* comfortable tap target on phones */
  padding: .7rem 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease,
              transform .15s ease, box-shadow .15s ease;
}
.btn:hover { color: #fff; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.btn--primary { background: var(--blue); box-shadow: 0 8px 20px rgba(37, 99, 235, .25); }
.btn--primary:hover { background: var(--blue-dark); }

.btn--navy { background: var(--navy); }
.btn--navy:hover { background: var(--navy-2); }

.btn--ghost {
  background: var(--white);
  color: var(--navy);
  border-color: var(--border-strong);
}
.btn--ghost:hover { background: var(--blue-soft); color: var(--blue-ink); border-color: var(--blue); }

.btn--quiet {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
  padding-inline: .6rem;
}
.btn--quiet:hover { color: var(--blue-ink); background: var(--bg-2); }

.btn--lg { min-height: 56px; padding: .85rem 1.75rem; font-size: 1.05rem; }
.btn--sm { min-height: 40px; padding: .45rem .9rem; font-size: .9rem; }
.btn--block { width: 100%; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.5rem;
}
.btn-row--center { justify-content: center; }

.text-link {
  font-weight: 600;
  color: var(--blue-ink);
  text-decoration: underline;
}


/* ==========================================================================
   5. HEADER / NAVIGATION
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, .93);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header.is-scrolled { box-shadow: var(--shadow-sm); }

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}

/* Logo */
.logo {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  text-decoration: none;
  color: var(--navy);
}
.logo__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(140deg, var(--navy) 0%, var(--blue) 100%);
  color: #fff;
  flex: none;
}
.logo__mark svg { width: 22px; height: 22px; }
.logo__text { display: flex; flex-direction: column; line-height: 1.1; }
.logo__name { font-weight: 800; font-size: 1.12rem; letter-spacing: -.02em; }
.logo__tag { font-size: .68rem; letter-spacing: .09em; text-transform: uppercase; color: var(--text-muted); }
.logo--footer { color: #fff; }
.logo--footer .logo__tag { color: rgba(255, 255, 255, .65); }

/* Hamburger (mobile only) */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--navy);
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before, .nav-toggle__bars::after {
  content: ""; position: absolute; left: 0;
}
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

/* Mobile drawer */
.primary-nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: .5rem 20px 1.25rem;
  display: none;
}
.primary-nav.is-open { display: block; }

.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-list > li { margin: 0; border-bottom: 1px solid var(--border); }
.nav-list > li:last-child { border-bottom: 0; }

.nav-list a,
.nav-link-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  width: 100%;
  padding: .85rem .25rem;
  border: 0;
  background: none;
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.nav-list a:hover, .nav-link-btn:hover { color: var(--blue-ink); background: var(--bg); }
.nav-list a[aria-current="page"] { color: var(--blue-ink); }
.nav-link-btn[aria-expanded="true"] { color: var(--blue-ink); }
.nav-link-btn.is-parent-current { color: var(--blue-ink); }

.nav-caret { width: 16px; height: 16px; flex: none; transition: transform .2s ease; }
.nav-link-btn[aria-expanded="true"] .nav-caret { transform: rotate(180deg); }

/* Sub menus: always visible inside the mobile drawer, indented */
.nav-menu {
  list-style: none;
  margin: 0 0 .5rem;
  padding: .25rem 0 .25rem .9rem;
  border-left: 2px solid var(--lavender-border);
  display: none;
}
.nav-menu.is-open { display: block; }
.nav-menu a { font-weight: 500; color: var(--text-muted); padding: .6rem .25rem; }
.nav-menu a[aria-current="page"] { color: var(--blue-ink); font-weight: 700; }


/* If JavaScript is disabled, keep every page reachable on a phone.
   The dropdown headings become static labels and their links are all visible. */
.no-js .nav-toggle { display: none; }
.no-js .primary-nav {
  position: static;
  display: block;
  padding: .5rem 0 1rem;
  background: #fff;
  border: 0;
  box-shadow: none;
}
.no-js .primary-nav .nav-list { display: flex; flex-direction: column; align-items: stretch; }
.no-js .primary-nav .nav-list > li { border-bottom: 1px solid var(--border); }
.no-js .nav-link-btn { display: none; }
.no-js .nav-menu {
  display: block;
  position: static;
  min-width: 0;
  padding: .25rem 0 .5rem .9rem;
  margin: 0;
  border: 0;
  border-left: 2px solid var(--lavender-border);
  border-radius: 0;
  box-shadow: none;
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* ==========================================================================
   6. HERO
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(3rem, 9vw, 6rem);
  background: linear-gradient(150deg, var(--navy) 0%, var(--navy-2) 55%, #24407e 100%);
  color: #fff;
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(10px);
  pointer-events: none;
}
.hero::before {
  width: 460px; height: 460px; right: -160px; top: -180px;
  background: radial-gradient(circle, rgba(124, 92, 255, .55) 0%, rgba(124, 92, 255, 0) 70%);
}
.hero::after {
  width: 520px; height: 520px; left: -220px; bottom: -300px;
  background: radial-gradient(circle, rgba(37, 99, 235, .55) 0%, rgba(37, 99, 235, 0) 70%);
}
.hero__inner { position: relative; z-index: 1; max-width: 720px; }
.hero h1 { color: #fff; font-size: clamp(2.1rem, 7vw, 3.5rem); }
.hero__lead {
  margin: 1rem 0 0;
  font-size: clamp(1.02rem, 2.4vw, 1.22rem);
  color: rgba(255, 255, 255, .85);
  max-width: 38em;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.9rem; }
.hero__actions .btn--ghost { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .4); color: #fff; }
.hero__actions .btn--ghost:hover { background: #fff; color: var(--navy); border-color: #fff; }
.hero__points {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .75rem;
  margin: 2rem 0 0;
  padding: 0;
  font-size: .9rem;
  color: rgba(255, 255, 255, .8);
}
.hero__points li {
  margin: 0;
  padding: .3rem .75rem;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .07);
}

/* Small page banner used on inner pages */
.page-head {
  padding-block: clamp(2.25rem, 6vw, 3.5rem);
  background: linear-gradient(150deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff;
}
.page-head h1 { color: #fff; margin-bottom: .5rem; }
.page-head p { color: rgba(255, 255, 255, .84); max-width: 46em; margin: 0; }
.breadcrumb {
  font-size: .85rem;
  margin: 0 0 .9rem;
  color: rgba(255, 255, 255, .7);
}
.breadcrumb a { color: rgba(255, 255, 255, .85); }


/* ==========================================================================
   7. SECTIONS, CARDS, STEPS, LISTS
   ========================================================================== */
.card {
  height: 100%;
  padding: clamp(1.15rem, 3vw, 1.6rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--lavender-border);
}
.card h3 { margin-bottom: .4rem; }
.card p { color: var(--text-muted); }

/* Tool card */
.tool-card { display: flex; flex-direction: column; gap: .65rem; }
.tool-card__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: linear-gradient(145deg, var(--blue-soft) 0%, var(--lavender-soft) 100%);
  color: var(--blue-ink);
  margin-bottom: .25rem;
}
.tool-card__icon svg { width: 24px; height: 24px; }
.tool-card__text { color: var(--text-muted); flex: 1; }
.tool-card .btn { margin-top: .5rem; align-self: flex-start; }

/* Steps */
.step-card { text-align: left; }
.step-card__num {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: .85rem;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-weight: 800;
}
.section--navy .step-card { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .16); box-shadow: none; }
.section--navy .step-card:hover { border-color: rgba(255, 255, 255, .4); }
.section--navy .step-card__num { background: #fff; color: var(--navy); }
.section--navy .card h3 { color: #fff; }

/* Why list */
.why-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.why-list li {
  display: flex;
  gap: .8rem;
  align-items: flex-start;
  margin: 0;
  padding: 1rem 1.1rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.why-list svg { width: 22px; height: 22px; flex: none; color: var(--ok); margin-top: .2rem; }
.why-list strong { display: block; color: var(--navy); }
.why-list span { color: var(--text-muted); }

/* CTA band */
.cta-band { text-align: center; }
.cta-band .btn-row { justify-content: center; }

/* Stat strip on cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: .75rem;
}
.stat {
  padding: .8rem .6rem;
  text-align: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.stat__value { display: block; font-size: clamp(1.3rem, 4vw, 1.75rem); font-weight: 800; color: var(--navy); line-height: 1.15; }
.stat__label { display: block; font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; color: var(--text-muted); }
.stat--good .stat__value { color: var(--ok); }
.stat--bad .stat__value { color: var(--no); }


/* ==========================================================================
   8. FOOTER
   ========================================================================== */
.site-footer {
  padding-block: clamp(2.5rem, 6vw, 3.5rem) 1.5rem;
  background: var(--navy);
  color: rgba(255, 255, 255, .78);
}
.footer__grid {
  display: grid;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.footer__title {
  margin: 0 0 .75rem;
  font-size: .8rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #fff;
}
.footer__col ul { list-style: none; margin: 0; padding: 0; }
.footer__col li { margin-bottom: .45rem; }
.footer__col a { color: rgba(255, 255, 255, .78); text-decoration: none; }
.footer__col a:hover { color: #fff; text-decoration: underline; }
.footer__note { color: rgba(255, 255, 255, .6); font-size: .9rem; margin-top: .75rem; }
.footer__bottom {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  padding-top: 1.25rem;
  font-size: .88rem;
  color: rgba(255, 255, 255, .58);
}
.footer__legal { list-style: none; display: flex; flex-wrap: wrap; gap: 1rem; margin: 0; padding: 0; }
.footer__legal a { color: rgba(255, 255, 255, .78); }


/* ==========================================================================
   9. CONTENT PAGES (prose, tables, forms)
   ========================================================================== */
.prose { max-width: 760px; }
.prose h2 { margin-top: 2.25rem; }
.prose h3 { margin-top: 1.6rem; }
.prose ul, .prose ol { color: var(--text-muted); }
.prose li strong { color: var(--text); }
.prose > :first-child { margin-top: 0; }

.card--page {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 4vw, 2.25rem);
  box-shadow: var(--shadow-sm);
}

.callout {
  display: flex;
  gap: .85rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--warn-border);
  background: var(--warn-bg);
  color: var(--warn-ink);
  font-size: .95rem;
}
.callout--info { border-color: #c9dcff; background: var(--blue-soft); color: var(--blue-ink); }
.callout svg { width: 22px; height: 22px; flex: none; margin-top: .15rem; }
.callout p { margin: 0; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
  min-width: 420px;
}
table.data caption { text-align: left; color: var(--text-muted); padding-bottom: .6rem; font-size: .9rem; }
table.data th, table.data td {
  padding: .65rem .8rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
table.data thead th { background: var(--bg-2); color: var(--navy); font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; }
table.data tbody tr:last-child td { border-bottom: 0; }

/* Forms */
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .35rem; color: var(--navy); }
.field .hint { display: block; font-weight: 400; font-size: .88rem; color: var(--text-muted); margin-bottom: .35rem; }
input[type="text"], input[type="email"], select, textarea {
  width: 100%;
  padding: .7rem .85rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
}
textarea { min-height: 130px; resize: vertical; }
input[type="text"]:focus-visible, input[type="email"]:focus-visible,
select:focus-visible, textarea:focus-visible { border-color: var(--blue); }


/* ==========================================================================
   10. TYPING TOOL UI
   ========================================================================== */
.tool-shell {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: clamp(1rem, 3.5vw, 1.75rem);
}

.tool-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1.1rem;
}
.tool-toolbar .field { margin: 0; min-width: 150px; }
.tool-toolbar select { padding: .55rem .7rem; }

.typing-status {
  margin-left: auto;
  font-size: .92rem;
  font-weight: 600;
  color: var(--text-muted);
}
.typing-status--live { color: var(--ok); }
.typing-status--done { color: var(--blue-ink); }

.typing-passage {
  display: flex;
  flex-wrap: wrap;
  row-gap: .3em;
  margin: 0 0 1rem;
  padding: clamp(.9rem, 3vw, 1.25rem);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2.7vw, 1.2rem);
  line-height: 1.85;
  user-select: none;
}
.typing-passage .word { white-space: pre; }
.typing-passage .ch { color: var(--text-muted); }
.typing-passage .ch--correct { color: var(--ok); }
.typing-passage .ch--wrong { color: var(--no); background: var(--no-bg); border-radius: 3px; }
.typing-passage .ch--current { position: relative; color: var(--navy); }
.typing-passage .ch--current::after {
  content: "";
  position: absolute;
  left: -1px;
  top: .1em;
  bottom: .1em;
  width: 2px;
  background: var(--blue);
  animation: caretBlink 1.05s steps(1, end) infinite;
}
@keyframes caretBlink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

.typing-input {
  width: 100%;
  min-height: 120px;
  padding: .9rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1.7;
  resize: vertical;
}
.typing-input:disabled { background: var(--bg); color: var(--text-muted); cursor: not-allowed; }

.typing-stats { margin-top: 1.25rem; }

.results-panel {
  margin-top: 1.5rem;
  padding: clamp(1.1rem, 3.5vw, 1.75rem);
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg, var(--lavender-soft), var(--blue-soft));
  border: 1px solid var(--lavender-border);
}
.results-panel h2, .results-panel h3 { color: var(--navy); }
.results-panel__head { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; }
.score-ring {
  display: grid;
  place-items: center;
  width: 108px;
  height: 108px;
  flex: none;
  border-radius: 50%;
  background: conic-gradient(var(--blue) var(--pct, 0%), var(--border) 0);
}
.score-ring__inner {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: #fff;
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--navy);
}
.result-level { font-size: 1.35rem; font-weight: 800; color: var(--navy); }
.result-line { color: var(--text-muted); }


/* ==========================================================================
   11. QUIZ TOOL UI
   ========================================================================== */
.quiz-app { max-width: 820px; margin-inline: auto; }
.quiz-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: clamp(1.1rem, 4vw, 2rem);
}
.quiz-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.1rem;
}
.quiz-progress {
  flex: 1 1 220px;
  height: 10px;
  background: var(--bg-2);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.quiz-progress__bar {
  height: 100%;
  width: 0;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--blue), var(--lavender));
  transition: width .35s ease;
}
.quiz-counter { font-size: .9rem; font-weight: 700; color: var(--text-muted); }

.badge {
  display: inline-block;
  padding: .25rem .7rem;
  border-radius: var(--radius-pill);
  font-size: .78rem;
  font-weight: 700;
  background: var(--lavender-soft);
  color: var(--lavender-ink);
  border: 1px solid var(--lavender-border);
}
.badge--blue { background: var(--blue-soft); color: var(--blue-ink); border-color: #c9dcff; }

.quiz-question { border: 0; margin: 0; padding: 0; }
.quiz-question legend, .quiz-q {
  font-size: clamp(1.08rem, 2.6vw, 1.3rem);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.45;
  padding: 0;
  margin-bottom: 1rem;
}
.quiz-options { display: grid; gap: .6rem; }

.option {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .85rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.option:hover { border-color: var(--blue); background: var(--blue-soft); }
.option input { margin: .3rem 0 0; width: 20px; height: 20px; accent-color: var(--blue); flex: none; }
.option__key {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 8px;
  background: var(--bg-2);
  color: var(--navy);
  font-weight: 700;
  font-size: .9rem;
}
.option__text { flex: 1; }
.option:has(input:checked),
.option--selected { border-color: var(--blue); background: var(--blue-soft); }
.option:has(input:checked) .option__key,
.option--selected .option__key { background: var(--blue); color: #fff; }
.option--correct { border-color: var(--ok-border); background: var(--ok-bg); }
.option--correct .option__key { background: var(--ok); color: #fff; }
.option--wrong { border-color: var(--no-border); background: var(--no-bg); }
.option--wrong .option__key { background: var(--no); color: #fff; }
.option--locked { cursor: default; }
.option--locked:hover { background: inherit; }

.quiz-feedback {
  margin-top: 1rem;
  padding: .9rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--ok-border);
  background: var(--ok-bg);
  color: var(--ok);
  font-weight: 600;
}
.quiz-feedback--wrong { border-color: var(--no-border); background: var(--no-bg); color: var(--no); }
.quiz-feedback p { margin: .4rem 0 0; font-weight: 400; color: var(--text); }

.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.quiz-actions .spacer { flex: 1; }

.quiz-dots { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: 1.25rem; }
.quiz-dots button {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: #fff;
  font-size: .85rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
}
.quiz-dots button:hover { border-color: var(--blue); color: var(--blue-ink); }
.quiz-dots button.is-answered { background: var(--blue-soft); border-color: #c9dcff; color: var(--blue-ink); }
.quiz-dots button[aria-current="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }

/* Review list shown after a test */
.review-list { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 1rem; }
.review-item {
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}
.review-item--right { border-left: 4px solid var(--ok); }
.review-item--wrong { border-left: 4px solid var(--no); }
.review-item__q { font-weight: 700; color: var(--navy); margin: 0 0 .5rem; }
.review-item__meta { margin: 0; font-size: .93rem; color: var(--text-muted); }
.review-item__meta strong { color: var(--text); }
.tag-ok { color: var(--ok); font-weight: 700; }
.tag-no { color: var(--no); font-weight: 700; }

.level-scale { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: .93rem; }
.level-scale th, .level-scale td { padding: .55rem .7rem; border-bottom: 1px solid var(--border); text-align: left; }
.level-scale tr.is-current td { background: var(--blue-soft); font-weight: 700; color: var(--blue-ink); }


/* ==========================================================================
   12. UTILITIES
   ========================================================================== */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: .7rem 1rem;
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; color: #fff; }

.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.75rem; }
.muted { color: var(--text-muted); }
.small { font-size: .9rem; }

.noscript {
  margin: 1rem 0 0;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--warn-border);
  background: var(--warn-bg);
  color: var(--warn-ink);
}

/* Scroll reveal (only when JS is available) */
.js .reveal { opacity: 0; transform: translateY(16px); }
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity .55s ease, transform .55s ease;
}


/* ==========================================================================
   13. RESPONSIVE — mobile styles above, larger screens below
   ========================================================================== */
@media (min-width: 560px) {
  .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__bottom { flex-direction: row; align-items: center; justify-content: space-between; }
}

@media (min-width: 900px) {
  h1 { font-size: clamp(2.4rem, 4vw, 3rem); }
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .footer__grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; }

  /* Desktop navigation */
  .nav-toggle { display: none; }
  .primary-nav {
    position: static;
    display: block !important;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
  }
  .nav-list { display: flex; align-items: center; gap: .15rem; }
  .nav-list > li { position: relative; border: 0; }
  .nav-list a, .nav-link-btn {
    padding: .55rem .8rem;
    border-radius: var(--radius-pill);
    font-size: .96rem;
  }
  .nav-list a[aria-current="page"] { background: var(--blue-soft); }

  .nav-menu {
    display: block;
    position: absolute;
    top: calc(100% + 8px);
    left: -4px;
    min-width: 230px;
    padding: .4rem;
    margin: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
  }
  .nav-menu a { padding: .6rem .75rem; border-radius: var(--radius-sm); color: var(--text); font-weight: 500; }
  .nav-menu.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav-list > li:hover > .nav-menu,
  .nav-list > li:focus-within > .nav-menu { opacity: 1; visibility: visible; transform: none; }
}

@media (min-width: 1100px) {
  .hero__inner { max-width: 760px; }
}


/* ==========================================================================
   14. MOTION PREFERENCES
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}
