:root {
  color-scheme: light;
  --bg: #f7f4ec;
  --bg-2: #edeff5;
  --ink: #10131b;
  --muted: #646b78;
  --panel: rgba(255, 255, 255, .72);
  --panel-solid: #ffffff;
  --line: rgba(28, 34, 48, .12);
  --blue: #4b8dff;
  --violet: #8a6dff;
  --gold: #d2a642;
  --cyan: #a8dbef;
  --board-light: #f3f7fa;
  --board-dark: #c8d8e3;
  --shadow: 0 34px 120px rgba(30, 36, 54, .18);
  --soft-shadow: 0 18px 60px rgba(30, 36, 54, .12);
  --radius: 28px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07090d;
  --bg-2: #101420;
  --ink: #f8fbff;
  --muted: #a6afbf;
  --panel: rgba(18, 22, 32, .72);
  --panel-solid: #111722;
  --line: rgba(255, 255, 255, .13);
  --blue: #6aa4ff;
  --violet: #a995ff;
  --gold: #e1bd65;
  --cyan: #77d7ff;
  --shadow: 0 40px 130px rgba(0, 0, 0, .46);
  --soft-shadow: 0 18px 70px rgba(0, 0, 0, .32);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  max-width: 100vw;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 5%, rgba(75, 141, 255, .20), transparent 32vw),
    radial-gradient(circle at 86% 14%, rgba(138, 109, 255, .18), transparent 30vw),
    linear-gradient(180deg, var(--bg), var(--bg-2) 46%, var(--bg));
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  line-height: 1.45;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, transparent, #000 20%, #000 70%, transparent);
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.ambient {
  position: fixed;
  inset: -20%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at var(--mx, 50%) var(--my, 20%), rgba(75, 141, 255, .16), transparent 22rem),
    radial-gradient(circle at 72% 78%, rgba(210, 166, 66, .16), transparent 24rem);
  filter: blur(4px);
}

.site-header {
  position: fixed;
  top: 14px;
  left: 50%;
  z-index: 50;
  width: min(1120px, calc(100% - 28px));
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 12px 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 84%, transparent);
  box-shadow: 0 14px 46px rgba(20, 24, 36, .12);
  -webkit-backdrop-filter: blur(24px) saturate(1.25);
  backdrop-filter: blur(24px) saturate(1.25);
  transform: translateX(-50%);
}

.brand,
nav,
.hero-actions,
.signal-strip,
.metrics,
.theme-toggle {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 900;
}

.brand img {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  box-shadow: var(--soft-shadow);
}

nav {
  gap: clamp(12px, 3vw, 34px);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

nav a {
  transition: color .25s ease;
}

nav a:hover {
  color: var(--ink);
}

.theme-toggle {
  justify-content: flex-start;
  width: 54px;
  height: 34px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255,255,255,.36);
  cursor: pointer;
}

.theme-toggle span {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fff, var(--blue));
  box-shadow: 0 6px 18px rgba(75,141,255,.35);
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
}

[data-theme="dark"] .theme-toggle span {
  transform: translateX(20px);
  background: linear-gradient(135deg, #1c2434, var(--violet));
}

.theme-toggle:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue) 48%, transparent);
  outline-offset: 3px;
}

.cinematic-section,
.chapter,
.download {
  min-height: 100vh;
  padding: clamp(108px, 12vw, 154px) clamp(18px, 5vw, 72px);
  scroll-margin-top: 96px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(420px, 1.05fr);
  align-items: center;
  gap: clamp(34px, 5vw, 86px);
  perspective: 1500px;
}

.hero-copy {
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p,
figure {
  margin-top: 0;
}

h1 {
  margin-bottom: 24px;
  font-size: clamp(48px, 6vw, 92px);
  line-height: .92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(40px, 6vw, 92px);
  line-height: .9;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 12px;
  font-size: clamp(28px, 3.3vw, 46px);
  line-height: .96;
}

.lead,
.chapter-copy p,
.section-heading + p,
.download p {
  color: var(--muted);
  font-size: clamp(18px, 2vw, 24px);
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  border-radius: 999px;
  font-weight: 900;
  transform: translateZ(0);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

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

.button.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  box-shadow: 0 18px 54px rgba(75, 141, 255, .34);
}

.button.secondary {
  border: 1px solid var(--line);
  background: var(--panel);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.hero-stage {
  position: relative;
  min-height: min(760px, 78vh);
  max-width: 100%;
  overflow: hidden;
  transform-style: preserve-3d;
}

.hero-light-sweep {
  position: absolute;
  top: -16%;
  bottom: -16%;
  left: -36%;
  width: 72%;
  z-index: 9;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 32%, rgba(255,255,255,.58) 47%, transparent 62%);
  mix-blend-mode: screen;
  opacity: 0;
  transform: translateX(-54%) rotate(6deg);
}

.hero-photo-card {
  position: absolute;
  inset: 2% 5% 0 18%;
  z-index: 2;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 42px;
  background: #090b12;
  box-shadow: var(--shadow);
  transform: rotateY(-8deg) rotateX(3deg) rotateZ(1deg);
}

.hero-photo-card::before {
  content: "";
  position: absolute;
  inset: 12px;
  z-index: 2;
  pointer-events: none;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 32px;
}

.hero-photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 58% 50%;
}

.hero-phone-device {
  position: absolute;
  right: 20%;
  top: 14%;
  z-index: 5;
  width: min(235px, 28vw);
  aspect-ratio: 598 / 1300;
  margin: 0;
  overflow: hidden;
  border: 8px solid #12151d;
  border-radius: 34px;
  background: #111722;
  box-shadow: 0 28px 72px rgba(18, 24, 35, .34);
  transform: rotateY(-8deg) rotateX(3deg) rotateZ(.5deg);
}

.hero-phone-device::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  z-index: 3;
  width: 58px;
  height: 18px;
  border-radius: 999px;
  background: #0d1017;
  transform: translateX(-50%);
}

.hero-phone-device img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.hero-phone-device figcaption {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 3;
  padding: 8px 11px;
  border-radius: 999px;
  color: #111722;
  background: rgba(255,255,255,.82);
  font-size: 12px;
  font-weight: 950;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.live-status,
.live-coach-tip {
  border: 1px solid rgba(255,255,255,.42);
  background: rgba(255,255,255,.82);
  box-shadow: 0 18px 45px rgba(18,24,35,.18);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  backdrop-filter: blur(20px) saturate(1.2);
}

.live-status {
  position: absolute;
  top: 12%;
  left: 23%;
  z-index: 8;
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 9px;
  width: min(310px, 42%);
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  color: #111722;
  font-size: 11px;
  font-weight: 950;
}

.live-status span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #36d982;
  box-shadow: 0 0 0 6px rgba(54,217,130,.16);
}

.live-status em {
  color: var(--blue);
  font-style: normal;
}

.live-board {
  position: absolute;
  right: 0;
  top: 18%;
  width: 42%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.44);
  border-radius: 16px;
  box-shadow: 0 22px 56px rgba(18,24,35,.24);
}

.live-board i {
  aspect-ratio: 1;
  background: var(--board-light);
}

.live-board .dark {
  background: var(--board-dark);
}

.live-piece {
  position: absolute;
  color: #10131b;
  font-size: clamp(18px, 2.4vw, 32px);
  line-height: 1;
  text-shadow: 0 8px 18px rgba(0,0,0,.2);
}

.live-one {
  left: 18%;
  bottom: 12%;
  color: #fff;
}

.live-two {
  right: 18%;
  top: 12%;
}

.live-coach-tip {
  position: absolute;
  right: 4%;
  top: 26%;
  z-index: 9;
  width: min(300px, 36%);
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border-radius: 22px;
  color: #111722;
}

.live-coach-tip img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  box-shadow: 0 10px 24px rgba(18,24,35,.18);
}

.live-coach-tip small {
  display: block;
  margin-bottom: 5px;
  color: #4b8dff;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.live-coach-tip strong {
  display: block;
  font-size: clamp(15px, 1.5vw, 19px);
  line-height: 1.08;
}

.halo {
  position: absolute;
  border-radius: 50%;
  filter: blur(16px);
}

.halo-blue {
  width: 54%;
  aspect-ratio: 1;
  left: 12%;
  top: 0;
  background: radial-gradient(circle, rgba(75,141,255,.46), transparent 68%);
}

.halo-gold {
  width: 42%;
  aspect-ratio: 1;
  right: 4%;
  bottom: 6%;
  background: radial-gradient(circle, rgba(210,166,66,.36), transparent 70%);
}

.coach-orb,
.stat-pill {
  position: absolute;
  z-index: 8;
  border: 1px solid rgba(255,255,255,.44);
  background: color-mix(in srgb, var(--panel-solid) 76%, transparent);
  box-shadow: var(--soft-shadow);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
}

.coach-orb {
  right: 2%;
  top: 56%;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 300px;
  padding: 10px 16px 10px 10px;
  border-radius: 999px;
  font-weight: 950;
}

.hero .coach-orb,
.hero .stat-two {
  display: none;
}

.coach-orb img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
}

.stat-pill {
  padding: 12px 16px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
}

.stat-one {
  left: 4%;
  top: 33%;
}

.stat-two {
  right: 8%;
  bottom: 13%;
}

.mini-board {
  position: absolute;
  left: 4%;
  bottom: 4%;
  z-index: 6;
  width: min(230px, 32%);
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  overflow: hidden;
  border-radius: 20px;
  box-shadow: var(--shadow);
  transform: rotateY(16deg) rotateX(10deg) rotateZ(-8deg);
}

.mini-board span {
  aspect-ratio: 1;
}

.mini-board .light {
  background: var(--board-light);
}

.mini-board .dark {
  background: var(--board-dark);
}

.piece {
  position: absolute;
  color: #151a22;
  font-size: clamp(22px, 4vw, 42px);
  text-shadow: 0 8px 22px rgba(0,0,0,.18);
}

.piece.one { left: 17%; top: 18%; }
.piece.two { left: 48%; top: 66%; color: #fff; }
.piece.three { right: 12%; top: 34%; }

.signal-strip {
  align-items: stretch;
  border-block: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-solid) 62%, transparent);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
}

.signal-strip article {
  flex: 1;
  min-height: 190px;
  padding: clamp(28px, 4vw, 48px);
  border-right: 1px solid var(--line);
}

.signal-strip article:last-child {
  border-right: 0;
}

.signal-strip span,
.lesson-card span {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 18px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  font-size: 12px;
  font-weight: 950;
}

.signal-strip strong {
  display: block;
  margin-bottom: 10px;
  font-size: 21px;
}

.signal-strip p {
  margin-bottom: 0;
  color: var(--muted);
}

.story {
  position: relative;
}

.chapter {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: clamp(30px, 6vw, 88px);
  border-bottom: 1px solid var(--line);
}

.chapter-copy {
  max-width: 650px;
}

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

.section-heading {
  grid-column: 1 / -1;
  max-width: 980px;
}

.pawn-scene {
  position: relative;
  min-height: 520px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 58%, rgba(75,141,255,.24), transparent 30%),
    linear-gradient(145deg, var(--panel), transparent);
  box-shadow: var(--soft-shadow);
  overflow: hidden;
}

.diagnostic-card {
  position: relative;
  width: min(460px, 86%);
  padding: 18px;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.84), rgba(255,255,255,.58)),
    radial-gradient(circle at 82% 12%, rgba(210,166,66,.18), transparent 34%);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(22px) saturate(1.12);
  backdrop-filter: blur(22px) saturate(1.12);
}

.diagnostic-top {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.diagnostic-top img {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(75,141,255,.18);
}

.diagnostic-top small,
.diagnostic-footer span {
  color: var(--blue);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.diagnostic-top strong {
  display: block;
  color: #111722;
  font-size: 19px;
  line-height: 1.1;
}

.starter-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  overflow: hidden;
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(30,36,54,.18);
}

.starter-board span {
  aspect-ratio: 1;
  background: var(--board-light);
}

.starter-board .dark {
  background: var(--board-dark);
}

.starter-piece {
  position: absolute;
  z-index: 3;
  width: 12%;
  filter: drop-shadow(0 10px 14px rgba(18,24,35,.22));
}

.starter-king { left: 43.75%; bottom: 0; }
.starter-pawn { left: 43.75%; bottom: 25%; }
.starter-rook { right: 18.75%; top: 12.5%; }

.starter-target {
  position: absolute;
  right: 19.5%;
  top: 13.25%;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  background: #ff5b67;
  box-shadow: 0 0 0 10px rgba(255,91,103,.14), 0 0 28px rgba(255,91,103,.44);
  font-size: 18px;
  font-weight: 950;
}

.starter-arrow {
  position: absolute;
  inset: 20% 18% auto auto;
  z-index: 5;
  width: 42%;
  overflow: visible;
}

.starter-arrow path {
  fill: none;
  stroke: var(--blue);
  stroke-width: 8;
  stroke-linecap: round;
  filter: drop-shadow(0 0 14px rgba(75,141,255,.5));
}

.starter-arrow polygon {
  fill: var(--blue);
}

.diagnostic-footer {
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.diagnostic-footer span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  letter-spacing: 0;
}

.diagnostic-footer p {
  margin: 0;
  color: #111722;
  font-weight: 850;
  line-height: 1.24;
}

.chapter-lessons {
  display: block;
}

.lesson-stack {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(18px, 3vw, 30px);
  margin-top: 54px;
  perspective: 1400px;
}

.lesson-card {
  position: relative;
  min-height: 390px;
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--panel-solid) 78%, transparent), color-mix(in srgb, var(--panel) 56%, transparent)),
    radial-gradient(circle at 80% 16%, rgba(138,109,255,.22), transparent 36%);
  box-shadow: var(--soft-shadow);
  opacity: .35;
  filter: blur(12px) saturate(.8);
  transform: translateY(90px) translateZ(calc(var(--i) * -70px)) rotateY(calc((var(--i) - 1) * -14deg)) scale(.94);
  transform-style: preserve-3d;
  overflow: hidden;
}

.lesson-card p {
  max-width: 72%;
}

.lesson-card::after {
  content: "";
  position: absolute;
  right: -18%;
  bottom: -24%;
  width: 68%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(75,141,255,.16), transparent 62%);
  pointer-events: none;
}

.lesson-preview {
  position: absolute;
  right: clamp(20px, 4vw, 34px);
  bottom: clamp(58px, 6vw, 82px);
  width: min(178px, 42%);
  aspect-ratio: 1.08;
  transform: rotate(-4deg);
}

.preview-board {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.42);
  box-shadow: 0 24px 56px rgba(18,24,35,.16);
}

.preview-board i {
  aspect-ratio: 1;
  background: var(--board-light);
}

.preview-board .dark {
  background: var(--board-dark);
}

.preview-piece {
  position: absolute;
  z-index: 3;
  width: 21%;
  filter: drop-shadow(0 9px 12px rgba(18,24,35,.2));
}

.preview-one { left: 14%; top: 12%; }
.preview-two { right: 13%; top: 36%; }
.preview-three { left: 39%; bottom: 8%; }

.lesson-preview svg {
  position: absolute;
  inset: 8% 5% auto auto;
  z-index: 4;
  width: 68%;
  overflow: visible;
}

.lesson-preview path {
  fill: none;
  stroke: var(--blue);
  stroke-width: 7;
  stroke-linecap: round;
  filter: drop-shadow(0 0 12px rgba(75,141,255,.48));
}

.lesson-preview polygon {
  fill: var(--blue);
}

.lesson-foundation .preview-two {
  display: none;
}

.lesson-foundation .lesson-preview svg {
  transform: rotate(13deg);
}

.lesson-tactics .preview-one {
  left: 39%;
  top: 9%;
}

.lesson-tactics .lesson-preview path {
  stroke: #ff6b77;
}

.lesson-tactics .lesson-preview polygon {
  fill: #ff6b77;
}

.lesson-openings .preview-two {
  right: 36%;
  top: 12%;
}

.lesson-openings .preview-three {
  left: 14%;
  bottom: 12%;
}

.lesson-card small {
  position: absolute;
  left: clamp(24px, 4vw, 40px);
  bottom: clamp(26px, 4vw, 38px);
  display: inline-flex;
  max-width: 52%;
  margin-top: 0;
  color: var(--blue);
  font-weight: 900;
  line-height: 1.24;
}

.analysis-lab {
  position: relative;
  min-height: 620px;
  display: grid;
  place-items: center;
  isolation: isolate;
  overflow: hidden;
}

.analysis-lab::before,
.analysis-lab::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}

.analysis-lab::before {
  width: 78%;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(75,141,255,.22), transparent 62%);
  filter: blur(18px);
}

.analysis-lab::after {
  width: 42%;
  aspect-ratio: 1;
  right: 2%;
  bottom: 8%;
  background: radial-gradient(circle, rgba(210,166,66,.2), transparent 64%);
  filter: blur(14px);
}

.analysis-board {
  position: relative;
  width: min(590px, 100%);
  margin-inline: auto;
  border-radius: 24px;
  transform: perspective(1200px) rotateX(52deg) rotateZ(-18deg);
  transform-style: preserve-3d;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  overflow: hidden;
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.board-grid span {
  aspect-ratio: 1;
  background: var(--board-light);
}

.board-grid span:nth-child(16n + 2),
.board-grid span:nth-child(16n + 4),
.board-grid span:nth-child(16n + 6),
.board-grid span:nth-child(16n + 8),
.board-grid span:nth-child(16n + 9),
.board-grid span:nth-child(16n + 11),
.board-grid span:nth-child(16n + 13),
.board-grid span:nth-child(16n + 15) {
  background: var(--board-dark);
}

.analysis-piece {
  position: absolute;
  z-index: 3;
  width: 13%;
  filter: drop-shadow(0 18px 18px rgba(0,0,0,.25));
}

.analysis-piece.knight {
  left: 23.5%;
  bottom: 24%;
}

.analysis-piece.queen {
  right: 20%;
  top: 22%;
}

.analysis-mark {
  position: absolute;
  z-index: 2;
  width: 12.5%;
  aspect-ratio: 1;
  border-radius: 16px;
  transform: translateZ(18px);
}

.analysis-mark.target {
  left: 36.5%;
  top: 24.5%;
  background: rgba(75,141,255,.28);
  box-shadow: inset 0 0 0 4px rgba(75,141,255,.52), 0 0 24px rgba(75,141,255,.42);
}

.analysis-mark.danger {
  right: 19%;
  top: 21%;
  background: rgba(255,91,103,.2);
  box-shadow: inset 0 0 0 4px rgba(255,91,103,.55), 0 0 24px rgba(255,91,103,.36);
}

.analysis-mark.safe {
  left: 24%;
  bottom: 23%;
  background: rgba(54,217,130,.18);
  box-shadow: inset 0 0 0 4px rgba(54,217,130,.5), 0 0 24px rgba(54,217,130,.32);
}

.move-arrow {
  position: absolute;
  inset: 12% 16% auto auto;
  z-index: 5;
  width: 48%;
  overflow: visible;
  transform: translateZ(60px) rotateX(-52deg) rotateZ(18deg);
}

.move-arrow path {
  fill: none;
  stroke: var(--blue);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 380;
  stroke-dashoffset: 380;
  filter: drop-shadow(0 0 16px rgba(75,141,255,.6));
}

.is-visible .move-arrow path,
.move-arrow.is-visible path {
  animation: draw-arrow 1.4s ease forwards;
}

.move-arrow polygon {
  fill: var(--blue);
  filter: drop-shadow(0 0 16px rgba(75,141,255,.6));
}

.analysis-panel {
  position: absolute;
  right: clamp(0px, 1vw, 18px);
  bottom: clamp(24px, 4vw, 42px);
  z-index: 8;
  width: min(350px, 76%);
  padding: 18px;
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 28px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--panel-solid) 80%, transparent), color-mix(in srgb, var(--panel) 62%, transparent)),
    radial-gradient(circle at 20% 10%, rgba(75,141,255,.22), transparent 38%);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(26px) saturate(1.2);
  backdrop-filter: blur(26px) saturate(1.2);
}

.analysis-panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.analysis-panel-top span,
.move-feed span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.analysis-panel-top strong {
  color: var(--blue);
  font-size: 34px;
  line-height: 1;
}

.eval-meter {
  position: relative;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(100, 107, 120, .16);
}

.eval-meter i {
  display: block;
  width: 52%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--blue), var(--violet), var(--gold));
  box-shadow: 0 0 24px rgba(75,141,255,.55);
  transform-origin: left center;
}

.move-feed {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.move-feed span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel-solid) 56%, transparent);
}

.move-feed span::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  opacity: .45;
}

.move-feed .is-best {
  color: var(--ink);
  background: linear-gradient(135deg, rgba(75,141,255,.18), rgba(138,109,255,.16));
}

.move-feed .is-best::after {
  width: 34px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--gold));
  opacity: 1;
}

.analysis-panel p {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 850;
  line-height: 1.3;
}

.metrics {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.metrics span {
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
}

.metrics strong {
  color: var(--ink);
}

.skill-tree {
  position: relative;
  min-height: 540px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 18% 68%, rgba(75,141,255,.2), transparent 30%),
    radial-gradient(circle at 76% 26%, rgba(210,166,66,.2), transparent 26%),
    var(--panel);
  box-shadow: var(--soft-shadow);
  overflow: hidden;
}

.skill-tree svg {
  position: absolute;
  inset: 12% 8%;
  width: 84%;
  height: 74%;
}

.skill-tree path {
  fill: none;
  stroke: url(#skill);
  stroke: var(--blue);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
}

.skill-tree.is-visible path,
.is-visible .skill-tree path {
  animation: draw-line 1.8s ease forwards;
}

.skill-tree.is-visible > span,
.is-visible .skill-tree > span {
  animation: pop-node .72s cubic-bezier(.2, .9, .2, 1.25) both;
}

.skill-tree > span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  box-shadow: 0 22px 58px rgba(75,141,255,.34);
  font-weight: 950;
  transform: translate(-50%, -50%);
}

.xp-console {
  position: absolute;
  right: clamp(20px, 5vw, 44px);
  bottom: 30px;
  z-index: 4;
  width: min(250px, 48%);
  padding: 18px;
  border: 1px solid rgba(255,255,255,.36);
  border-radius: 24px;
  background: color-mix(in srgb, var(--panel-solid) 74%, transparent);
  box-shadow: var(--soft-shadow);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
}

.xp-console small,
.coach-spotlight small {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.xp-console strong {
  display: block;
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 34px;
  line-height: 1;
}

.xp-console strong::after {
  content: " XP";
  color: var(--blue);
  font-size: 14px;
  font-weight: 950;
}

.xp-track {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: rgba(100, 107, 120, .18);
}

.xp-track i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--violet), var(--gold));
  box-shadow: 0 0 22px rgba(75,141,255,.55);
}

.world-card,
.streak-card,
.reward-card {
  position: absolute;
  z-index: 5;
  border: 1px solid rgba(255,255,255,.36);
  background: color-mix(in srgb, var(--panel-solid) 74%, transparent);
  box-shadow: var(--soft-shadow);
  -webkit-backdrop-filter: blur(24px) saturate(1.18);
  backdrop-filter: blur(24px) saturate(1.18);
}

.world-card {
  left: clamp(18px, 4vw, 36px);
  top: 28px;
  width: min(320px, 50%);
  padding: 20px;
  border-radius: 28px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--panel-solid) 78%, transparent), color-mix(in srgb, var(--panel) 64%, transparent)),
    radial-gradient(circle at 90% 10%, rgba(210,166,66,.18), transparent 34%);
}

.streak-card {
  right: clamp(18px, 5vw, 42px);
  top: 30px;
  min-width: 150px;
  padding: 16px 18px;
  border-radius: 24px;
}

.reward-card {
  width: min(230px, 40%);
  padding: 15px 17px;
  border-radius: 22px;
}

.reward-one {
  left: 8%;
  bottom: 38px;
}

.reward-two {
  right: 9%;
  top: 39%;
}

.world-card small,
.streak-card small,
.reward-card small {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.world-card strong,
.streak-card strong,
.reward-card strong {
  display: block;
  color: var(--ink);
  line-height: 1.05;
}

.world-card strong {
  font-size: clamp(24px, 3vw, 34px);
}

.world-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-weight: 760;
}

.streak-card strong {
  color: var(--gold);
  font-size: 26px;
}

.reward-card strong {
  font-size: 18px;
}

.reward-card::before {
  content: "";
  display: block;
  width: 34px;
  height: 34px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gold), var(--blue));
  box-shadow: 0 0 26px rgba(210,166,66,.34);
}

.coach-stage {
  position: relative;
  min-height: 560px;
}

.coach-spotlight {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  width: min(300px, 72%);
  min-height: 360px;
  display: grid;
  place-items: center;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 38px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 22%, rgba(75,141,255,.24), transparent 42%),
    color-mix(in srgb, var(--panel) 70%, transparent);
  box-shadow: var(--shadow);
  transform: translate(-50%, -50%);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
}

.coach-spotlight img {
  width: 154px;
  height: 154px;
  border-radius: 40px;
  box-shadow: 0 24px 70px rgba(75,141,255,.22);
  transition: filter .35s ease, transform .35s ease;
}

.coach-spotlight strong {
  display: block;
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
}

.coach-console {
  position: absolute;
  left: 50%;
  bottom: 4%;
  z-index: 6;
  width: min(390px, 72%);
  padding: 18px;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 28px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--panel-solid) 80%, transparent), color-mix(in srgb, var(--panel) 62%, transparent)),
    radial-gradient(circle at 92% 12%, rgba(75,141,255,.18), transparent 32%);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  -webkit-backdrop-filter: blur(26px) saturate(1.22);
  backdrop-filter: blur(26px) saturate(1.22);
}

.coach-console-top,
.coach-confidence {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.coach-console-top span,
.coach-confidence span,
.coach-tools span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.coach-console-top strong {
  color: var(--gold);
  font-size: 24px;
  line-height: 1;
}

.coach-console p {
  margin: 12px 0 14px;
  color: var(--ink);
  font-size: 19px;
  font-weight: 850;
  line-height: 1.22;
}

.coach-tools {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 15px;
}

.coach-tools span {
  display: grid;
  place-items: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel-solid) 56%, transparent);
  letter-spacing: 0;
  text-transform: none;
}

.coach-confidence b {
  flex: 1;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(100,107,120,.16);
}

.coach-confidence i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--blue), var(--gold));
  box-shadow: 0 0 22px rgba(75,141,255,.5);
}

.coach-confidence em {
  min-width: 42px;
  color: var(--ink);
  font-style: normal;
  font-weight: 950;
  text-align: right;
}

.coach-card {
  position: absolute;
  z-index: 2;
  width: min(280px, 68vw);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--soft-shadow);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
}

.coach-card img {
  width: 104px;
  height: 104px;
  border-radius: 28px;
}

.coach-card p {
  margin: 16px 0 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
}

.emotion-0 { left: 0; top: 2%; }
.emotion-1 { right: 0; top: 10%; }
.emotion-2 { left: 2%; bottom: 4%; }
.emotion-3 { right: 4%; bottom: 0; }

.chapter-devices {
  display: block;
  overflow: hidden;
}

.device-cloud {
  position: relative;
  min-height: 700px;
  margin-top: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 30% 24%, rgba(75,141,255,.18), transparent 34%),
    radial-gradient(circle at 78% 70%, rgba(210,166,66,.16), transparent 32%),
    color-mix(in srgb, var(--panel-solid) 20%, transparent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), var(--soft-shadow);
}

.sync-rail {
  position: absolute;
  inset: 8% 6%;
  z-index: 1;
  pointer-events: none;
}

.sync-rail svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.sync-rail path {
  fill: none;
  stroke: url(#sync-gradient);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 1120;
  stroke-dashoffset: 1120;
  filter: drop-shadow(0 0 18px rgba(75,141,255,.5));
}

.sync-dot {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 3px solid color-mix(in srgb, var(--panel-solid) 80%, transparent);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 0 0 9px rgba(75,141,255,.12), 0 0 34px rgba(75,141,255,.72);
}

.phone-dot { left: 8%; top: 57%; }
.tablet-dot { left: 42%; top: 44%; }
.mac-dot { right: 10%; top: 28%; }
.android-dot { right: 25%; bottom: 19%; }

.sync-card {
  position: absolute;
  left: 52%;
  bottom: 7%;
  z-index: 8;
  width: min(370px, 40%);
  padding: 20px;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 30px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--panel-solid) 82%, transparent), color-mix(in srgb, var(--panel) 64%, transparent)),
    radial-gradient(circle at 85% 10%, rgba(210,166,66,.18), transparent 35%);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  -webkit-backdrop-filter: blur(28px) saturate(1.22);
  backdrop-filter: blur(28px) saturate(1.22);
}

.sync-card small {
  display: block;
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.sync-card strong {
  display: block;
  color: var(--ink);
  font-size: clamp(28px, 3vw, 42px);
  line-height: .95;
}

.sync-card p {
  margin: 12px 0 18px;
  color: var(--muted);
  font-weight: 750;
}

.sync-progress {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.sync-progress b {
  display: block;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(100,107,120,.16);
}

.sync-progress i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--violet), var(--gold));
  box-shadow: 0 0 22px rgba(75,141,255,.55);
}

.sync-progress em {
  color: var(--ink);
  font-style: normal;
}

.device {
  position: absolute;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel-solid);
  box-shadow: var(--shadow);
  opacity: .92;
  filter: saturate(1.08) contrast(1.04);
  z-index: 4;
}

.device img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.device figcaption {
  position: absolute;
  left: 16px;
  bottom: 16px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  color: #111722;
  font-size: 13px;
  font-weight: 950;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.phone-a {
  left: 3%;
  top: 16%;
  width: min(260px, 32vw);
  aspect-ratio: 598 / 1300;
  transform: rotate(-8deg);
}

.tablet-a {
  left: 29%;
  top: 8%;
  width: min(420px, 45vw);
  aspect-ratio: 1125 / 1500;
}

.desktop-a {
  right: 4%;
  top: 24%;
  width: min(430px, 38vw);
  aspect-ratio: 16 / 9;
  transform: rotate(3deg);
}

.android-a {
  right: 13%;
  bottom: 5%;
  width: min(228px, 28vw);
  aspect-ratio: 598 / 1300;
  transform: rotate(8deg);
}

.download {
  min-height: 92vh;
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(360px, 1.08fr);
  align-items: center;
  gap: clamp(32px, 6vw, 92px);
  overflow: hidden;
}

.download-copy {
  max-width: 780px;
}

.download-copy h2 {
  margin-bottom: 22px;
}

.download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.download-stage {
  position: relative;
  min-height: min(680px, 74vh);
  display: grid;
  place-items: center;
  isolation: isolate;
}

.download-stage::before {
  content: "";
  position: absolute;
  inset: 7% 4%;
  z-index: -1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 45% 45%, rgba(75,141,255,.34), transparent 34%),
    radial-gradient(circle at 68% 66%, rgba(210,166,66,.24), transparent 30%),
    radial-gradient(circle at 30% 22%, rgba(138,109,255,.28), transparent 32%);
  filter: blur(18px);
}

.download-phone {
  position: relative;
  z-index: 4;
  width: min(360px, 62%);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 42px;
  background: #090b12;
  box-shadow: var(--shadow);
  transform: rotateY(-12deg) rotateX(4deg) rotateZ(2deg);
}

.download-phone::before {
  content: "";
  position: absolute;
  inset: 10px;
  z-index: 2;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 32px;
  pointer-events: none;
}

.download-phone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.store-card,
.download-proof {
  position: absolute;
  z-index: 7;
  border: 1px solid rgba(255,255,255,.42);
  background: color-mix(in srgb, var(--panel-solid) 78%, transparent);
  box-shadow: var(--soft-shadow);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  backdrop-filter: blur(24px) saturate(1.2);
}

.store-card {
  left: 0;
  top: 13%;
  width: min(360px, 68%);
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: 28px;
}

.store-card img {
  border-radius: 20px;
  box-shadow: 0 14px 34px rgba(75,141,255,.22);
}

.store-card small,
.download-proof small {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.store-card strong {
  display: block;
  color: var(--ink);
  font-size: 23px;
  line-height: 1.05;
}

.store-card span {
  grid-column: 1 / -1;
  display: inline-flex;
  justify-self: start;
  padding: 8px 11px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  font-size: 12px;
  font-weight: 950;
}

.download-proof {
  min-width: 172px;
  padding: 15px 17px;
  border-radius: 22px;
}

.download-proof strong {
  color: var(--ink);
  font-size: 21px;
  line-height: 1;
}

.proof-one {
  right: 2%;
  top: 22%;
}

.proof-two {
  left: 6%;
  bottom: 20%;
}

.proof-three {
  right: 8%;
  bottom: 11%;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 32px clamp(18px, 5vw, 72px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-weight: 800;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 13px;
}

.footer-links a {
  font-weight: 850;
}

.legal-body {
  min-height: 100vh;
}

.legal-page {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: max(152px, calc(env(safe-area-inset-top) + 140px)) 0 72px;
}

.legal-hero {
  display: grid;
  gap: 22px;
  min-height: auto;
  padding: clamp(34px, 6vw, 64px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 88% 14%, rgba(75,141,255,.24), transparent 34%),
    radial-gradient(circle at 12% 86%, rgba(210,166,66,.18), transparent 30%),
    color-mix(in srgb, var(--panel) 84%, transparent);
  box-shadow: var(--soft-shadow);
  -webkit-backdrop-filter: blur(24px) saturate(1.16);
  backdrop-filter: blur(24px) saturate(1.16);
}

.legal-hero h1 {
  max-width: 860px;
  font-size: clamp(42px, 7vw, 82px);
}

.legal-hero .lead {
  max-width: 840px;
}

.legal-meta,
.support-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.legal-meta span,
.legal-meta a {
  color: var(--muted);
  font-weight: 800;
}

.legal-meta span {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel-solid) 58%, transparent);
}

.legal-meta a,
.legal-content a {
  color: var(--blue);
}

.legal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0;
}

.legal-grid-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.legal-card {
  min-height: 252px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: color-mix(in srgb, var(--panel) 86%, transparent);
  box-shadow: var(--soft-shadow);
}

.legal-card span {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 22px;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  font-size: 12px;
  font-weight: 950;
}

.legal-card h2,
.legal-content h2,
.support-contact h2 {
  margin-bottom: 12px;
  color: var(--ink);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.08;
}

.legal-card p,
.legal-content p,
.legal-content li,
.support-contact p {
  color: var(--muted);
  font-size: 17px;
  font-weight: 720;
}

.legal-content strong {
  color: var(--ink);
}

.support-contact h2 a {
  color: var(--blue);
}

.legal-content {
  display: grid;
  gap: 14px;
}

.legal-content article {
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: color-mix(in srgb, var(--panel-solid) 72%, transparent);
  box-shadow: var(--soft-shadow);
}

.legal-content p:last-child,
.legal-card p:last-child,
.support-contact p:last-child {
  margin-bottom: 0;
}

.legal-content ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
}

.support-contact {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  margin: 18px 0;
  padding: clamp(22px, 4vw, 36px);
  border: 1px solid var(--line);
  border-radius: 32px;
  background:
    radial-gradient(circle at 10% 30%, rgba(210,166,66,.22), transparent 30%),
    color-mix(in srgb, var(--panel) 86%, transparent);
  box-shadow: var(--soft-shadow);
}

.support-avatar {
  display: grid;
  place-items: center;
  width: 150px;
  height: 150px;
  border-radius: 42px;
  background: linear-gradient(135deg, rgba(75,141,255,.18), rgba(210,166,66,.22));
  box-shadow: var(--soft-shadow);
}

.support-avatar img {
  width: 118px;
  height: 118px;
  border-radius: 34px;
}

[data-reveal] {
  opacity: 1;
  transform: none;
  transition: opacity .85s ease, transform .85s cubic-bezier(.2,.8,.2,1);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

.floating {
  animation: float 7s ease-in-out infinite;
}

.float-delay {
  animation: float 8s ease-in-out .8s infinite;
}

.float-slow {
  animation: float 10s ease-in-out 1.2s infinite;
}

@keyframes float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -18px; }
}

@keyframes draw-arrow {
  to { stroke-dashoffset: 0; }
}

@keyframes draw-line {
  to { stroke-dashoffset: 0; }
}

@keyframes pop-node {
  0% { opacity: 0; scale: .45; }
  100% { opacity: 1; scale: 1; }
}

/* Reworked product-story sections: clearer, less fragile layering. */
.story .chapter {
  padding-top: clamp(96px, 8vw, 122px);
  padding-bottom: clamp(72px, 7vw, 108px);
}

.story .chapter h2 {
  font-size: clamp(42px, 5.6vw, 78px);
  line-height: .94;
}

.chapter-lessons .section-heading h2,
.chapter-devices .section-heading h2 {
  font-size: clamp(42px, 5.2vw, 72px);
  line-height: .96;
}

.hero-stage {
  min-height: min(690px, 76vh);
  isolation: isolate;
}

.hero-photo-card.product-tablet-peek {
  inset: auto;
  left: 6%;
  top: 14%;
  width: min(460px, 56%);
  aspect-ratio: 1125 / 1500;
  opacity: .72;
  border-radius: 34px;
  transform: rotate(-4deg) scale(.94);
}

.product-tablet-peek figcaption {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 3;
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  color: #111722;
  font-size: 12px;
  font-weight: 950;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.hero-phone-device {
  right: 7%;
  top: 7%;
  width: min(315px, 38%);
  border-width: 9px;
  border-radius: 38px;
}

.live-status {
  top: 7%;
  left: 8%;
  width: min(320px, 42%);
}

.live-coach-tip {
  top: 31%;
  right: 2%;
  width: min(300px, 36%);
}

.coach-orb {
  top: auto;
  right: 3%;
  bottom: 20%;
  max-width: 300px;
}

.stat-one {
  left: 4%;
  top: 42%;
}

.stat-two {
  right: 6%;
  bottom: 7%;
}

.mini-board {
  left: 13%;
  bottom: 5%;
  width: min(210px, 28%);
  opacity: .96;
}

.mini-piece {
  position: absolute;
  width: 13%;
  height: auto;
  filter: drop-shadow(0 10px 16px rgba(18,24,35,.22));
}

.piece.one { left: 17%; top: 18%; }
.piece.two { left: 48%; top: 66%; }
.piece.three { right: 12%; top: 34%; }

.diagnostic-card {
  width: min(640px, 92%);
}

.diagnostic-body {
  display: grid;
  grid-template-columns: minmax(220px, .92fr) minmax(170px, .72fr);
  gap: 16px;
  align-items: center;
}

.diagnostic-checks {
  display: grid;
  gap: 10px;
}

.diagnostic-checks p {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(28,34,48,.1);
  border-radius: 16px;
  background: rgba(255,255,255,.62);
  color: #111722;
  font-weight: 850;
  line-height: 1.18;
}

.diagnostic-checks span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  font-size: 11px;
  font-weight: 950;
}

.lesson-card {
  min-height: 280px;
  display: block;
  padding: 28px;
}

.lesson-card > span {
  margin-bottom: 14px;
}

.lesson-card h3 {
  margin-bottom: 0;
  max-width: 72%;
  font-size: clamp(28px, 2.8vw, 36px);
}

.lesson-card p {
  max-width: 72%;
  margin-bottom: 0;
  font-size: 16px;
  line-height: 1.3;
}

.lesson-steps {
  width: min(260px, 72%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.lesson-steps b {
  display: grid;
  place-items: center;
  min-height: 29px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: color-mix(in srgb, var(--panel-solid) 58%, transparent);
  font-size: 12px;
  line-height: 1;
}

.lesson-preview {
  position: absolute;
  right: 22px;
  bottom: 24px;
  width: min(108px, 31%);
  max-width: none;
}

.lesson-card small {
  display: none;
}

.analysis-lab {
  min-height: 560px;
  overflow: visible;
  align-content: center;
  gap: 14px;
  transform: translateY(-116px);
}

.analysis-board {
  width: min(270px, 78%);
  transform: none;
}

.move-arrow {
  inset: 15% 14% auto auto;
  width: 46%;
  transform: none;
}

.analysis-panel {
  position: relative;
  right: auto;
  bottom: auto;
  width: min(360px, 88%);
  margin-top: 0;
  padding: 15px;
  border-radius: 24px;
}

.analysis-panel p {
  display: none;
}

.move-feed {
  gap: 6px;
  margin: 12px 0;
}

.move-feed span {
  min-height: 34px;
}

.skill-tree {
  min-height: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(220px, .85fr);
  grid-template-areas:
    "world streak"
    "route route"
    "reward1 reward2"
    "xp xp";
  gap: 16px;
  padding: 24px;
  overflow: visible;
}

.skill-tree .world-card,
.skill-tree .streak-card,
.skill-tree .reward-card,
.skill-tree .xp-console {
  position: relative;
  inset: auto;
  width: auto;
  min-width: 0;
}

.skill-tree .world-card { grid-area: world; }
.skill-tree .streak-card { grid-area: streak; }
.skill-tree .reward-one { grid-area: reward1; }
.skill-tree .reward-two { grid-area: reward2; }
.skill-tree .xp-console { grid-area: xp; }

.skill-route {
  grid-area: route;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 148px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: color-mix(in srgb, var(--panel-solid) 38%, transparent);
  overflow: hidden;
}

.skill-route svg {
  position: absolute;
  inset: 16px 20px;
  width: calc(100% - 40px);
  height: calc(100% - 32px);
  pointer-events: none;
}

.skill-route path {
  fill: none;
  stroke: var(--blue);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  filter: drop-shadow(0 0 16px rgba(75,141,255,.42));
}

.skill-node {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 26px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  box-shadow: 0 18px 48px rgba(75,141,255,.32);
  font-weight: 950;
}

.skill-node.is-done {
  background: linear-gradient(135deg, #6edaa2, var(--blue));
}

.skill-node.is-active {
  box-shadow: 0 0 0 8px rgba(75,141,255,.14), 0 22px 58px rgba(75,141,255,.42);
}

.coach-stage {
  min-height: auto;
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.coach-spotlight,
.coach-console,
.coach-card {
  position: relative;
  inset: auto;
  transform: none;
}

.coach-spotlight {
  left: auto;
  top: auto;
  width: 100%;
  min-height: auto;
}

.coach-console {
  left: auto;
  bottom: auto;
  width: 100%;
}

.coach-cards {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.coach-card {
  width: auto;
  padding: 12px;
  border-radius: 22px;
}

.coach-card img {
  width: 76px;
  height: 76px;
  border-radius: 20px;
}

.coach-card p {
  margin-top: 10px;
  font-size: 16px;
  line-height: 1.12;
}

.emotion-0,
.emotion-1,
.emotion-2,
.emotion-3 {
  left: auto;
  right: auto;
  top: auto;
  bottom: auto;
}

.device-cloud {
  min-height: auto;
  display: grid;
  grid-template-columns: minmax(170px, .8fr) minmax(260px, 1.25fr) minmax(170px, .8fr);
  align-items: center;
  gap: 18px;
  padding: 28px;
  overflow: hidden;
}

.sync-rail {
  display: none;
}

.device {
  position: relative;
  inset: auto;
  width: auto;
  max-width: none;
  transform: none;
}

.phone-a,
.android-a {
  aspect-ratio: 598 / 1300;
}

.tablet-a {
  aspect-ratio: 1125 / 1500;
}

.sync-card {
  position: relative;
  left: auto;
  bottom: auto;
  grid-column: 1 / -1;
  justify-self: center;
  width: min(680px, 100%);
  transform: none;
}

@media (max-width: 980px) {
  nav {
    display: none;
  }

  .footer-links {
    display: flex;
  }

  .hero,
  .chapter,
  .download {
    grid-template-columns: 1fr;
  }

  .legal-grid,
  .legal-grid-four,
  .support-contact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-stage {
    min-height: 660px;
  }

  .hero-photo-card {
    inset: 2% 4% 2% 8%;
  }

  .hero-phone-device {
    right: 14%;
    width: min(230px, 34vw);
  }

  .live-status {
    left: 13%;
    width: min(300px, 48%);
  }

  .live-coach-tip {
    right: 4%;
    width: min(280px, 40%);
  }

  .lesson-stack,
  .signal-strip {
    grid-template-columns: 1fr;
    display: grid;
  }

  .signal-strip article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .signal-strip article:last-child {
    border-bottom: 0;
  }

  .device-cloud {
    min-height: auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 18px;
  }

  .device {
    position: relative;
    inset: auto;
    width: 100%;
    transform: none;
  }

  .sync-rail {
    inset: 4%;
  }

  .sync-card {
    position: relative;
    left: auto;
    bottom: auto;
    grid-column: 1 / -1;
    width: 100%;
    transform: none;
  }

  .lesson-preview {
    width: min(178px, 34%);
  }
}

@media (max-width: 640px) {
  .site-header {
    top: 10px;
    height: 56px;
  }

  .brand span {
    display: none;
  }

  .cinematic-section,
  .chapter,
  .download {
    padding-inline: 16px;
  }

  .chapter,
  .hero {
    overflow: hidden;
  }

  h1 {
    font-size: clamp(46px, 14vw, 68px);
  }

  h2 {
    font-size: clamp(38px, 12vw, 60px);
  }

  .hero-stage {
    min-height: 560px;
  }

  .hero-photo-card {
    inset: 3% 0 12% 7%;
    border-radius: 32px;
  }

  .hero-phone-device {
    right: 12%;
    top: 17%;
    width: min(205px, 48vw);
    border-width: 7px;
    border-radius: 30px;
  }

  .live-status {
    top: 10%;
    left: 6%;
    width: min(275px, 74%);
  }

  .live-board {
    width: 38%;
  }

  .live-coach-tip {
    top: auto;
    right: 4%;
    bottom: 23%;
    width: min(230px, 68%);
  }

  .coach-orb {
    right: 0;
    top: 38%;
    max-width: 230px;
  }

  .mini-board {
    width: 42%;
  }

.lesson-stack,
.device-cloud {
    grid-template-columns: 1fr;
  }

  .analysis-board {
    width: min(82vw, 360px);
    transform: perspective(1000px) rotateX(48deg) rotateZ(-14deg);
  }

  .analysis-lab {
    min-height: 600px;
  }

  .analysis-panel {
    right: 0;
    bottom: 0;
    width: min(330px, 92%);
  }

  .skill-tree {
    min-height: auto;
    display: grid;
    gap: 12px;
    padding: 18px;
  }

  .skill-tree svg {
    position: relative;
    inset: auto;
    width: 100%;
    height: 260px;
    order: 2;
  }

  .skill-tree > span {
    position: relative;
    left: auto;
    top: auto;
    width: 68px;
    height: 68px;
    border-radius: 22px;
    font-size: 12px;
    transform: none;
  }

  .xp-console {
    position: relative;
    right: auto;
    bottom: auto;
    width: calc(100% - 36px);
    order: 1;
    margin-inline: auto;
  }

  .world-card,
  .streak-card,
  .reward-card {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    width: 100%;
    min-width: 0;
  }

  .world-card {
    order: 0;
  }

  .streak-card,
  .reward-card {
    order: 3;
  }

  .coach-stage {
    min-height: 760px;
  }

  .coach-spotlight {
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
    min-height: 300px;
    margin-bottom: 14px;
    transform: none;
  }

  .coach-card {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    width: 100%;
    margin-bottom: 14px;
  }

  .coach-console {
    position: relative;
    left: auto;
    bottom: auto;
    width: 100%;
    margin-bottom: 14px;
    transform: none;
  }

  .coach-tools {
    grid-template-columns: 1fr;
  }

  .download-stage {
    min-height: 640px;
  }

  .download-phone {
    width: min(270px, 74%);
    border-radius: 34px;
    transform: rotateY(-8deg) rotateX(3deg) rotateZ(1deg);
  }

  .store-card {
    left: 0;
    top: 0;
    width: min(320px, 88%);
  }

  .proof-one {
    right: 0;
    top: 31%;
  }

  .proof-two {
    left: 0;
    bottom: 18%;
  }

  .proof-three {
    right: 0;
    bottom: 4%;
  }

  .download-proof {
    min-width: 150px;
  }

  .legal-page {
    width: min(100% - 24px, 1100px);
    padding-top: max(126px, calc(env(safe-area-inset-top) + 116px));
  }

  .legal-hero {
    padding: 28px;
  }

  .legal-meta span {
    width: 100%;
    border-radius: 18px;
  }

  .support-avatar {
    width: 126px;
    height: 126px;
    border-radius: 34px;
  }

  .support-avatar img {
    width: 96px;
    height: 96px;
  }

  .legal-grid,
  .legal-grid-four,
  .support-contact {
    grid-template-columns: 1fr;
  }

  footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 980px) {
  .hero-photo-card.product-tablet-peek {
    left: 6%;
    top: 10%;
    width: min(440px, 58%);
  }

  .hero-phone-device {
    right: 8%;
    width: min(300px, 36vw);
  }

  .diagnostic-body,
  .skill-tree,
  .coach-stage {
    grid-template-columns: 1fr;
  }

  .skill-tree {
    grid-template-areas:
      "world"
      "streak"
      "route"
      "reward1"
      "reward2"
      "xp";
  }

  .skill-route svg {
    position: absolute;
    inset: 16px 20px;
    width: calc(100% - 40px);
    height: calc(100% - 32px);
    order: initial;
  }

  .coach-stage {
    min-height: auto;
  }

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

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

  .tablet-a {
    grid-column: 1 / -1;
    width: min(520px, 100%);
    justify-self: center;
  }
}

@media (max-width: 640px) {
  .hero-stage {
    min-height: 600px;
  }

  .hero-photo-card.product-tablet-peek {
    left: 0;
    top: 12%;
    width: min(320px, 68%);
    opacity: .6;
  }

  .hero-phone-device {
    right: 2%;
    top: 14%;
    width: min(220px, 54%);
  }

  .live-status {
    left: 0;
    top: 4%;
    width: min(270px, 78%);
  }

  .live-coach-tip {
    right: 0;
    bottom: 18%;
    width: min(240px, 74%);
  }

  .coach-orb {
    right: 0;
    bottom: 6%;
  }

  .mini-board {
    left: 0;
    bottom: 4%;
    width: min(170px, 42%);
  }

  .lesson-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "num"
      "title"
      "copy"
      "preview"
      "steps"
      "tags";
  }

  .lesson-preview {
    justify-self: start;
    width: min(180px, 58%);
  }

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

  .analysis-board {
    width: min(92vw, 380px);
  }

  .analysis-panel {
    position: relative;
    right: auto;
    bottom: auto;
    width: 100%;
    margin-top: -20px;
  }

  .skill-route {
    min-height: 360px;
    flex-direction: column;
    align-items: stretch;
  }

  .skill-route svg {
    display: none;
  }

  .skill-node {
    width: 100%;
    height: 54px;
    border-radius: 18px;
  }

  .coach-cards,
  .device-cloud {
    grid-template-columns: 1fr;
  }

  .tablet-a {
    grid-column: auto;
  }
}

/* Chapter 3 rebuild: exact board coordinates, no decorative drift. */
.chapter-analysis {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  background:
    radial-gradient(circle at 18% 42%, rgba(75,141,255,.14), transparent 36vw),
    radial-gradient(circle at 82% 64%, rgba(210,166,66,.12), transparent 30vw);
}

.chapter-analysis .chapter-copy {
  align-self: center;
}

.chapter-analysis .chapter-copy h2 {
  max-width: 760px;
}

.analysis-scene {
  min-height: auto;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: clamp(14px, 2vw, 24px);
  overflow: visible;
  transform: none;
}

.analysis-scene::before,
.analysis-scene::after {
  display: none;
}

.analysis-board-frame {
  position: relative;
  width: min(500px, 100%);
  justify-self: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--panel-solid) 88%, transparent), color-mix(in srgb, var(--panel) 76%, transparent)),
    radial-gradient(circle at 22% 10%, rgba(75,141,255,.16), transparent 34%);
  box-shadow: var(--shadow);
}

.analysis-frame-top,
.analysis-frame-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.analysis-frame-top {
  padding: 0 4px 12px;
}

.analysis-frame-bottom {
  padding: 12px 4px 0;
}

.analysis-frame-top strong,
.analysis-frame-bottom strong {
  color: var(--ink);
}

.analysis-frame-top em {
  font-style: normal;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #36d982;
  box-shadow: 0 0 0 6px rgba(54,217,130,.14);
}

.analysis-scene .analysis-board {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  margin: 0;
  overflow: hidden;
  border-radius: 24px;
  transform: none;
  box-shadow: 0 18px 45px rgba(30,36,54,.16);
}

.analysis-scene .board-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  border-radius: inherit;
  box-shadow: none;
}

.analysis-scene .board-grid span {
  aspect-ratio: auto;
}

.analysis-scene .analysis-piece {
  position: absolute;
  left: var(--left);
  top: var(--top);
  z-index: 4;
  width: 10.5%;
  max-width: none;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 8px 8px rgba(16,19,27,.22));
}

.analysis-scene .analysis-piece-focus {
  z-index: 6;
  width: 11.4%;
  filter: drop-shadow(0 10px 10px rgba(16,19,27,.24)) drop-shadow(0 0 16px rgba(75,141,255,.35));
}

.analysis-scene .analysis-mark {
  position: absolute;
  left: var(--left);
  top: var(--top);
  z-index: 2;
  width: 12.5%;
  aspect-ratio: 1;
  border-radius: 14px;
  transform: translate(-50%, -50%);
}

.analysis-scene .analysis-mark.target {
  background: rgba(75,141,255,.25);
  box-shadow: inset 0 0 0 3px rgba(75,141,255,.72), 0 0 24px rgba(75,141,255,.38);
}

.analysis-scene .analysis-mark.danger {
  background: rgba(255,91,103,.22);
  box-shadow: inset 0 0 0 3px rgba(255,91,103,.62), 0 0 22px rgba(255,91,103,.34);
}

.analysis-scene .analysis-mark.safe {
  background: rgba(54,217,130,.18);
  box-shadow: inset 0 0 0 3px rgba(54,217,130,.56);
}

.analysis-move-arrow {
  position: absolute;
  inset: 0;
  z-index: 7;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.analysis-move-arrow > path {
  fill: none;
  stroke: var(--blue);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  marker-end: url(#analysis-arrow-head);
  stroke-dasharray: 92;
  stroke-dashoffset: 92;
  filter: drop-shadow(0 0 10px rgba(75,141,255,.44));
}

#analysis-arrow-head path {
  fill: var(--blue);
  stroke: none;
}

.chapter-analysis.is-visible .analysis-move-arrow > path,
.analysis-scene.is-visible .analysis-move-arrow > path {
  animation: draw-arrow 1.1s ease forwards .15s;
}

.coach-analysis-card {
  position: relative;
  right: auto;
  bottom: auto;
  width: min(500px, 100%);
  margin: 0;
  padding: 18px;
  border-radius: 26px;
  justify-self: center;
  align-self: start;
}

.coach-analysis-card::before {
  content: "";
  display: block;
  width: 54px;
  height: 54px;
  margin-bottom: 12px;
  border-radius: 50%;
  background:
    url("assets/avatar-thinking.png") center / cover no-repeat,
    linear-gradient(135deg, #fff, rgba(75,141,255,.28));
  box-shadow: 0 10px 24px rgba(75,141,255,.22);
}

.coach-analysis-card .analysis-panel-top {
  margin-bottom: 12px;
}

.coach-analysis-card .analysis-panel-top strong {
  font-size: 28px;
}

.coach-analysis-card .move-feed span {
  min-height: 36px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
}

.coach-analysis-card p {
  display: block;
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.36;
}

.chapter-analysis .metrics {
  display: flex;
  margin-top: 24px;
}

.chapter-analysis .metrics span {
  background: color-mix(in srgb, var(--panel-solid) 82%, transparent);
}

@media (max-width: 1120px) {
  .analysis-scene {
    grid-template-columns: 1fr;
  }

  .coach-analysis-card {
    width: 100%;
  }
}

@media (max-width: 980px) {
  .chapter-analysis {
    grid-template-columns: 1fr;
  }

  .analysis-scene {
    max-width: 680px;
    margin-inline: auto;
  }
}

@media (max-width: 640px) {
  .analysis-board-frame {
    width: 100%;
    padding: 12px;
    border-radius: 24px;
  }

  .analysis-scene .analysis-board {
    border-radius: 18px;
  }

  .analysis-frame-top,
  .analysis-frame-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .coach-analysis-card {
    margin-top: 0;
  }
}

/* Chapters 1 and 2 rebuild: real board coordinates instead of decorative previews. */
.chapter-pawn .pawn-scene {
  min-height: 560px;
}

.chapter-pawn .diagnostic-card {
  width: min(690px, 94%);
}

.chapter-pawn .diagnostic-body {
  grid-template-columns: minmax(270px, 1fr) minmax(190px, .72fr);
}

.starter-board {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 24px;
  transform: none;
}

.starter-board .starter-piece {
  position: absolute;
  left: var(--left);
  top: var(--top);
  z-index: 5;
  width: 10.8%;
  max-height: 11.5%;
  max-width: none;
  object-fit: contain;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 8px 9px rgba(16,19,27,.22));
}

.starter-board .starter-focus {
  z-index: 7;
  width: 11.8%;
  filter: drop-shadow(0 10px 10px rgba(16,19,27,.24)) drop-shadow(0 0 14px rgba(54,217,130,.38));
}

.starter-file-danger {
  position: absolute;
  left: var(--left);
  top: 6.25%;
  bottom: 6.25%;
  z-index: 2;
  width: 9.5%;
  margin: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,91,103,.34), rgba(255,91,103,.06));
  transform: translateX(-50%);
  pointer-events: none;
}

.starter-mark {
  position: absolute;
  left: var(--left);
  top: var(--top);
  z-index: 3;
  display: block;
  width: 12.5%;
  aspect-ratio: 1;
  margin: 0;
  border-radius: 14px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.starter-mark.shield {
  background: rgba(54,217,130,.17);
  box-shadow: inset 0 0 0 3px rgba(54,217,130,.58), 0 0 20px rgba(54,217,130,.28);
}

.starter-mark.danger {
  background: rgba(255,91,103,.18);
  box-shadow: inset 0 0 0 3px rgba(255,91,103,.54), 0 0 20px rgba(255,91,103,.24);
}

.starter-board .starter-arrow {
  position: absolute;
  inset: 0;
  z-index: 6;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.starter-board .starter-arrow path {
  fill: none;
  stroke: #ff5b67;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 4 4;
  filter: drop-shadow(0 0 8px rgba(255,91,103,.34));
}

.chapter-pawn .diagnostic-checks p {
  min-height: 56px;
}

.chapter-lessons .lesson-stack {
  align-items: stretch;
  margin-top: 34px;
}

.chapter-lessons .section-heading h2 {
  font-size: clamp(40px, 4.8vw, 64px);
}

.chapter-lessons .lesson-card {
  min-height: 400px;
  padding: 28px;
}

.chapter-lessons .lesson-card h3,
.chapter-lessons .lesson-card p {
  max-width: none;
}

.chapter-lessons .lesson-card p {
  font-size: 15px;
}

.chapter-lessons .lesson-steps {
  width: 100%;
}

.chapter-lessons .lesson-preview {
  position: relative;
  right: auto;
  bottom: auto;
  width: min(168px, 76%);
  aspect-ratio: 1;
  margin: 18px auto 0;
  transform: none;
}

.chapter-lessons .preview-board {
  inset: 0;
  grid-template-columns: repeat(8, 1fr);
  aspect-ratio: 1;
  border-radius: 20px;
  overflow: visible;
}

.chapter-lessons .preview-board i {
  aspect-ratio: auto;
}

.lesson-card .lesson-piece {
  position: absolute;
  left: var(--left);
  top: var(--top);
  z-index: 5;
  width: 17%;
  max-width: none;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 6px 7px rgba(16,19,27,.2));
}

.lesson-card .lesson-focus {
  z-index: 7;
  width: 11.8%;
  filter: drop-shadow(0 8px 8px rgba(16,19,27,.22)) drop-shadow(0 0 12px rgba(75,141,255,.34));
}

.lesson-card .lesson-mark {
  position: absolute;
  left: var(--left);
  top: var(--top);
  z-index: 2;
  display: block;
  width: 12.5%;
  height: auto;
  aspect-ratio: 1;
  margin: 0;
  border-radius: 10px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.lesson-card .lesson-mark.safe {
  background: rgba(54,217,130,.17);
  box-shadow: inset 0 0 0 2px rgba(54,217,130,.56);
}

.lesson-card .lesson-mark.danger {
  background: rgba(255,91,103,.2);
  box-shadow: inset 0 0 0 2px rgba(255,91,103,.58);
}

.lesson-visual-arrow {
  position: absolute;
  inset: 0;
  z-index: 8;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.lesson-visual-arrow path {
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 7px rgba(75,141,255,.32));
}

.lesson-arrow-blue path,
.lesson-arrow-blue marker path {
  stroke: var(--blue);
  fill: var(--blue);
}

.lesson-arrow-red path,
.lesson-arrow-red marker path {
  stroke: #ff5b67;
  fill: #ff5b67;
}

.lesson-visual-arrow marker path {
  stroke: none;
}

.preview-foundation {
  background: linear-gradient(135deg, rgba(54,217,130,.08), transparent);
}

.preview-tactics {
  background: linear-gradient(135deg, rgba(255,91,103,.08), transparent);
}

.preview-openings {
  background: linear-gradient(135deg, rgba(75,141,255,.08), transparent);
}

@media (max-width: 980px) {
  .chapter-pawn .diagnostic-body {
    grid-template-columns: 1fr;
  }

  .chapter-pawn .starter-board {
    max-width: 420px;
    margin-inline: auto;
  }

  .chapter-lessons .lesson-card h3,
  .chapter-lessons .lesson-card p {
    max-width: 72%;
  }
}

@media (max-width: 640px) {
  .chapter-lessons .lesson-card {
    min-height: auto;
  }

  .chapter-lessons .lesson-card h3,
  .chapter-lessons .lesson-card p,
  .chapter-lessons .lesson-steps {
    max-width: none;
    width: 100%;
  }

  .chapter-lessons .lesson-preview {
    width: min(230px, 72vw);
    margin-top: 18px;
  }
}
