:root,
html[data-theme="dark"] {
  --bg: #080c16;
  --surface: #111a2a;
  --surface2: #192438;
  --cream: #f4efe4;
  --gold: #e2c484;
  --muted: #a9b5c7;
  --border: #354256;
  --page-glow: #1b2740;
  --page-mid: #0d1423;
  --page-deep: #080c16;
  --header-bg: rgba(8, 12, 22, 0.83);
  --nav: #d4d7e0;
  --card-bg: rgba(21, 31, 49, 0.82);
  --feature-from: #1b2940;
  --feature-to: #111b2c;
  --tag-border: #40506b;
  --tag-text: #d4d9e2;
  --math-art-from: #24334b;
  --math-art-mid: #111a2a;
  --math-art-to: #0e1625;
  --button-ink: #101522;
  --skip-fg: #080c16;
  --skip-bg: #f4efe4;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f8f7f3;
  --surface: #ffffff;
  --surface2: #f1efe8;
  --cream: #203238;
  --gold: #234b52;
  --muted: #57676b;
  --border: #d7ddd8;
  --page-glow: #ffffff;
  --page-mid: #f7f4ec;
  --page-deep: #f1eee6;
  --header-bg: rgba(248, 247, 243, 0.92);
  --nav: #48585d;
  --card-bg: #ffffff;
  --feature-from: #fffaf2;
  --feature-to: #f3ebe0;
  --tag-border: #d5ddd7;
  --tag-text: #55666a;
  --math-art-from: #fff8ec;
  --math-art-mid: #f4e8d6;
  --math-art-to: #ebe1d1;
  --button-ink: #ffffff;
  --skip-fg: #203238;
  --skip-bg: #ffffff;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 75% 12%, var(--page-glow) 0%, var(--page-mid) 42%, var(--page-deep) 78%);
  color: var(--cream);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--gold); outline-offset: 5px; }
.container { width: min(1130px, calc(100% - 48px)); margin: 0 auto; }
.skip-link { position: fixed; top: -90px; left: 12px; z-index: 99; padding: 9px 18px; color: var(--skip-fg); background: var(--skip-bg); }
.skip-link:focus { top: 12px; }
.site-header {
  border-bottom: 1px solid color-mix(in srgb, var(--gold) 16%, transparent);
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 9;
}
.header-inner { min-height: 78px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.brand { color: var(--cream); font: 600 27px/1.2 "Cormorant Garamond", Georgia, serif; text-decoration: none; white-space: nowrap; }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a { text-decoration: none; color: var(--nav); font-size: 14px; }
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--gold); }
.site-nav .nav-featured {
  border: 1px solid color-mix(in srgb, var(--gold) 50%, transparent);
  border-radius: 100px;
  color: var(--gold);
  padding: 8px 16px;
}
.eyebrow { font-size: 11px; font-weight: 750; letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, .serif { font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif; font-weight: 500; }
h1 { font-size: clamp(57px, 8vw, 110px); line-height: 0.98; letter-spacing: -0.028em; margin: 24px 0 27px; }
h2 { font-size: clamp(37px, 5vw, 57px); line-height: 1.08; }
h1 em, h2 em { color: var(--gold); font-weight: 500; }
.lead { font-size: clamp(17px, 2.1vw, 20px); line-height: 1.7; max-width: 620px; color: var(--muted); }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 51px;
  padding: 12px 22px;
  border-radius: 100px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}
.button-gold { background: var(--gold); color: var(--button-ink); }
html[data-theme="dark"] .button-gold:hover { background: #f1d79e; }
html[data-theme="light"] .button-gold:hover { background: #163940; }
.button-quiet {
  border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
  color: var(--gold);
}
.button-quiet:hover { background: color-mix(in srgb, var(--gold) 7%, transparent); }
.page-hero { padding: clamp(66px, 10vw, 140px) 0 clamp(54px, 7vw, 90px); }
.page-hero h1 { max-width: 960px; }
.intro-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: clamp(28px, 6vw, 85px); align-items: center; }
.math-art {
  display: grid;
  place-items: center;
  min-height: 390px;
  border: 1px solid color-mix(in srgb, var(--gold) 22%, transparent);
  border-radius: 28px;
  background: radial-gradient(circle at 50% 40%, var(--math-art-from), var(--math-art-mid) 62%, var(--math-art-to) 100%);
  position: relative;
  overflow: hidden;
}
.math-art::before,
.math-art::after {
  content: "";
  border: 1px solid color-mix(in srgb, var(--gold) 22%, transparent);
  border-radius: 50%;
  width: 275px;
  height: 275px;
  position: absolute;
  transform: rotate(30deg);
}
.math-art::after { width: 340px; height: 340px; border-style: dashed; opacity: 0.32; }
.math-art span { font: italic 88px/1 "Cormorant Garamond", Georgia, serif; color: var(--gold); position: relative; z-index: 1; }
.math-art small { position: absolute; bottom: 27px; font-size: 11px; letter-spacing: 0.22em; color: var(--muted); text-transform: uppercase; }
.content-section { padding: 64px 0 90px; border-top: 1px solid color-mix(in srgb, var(--gold) 15%, transparent); }
.content-section p { color: var(--muted); max-width: 780px; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 36px; }
.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 22px; padding: 30px; }
.card h3 { font-size: 20px; margin-bottom: 10px; }
.card p { font-size: 14px; margin-bottom: 0; }
.card-number { font: italic 33px "Cormorant Garamond", Georgia, serif; color: var(--gold); }
.lesson-feature {
  background: linear-gradient(135deg, var(--feature-from), var(--feature-to));
  display: grid;
  grid-template-columns: 1fr 0.8fr;
  gap: 20px;
  border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent);
  border-radius: 27px;
  padding: clamp(28px, 5vw, 60px);
  align-items: center;
}
.lesson-feature h2 { margin: 14px 0 24px; }
.lesson-feature p { color: var(--muted); }
.lesson-feature .formula {
  font: clamp(36px, 5.4vw, 68px)/1.2 "Cormorant Garamond", Georgia, serif;
  color: var(--gold);
  text-align: center;
  padding: 40px 6px;
}
.tags { display: flex; flex-wrap: wrap; gap: 9px; margin: 20px 0 25px; }
.tags span {
  border: 1px solid var(--tag-border);
  border-radius: 100px;
  padding: 5px 12px;
  font-size: 12px;
  color: var(--tag-text);
}
.footer {
  margin-top: 64px;
  padding: 35px 0;
  border-top: 1px solid color-mix(in srgb, var(--gold) 18%, transparent);
  color: var(--muted);
  font-size: 13px;
}
.footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 15px; }
.footer a { color: var(--gold); }

.about-hero .lead { margin-bottom: 28px; }
.about-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.about-intro {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}
.about-intro p,
.about-process p { color: var(--muted); max-width: none; }
.about-portrait,
.about-media {
  margin: 0;
  border: 1px solid color-mix(in srgb, var(--gold) 22%, transparent);
  border-radius: 28px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
}
.about-portrait img,
.about-media img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 34px;
}
.stat-card {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--card-bg);
}
.stat-card strong {
  display: block;
  margin-bottom: 12px;
  font: 500 clamp(34px, 4vw, 48px)/1 "Cormorant Garamond", Georgia, serif;
  color: var(--gold);
}
.stat-card p { margin: 0; color: var(--muted); font-size: 15px; }
.check-list,
.dash-list {
  margin: 28px 0 28px;
  padding: 0;
  list-style: none;
  max-width: 780px;
}
.check-list li,
.dash-list li {
  position: relative;
  padding: 12px 0 12px 34px;
  border-bottom: 1px solid color-mix(in srgb, var(--gold) 12%, transparent);
  color: var(--muted);
}
.check-list li:last-child,
.dash-list li:last-child { border-bottom: 0; }
.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 12px;
  color: var(--gold);
  font-weight: 700;
}
.dash-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  top: 12px;
  color: var(--gold);
}
.format-card {
  margin-top: 28px;
  max-width: 560px;
  border: 1px solid color-mix(in srgb, var(--gold) 28%, transparent);
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--feature-from), var(--feature-to));
}
.format-card header {
  padding: 18px 26px;
  border-bottom: 1px solid color-mix(in srgb, var(--gold) 18%, transparent);
  font: 600 13px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
.format-card ul {
  margin: 0;
  padding: 18px 26px 24px;
  list-style: none;
}
.format-card li {
  position: relative;
  padding: 10px 0 10px 18px;
  color: var(--muted);
}
.format-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.15em;
  width: 10px;
  height: 1px;
  background: var(--gold);
}
.quote-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 34px;
}
.quote-card {
  margin: 0;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--card-bg);
}
.quote-card cite {
  display: block;
  margin-bottom: 14px;
  font: 600 16px/1.3 "Cormorant Garamond", Georgia, serif;
  font-style: normal;
  color: var(--cream);
}
.quote-card cite span {
  display: block;
  margin-top: 4px;
  font: 600 11px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
.quote-card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
  max-width: none;
}
.review-links,
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  margin-top: 28px;
}
.review-links a,
.contact-links a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
  padding-bottom: 3px;
  font-size: 14px;
  font-weight: 650;
}
.review-links a:hover,
.contact-links a:hover { border-bottom-color: var(--gold); }
.about-process {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.about-contact .lead { margin-bottom: 0; }

@media (max-width: 760px) {
  .container { width: min(100% - 32px, 1130px); }
  .header-inner { min-height: 70px; }
  .brand { font-size: 21px; }
  .site-nav { gap: 15px; }
  .site-nav a { font-size: 12px; }
  .site-nav .nav-featured { padding: 7px 11px; }
  .intro-grid,
  .lesson-feature,
  .about-intro,
  .about-process { grid-template-columns: 1fr; }
  .math-art { min-height: 280px; }
  .card-grid,
  .stat-grid,
  .quote-grid { grid-template-columns: 1fr; }
  .page-hero { padding-top: 55px; }
  .lesson-feature .formula { padding: 0 0 10px; }
  .about-portrait { max-width: 420px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
