:root {
  --bg: #f3f1eb;
  --paper: #fbfaf7;
  --ink: #173036;
  --ink2: #34494d;
  --muted: #697476;
  --green: #0e4d43;
  --teal: #376b64;
  --teal-soft: #dce7e2;
  --blue: #1e3f5f;
  --line: #d7d3ca;
  --shadow: 0 16px 42px rgba(23, 48, 54, .08);
  --shadow2: 0 22px 52px rgba(23, 48, 54, .12);
  --site: 1440px;
  --read: 800px;
}

* {
  box-sizing: border-box;
  min-width: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

::selection {
  background: var(--teal-soft);
}

:focus-visible {
  outline: 3px solid rgba(55, 107, 100, .72);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: .75rem;
  z-index: 300;
  padding: .7rem 1rem;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  transform: translateY(-180%);
  transition: transform .16s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 245, 239, .94);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(23, 48, 54, .1);
}

.header-inner {
  width: min(calc(100% - 32px), var(--site));
  min-height: 68px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex: 0 0 auto;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  width: 26px;
  height: 36px;
  flex: 0 0 26px;
}

.brand-mark::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 1px;
  width: 17px;
  height: 11px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 10px 0 #365f58, 0 20px 0 #8d958c;
  transform: translateX(-50%);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.wordmark {
  font-family: "Noto Serif", Georgia, serif;
  font-size: 1.68rem;
  font-weight: 700;
  letter-spacing: -.035em;
}

.brand-copy small {
  margin-top: .25rem;
  color: var(--muted);
  font-size: .65rem;
  white-space: nowrap;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.desktop-nav a {
  position: relative;
  padding: .48rem .62rem;
  color: #31464a;
  font-size: .84rem;
  text-decoration: none;
  white-space: nowrap;
}

.desktop-nav a::after {
  content: "";
  position: absolute;
  left: .62rem;
  right: .62rem;
  bottom: .18rem;
  height: 2px;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .18s ease;
}

.desktop-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.mobile-nav {
  display: none;
}

.container,
.lesson-shell {
  width: min(calc(100% - 32px), var(--site));
  margin-inline: auto;
}

/* Hero family: site-specific to Ehtimol. */
.home-hero-wrap {
  padding-top: 18px;
}

.home-hero,
.lesson-hero {
  display: grid;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid rgba(23, 48, 54, .11);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.home-hero {
  width: min(calc(100% - 32px), var(--site));
  margin-inline: auto;
}

.container > .lesson-hero {
  width: 100%;
  margin-inline: 0;
}

.hero-copy,
.lesson-hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  background: var(--paper);
}

.hero-copy::after,
.lesson-hero-copy::after {
  content: "";
  position: absolute;
  top: 0;
  right: -18px;
  bottom: 0;
  width: 18px;
  background: linear-gradient(90deg, var(--paper), rgba(251, 250, 247, 0));
  pointer-events: none;
}

.hero-media,
.lesson-visual {
  position: relative;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  background: #e7e5dd;
}

.hero-media img,
.lesson-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  filter: saturate(.9) contrast(1.01) brightness(1.025);
}

.home-hero .hero-media img {
  object-position: 58% 50%;
}

.hero-probability .lesson-visual img {
  object-position: 58% center;
}

.hero-overround .lesson-visual img {
  object-position: 62% center;
}

.lesson-visual.formula-visual,
.about-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px;
  background: radial-gradient(circle at 70% 28%, rgba(55, 107, 100, .20) 0 12%, transparent 13%), radial-gradient(circle at 82% 72%, rgba(30, 63, 95, .15) 0 16%, transparent 17%), linear-gradient(135deg, #e7e5de, #dfe5e1);
}

.formula-card {
  position: relative;
  z-index: 2;
  width: min(78%, 460px);
  padding: 1.35rem 1.55rem;
  border: 1px solid rgba(23, 48, 54, .16);
  border-radius: 14px;
  background: rgba(251, 250, 247, .94);
  box-shadow: 0 14px 34px rgba(23, 48, 54, .08);
  text-align: center;
}

.formula-card strong {
  display: block;
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 2.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.12;
  text-wrap: balance;
}

.formula-card span {
  display: block;
  margin-top: .45rem;
  color: var(--muted);
  font-size: .82rem;
}

.about-visual::before,
.about-visual::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.about-visual::before {
  top: 15%;
  right: 15%;
  width: min(38%, 220px);
  aspect-ratio: 1;
  background: #d5dfda;
  box-shadow: -110px 135px 0 -55px #1e3f5f;
}

.about-visual::after {
  right: 29%;
  bottom: 14%;
  width: min(22%, 120px);
  aspect-ratio: 1;
  background: #376b64;
}

.home-hero h1,
.lesson-hero h1 {
  margin: .7rem 0 1rem;
  overflow-wrap: break-word;
  font-family: "Noto Serif", Georgia, serif;
  letter-spacing: -.035em;
  line-height: 1.05;
  text-wrap: pretty;
}

.hero-copy > p,
.lesson-deck {
  margin: .48rem 0;
  color: var(--ink2);
}

.eyebrow,
.lesson-index {
  color: var(--teal);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 1.15rem;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .68rem 1rem;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease;
}

.primary-action {
  background: var(--green);
  box-shadow: 0 8px 18px rgba(14, 77, 67, .17);
  color: #fff;
}

.secondary-action {
  border: 1px solid rgba(23, 48, 54, .28);
  background: #fff;
}

.hero-meta {
  width: min(calc(100% - 32px), var(--site));
  margin: 10px auto 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #eceae4;
}

.benefit {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: .65rem 1rem;
  color: #425457;
  font-size: .82rem;
}

.benefit + .benefit {
  border-left: 1px solid var(--line);
}

.benefit-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border: 2px solid var(--green);
  border-radius: 50%;
}

/* Homepage route */
.route-shell {
  padding: clamp(44px, 6vw, 78px) 0;
}

.section-heading {
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  align-items: end;
  gap: clamp(18px, 2vw, 30px);
}

.section-heading h2,
.content-section h2 {
  font-family: "Noto Serif", Georgia, serif;
  letter-spacing: -.028em;
  line-height: 1.14;
}

.section-heading h2 {
  margin: .2rem 0 0;
  font-size: clamp(2rem, 3.2vw, 3rem);
}

.section-heading p {
  margin: 0;
  color: var(--muted);
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.route-card {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.route-art {
  position: relative;
  height: 142px;
  flex: 0 0 142px;
  overflow: hidden;
  background: #e6e4dc;
}

.route-card-body {
  padding: 1.2rem 1.25rem 1.3rem;
  display: flex;
  flex: 1;
  flex-direction: column;
}

.route-no {
  color: var(--teal);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .14em;
}

.route-title {
  margin: .6rem 0;
  font-family: "Noto Serif", Georgia, serif;
  font-size: 1.4rem;
  line-height: 1.15;
}

.route-desc {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: .91rem;
}

.route-link {
  margin-top: auto;
  color: var(--green);
  font-size: .88rem;
  font-weight: 700;
}

.route-art::before,
.route-art::after {
  content: "";
  position: absolute;
}

.art-1::before { width: 80px; height: 80px; left: 22%; top: 24%; border-radius: 50%; background: #1e3f5f; }
.art-1::after { width: 116px; height: 16px; right: 13%; top: 47%; border-radius: 14px; background: #376b64; box-shadow: 0 30px 0 #d2cbbd; }
.art-2::before { width: 84px; height: 84px; left: 17%; top: 20%; border-radius: 50%; background: conic-gradient(#376b64 0 40%, #1e3f5f 40% 100%); }
.art-2::after { width: 86px; height: 86px; right: 15%; top: 19%; border: 17px solid #cfc8b7; border-radius: 50%; }
.art-3::before { width: 42px; height: 84px; left: 18%; bottom: 0; background: #1e3f5f; box-shadow: 58px 20px 0 #376b64, 116px 41px 0 #c8bda7; }
.art-3::after { left: 11%; right: 11%; bottom: 29px; height: 2px; background: #173036; }
.art-4::before { width: 188px; height: 16px; left: 14%; top: 61%; border-radius: 999px; background: #c8bda7; transform: rotate(-8deg); }
.art-4::after { width: 43px; height: 43px; left: 44%; top: 34%; border-radius: 50%; background: #376b64; box-shadow: -67px 32px 0 #1e3f5f, 73px -14px 0 #d3c6af; }

/* Content */
.article-home,
.article-wrap {
  width: min(calc(100% - 32px), 1080px);
  margin-inline: auto;
  padding-bottom: 5rem;
}

.article-wrap {
  padding-top: clamp(28px, 4vw, 48px);
}

.article-home > p,
.article-wrap > p {
  width: min(100%, var(--read));
  margin-inline: auto;
}

.article-wrap > .source-note:first-child {
  margin-top: 0;
}

.content-section {
  padding: 2.35rem 0;
  border-top: 1px solid var(--line);
  overflow-wrap: break-word;
}

.article-wrap > .content-section:not(.tile-section),
.article-home > .content-section:not(.tile-section) {
  width: min(100%, var(--read));
  margin-inline: auto;
}

.content-section h2 {
  margin: 0 0 .9rem;
  font-size: clamp(1.72rem, 2.6vw, 2.45rem);
}

.content-section h3 {
  margin: 1.5rem 0 .6rem;
  font-family: "Noto Serif", Georgia, serif;
  line-height: 1.2;
}

.content-section p {
  margin: .7rem 0;
}

.content-section ul,
.content-section ol {
  padding-left: 1.3rem;
}

.content-section li {
  margin: .48rem 0;
}

.section-pair,
.section-triplet {
  width: 100%;
  display: grid;
  gap: 16px;
  margin: 1.6rem 0 2rem;
}

.section-pair {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.section-triplet {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tile-section {
  height: 100%;
  padding: 1.35rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--paper);
  box-shadow: 0 4px 15px rgba(23, 48, 54, .035);
}

.tile-section.content-section {
  padding: 1.35rem 1.4rem;
  border-top: 1px solid var(--line);
}

.tile-section h2 {
  font-size: 1.48rem;
}

.term-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
}

.term-card {
  padding: 1rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.term-card h3 {
  margin: 0 0 .35rem;
}

.term-card p {
  margin: 0;
  color: var(--muted);
}

.math-line {
  margin: .85rem 0;
  padding: .72rem .92rem;
  border-left: 3px solid var(--teal);
  background: linear-gradient(90deg, #f8f7f3, #edf1ee);
  font-family: "Manrope", system-ui, sans-serif;
  font-size: clamp(1.04rem, 1.8vw, 1.32rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.38;
}

.micro-label {
  margin: 1rem 0 .1rem !important;
  color: var(--teal);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.term-heading {
  margin-bottom: .3rem;
}

.source-note {
  width: min(100%, var(--read));
  margin: 1.3rem auto 1.8rem;
  padding: 1rem 1.1rem;
  border-left: 3px solid var(--teal);
  border-radius: 0 10px 10px 0;
  background: #edf1ee;
  color: #38504d;
  font-size: .9rem;
}

.source-link {
  overflow-wrap: anywhere;
}

.source-list {
  margin: 1.2rem 0 0;
}

.source-list > li {
  margin-bottom: 1.25rem;
  padding-left: .25rem;
}

.source-list p {
  margin: .45rem 0;
}

.inline-action a {
  border-bottom: 1px solid rgba(14, 77, 67, .35);
  color: var(--green);
  font-weight: 700;
  text-decoration: none;
}

.example-table-wrap {
  margin: 1.2rem 0 .5rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.example-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.example-table th,
.example-table td {
  padding: .85rem .9rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.example-table th {
  background: #edf1ee;
  color: var(--ink2);
  font-size: .78rem;
  letter-spacing: .04em;
}

.example-table td:not(:first-child) {
  font-weight: 700;
}

.example-table tbody tr:last-child td {
  border-bottom: 0;
}

.knowledge-check > li {
  margin-bottom: 1.25rem;
  padding-left: .2rem;
}

.knowledge-answer {
  margin: .55rem 0 0;
  padding: .7rem .85rem;
  border-left: 3px solid var(--teal);
  background: #edf1ee;
}

.lesson-nav {
  width: min(100%, var(--read));
  margin: 2.4rem auto 0;
  padding-top: 1.8rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  border-top: 1px solid var(--line);
}

.lesson-nav a {
  min-height: 48px;
  padding: 1rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease;
}

.lesson-nav .next {
  text-align: right;
}

/* Footer and 404 */
.site-footer {
  margin-top: auto;
  padding: 2.2rem 0 3rem;
  border-top: 1px solid var(--line);
  background: #ebe9e3;
}

.footer-inner {
  width: min(calc(100% - 32px), var(--site));
  margin: auto;
  display: flex;
  justify-content: space-between;
  gap: 2rem;
}

.site-footer .wordmark {
  text-decoration: none;
}

.footer-inner p {
  margin: .25rem 0;
  color: var(--muted);
  font-size: .86rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1rem;
}

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

.not-found-page {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.not-found {
  width: min(calc(100% - 32px), 820px);
  margin-inline: auto;
  padding: clamp(72px, 9vw, 132px) 0 clamp(90px, 11vw, 150px);
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.not-found h1 {
  margin: .35rem 0 .9rem;
  font-family: "Noto Serif", Georgia, serif;
  font-size: clamp(3.1rem, 8vw, 6.3rem);
  letter-spacing: -.045em;
  line-height: .98;
}

.not-found > p:not(.eyebrow):not(.inline-action) {
  max-width: 46ch;
  color: var(--muted);
}

/* Desktop hero: locked 12:5 and 44/56. */
@media (min-width: 1101px) {
  .home-hero,
  .lesson-hero {
    aspect-ratio: 12 / 5;
    grid-template-columns: 44% 56%;
    grid-template-rows: 1fr;
  }

  .hero-copy,
  .lesson-hero-copy {
    grid-column: 1;
    grid-row: 1;
    height: 100%;
  }

  .hero-media,
  .lesson-visual {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    height: 100%;
  }
}

/* Narrow desktop: only type and padding change inside the locked geometry. */
@media (min-width: 1101px) and (max-width: 1379px) {
  .hero-copy,
  .lesson-hero-copy {
    padding: 28px 32px;
  }

  .home-hero h1 {
    max-width: 520px;
    font-size: 44px;
  }

  .lesson-hero h1 {
    max-width: 540px;
    font-size: 40px;
  }

  .hero-probability h1 {
    font-size: 38px;
  }

  .hero-overround h1 {
    font-size: 36px;
  }

  .hero-copy > p,
  .lesson-deck {
    max-width: 520px;
    font-size: 14.5px;
    line-height: 1.5;
  }

  .formula-card strong {
    font-size: 1.9rem;
  }
}

@media (min-width: 1380px) {
  .hero-copy,
  .lesson-hero-copy {
    padding: 44px 46px;
  }

  .home-hero h1 {
    max-width: 520px;
    font-size: 56px;
  }

  .lesson-hero h1 {
    max-width: 540px;
    font-size: 46px;
  }

  .hero-overround h1 {
    font-size: 42px;
  }

  .hero-copy > p,
  .lesson-deck {
    max-width: 520px;
    font-size: 16px;
  }
}

@media (max-width: 1180px) and (min-width: 941px) {
  .desktop-nav a {
    padding-inline: .45rem;
    font-size: .79rem;
  }
}

@media (max-width: 1100px) {
  .home-hero,
  .lesson-hero {
    aspect-ratio: auto;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  .hero-copy,
  .lesson-hero-copy {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    height: auto;
    padding: 34px 34px 30px;
  }

  .hero-copy::after,
  .lesson-hero-copy::after {
    display: none;
  }

  .hero-media,
  .lesson-visual,
  .lesson-visual.formula-visual,
  .about-visual {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    padding: 28px;
  }

  .hero-media img,
  .lesson-visual img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-position: center;
  }

  .home-hero h1 {
    max-width: 720px;
    font-size: 48px;
  }

  .lesson-hero h1 {
    max-width: 760px;
    font-size: 42px;
  }

  .hero-copy > p,
  .lesson-deck {
    max-width: 760px;
    font-size: 16px;
  }

  .formula-card {
    width: min(84%, 560px);
  }

  .route-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-heading {
    grid-template-columns: 1fr;
  }

  .section-triplet {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 940px) {
  .desktop-nav {
    display: none;
  }

  .mobile-nav {
    position: relative;
    display: block;
  }

  .mobile-nav summary {
    min-width: 92px;
    min-height: 44px;
    padding: .55rem .7rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    border: 1px solid rgba(23, 48, 54, .2);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 800;
    list-style: none;
  }

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

  .mobile-nav summary::after {
    content: "+";
    font-size: 1.2rem;
    line-height: 1;
  }

  .mobile-nav[open] summary::after {
    content: "−";
  }

  .mobile-nav nav {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 90;
    width: min(280px, calc(100vw - 24px));
    padding: .45rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
    box-shadow: var(--shadow);
  }

  .mobile-nav a {
    min-height: 44px;
    padding: .65rem .7rem;
    display: flex;
    align-items: center;
    border-radius: 8px;
    text-decoration: none;
  }

  .mobile-nav a[aria-current="page"] {
    background: #edf1ee;
    color: var(--green);
    font-weight: 700;
  }
}

@media (max-width: 860px) {
  .section-pair {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .header-inner,
  .container,
  .lesson-shell,
  .footer-inner {
    width: min(calc(100% - 24px), var(--site));
  }

  .brand-copy small {
    display: none;
  }

  .home-hero {
    width: calc(100% - 16px);
    border-radius: 15px;
  }

  .lesson-hero {
    border-radius: 15px;
  }

  .hero-copy,
  .lesson-hero-copy {
    padding: 28px 24px 26px;
  }

  .home-hero h1 {
    max-width: none;
    font-size: 40px;
  }

  .lesson-hero h1 {
    max-width: none;
    font-size: 34px;
  }

  .hero-copy > p,
  .lesson-deck {
    max-width: none;
    font-size: 15.5px;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .primary-action,
  .secondary-action {
    width: 100%;
  }

  .hero-meta {
    width: calc(100% - 16px);
    grid-template-columns: 1fr;
  }

  .benefit {
    min-height: 42px;
    justify-content: flex-start;
  }

  .benefit + .benefit {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .route-grid,
  .term-grid {
    grid-template-columns: 1fr;
  }

  .route-card {
    min-height: 0;
  }

  .lesson-nav {
    grid-template-columns: 1fr;
  }

  .lesson-nav .next {
    text-align: left;
  }

  .article-home,
  .article-wrap {
    width: calc(100% - 24px);
  }

  .footer-inner {
    display: block;
  }

  .footer-links {
    margin-top: 1.3rem;
    padding-top: .8rem;
    border-top: 1px solid rgba(23, 48, 54, .13);
  }

  .not-found {
    width: calc(100% - 32px);
  }
}

@media (max-width: 600px) {
  .example-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .example-table,
  .example-table tbody,
  .example-table tr,
  .example-table td {
    display: block;
    width: 100%;
  }

  .example-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .example-table tr {
    margin-bottom: .75rem;
    padding: .35rem .8rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--paper);
  }

  .example-table td,
  .example-table tbody tr:last-child td {
    padding: .5rem 0;
    display: grid;
    grid-template-columns: minmax(108px, .9fr) minmax(0, 1.1fr);
    gap: .75rem;
    border-bottom: 1px solid var(--line);
  }

  .example-table td:last-child {
    border-bottom: 0;
  }

  .example-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
  }
}

@media (max-width: 420px) {
  .hero-copy,
  .lesson-hero-copy {
    padding: 24px 18px 22px;
  }

  .home-hero h1 {
    font-size: 36px;
  }

  .lesson-hero h1 {
    font-size: 30px;
  }

  .formula-card {
    width: 90%;
    padding: 1rem;
  }

  .formula-card strong {
    font-size: 1.35rem;
  }

  .eyebrow,
  .lesson-index {
    font-size: .67rem;
    letter-spacing: .13em;
  }

  .wordmark {
    font-size: 1.48rem;
  }

  .tile-section,
  .tile-section.content-section {
    padding: 1.15rem 1rem;
  }
}

@media (hover: hover) {
  .desktop-nav a:hover::after {
    transform: scaleX(1);
  }

  .primary-action:hover,
  .secondary-action:hover,
  .lesson-nav a:hover {
    transform: translateY(-2px);
  }

  .route-card:hover {
    border-color: #b8c7c2;
    box-shadow: var(--shadow2);
    transform: translateY(-2px);
  }

  .mobile-nav a:hover {
    background: #f0eee8;
  }
}

.fade-up {
  animation: fadeUp .45s cubic-bezier(.2, .75, .25, 1) both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
