/* ============================================================
   A11y.mv — Irshad Qasim · Web Accessibility
   Modern dark theme (and an accessible one)
   ============================================================ */

:root {
  --bg: #0b0c10;
  --bg-soft: #111319;
  --surface: #15171f;
  --surface-2: #1b1e29;
  --border: #262a38;
  --text: #e8eaf0;
  --text-dim: #a7adc0;
  --text-faint: #8f96ad;
  --accent: #64ffda;
  --accent-2: #7c83ff;
  --accent-glow: rgba(100, 255, 218, 0.15);
  --radius: 14px;
  --radius-sm: 8px;
  --maxw: 1080px;
  --nav-h: 72px;
  --font: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.7);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Semantic tokens that shift between dark and light themes.
     --accent stays bright (it fills buttons with dark ink in both themes);
     --accent-ink is the accent used for TEXT, links and focus rings. */
  --accent-ink: #64ffda;
  --bad-ink: #ffb4b4;
  --good-ink: #8af0c8;
  --code-ink: #cdd3e6;
  --nav-bg: rgba(11, 12, 16, 0.8);
  --nav-menu-bg: rgba(11, 12, 16, 0.96);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.accent { color: var(--accent-ink); }

/* ---------- Accessibility helpers ---------- */
/* Visible focus for keyboard users (this is an a11y site — we practise what we preach) */
:focus-visible {
  outline: 3px solid var(--accent-ink);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  background: var(--accent);
  color: #04201a;
  font-weight: 700;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* Screen-reader-only utility */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

kbd {
  font-family: var(--mono);
  font-size: 0.8em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--text);
}

abbr[title] { text-decoration-color: var(--text-faint); cursor: help; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 40px);
}

/* ---------- Background decoration ---------- */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.25;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
}

.bg-glow {
  position: fixed;
  top: -20%;
  left: 50%;
  width: 70vw;
  height: 70vw;
  max-width: 900px;
  max-height: 900px;
  transform: translateX(-50%);
  z-index: -1;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 60%);
  filter: blur(40px);
  pointer-events: none;
}

/* ---------- Navbar ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex;
  align-items: center;
  transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease),
    backdrop-filter 0.3s var(--ease);
}

.nav.scrolled {
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.nav__logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
  transition: transform 0.4s var(--ease);
}
.nav__brand:hover .nav__logo { transform: scale(1.12) rotate(-6deg); }

.nav__links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav__links a:not(.nav__cta) {
  font-size: 0.92rem;
  color: var(--text-dim);
  font-weight: 500;
  position: relative;
  transition: color 0.2s;
}
.nav__links a:not(.nav__cta)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s var(--ease);
}
.nav__links a:not(.nav__cta):hover { color: var(--text); }
.nav__links a:not(.nav__cta):hover::after { width: 100%; }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav__toggle span {
  width: 26px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.nav.open .nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.open .nav__toggle span:nth-child(2) { opacity: 0; }
.nav.open .nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s, box-shadow 0.2s,
    border-color 0.2s, color 0.2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-3px); }
.btn:active { transform: translateY(-1px); }

.btn--primary {
  background: var(--accent);
  color: #04201a;
  box-shadow: 0 8px 24px -8px var(--accent-glow);
}
.btn--primary:hover { box-shadow: 0 14px 30px -8px var(--accent-glow); }

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

.btn--sm { padding: 9px 18px; font-size: 0.85rem; }
.btn--lg { padding: 16px 38px; font-size: 1.05rem; }

/* ---------- Sections ---------- */
.section {
  padding: clamp(72px, 12vh, 130px) 0;
}
.section--center { text-align: center; }

.section__title {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 44px;
}
.section__title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
  max-width: 280px;
}
.section__num {
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 500;
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  padding-top: var(--nav-h);
}
.hero__inner { max-width: 760px; }

.hero__eyebrow {
  font-family: var(--mono);
  color: var(--accent-ink);
  font-size: 0.95rem;
  margin-bottom: 22px;
}

.hero__title {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 24px;
}
.hero__name {
  font-size: clamp(2.8rem, 9vw, 5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, #fff 30%, var(--accent) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__tagline {
  font-size: clamp(1.6rem, 6vw, 3.2rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-dim);
}

.hero__sub {
  max-width: 560px;
  color: var(--text-dim);
  font-size: 1.08rem;
  margin-bottom: 38px;
}

.hero__actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.hero__socials {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.9rem;
}
.hero__socials a { transition: color 0.2s; }
.hero__socials a:hover { color: var(--accent-ink); }
.hero__socials .dot { color: var(--border); }

.hero__scroll {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 42px;
  border: 2px solid var(--text-faint);
  border-radius: 14px;
  display: flex;
  justify-content: center;
  padding-top: 8px;
}
.hero__scroll span {
  width: 4px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent);
  animation: scroll 1.6s var(--ease) infinite;
}
@keyframes scroll {
  0% { opacity: 0; transform: translateY(-4px); }
  40% { opacity: 1; }
  80%, 100% { opacity: 0; transform: translateY(10px); }
}

/* ---------- About ---------- */
.about {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 48px;
  align-items: start;
}
.about__text p { color: var(--text-dim); margin-bottom: 16px; }
.about__text p:first-child { color: var(--text); }

.about__tech {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 20px;
  margin-top: 16px;
}
.about__tech li {
  position: relative;
  padding-left: 22px;
  font-family: var(--mono);
  font-size: 0.88rem;
  color: var(--text-dim);
}
.about__tech li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--accent-ink);
}

.about__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  position: sticky;
  top: 100px;
  box-shadow: var(--shadow);
}
.about__avatar {
  width: 96px;
  height: 96px;
  margin: 0 auto 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 2.4rem;
  font-weight: 800;
  color: #04201a;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 30px -8px var(--accent-glow);
}
.about__stats {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.about__stats > div {
  display: flex;
  flex-direction: column;
}
.about__stats strong {
  font-size: 1.7rem;
  color: var(--accent-ink);
  font-weight: 800;
}
.about__stats span {
  font-size: 0.85rem;
  color: var(--text-faint);
}

/* ---------- Projects ---------- */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s;
}
.card:hover {
  transform: translateY(-8px);
  border-color: var(--accent-ink);
  box-shadow: var(--shadow);
}
.card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
.card__icon {
  font-size: 1.6rem;
  color: var(--accent-ink);
}
.card__links a {
  color: var(--text-dim);
  font-size: 1.3rem;
  transition: color 0.2s, transform 0.2s;
  display: inline-block;
}
.card__links a:hover { color: var(--accent-ink); transform: translate(2px, -2px); }
.card__title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}
.card:hover .card__title { color: var(--accent-ink); }
.card__desc {
  color: var(--text-dim);
  font-size: 0.95rem;
  flex: 1;
  margin-bottom: 22px;
}
.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}
.card__tags li {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-faint);
}

/* ---------- Skills ---------- */
.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}
.skill-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color 0.3s, transform 0.3s var(--ease);
}
.skill-group:hover { border-color: var(--accent-2); transform: translateY(-4px); }
.skill-group h3 {
  font-size: 1.1rem;
  margin-bottom: 18px;
  color: var(--text);
}
.skill-group ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.skill-group li {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 100px;
  transition: color 0.2s, border-color 0.2s;
}
.skill-group li:hover { color: var(--accent-ink); border-color: var(--accent-ink); }

/* ---------- Contact ---------- */
.contact__eyebrow {
  font-family: var(--mono);
  color: var(--accent-ink);
  margin-bottom: 16px;
}
.contact__title {
  font-size: clamp(2.2rem, 7vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}
.contact__text {
  max-width: 540px;
  margin: 0 auto 38px;
  color: var(--text-dim);
  font-size: 1.05rem;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
}
.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-faint);
  font-size: 0.85rem;
  font-family: var(--mono);
}

/* ---------- Back to top ---------- */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--accent-ink);
  font-size: 1.2rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s var(--ease),
    border-color 0.2s;
  z-index: 90;
}
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { border-color: var(--accent-ink); transform: translateY(-4px); }

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .about { grid-template-columns: 1fr; }
  .about__card { position: static; max-width: 380px; }
  .about__stats { flex-direction: row; justify-content: space-around; }
}

@media (max-width: 680px) {
  .nav__toggle { display: flex; }
  .nav__links {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    flex-direction: column;
    gap: 22px;
    padding: 32px 24px 40px;
    background: var(--nav-menu-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%);
    transition: transform 0.35s var(--ease);
  }
  .nav.open .nav__links { transform: translateY(0); }
  .nav__links a:not(.nav__cta) { font-size: 1.05rem; }
  .nav__cta { width: 100%; }
  .hero__actions { width: 100%; }
  .hero__actions .btn { flex: 1; }
}

/* ============================================================
   Section lead text
   ============================================================ */
.section__lead {
  color: var(--text-dim);
  font-size: 1.05rem;
  max-width: 620px;
  margin: -28px 0 36px;
}

/* ============================================================
   Homepage — Training callout
   ============================================================ */
.callout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
  align-items: center;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(28px, 5vw, 52px);
  box-shadow: var(--shadow);
}
.callout__eyebrow {
  font-family: var(--mono);
  color: var(--accent-ink);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.callout__title {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.callout__text p { color: var(--text-dim); margin-bottom: 22px; }
.callout__list {
  display: grid;
  gap: 12px;
}
.callout__list li {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 500;
}

/* ============================================================
   Resource cards (homepage + training)
   ============================================================ */
.resources {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.resource {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.25s var(--ease), border-color 0.25s;
}
a.resource:hover { transform: translateY(-5px); border-color: var(--accent-ink); }
.resource h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
a.resource:hover h3 { color: var(--accent-ink); }
.resource p { color: var(--text-dim); font-size: 0.92rem; }
.resource--static { cursor: default; }

/* ============================================================
   Training page
   ============================================================ */
.t-hero {
  padding-top: calc(var(--nav-h) + clamp(40px, 8vh, 80px));
  padding-bottom: clamp(40px, 6vh, 64px);
}
.t-hero__title {
  font-size: clamp(2.2rem, 7vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: 20px;
  max-width: 14ch;
  background: linear-gradient(120deg, #fff 30%, var(--accent) 130%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.t-hero__sub {
  max-width: 640px;
  color: var(--text-dim);
  font-size: 1.08rem;
  margin-bottom: 32px;
}

/* Legend */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
  padding: 18px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 28px;
}
.legend__item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--text-dim);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge--bad {
  color: var(--bad-ink);
  background: rgba(255, 90, 90, 0.12);
  border-color: rgba(255, 90, 90, 0.4);
}
.badge--good {
  color: var(--good-ink);
  background: rgba(80, 230, 160, 0.12);
  border-color: rgba(80, 230, 160, 0.4);
}

/* Jump nav */
.lesson-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.lesson-jump a {
  font-size: 0.85rem;
  font-family: var(--mono);
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 100px;
  transition: color 0.2s, border-color 0.2s;
}
.lesson-jump a:hover { color: var(--accent-ink); border-color: var(--accent-ink); }

/* Lesson */
.lesson { padding: clamp(48px, 8vh, 80px) 0; }
.lesson:nth-of-type(even) { background: rgba(255, 255, 255, 0.012); }
.lesson__head {
  display: flex;
  gap: 20px;
  margin-bottom: 32px;
  align-items: flex-start;
}
.lesson__num {
  font-family: var(--mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--surface);
  border: 1px solid var(--border);
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
/* On phones, put the lesson number above the title so the heading and
   explanation get the full line width instead of a narrow column. */
@media (max-width: 560px) {
  .lesson__head { flex-direction: column; gap: 12px; }
  .lesson__num { width: 44px; height: 44px; font-size: 1.2rem; }
}
.lesson__head h2 {
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.lesson__lead { color: var(--text-dim); margin-bottom: 12px; max-width: 70ch; }
.wcag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent-2);
  background: rgba(124, 131, 255, 0.1);
  border: 1px solid rgba(124, 131, 255, 0.3);
  padding: 4px 10px;
  border-radius: 6px;
}

/* Demo grid */
.demo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.demo {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  border-top: 3px solid var(--border);
}
.demo--bad { border-top-color: #e05a5a; }
.demo--good { border-top-color: #50e6a0; }
.demo__label { margin-bottom: 12px; }
.demo__hint {
  font-size: 0.88rem;
  color: var(--text-faint);
  margin-bottom: 16px;
}
.demo__stage {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  min-height: 92px;
  margin-bottom: 16px;
}
.demo__why {
  font-size: 0.9rem;
  color: var(--text-dim);
}
.demo__why code, .lesson__lead code, .demo__hint code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 5px;
  color: var(--accent-ink);
}

/* Demo buttons */
.d-btn {
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #04201a;
  border: 1px solid var(--accent);
  cursor: pointer;
}
.d-btn:hover { filter: brightness(1.06); }
/* The "bad" no-ring buttons deliberately remove focus styling */
.d-btn--noring { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.demo__stage--noring .d-btn--noring:focus,
.demo__stage--noring .d-btn--noring:focus-visible { outline: none; }
/* The fake div-button: looks the part, but no real semantics */
.d-btn--fake {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
  user-select: none;
}

.counter { font-family: var(--mono); font-size: 0.9rem; color: var(--text-dim); }
.counter span { color: var(--accent-ink); font-weight: 600; }

/* Demo forms */
.d-form { display: grid; gap: 14px; }
.d-input {
  font-family: var(--font);
  font-size: 0.95rem;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  width: 100%;
}
.d-input::placeholder { color: var(--text-faint); }
.d-input:focus-visible { border-color: var(--accent-ink); }
.d-input.is-bad-error { border-color: #e05a5a; background: rgba(224, 90, 90, 0.08); }
.d-input.is-error { border-color: #e05a5a; }

.field { display: grid; gap: 6px; }
.field label { font-size: 0.88rem; font-weight: 600; }
.field__err {
  font-size: 0.83rem;
  color: var(--bad-ink);
  min-height: 1em;
}
.field__err:not(:empty)::before { content: "⚠ "; }
.field__ok { color: var(--good-ink); font-size: 0.9rem; font-weight: 600; margin-top: 4px; }

.d-error-summary {
  background: rgba(224, 90, 90, 0.1);
  border: 1px solid rgba(224, 90, 90, 0.5);
  border-left-width: 4px;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.9rem;
}
.d-error-summary[hidden] { display: none; }
.d-error-summary strong { color: #ffd0d0; display: block; margin-bottom: 8px; }
.d-error-summary ul { padding-left: 18px; list-style: disc; }
.d-error-summary a { color: var(--bad-ink); text-decoration: underline; }

/* Contrast demo */
.contrast-card {
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
.contrast-card--bad { background: #8e8e8e; border-color: #8e8e8e; }
.contrast-card--good { background: #f4f4f0; border-color: #f4f4f0; }
.contrast-text { font-size: 1rem; font-weight: 500; margin: 0; }
.contrast-text--bad { color: #a3a3a3; }
.contrast-text--good { color: #1a1a1a; }
.ratio {
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 3px 8px;
  border-radius: 5px;
}
.ratio--bad { background: rgba(0,0,0,0.25); color: #2a2a2a; }
.ratio--good { background: rgba(0,0,0,0.08); color: #1a1a1a; }

/* Images / alt-text demo */
.img-demo { flex-direction: column; align-items: flex-start; gap: 14px; }
.img-thumb {
  width: 64px; height: 64px;
  display: grid; place-items: center;
  font-size: 2rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.sr-hears { font-size: 0.9rem; color: var(--text-dim); }
.sr-hears q { font-family: var(--mono); font-style: normal; display: inline-block; margin-top: 4px; }
.sr-bad { color: var(--bad-ink); }
.sr-good { color: var(--good-ink); }

/* Touch target demo */
.touch-row { gap: 0; }
.demo--good .touch-row { gap: 12px; }
.t-target {
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  width: 44px; height: 44px;
  font-size: 1.1rem;
}
.t-target--tiny { width: 22px; height: 22px; font-size: 0.7rem; border-radius: 4px; }
.t-target:hover { border-color: var(--accent-ink); }

/* Training CTA */
.t-cta {
  margin-top: 44px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 24px;
}
.t-cta p { color: var(--text-dim); margin-bottom: 20px; font-size: 1.05rem; }

/* Training responsive */
@media (max-width: 760px) {
  .callout { grid-template-columns: 1fr; }
  .demo-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Training — lessons 7–10
   ============================================================ */

/* Link text demo */
.link-list { display: grid; gap: 10px; width: 100%; }
.link-list a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-size: 0.95rem;
}
.demo--bad .link-list a { color: var(--text-dim); }

/* Heading structure demo */
.outline { width: 100%; display: grid; gap: 8px; }
.fake-h { font-weight: 700; color: var(--text); margin: 0; }
.fake-h--1 { font-size: 1.2rem; }
.fake-h--3 { font-size: 1rem; padding-left: 16px; }
.real-h {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.real-h--1 { font-size: 1.2rem; }
.real-h--2 { font-size: 1rem; padding-left: 16px; }
.lvl {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-2);
  background: rgba(124, 131, 255, 0.12);
  border: 1px solid rgba(124, 131, 255, 0.3);
  border-radius: 5px;
  padding: 1px 6px;
}

/* Bad (fake) dialog — intentionally does not trap focus */
.fake-dialog {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.6);
  padding: 20px;
}
.fake-dialog[hidden] { display: none; }
.fake-dialog__panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 360px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
}
.fake-dialog__title { font-size: 1.2rem; font-weight: 700; margin: 0; }
.fake-dialog__panel p { color: var(--text-dim); font-size: 0.95rem; margin: 0; }

/* Good (native) dialog */
.real-dialog {
  width: min(400px, calc(100vw - 40px));
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.real-dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.real-dialog p { color: var(--text-dim); font-size: 0.95rem; margin: 10px 0 20px; }
.real-dialog__actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ============================================================
   Blog — listing
   ============================================================ */
.post-list {
  display: grid;
  gap: 22px;
  max-width: 760px;
}
.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s;
}
.post-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-ink);
  box-shadow: var(--shadow);
}
.post-card__link {
  display: block;
  padding: 28px;
}
.post-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-bottom: 12px;
}
.post-card__title {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  line-height: 1.25;
}
.post-card:hover .post-card__title { color: var(--accent-ink); }
.post-card__excerpt { color: var(--text-dim); font-size: 0.97rem; margin-bottom: 16px; }
.post-card__excerpt code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 5px;
  color: var(--accent-ink);
}
.post-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.post-card__tags li {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 100px;
}
.post-card__more {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-ink);
}

/* ============================================================
   Blog — article
   ============================================================ */
.article { padding: calc(var(--nav-h) + clamp(36px, 7vh, 70px)) 0 clamp(48px, 8vh, 90px); }
.article__container { max-width: 720px; }

.article__back {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 20px;
}
.article__back:hover { color: var(--accent-ink); }

.article__header { margin-bottom: 36px; }
.article__header h1 {
  font-size: clamp(1.9rem, 5.5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 14px 0 18px;
}
.article__lead {
  font-size: 1.15rem;
  color: var(--text-dim);
  line-height: 1.6;
}
.article__lead code, .post-card__title code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 5px;
  color: var(--accent-ink);
}

/* Prose typography */
.prose { font-size: 1.05rem; color: var(--text-dim); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-top: 2em;
  margin-bottom: 0.2em;
}
.prose h3 {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 1.6em;
  margin-bottom: 0.1em;
}
.prose p { line-height: 1.75; }
.prose strong { color: var(--text); }
.prose a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.prose a:hover { text-decoration-thickness: 2px; }
.prose ul { list-style: disc; padding-left: 1.4em; }
.prose li { margin-top: 0.5em; line-height: 1.7; }
.prose code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 5px;
  color: var(--accent-ink);
}
.prose pre {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.6;
}
.prose pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--code-ink);
  font-size: inherit;
}
.prose q { font-style: italic; color: var(--text); }

.prose__callout {
  background: linear-gradient(135deg, rgba(100,255,218,0.06), rgba(124,131,255,0.06));
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-top: 1.6em;
}
.prose__callout p { margin: 0; font-size: 0.97rem; }

/* Article footer */
.article__footer {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.article__byline {
  font-family: var(--mono);
  font-size: 0.88rem;
  color: var(--text-faint);
  margin-bottom: 20px;
}
.article__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  font-size: 0.92rem;
  font-weight: 600;
}
.article__nav a { color: var(--accent-ink); }
.article__nav a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* Current page indicator in nav */
.nav__links a[aria-current="page"] { color: var(--accent-ink); }

/* ============================================================
   Contact — actions, direct email, copy status
   ============================================================ */
.contact__actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 20px;
}
.contact__direct {
  color: var(--text-dim);
  font-size: 0.98rem;
}
.contact__direct a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-family: var(--mono);
  font-size: 0.95em;
}
.contact__status {
  min-height: 1.4em;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent-ink);
}

/* Inline note inside prose (e.g. legal disclaimer) */
.prose__note {
  font-size: 0.92rem;
  color: var(--text-faint);
  border-left: 3px solid var(--border);
  padding-left: 14px;
}

/* ============================================================
   Footer links + accessibility statement page
   ============================================================ */
.footer__links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.footer__links a {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-dim);
  transition: color 0.2s;
}
.footer__links a:hover { color: var(--accent-ink); }
.footer__links a[aria-current="page"] { color: var(--accent-ink); }

.statement__contact {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 1.2em;
}
.statement__direct {
  font-size: 0.95rem;
  color: var(--text-dim);
}
.statement__direct a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-family: var(--mono);
  font-size: 0.92em;
}

/* ============================================================
   Featured blog card
   ============================================================ */
.post-card--featured {
  border-color: var(--accent-ink);
  background: linear-gradient(135deg, rgba(100,255,218,0.07), rgba(124,131,255,0.05));
}
.post-card--featured .post-card__title { font-size: clamp(1.4rem, 3.5vw, 1.75rem); }

/* ============================================================
   Homepage services CTA
   ============================================================ */
.services-cta { margin-top: 32px; }

/* ============================================================
   Services page
   ============================================================ */
.svc-list {
  display: grid;
  gap: 22px;
}
.svc {
  display: flex;
  gap: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: border-color 0.25s, transform 0.25s var(--ease);
}
.svc:hover { border-color: var(--accent-ink); transform: translateY(-3px); }
.svc__icon {
  font-size: 2rem;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.svc__body h3 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.svc__body > p { color: var(--text-dim); margin-bottom: 16px; }
.svc__points { display: grid; gap: 9px; }
.svc__points li {
  position: relative;
  padding-left: 26px;
  color: var(--text-dim);
  font-size: 0.95rem;
}
.svc__points li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: -1px;
  color: var(--accent-ink);
  font-weight: 700;
}
.svc__points a, .svc__body a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Process steps */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  counter-reset: step;
}
.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
}
.step__num {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent);
  color: #04201a;
  font-weight: 800;
  font-family: var(--mono);
  margin-bottom: 16px;
}
.step h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 8px; }
.step p { color: var(--text-dim); font-size: 0.93rem; }

@media (max-width: 620px) {
  .svc { flex-direction: column; gap: 16px; }
}

/* ============================================================
   Blog category filter
   ============================================================ */
.filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.filter__label {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-faint);
  margin-right: 4px;
}
.filter__chip {
  font-family: var(--mono);
  font-size: 0.84rem;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 100px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.filter__chip:hover { color: var(--accent-ink); border-color: var(--accent-ink); }
.filter__chip[aria-pressed="true"] {
  color: #04201a;
  background: var(--accent);
  border-color: var(--accent-ink);
  font-weight: 600;
}

/* ============================================================
   RTI page
   ============================================================ */
.rti-list { display: grid; gap: 20px; }
.rti {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-left: 3px solid var(--accent-2);
  padding: 26px 28px;
}
.rti__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.rti__title { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; }
.rti__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  padding: 14px 0;
  margin-bottom: 14px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.rti__meta div { display: flex; flex-direction: column; gap: 2px; }
.rti__meta dt {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}
.rti__meta dd { font-size: 0.92rem; color: var(--text); }
.rti__ask, .rti__outcome {
  font-size: 0.95rem;
  color: var(--text-dim);
  margin-top: 8px;
}
.rti__ask strong, .rti__outcome strong { color: var(--text); }

/* Status badges (extends .badge) */
.badge--pending {
  color: #ffd9a0;
  background: rgba(255, 184, 80, 0.12);
  border-color: rgba(255, 184, 80, 0.4);
}
.badge--partial {
  color: #c9b6ff;
  background: rgba(124, 131, 255, 0.14);
  border-color: rgba(124, 131, 255, 0.42);
}

/* ============================================================
   Additions: numbered prose steps, comparison tables,
   and the interactive colour-contrast checker
   ============================================================ */

/* Ordered steps inside articles */
.prose ol { list-style: decimal; padding-left: 1.4em; }
.prose ol li { margin-top: 0.5em; line-height: 1.7; }
.prose ol li::marker { color: var(--accent-ink); font-family: var(--mono); font-weight: 600; }

/* Responsive comparison table */
.cmp-table { overflow-x: auto; margin-top: 1.4em; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.cmp-table table { width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 620px; }
.cmp-table th, .cmp-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.cmp-table thead th {
  font-family: var(--mono);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  background: var(--bg-soft);
}
.cmp-table tbody tr:last-child td { border-bottom: none; }
.cmp-table td:first-child { color: var(--text); font-weight: 600; }
.cmp-table .yes { color: var(--accent-ink); }
.cmp-table .no { color: var(--bad-ink); }

/* Colour-contrast checker widget */
.cc { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 10px; }
.cc__controls { display: grid; gap: 16px; align-content: start; }
.cc__row { display: flex; align-items: center; gap: 12px; }
.cc__row label { min-width: 110px; font-weight: 600; color: var(--text); font-size: 0.95rem; }
.cc__swatch {
  inline-size: 44px; block-size: 34px; padding: 0;
  border: 1px solid var(--border); border-radius: 8px; background: none; cursor: pointer;
}
.cc__hex {
  width: 108px; font-family: var(--mono); font-size: 0.9rem;
  background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px;
}
.cc__preview {
  border-radius: var(--radius); border: 1px solid var(--border);
  padding: 22px; display: grid; gap: 10px; place-content: center; text-align: center; min-height: 150px;
}
.cc__preview .cc__big { font-size: 1.5rem; font-weight: 800; }
.cc__preview .cc__small { font-size: 0.95rem; }
.cc__ratio { margin-top: 20px; text-align: center; }
.cc__ratio .cc__num { font-size: 2.4rem; font-weight: 800; font-family: var(--mono); letter-spacing: -0.02em; }
.cc__ratio .cc__num-label { display: block; font-size: 0.8rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }
.cc__results { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
.cc__result { display: inline-flex; align-items: center; gap: 8px; font-size: 0.86rem; color: var(--text-dim); }

@media (max-width: 620px) {
  .cc { grid-template-columns: 1fr; }
  .cc__row label { min-width: 92px; }
}

/* Contrast checker example presets */
.cc__hint { font-size: 0.82rem; color: var(--bad-ink); margin: 2px 0 0; min-height: 1.05em; }
#cc-swap { align-self: start; margin-top: 2px; }
.cc__examples { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); }
.cc__examples-label { font-size: 0.88rem; color: var(--text-faint); margin-right: 4px; }
.cc__examples .filter__chip { font-size: 0.8rem; padding: 7px 13px; }

/* ============================================================
   Criteria list (the 16-point checklist page): each item shows
   an inaccessible and an accessible example, side by side.
   ============================================================ */
.crit-list { display: grid; gap: 18px; margin-top: 10px; }
.crit {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 24px 26px;
}
.crit__head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-bottom: 4px; }
.crit__id {
  font-family: var(--mono);
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--accent-ink);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 4px 9px;
}
.crit__title { font-size: 1.14rem; font-weight: 700; color: var(--text); }
.crit__lead { color: var(--text-dim); font-size: 0.95rem; margin: 8px 0 16px; line-height: 1.6; }
.crit__ex { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.crit__cell { border-radius: var(--radius-sm); padding: 14px 16px; border: 1px solid var(--border); }
.crit__cell--bad { background: rgba(255, 99, 122, 0.05); border-color: rgba(255, 99, 122, 0.28); }
.crit__cell--good { background: rgba(100, 255, 218, 0.05); border-color: rgba(100, 255, 218, 0.28); }
.crit__cell .badge { margin-bottom: 10px; }
.crit__cell p { color: var(--text-dim); font-size: 0.92rem; line-height: 1.6; }
.crit__cell strong { color: var(--text); }
.crit__cell code, .crit__cell .mono {
  font-family: var(--mono);
  font-size: 0.84em;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 5px;
  color: var(--text);
  word-break: break-word;
}
.crit__wcag { display: inline-block; margin-top: 14px; font-family: var(--mono); font-size: 0.78rem; color: var(--text-faint); }
.crit__wcag a { color: var(--accent-ink); }
@media (max-width: 640px) { .crit__ex { grid-template-columns: 1fr; } }

/* ============================================================
   Theme toggle button (in the navbar)
   ============================================================ */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  font-size: 1.02rem;
  line-height: 1;
  margin-left: 6px;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), background 0.2s;
}
.theme-toggle:hover { border-color: var(--accent-ink); transform: translateY(-2px); }
.theme-toggle__icon { display: block; }

/* ============================================================
   Light theme — set on <html data-theme="light"> by the inline
   head script (from the saved choice, or the system preference).
   --accent stays bright so button ink stays readable; --accent-ink
   darkens so accent text, links and focus rings keep 4.5:1+ on light.
   ============================================================ */
:root[data-theme="light"] {
  --bg: #f6f8fc;
  --bg-soft: #eceff6;
  --surface: #ffffff;
  --surface-2: #f1f4fa;
  --border: #d7dde8;
  --text: #12141c;
  --text-dim: #454b5e;
  --text-faint: #656c80;
  --accent-ink: #0f766e;
  --accent-2: #4f46e5;
  --accent-glow: rgba(15, 118, 110, 0.16);
  --bad-ink: #b42318;
  --good-ink: #077a48;
  --code-ink: #2b3040;
  --nav-bg: rgba(246, 248, 252, 0.82);
  --nav-menu-bg: rgba(246, 248, 252, 0.97);
  --shadow: 0 18px 40px -22px rgba(20, 30, 60, 0.28);
}
/* Softer background glow on light so it doesn't wash out */
:root[data-theme="light"] .bg-grid { opacity: 0.5; }
:root[data-theme="light"] .bg-glow { opacity: 0.5; }

/* ============================================================
   FAQ accordion (native <details>)
   ============================================================ */
.faq { display: grid; gap: 12px; margin-top: 12px; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 22px;
  transition: border-color 0.2s;
}
.faq details[open] { border-color: var(--accent-ink); }
.faq summary {
  cursor: pointer;
  padding: 18px 0;
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: var(--mono);
  color: var(--accent-ink);
  font-size: 1.4rem;
  line-height: 1;
  transition: transform 0.2s var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > p {
  color: var(--text-dim);
  padding: 0 0 20px;
  margin: 0;
  line-height: 1.75;
  max-width: 68ch;
}
.faq details > p + p { padding-top: 0; margin-top: -8px; }
.faq a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }

/* ============================================================
   Mock social-post card — makes the do/don't examples look like
   the real thing (avatar, handle, body, reactions).
   ============================================================ */
.post {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 15px 17px 13px;
  text-align: left;
  box-shadow: var(--shadow);
  max-width: 360px;
  margin: 0 auto;
}
.post__head { display: flex; align-items: center; gap: 11px; margin-bottom: 11px; }
.post__avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 1.2rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.post__id { line-height: 1.3; min-width: 0; }
.post__name { font-weight: 700; color: var(--text); font-size: 0.95rem; display: flex; align-items: center; gap: 5px; }
.post__tick { color: var(--accent-ink); font-size: 0.82rem; }
.post__handle { color: var(--text-faint); font-size: 0.82rem; }
.post__body { color: var(--text); font-size: 0.96rem; line-height: 1.55; word-break: break-word; }
.post__body .tag { color: var(--accent-ink); font-weight: 500; }
.post__img {
  margin-top: 12px; border-radius: 11px; border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--surface-2), var(--bg-soft));
  aspect-ratio: 16 / 10; display: grid; place-items: center; font-size: 2.7rem;
}
.post__actions {
  display: flex; gap: 22px; margin-top: 13px; padding-top: 11px;
  border-top: 1px solid var(--border); color: var(--text-faint); font-size: 0.85rem;
}
.post__actions span { display: inline-flex; align-items: center; gap: 6px; }
.demo .post + .sr-hears, .lesson .post + .sr-hears { margin-top: 14px; }

/* ============================================================
   Code comparison (developer page): inaccessible vs accessible
   markup, side by side, with a copy button on each block.
   ============================================================ */
.code-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 6px; }
.code__label { margin-bottom: 2px; }
.code__why { color: var(--text-dim); font-size: 0.92rem; line-height: 1.6; margin-top: 12px; }
.code__why code, .prose--dev code { font-family: var(--mono); font-size: 0.86em; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 5px; border-radius: 5px; color: var(--accent-ink); }
.code__pre { position: relative; }
.code pre {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-top: 10px;
  overflow-x: auto;
}
.code--bad pre { border-color: rgba(255, 99, 122, 0.32); }
.code--good pre { border-color: rgba(100, 255, 218, 0.32); }
.code pre code {
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.7;
  color: var(--code-ink);
  white-space: pre;
  display: block;
}
.code .tok { color: var(--accent-ink); }   /* the key accessible bit */
.code .cmt { color: var(--text-faint); font-style: italic; }
.code__copy {
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.code__copy:hover, .code__copy:focus-visible { color: var(--accent-ink); border-color: var(--accent-ink); }
@media (max-width: 760px) { .code-compare { grid-template-columns: 1fr; } }

/* Small live-region demo on the developer page */
.live-demo { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 14px; }
.live-demo__out { font-weight: 600; color: var(--accent-ink); min-height: 1.4em; }

/* "Show the code" disclosure under each lesson demo */
.show-code { margin-top: 24px; border-top: 1px dashed var(--border); padding-top: 16px; }
.show-code > summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-ink);
}
.show-code > summary::-webkit-details-marker { display: none; }
.show-code > summary::before { content: "›"; font-size: 1.1rem; line-height: 1; transition: transform 0.2s var(--ease); }
.show-code[open] > summary::before { transform: rotate(90deg); }
.show-code .code-compare { margin-top: 16px; }

/* ============================================================
   Live component demos (ARIA APG patterns) on the dev page
   ============================================================ */
.widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-top: 4px;
}
/* Tabs */
.tabs__list { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); }
.tabs__tab {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-dim);
  cursor: pointer;
}
.tabs__tab:hover { color: var(--text); }
.tabs__tab[aria-selected="true"] { color: var(--accent-ink); border-bottom-color: var(--accent-ink); }
.tabs__panel { padding-top: 16px; color: var(--text-dim); line-height: 1.65; }
.tabs__panel[hidden] { display: none; }
/* Disclosure */
.disclosure__region { margin-top: 12px; color: var(--text-dim); line-height: 1.65; border-left: 2px solid var(--border); padding-left: 14px; }
.disclosure__region[hidden] { display: none; }
/* Tooltip */
.tip-wrap { position: relative; display: inline-block; }
.tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 240px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.85rem;
  line-height: 1.45;
  box-shadow: var(--shadow);
  z-index: 5;
}
.tooltip[hidden] { display: none; }
.dev-subhead { font-size: 1.2rem; font-weight: 700; color: var(--text); margin: 36px 0 6px; }

/* Accordion */
.accordion__item { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; overflow: hidden; }
.accordion__title { margin: 0; }
.accordion__btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: none;
  border: 0;
  padding: 14px 16px;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.accordion__btn::after { content: "+"; font-family: var(--mono); color: var(--accent-ink); font-size: 1.25rem; line-height: 1; }
.accordion__btn[aria-expanded="true"]::after { content: "–"; }
.accordion__panel { padding: 0 16px 16px; color: var(--text-dim); line-height: 1.65; }
.accordion__panel[hidden] { display: none; }

/* Switch */
.switch { display: inline-flex; align-items: center; gap: 12px; background: none; border: 0; padding: 4px; font: inherit; font-weight: 600; color: var(--text); cursor: pointer; }
.switch__track { position: relative; width: 46px; height: 26px; border-radius: 100px; background: var(--surface-2); border: 1px solid var(--border); transition: background 0.2s var(--ease); flex: none; }
.switch__thumb { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--text-faint); transition: transform 0.2s var(--ease), background 0.2s; }
.switch[aria-checked="true"] .switch__track { background: var(--accent); border-color: var(--accent); }
.switch[aria-checked="true"] .switch__thumb { transform: translateX(20px); background: #04201a; }

/* Combobox (editable autocomplete) */
.combo { position: relative; max-width: 340px; }
.combo__input {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.combo__list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 6;
  max-height: 220px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 4px;
}
.combo__list[hidden] { display: none; }
.combo__option { padding: 9px 12px; border-radius: 7px; cursor: pointer; color: var(--text-dim); }
.combo__option[aria-selected="true"], .combo__option:hover { background: var(--surface-2); color: var(--text); }
.combo__empty { padding: 9px 12px; color: var(--text-faint); font-size: 0.9rem; }

/* Menu button (ARIA APG) */
.menu-wrap { position: relative; display: inline-block; }
.menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 190px;
  list-style: none;
  margin: 0;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 6;
}
.menu[hidden] { display: none; }
.menu__item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 9px 12px;
  border-radius: 7px;
  font: inherit;
  color: var(--text-dim);
  cursor: pointer;
}
.menu__item:hover, .menu__item:focus-visible { background: var(--surface-2); color: var(--text); }

/* ============================================================
   Breadcrumbs
   ============================================================ */
.crumbs { margin-bottom: 22px; }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; list-style: none; font-family: var(--mono); font-size: 0.82rem; }
.crumbs li { display: inline-flex; align-items: center; gap: 7px; }
.crumbs li + li::before { content: "›"; color: var(--text-faint); }
.crumbs a { color: var(--accent-ink); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; text-underline-offset: 2px; }
.crumbs [aria-current="page"] { color: var(--text-dim); }

/* ============================================================
   Quiz — "spot the issue" knowledge check
   ============================================================ */
.quiz { display: grid; gap: 18px; margin-top: 10px; }
.quiz__q {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 0;
}
.quiz__q legend { font-weight: 700; font-size: 1.06rem; color: var(--text); padding: 0; }
.quiz__q legend code { font-family: var(--mono); font-size: 0.86em; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 5px; border-radius: 5px; color: var(--accent-ink); }
.quiz__opts { display: grid; gap: 10px; margin-top: 14px; }
.quiz__opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; color: var(--text-dim); }
.quiz__opt:hover { border-color: var(--accent-ink); }
.quiz__opt input { margin-top: 3px; flex: none; }
.quiz__opt code { font-family: var(--mono); font-size: 0.86em; color: var(--text); }
.quiz__q[data-answered] .quiz__opt { cursor: default; }
.quiz__q[data-answered="correct"] { border-color: rgba(100, 255, 218, 0.45); }
.quiz__q[data-answered="wrong"] { border-color: rgba(255, 99, 122, 0.45); }
.quiz__fb { margin-top: 14px; font-size: 0.95rem; line-height: 1.6; }
.quiz__fb:empty { display: none; }
.quiz__fb--correct { color: var(--good-ink); }
.quiz__fb--wrong { color: var(--bad-ink); }
.quiz__score { font-family: var(--mono); color: var(--accent-ink); font-weight: 600; }

/* ============================================================
   Inline links in running text are underlined so they don't rely
   on colour alone (the reset strips underlines globally).
   ============================================================ */
.lesson__lead a, .section__lead a, .t-hero__sub a, .demo__why a, .crit__lead a,
.wcag a, .crit__wcag a, .callout__text a, .article__lead a, .sr-hears a,
.resource__links a {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.resource__links { margin-top: 10px; font-weight: 600; }
.resource__links a { color: var(--accent-ink); }
