/*
  Fiancho Chess — main stylesheet
  Google Fonts pairing: "Fraunces" (display and headings) + "Inter" (body and interface).
  Palette drawn from a tournament board: ivory, deep forest green and walnut, with a single gold accent.
  Motion: only transform and opacity are animated; everything is switched off under prefers-reduced-motion.
*/

/* ---------- Tokens ---------- */
:root {
  --bg: #f7f3e9;
  --bg-alt: #efe8d9;
  --surface: #fffdf8;
  --surface-2: #f2ecde;
  --ink: #1a231e;
  --ink-soft: #2c3a32;
  --muted: #4d5951;
  --line: #ddd3be;
  --line-strong: #c6b897;
  --green: #1d4a36;
  --walnut: #6a4529;
  --gold: #b98a2c;
  --link: #1d4a36;
  --link-hover: #6a4529;
  --btn-bg: #1d4a36;
  --btn-ink: #fbf8ef;
  --btn-bg-hover: #143728;
  --ghost-ink: #1d4a36;
  --ghost-line: #1d4a36;
  --band-bg: #1d4a36;
  --band-ink: #f4eedf;
  --band-muted: #cfdcd2;
  --band-accent: #e4c069;
  --band-line: rgba(244, 238, 223, 0.18);
  --sq-l: #ede5d3;
  --sq-d: #7f9c89;
  --frame: #5a3b24;
  --frame-ink: #f0e4c8;
  --focus: #b98a2c;
  --shadow-rgb: 24, 34, 28;
  --radius: 16px;
  --radius-sm: 10px;
  --header-h: 76px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101511;
    --bg-alt: #141b16;
    --surface: #19211b;
    --surface-2: #1f2821;
    --ink: #ece6d6;
    --ink-soft: #d9d2c1;
    --muted: #a9b2a8;
    --line: #2c372f;
    --line-strong: #43524a;
    --green: #93c7a9;
    --walnut: #d6ae86;
    --gold: #d8b25a;
    --link: #9fd0b3;
    --link-hover: #e4c272;
    --btn-bg: #ece6d6;
    --btn-ink: #101511;
    --btn-bg-hover: #fffaf0;
    --ghost-ink: #ece6d6;
    --ghost-line: #5f7064;
    --band-bg: #0c2419;
    --band-ink: #efe8d7;
    --band-muted: #b8c8bd;
    --band-accent: #e2bd62;
    --band-line: rgba(239, 232, 215, 0.14);
    --sq-l: #d6cdb6;
    --sq-d: #62806d;
    --frame: #3b2717;
    --frame-ink: #e8dbbd;
    --focus: #e2bd62;
    --shadow-rgb: 0, 0, 0;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.14;
  color: var(--ink);
  margin: 0 0 0.5em;
  letter-spacing: -0.012em;
}

h1 {
  font-size: clamp(2.25rem, 1.55rem + 3.1vw, 3.75rem);
}

h2 {
  font-size: clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem);
}

h3 {
  font-size: 1.25rem;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--link-hover);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--gold);
  color: #17140c;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: none;
  color: var(--btn-ink);
}

.container {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: 24px;
}

@media (max-width: 480px) {
  .container {
    padding-inline: 16px;
  }
}

.section {
  padding-block: clamp(64px, 9vw, 120px);
  scroll-margin-top: 72px;
}

.section--alt {
  background: var(--bg-alt);
}

.section--tight {
  padding-block: clamp(48px, 6vw, 80px);
}

.section-head {
  max-width: 720px;
  margin-bottom: clamp(32px, 4vw, 52px);
}

.section-head p {
  color: var(--muted);
  font-size: 1.1rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--walnut);
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  border-radius: 2px;
  background: var(--gold);
}

.lede {
  font-size: clamp(1.08rem, 1rem + 0.4vw, 1.25rem);
  color: var(--muted);
  max-width: 60ch;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 24px;
  border: 1.5px solid transparent;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease;
}

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

.btn--primary {
  background: var(--btn-bg);
  color: var(--btn-ink);
}

.btn--primary:hover {
  background: var(--btn-bg-hover);
  color: var(--btn-ink);
}

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

.btn--ghost:hover {
  background: var(--surface-2);
  color: var(--ghost-ink);
}

.btn--block {
  width: 100%;
}

.text-link {
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.text-link::after {
  content: "";
  width: 7px;
  height: 7px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.text-link:hover::after {
  transform: translateX(3px) rotate(45deg);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  transition: transform 0.35s ease;
}

.site-header__bg {
  position: absolute;
  inset: 0;
  background: var(--bg);
}

.site-header__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 12px 30px -20px rgba(var(--shadow-rgb), 0.5);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.site-header.is-compact {
  transform: translateY(-12px);
}

.site-header.is-compact .site-header__bg::after,
.site-header.is-open .site-header__bg::after {
  opacity: 1;
}

.site-header__inner {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  transition: transform 0.35s ease;
}

.site-header.is-compact .site-header__inner {
  transform: translateY(6px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  transform-origin: left center;
  transition: transform 0.35s ease;
}

.brand:hover {
  color: var(--ink);
}

.site-header.is-compact .brand {
  transform: scale(0.92);
}

.brand__mark {
  width: 30px;
  height: 30px;
  flex: none;
}

.brand__mark-piece {
  fill: var(--green);
  color: var(--bg);
}

@media (prefers-color-scheme: dark) {
  .brand__mark-piece {
    fill: var(--ink);
  }
}

.brand__name {
  font-family: var(--font-display);
  font-size: 1.34rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.site-nav ul {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 0.98rem;
  font-weight: 500;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.site-nav a[aria-current="page"] {
  color: var(--ink);
  background: var(--surface-2);
  box-shadow: inset 0 -2px 0 var(--gold);
}

.nav-toggle {
  display: none;
}

@media (max-width: 760px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
  }

  .nav-toggle__bars,
  .nav-toggle__bars::before,
  .nav-toggle__bars::after {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
  }

  .nav-toggle__bars {
    position: relative;
  }

  .nav-toggle__bars::before,
  .nav-toggle__bars::after {
    content: "";
    position: absolute;
    left: 0;
    transition: transform 0.25s ease;
  }

  .nav-toggle__bars::before {
    transform: translateY(-6px);
  }

  .nav-toggle__bars::after {
    transform: translateY(6px);
  }

  .is-open .nav-toggle__bars {
    background: transparent;
  }

  .is-open .nav-toggle__bars::before {
    transform: rotate(45deg);
  }

  .is-open .nav-toggle__bars::after {
    transform: rotate(-45deg);
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 8px 16px 18px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 30px -24px rgba(var(--shadow-rgb), 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
  }

  .site-header.is-open .site-nav {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 2px;
  }

  .site-nav a {
    display: block;
    padding: 12px 14px;
    border-radius: 10px;
  }

  html:not(.js) .nav-toggle {
    display: none;
  }

  html:not(.js) .site-header {
    height: auto;
  }

  html:not(.js) .site-header__inner {
    flex-wrap: wrap;
    padding-block: 12px;
  }

  html:not(.js) .site-nav {
    position: static;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  html:not(.js) .site-nav ul {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

/* ---------- Hero ---------- */
.hero {
  padding-block: clamp(48px, 7vw, 104px) clamp(64px, 8vw, 120px);
  border-bottom: 1px solid var(--line);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
}

@media (max-width: 920px) {
  .hero__grid {
    grid-template-columns: 1fr;
  }
}

.hero h1 {
  max-width: 15ch;
  font-size: clamp(2.4rem, 1.65rem + 2.9vw, 3.7rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.hero .lede {
  max-width: 54ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  margin-top: 32px;
}

.hero__facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  max-width: 560px;
  margin: 44px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.hero__facts dt {
  margin-bottom: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--walnut);
}

.hero__facts dd {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

@media (max-width: 520px) {
  .hero__facts {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

.hero-board {
  width: 100%;
  max-width: 480px;
  margin: 0;
  justify-self: end;
}

@media (max-width: 920px) {
  .hero-board {
    justify-self: center;
  }
}

.hero-board__plate {
  padding: clamp(16px, 2.6vw, 28px) clamp(14px, 2.2vw, 24px) clamp(12px, 2vw, 20px) clamp(10px, 1.6vw, 16px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 40px 70px -50px rgba(var(--shadow-rgb), 0.55);
}

.hero-board svg {
  width: 100%;
  height: auto;
}

.hero-board figcaption {
  display: grid;
  gap: 2px;
  margin-top: 16px;
  font-size: 0.92rem;
  color: var(--muted);
}

.hero-board__label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--walnut);
}

.hb-moves {
  display: block;
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--muted);
  word-spacing: 0.08em;
}

.hb-moves .is-current {
  color: var(--ink);
  font-weight: 600;
}

.hb-border {
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 3;
}

.hb-coord {
  fill: var(--muted);
  font-family: var(--font-body);
  font-size: 19px;
  font-weight: 500;
}

.hb-frame {
  fill: var(--frame);
}

.sq-l {
  fill: var(--sq-l);
}

.sq-d {
  fill: var(--sq-d);
}

.hb-hl {
  fill: var(--gold);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hb-hl.is-on {
  opacity: 0.3;
}

.hb-mate {
  fill: none;
  stroke: var(--walnut);
  stroke-width: 6;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.hb-mate.is-on {
  opacity: 1;
}

.hb-pieces {
  transition: opacity 0.6s ease;
}

.hb-piece {
  transition: transform 0.78s cubic-bezier(0.45, 0.05, 0.25, 1), opacity 0.45s ease;
}

[data-hero-board].is-resetting .hb-piece,
[data-hero-board].is-resetting .hb-hl {
  transition: none;
}

/* ---------- Chess pieces (original SVG shapes, see sprite in each page) ---------- */
.pc .po {
  fill: var(--pc-outline);
  stroke: var(--pc-outline);
  stroke-width: 7;
  stroke-linejoin: round;
}

.pc .pf {
  fill: var(--pc-fill);
  stroke: none;
  color: var(--pc-detail);
}

.pc--w {
  --pc-fill: #fbf8ef;
  --pc-outline: #1c211d;
  --pc-detail: #1c211d;
}

.pc--b {
  --pc-fill: #2a2f2b;
  --pc-outline: #0f120f;
  --pc-detail: #d9cfb6;
}

/* ---------- Self-study band ---------- */
.band {
  background: var(--band-bg);
  color: var(--band-ink);
}

.band h2,
.band h3 {
  color: var(--band-ink);
}

.band p {
  color: var(--band-muted);
}

.band a {
  color: var(--band-accent);
}

.band .eyebrow {
  color: var(--band-accent);
}

.notice {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.3fr);
  gap: clamp(20px, 4vw, 44px);
  align-items: start;
  padding-block: clamp(44px, 6vw, 72px);
}

.notice h2 {
  margin: 0;
  font-size: clamp(1.5rem, 1.25rem + 1.1vw, 2.1rem);
  font-weight: 500;
}

.notice p {
  max-width: 68ch;
  font-size: 1.08rem;
}

@media (max-width: 820px) {
  .notice {
    grid-template-columns: 1fr;
  }
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: 6px 14px;
  border: 1px solid var(--band-line);
  border-radius: 6px;
  font-size: 0.92rem;
  color: var(--band-ink);
}

/* ---------- Course cards ---------- */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.course-grid > li {
  display: flex;
}

.course-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.3s ease;
}

.course-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 26px 46px -24px rgba(var(--shadow-rgb), 0.55);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.course-card:hover,
.course-card:focus-within {
  transform: translateY(-6px);
}

.course-card:hover::after,
.course-card:focus-within::after {
  opacity: 1;
}

.course-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.course-card__icon {
  width: 58px;
  height: 58px;
  flex: none;
}

.icon-tile {
  fill: var(--sq-d);
}

.icon-tile--alt {
  fill: var(--sq-l);
}

.icon-tile--gold {
  fill: var(--gold);
}

.level {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--walnut);
  text-align: right;
}

.course-card h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.course-card h3 a {
  color: inherit;
  text-decoration: none;
}

.course-card h3 a::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: var(--radius);
}

.course-card h3 a:focus-visible {
  outline: none;
}

.course-card h3 a:focus-visible::before {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.course-card p {
  flex: 1;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.97rem;
}

.course-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.course-card__price {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 600;
}

.course-card__more {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--link);
}

/* ---------- Features & steps ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (max-width: 880px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }
}

.feature {
  height: 100%;
  padding: 30px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.feature__icon {
  width: 54px;
  height: 54px;
  margin-bottom: 20px;
}

.fi-stroke {
  fill: none;
  stroke: var(--green);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fi-fill {
  fill: var(--gold);
}

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

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (max-width: 980px) {
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .steps {
    grid-template-columns: 1fr;
  }
}

.step {
  height: 100%;
  padding: 26px 24px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  border-radius: 6px 6px var(--radius) var(--radius);
}

.step__num {
  display: block;
  margin-bottom: 14px;
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 600;
  line-height: 1;
  color: var(--walnut);
}

.step h3 {
  font-size: 1.15rem;
}

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

.after-steps {
  margin-top: 32px;
  color: var(--muted);
}

/* ---------- FAQ ---------- */
.faq-list {
  display: grid;
  gap: 12px;
  max-width: 860px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.faq-item summary {
  position: relative;
  padding: 18px 56px 18px 22px;
  font-size: 1.04rem;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

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

.faq-item summary::after {
  content: "";
  position: absolute;
  right: 24px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--walnut);
  border-bottom: 2px solid var(--walnut);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.25s ease;
}

.faq-item[open] summary::after {
  transform: translateY(-25%) rotate(225deg);
}

.faq-item__body {
  padding: 0 22px 20px;
  color: var(--muted);
}

.faq-item__body p:last-child {
  margin-bottom: 0;
}

.faq-group + .faq-group {
  margin-top: clamp(40px, 5vw, 64px);
}

.faq-group h2 {
  font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.8rem);
  margin-bottom: 20px;
}

.section-foot {
  margin-top: 32px;
}

/* ---------- Page heroes & prose ---------- */
.page-hero {
  padding-block: clamp(40px, 6vw, 84px) clamp(28px, 4vw, 48px);
}

.page-hero h1 {
  max-width: 20ch;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 26px;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
  color: var(--muted);
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 6px;
  color: var(--line-strong);
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--link-hover);
}

.doc-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

@media (max-width: 900px) {
  .doc-layout {
    grid-template-columns: 1fr;
  }
}

.doc-toc {
  position: sticky;
  top: 96px;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.93rem;
}

@media (max-width: 900px) {
  .doc-toc {
    position: static;
  }
}

.doc-toc h2 {
  margin-bottom: 10px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--walnut);
}

.doc-toc ol {
  margin: 0;
  padding-left: 1.2em;
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.doc-toc a {
  color: var(--ink-soft);
  text-decoration: none;
}

.doc-toc a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.prose {
  max-width: 740px;
}

.prose h2 {
  margin-top: 2.2em;
  font-size: clamp(1.35rem, 1.2rem + 0.6vw, 1.65rem);
  scroll-margin-top: 90px;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  margin-top: 1.6em;
  font-size: 1.15rem;
}

.prose ul,
.prose ol {
  padding-left: 1.3em;
  margin: 0 0 1.2em;
}

.prose li {
  margin-bottom: 0.45em;
}

.prose li::marker {
  color: var(--gold);
}

.updated {
  margin-top: -4px;
  color: var(--muted);
  font-size: 0.95rem;
}

.summary-box {
  margin: 0 0 2em;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 6px var(--radius-sm) var(--radius-sm) 6px;
}

.summary-box p:last-child,
.summary-box ul:last-child {
  margin-bottom: 0;
}

/* ---------- Product page ---------- */
.product-hero {
  padding-block: clamp(32px, 5vw, 64px) clamp(48px, 6vw, 88px);
}

.product-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.8fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}

@media (max-width: 920px) {
  .product-hero__grid {
    grid-template-columns: 1fr;
  }
}

.product-hero h1 {
  max-width: 18ch;
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0;
}

@media (max-width: 520px) {
  .facts {
    grid-template-columns: 1fr;
  }
}

.facts div {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.facts dt {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--walnut);
}

.facts dd {
  margin: 4px 0 0;
  font-weight: 500;
}

.callout {
  padding: 16px 20px;
  background: var(--surface-2);
  border-left: 4px solid var(--gold);
  border-radius: 4px 12px 12px 4px;
  color: var(--ink-soft);
}

.callout p:last-child {
  margin-bottom: 0;
}

.buy-box {
  position: sticky;
  top: 92px;
  padding: 30px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 30px 50px -36px rgba(var(--shadow-rgb), 0.6);
}

@media (max-width: 920px) {
  .buy-box {
    position: static;
  }
}

.buy-box__name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
}

.buy-box__level {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  margin: 18px 0 16px;
}

.price {
  margin: 0;
  font-family: var(--font-display);
  font-size: 3.1rem;
  font-weight: 600;
  line-height: 1;
}

.price__cur {
  margin-left: 4px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.buy-box__terms {
  margin: 0;
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: 10px;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.buy-box__action {
  margin-top: 18px;
}

.buy-box__list {
  display: grid;
  gap: 10px;
  margin: 22px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
  font-size: 0.95rem;
  color: var(--muted);
}

.buy-box__list li {
  position: relative;
  padding-left: 26px;
}

.buy-box__list li::before,
.check-list--yes li::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 0.3em;
  width: 6px;
  height: 11px;
  border-right: 2.5px solid var(--green);
  border-bottom: 2.5px solid var(--green);
  transform: rotate(45deg);
}

.contents-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: part;
  max-width: 900px;
}

.contents-list li {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 18px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.contents-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.contents-list li::before {
  counter-increment: part;
  content: counter(part, decimal-leading-zero);
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.15;
  color: var(--gold);
}

.contents-list h3 {
  font-size: 1.2rem;
  margin-bottom: 6px;
}

.contents-list h3 a {
  color: inherit;
}

.contents-list p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 480px) {
  .contents-list li {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}

@media (max-width: 980px) {
  .preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .preview-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin-inline: auto;
  }
}

.preview {
  margin: 0;
}

.preview__page {
  overflow: hidden;
  border: 1px solid #e0d6c1;
  border-radius: 6px;
  background: #fbf8f0;
  box-shadow: 0 22px 40px -26px rgba(var(--shadow-rgb), 0.6);
}

.preview__page svg {
  width: 100%;
  height: auto;
}

.preview figcaption {
  margin-top: 16px;
  font-size: 0.95rem;
  color: var(--muted);
}

.preview figcaption strong {
  display: block;
  margin-bottom: 2px;
  font-family: var(--font-display);
  font-size: 1.08rem;
  color: var(--ink);
}

/* Preview page artwork (fixed paper colors, like a printed workbook) */
.pv-run {
  font-family: var(--font-body);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.12em;
  fill: #6a4529;
}

.pv-rule {
  stroke: #d9ccb0;
  stroke-width: 1;
}

.pv-label {
  font-family: var(--font-body);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  fill: #9a7322;
}

.pv-h {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  fill: #1a231e;
}

.pv-h2 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  fill: #1a231e;
}

.pv-body {
  font-family: var(--font-body);
  font-size: 10px;
  fill: #36423b;
}

.pv-move {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  fill: #1d4a36;
}

.pv-note {
  font-family: var(--font-body);
  font-size: 9px;
  font-style: italic;
  fill: #6b746e;
}

.pv-coord {
  font-family: var(--font-body);
  font-size: 6.5px;
  font-weight: 600;
  fill: #6b746e;
}

.pv-l {
  fill: #f1ebdc;
}

.pv-d {
  fill: #86a591;
}

.pv-edge {
  fill: #3b4a40;
}

.pv-accent {
  stroke: #b98a2c;
  stroke-width: 2;
}

.pv-box {
  fill: #f0e8d6;
}

.pv-bar {
  fill: #b98a2c;
}

.pv-dot-w {
  fill: #fbf8ef;
  stroke: #1c211d;
  stroke-width: 1.2;
}

.pv-dot-b {
  fill: #1c211d;
}

.fit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

@media (max-width: 760px) {
  .fit-grid {
    grid-template-columns: 1fr;
  }
}

.fit {
  padding: 30px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.fit h2 {
  font-size: 1.45rem;
}

.check-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  position: relative;
  padding-left: 30px;
}

.check-list--no li::before,
.check-list--no li::after {
  content: "";
  position: absolute;
  left: 1px;
  top: 0.78em;
  width: 15px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--walnut);
  transform: rotate(45deg);
}

.check-list--no li::after {
  transform: rotate(-45deg);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}

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

.zip-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.zip-list li {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.zip-list strong {
  display: block;
  margin-bottom: 2px;
}

.zip-list span {
  color: var(--muted);
  font-size: 0.97rem;
}

.file-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 56px;
  border-radius: 6px 14px 6px 6px;
  background: var(--green);
  color: var(--bg);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.file-badge--alt {
  background: var(--walnut);
}

@media (prefers-color-scheme: dark) {
  .file-badge {
    color: #101511;
  }
}

.related-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.related-list a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  height: 100%;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.25s ease;
}

.related-list a:hover {
  transform: translateY(-3px);
  color: var(--ink);
  border-color: var(--line-strong);
}

.related-list span {
  font-weight: 600;
}

.related-list small {
  flex: none;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--walnut);
}

/* ---------- Contact & about ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(28px, 4vw, 48px);
  align-items: start;
}

@media (max-width: 880px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

.contact-stack {
  display: grid;
  gap: 18px;
}

.contact-card {
  padding: 28px;
  border-radius: var(--radius);
  background: var(--band-bg);
  color: var(--band-ink);
}

.contact-card__label {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--band-accent);
}

.contact-card__value {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.1rem + 0.8vw, 1.6rem);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.contact-card__value a {
  color: var(--band-ink);
}

.contact-card__value a:hover {
  color: var(--band-accent);
}

.contact-card p:not([class]) {
  margin: 10px 0 0;
  color: var(--band-muted);
}

.info-card {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.info-card h2 {
  font-size: 1.4rem;
}

.info-card ul {
  margin: 0;
  padding-left: 1.2em;
}

.info-card li + li {
  margin-top: 8px;
}

.info-card li::marker {
  color: var(--gold);
}

.request-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.request-list li {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.request-list h3 {
  font-size: 1.08rem;
  margin-bottom: 4px;
}

.request-list p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.value-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (max-width: 760px) {
  .value-grid {
    grid-template-columns: 1fr;
  }
}

.value-grid li {
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.value-grid h3 {
  font-size: 1.15rem;
}

.value-grid p {
  margin: 0;
  color: var(--muted);
}

.cta-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  padding: clamp(28px, 4vw, 44px);
  border-radius: var(--radius);
  background: var(--band-bg);
  color: var(--band-ink);
}

.cta-band h2 {
  margin: 0 0 6px;
  font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.9rem);
  color: var(--band-ink);
}

.cta-band p {
  margin: 0;
  color: var(--band-muted);
}

.cta-band .btn--primary {
  background: var(--band-accent);
  color: #17140c;
}

.cta-band .btn--primary:hover {
  background: #edcf86;
  color: #17140c;
}

.cta-band__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.cta-band .btn--ghost {
  color: var(--band-ink);
  border-color: var(--band-line);
}

.cta-band .btn--ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--band-ink);
}

/* ---------- 404 ---------- */
.not-found {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  padding-block: clamp(56px, 8vw, 120px);
}

@media (max-width: 820px) {
  .not-found {
    grid-template-columns: 1fr;
  }
}

.not-found__board {
  width: 100%;
  max-width: 360px;
  justify-self: center;
}

.not-found__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

/* ---------- Footer ---------- */
.site-footer {
  padding-block: 64px 32px;
  background: var(--band-bg);
  color: var(--band-ink);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1.1fr 0.8fr 0.9fr;
  gap: 40px;
}

@media (max-width: 960px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 540px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.site-footer .brand {
  color: var(--band-ink);
}

.site-footer .brand__mark-piece {
  fill: var(--band-accent);
  color: var(--band-bg);
}

.footer-brand p {
  max-width: 38ch;
  margin-top: 16px;
  color: var(--band-muted);
  font-size: 0.97rem;
}

.footer-email {
  font-weight: 600;
}

.footer-email a {
  color: var(--band-accent);
}

.footer-heading {
  margin: 0 0 14px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--band-accent);
}

.footer-links {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.96rem;
}

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

.site-footer a:hover {
  color: var(--band-accent);
  text-decoration: underline;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  margin-top: 52px;
  padding-top: 24px;
  border-top: 1px solid var(--band-line);
  font-size: 0.9rem;
  color: var(--band-muted);
}

.footer-bottom p {
  margin: 0;
}

/* ---------- Reveal on scroll ---------- */
html.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.65, 0.3, 1);
  transition-delay: calc(var(--i, 0) * 80ms);
}

html.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

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

  html.js .reveal {
    opacity: 1;
    transform: none;
  }

  .btn:hover,
  .course-card:hover,
  .course-card:focus-within,
  .related-list a:hover {
    transform: none;
  }

  .site-header.is-compact,
  .site-header.is-compact .site-header__inner,
  .site-header.is-compact .brand {
    transform: none;
  }
}

/* ---------- Print ---------- */
@media print {
  .site-header,
  .site-footer,
  .skip-link {
    display: none;
  }

  html.js .reveal {
    opacity: 1;
    transform: none;
  }
}
