/* The paper and its explorer, in the look of lichessneo.com: its surfaces (an oklch
   lightness scale on one hue), its accent, its type and its board. */

@font-face {
  font-family: Inter;
  src: url('./fonts/inter.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --hue: 286;
  --tint: 0.012;
  --accent: #5e6ad2;
  --l0: 0%;
  --lk: 1;
  --glow: #fff;
  --shadow: #000;
  --ink: oklch(calc(var(--l0) + 15.5% * var(--lk)) var(--tint) var(--hue));
  --ink-raised: oklch(calc(var(--l0) + 17% * var(--lk)) var(--tint) var(--hue));
  --panel: oklch(calc(var(--l0) + 19% * var(--lk)) var(--tint) var(--hue));
  --panel-raised: oklch(calc(var(--l0) + 21.5% * var(--lk)) var(--tint) var(--hue));
  --well: oklch(calc(var(--l0) + 13.5% * var(--lk)) var(--tint) var(--hue));
  --line: color-mix(in srgb, var(--glow) 7.1%, transparent);
  --line-strong: color-mix(in srgb, var(--glow) 12.9%, transparent);
  --text: oklch(95% calc(var(--tint) / 2) var(--hue));
  --dim: oklch(71% var(--tint) var(--hue));
  --faint: oklch(55% var(--tint) var(--hue));
  --accent-light: color-mix(in oklch, var(--accent) 60%, #fff);
  --accent-top: color-mix(in oklch, var(--accent) 84%, #fff);
  --accent-low: color-mix(in oklch, var(--accent) 92%, #000);
  --accent-edge: color-mix(in oklch, var(--accent) 52%, #000);
  --accent-soft: color-mix(in srgb, var(--accent) 18%, transparent);
  --board-light: #f7f8f8;
  --board-dark: var(--accent);
  /* Lichess's colors for its marks. */
  --dubious: #53b2ea;
  --mistake: #e69d00;
  --blunder: #df5353;
  --series-1: #7c86e8;
  --series-2: color-mix(in srgb, var(--glow) 16%, transparent);
  --code: oklch(calc(var(--l0) + 12% * var(--lk)) var(--tint) var(--hue));
  --sans: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, monospace;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --hop: cubic-bezier(0.34, 1.56, 0.64, 1);
  color-scheme: dark;
}

:root[data-scheme='light'] {
  --l0: 84%;
  --lk: 0.75;
  --glow: oklch(24% 0.03 var(--hue));
  --shadow: oklch(32% 0.05 var(--hue) / 40%);
  --tint: 0.008;
  --text: oklch(22% calc(var(--tint) * 2) var(--hue));
  --dim: oklch(44% var(--tint) var(--hue));
  --faint: oklch(56% var(--tint) var(--hue));
  --accent-light: color-mix(in oklch, var(--accent) 82%, #000);
  --headline-top: var(--text);
  --headline-end: 46%;
  --series-1: #5e6ad2;
  --dubious: #2b8fc9;
  --mistake: #c27f00;
  --blunder: #c93c3c;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; }

html {
  background: var(--ink);
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}

body {
  overflow-x: clip;
  color: var(--text);
  font: 400 16px / 1.65 var(--sans);
  font-feature-settings: 'cv01', 'ss03';
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-light); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--text); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 2px; }
b { font-weight: 620; }

.wrap { width: min(1200px, 100% - 48px); margin-inline: auto; }
.column { width: min(720px, 100% - 48px); margin-inline: auto; }

code {
  font: 0.86em var(--mono);
  padding: 1.5px 6px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--glow) 6%, transparent);
  box-shadow: inset 0 0 0 1px var(--line);
}

pre {
  margin: 18px 0;
  padding: 16px 18px;
  overflow-x: auto;
  border-radius: 14px;
  background: var(--code);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13px;
  line-height: 1.6;
}
pre code { padding: 0; background: none; box-shadow: none; font-size: inherit; }
pre.json code { white-space: pre-wrap; }

kbd {
  display: inline-block;
  min-width: 22px;
  padding: 0 6px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--glow) 6%, transparent);
  box-shadow: inset 0 0 0 1px var(--line-strong), inset 0 -1px var(--line-strong);
  font: 500 12px/20px var(--sans);
  text-align: center;
}

/* ---- the bar on top ---- */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--ink) 72%, transparent);
  box-shadow: inset 0 -1px var(--line);
  backdrop-filter: blur(16px) saturate(1.5);
}
.nav .wrap { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand {
  display: flex; flex: none; align-items: center; gap: 10px;
  color: var(--text); font-size: 15px; font-weight: 590; letter-spacing: -0.012em; text-decoration: none; white-space: nowrap;
}
.brand img { width: 28px; height: 28px; border-radius: 22%; }
.brand-sub { color: var(--faint); font-weight: 500; }
.nav-end { display: flex; align-items: center; gap: 8px; margin-left: auto; }
/* The bar shows the store button of the browser only: Firefox, or Chrome for all others. */
.button.store-nav { background: linear-gradient(var(--accent-top), var(--accent-low)); color: #fff;
  box-shadow: inset 0 1px #ffffff4d, inset 0 -1px var(--accent-edge), 0 8px 24px color-mix(in srgb, var(--accent) 25%, transparent); }
/* As on the landing: the accent gets lighter, and the button keeps its color. */
.button.store-nav:hover { background: linear-gradient(color-mix(in oklch, var(--accent) 76%, #fff), var(--accent)); color: #fff; }
.store-nav.firefox, :root[data-browser='firefox'] .store-nav.chrome { display: none; }
:root[data-browser='firefox'] .store-nav.firefox { display: inline-flex; }
.star-link {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 5px 0 11px; border-radius: 9px;
  color: var(--dim); font-size: 14px; font-weight: 500; white-space: nowrap; text-decoration: none;
  box-shadow: inset 0 0 0 1px var(--line); transition: color 0.2s, background-color 0.2s;
}
.star-link:hover { background: color-mix(in srgb, var(--glow) 5.1%, transparent); color: var(--text); }
.star-link > svg { flex: none; }
.star-link__count {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px 0 7px; border-radius: 6px;
  background: color-mix(in srgb, var(--glow) 5.9%, transparent); color: var(--text); font-variant-numeric: tabular-nums;
}
/* Room for three digits from the first paint, so the bar doesn't move when the count arrives. */
.star-link__count b { display: inline-block; min-width: 3ch; text-align: center; font-weight: 600; }
.star-link__count svg { color: #f5c451; }
@media (max-width: 520px) { .nav-end .store-nav, :root[data-browser='firefox'] .nav-end .store-nav { display: none; } }
@media (max-width: 420px) { .star-link > span:not([class]) { display: none; } }
@media (max-width: 380px) { .brand-sub { display: none; } }
.scheme-switch {
  display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 9px;
  background: none; color: var(--dim); cursor: pointer; transition: background-color 0.15s, color 0.15s;
}
.scheme-switch:hover { background: color-mix(in srgb, var(--glow) 5%, transparent); color: var(--text); }
.scheme-switch svg { grid-area: 1 / 1; }
.scheme-switch .moon, :root[data-scheme='light'] .scheme-switch .sun { display: none; }
:root[data-scheme='light'] .scheme-switch .moon { display: block; }

/* ---- buttons ---- */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 46px; padding: 0 20px; border: 0; border-radius: 12px;
  background: color-mix(in srgb, var(--glow) 5.1%, transparent);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--text); font-size: 15.5px; font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color 0.2s, box-shadow 0.2s, transform 0.25s var(--hop);
}
.button:hover { background: color-mix(in srgb, var(--glow) 9%, transparent); color: var(--text); }
.button:active { transform: scale(0.98); }
.button.primary {
  background: linear-gradient(var(--accent-top), var(--accent-low));
  color: #fff;
  box-shadow: inset 0 1px #ffffff4d, inset 0 -1px var(--accent-edge), 0 8px 24px color-mix(in srgb, var(--accent) 25%, transparent);
}
.button.primary:hover { background: linear-gradient(color-mix(in oklch, var(--accent) 76%, #fff), var(--accent)); color: #fff; }
.button.small { gap: 7px; height: 34px; padding: 0 13px; border-radius: 9px; font-size: 14px; }
.install { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---- the hero ---- */

.hero { position: relative; padding-top: clamp(48px, 6.5vw, 88px); }
.hero::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  z-index: -1;
  height: 760px;
  background: repeating-conic-gradient(color-mix(in srgb, var(--glow) 2.4%, transparent) 0 25%, transparent 0 50%) 0 0 / 96px 96px;
  mask: radial-gradient(ellipse 60% 70% at 30% 0%, #000, transparent);
  pointer-events: none;
}
.hero-words { display: grid; justify-items: start; gap: 22px; }
.kicker, .eyebrow {
  color: var(--accent-light); font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
}
h1, h2 { font-weight: 590; text-wrap: balance; }
h1 {
  font-size: clamp(44px, 6.6vw, 84px);
  line-height: 1;
  letter-spacing: -0.032em;
  background: linear-gradient(180deg, var(--headline-top, #fff) 35%, oklch(var(--headline-end, 76%) calc(var(--tint) * 3) var(--hue)));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-bottom: 0.06em;
}
.lead { max-width: 36em; color: var(--dim); font-size: clamp(17px, 1.6vw, 20px); line-height: 1.5; text-wrap: pretty; }
.lead b { color: var(--text); font-weight: 600; }

/* ---- the explorer ---- */

.explorer-wrap { margin-top: clamp(44px, 6vw, 72px); }
.explorer {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(oklch(calc(var(--l0) + 18.5% * var(--lk)) var(--tint) var(--hue)), oklch(calc(var(--l0) + 16.5% * var(--lk)) var(--tint) var(--hue)));
  box-shadow:
    inset 0 0 0 1px var(--line),
    inset 0 1px color-mix(in srgb, var(--glow) 4%, transparent),
    0 40px 80px -30px color-mix(in srgb, var(--shadow) 70%, transparent),
    0 0 0 1px color-mix(in srgb, var(--shadow) 30%, transparent);
}
.explorer-board { padding: 22px; display: grid; gap: 12px; align-content: start; }
.board-frame {
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--shadow) 40%, transparent), 0 18px 40px -18px color-mix(in srgb, var(--shadow) 80%, transparent);
}
.board { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer; }
.board .sq.light { fill: var(--board-light); }
.board .sq.dark { fill: var(--board-dark); }
.board .sq.last { fill: rgb(255 255 51); opacity: 0.5; }
.board .sq.selected { fill: rgb(255 255 51); opacity: 0.5; }
.board .check { fill: #e53935; opacity: 0.5; }
.board .coord { font: 600 0.17px var(--sans); pointer-events: none; }
.board .coord.on-light { fill: var(--board-dark); }
.board .coord.on-dark { fill: var(--board-light); }
.board .piece { pointer-events: none; }
.board .piece.lifted { opacity: 0.35; }
.board .piece.dragged { filter: drop-shadow(0 0.06px 0.08px rgb(0 0 0 / 0.4)); }
.board .dest { fill: #000; opacity: 0.14; pointer-events: none; }
.board .dest.capture { fill: none; stroke: #000; stroke-width: 0.1; opacity: 0.14; }
.board .shapes { pointer-events: none; }

.board-bar { display: flex; justify-content: space-between; align-items: center; }
.board-nav { display: flex; gap: 4px; }
.icon-button {
  display: grid; place-items: center; width: 40px; height: 36px; border: 0; border-radius: 10px;
  background: color-mix(in srgb, var(--glow) 5%, transparent);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--dim); cursor: pointer; transition: background-color 0.15s, color 0.15s, transform 0.2s var(--hop);
}
.icon-button:hover:not(:disabled) { color: var(--text); background: color-mix(in srgb, var(--glow) 9%, transparent); }
.icon-button:active:not(:disabled) { transform: scale(0.95); }
.icon-button:disabled { opacity: 0.35; cursor: default; }

.explorer-side {
  display: grid;
  grid-template-rows: auto auto 1fr;
  min-width: 0;
  max-height: calc(100% + 0px);
  border-left: 1px solid var(--line);
  background: color-mix(in srgb, var(--well) 55%, transparent);
}
.explorer-tools { display: grid; gap: 10px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.search { position: relative; display: flex; align-items: center; }
.search > svg { position: absolute; left: 12px; color: var(--faint); pointer-events: none; }
.search input {
  width: 100%; height: 40px; padding: 0 12px 0 36px; border: 0; border-radius: 11px;
  background: var(--well); box-shadow: inset 0 0 0 1px var(--line-strong); font-size: 14.5px; outline: none;
}
.search input:focus { box-shadow: inset 0 0 0 1.5px var(--accent-light); }
.search input::placeholder { color: var(--faint); }
.results {
  position: absolute; top: 46px; left: 0; right: 0; z-index: 8; max-height: 360px; overflow-y: auto;
  padding: 6px; list-style: none; border-radius: 13px;
  background: color-mix(in srgb, var(--panel-raised) 94%, transparent); backdrop-filter: blur(14px);
  box-shadow: inset 0 0 0 1px var(--line-strong), 0 18px 40px color-mix(in srgb, var(--shadow) 45%, transparent);
}
.results li { display: grid; grid-template-columns: 42px 1fr; gap: 0 8px; padding: 7px 9px; border-radius: 8px; cursor: pointer; font-size: 14px; line-height: 1.35; }
.results li.active, .results li:hover { background: var(--accent-soft); }
.results li.empty { display: block; color: var(--faint); cursor: default; }
.results .eco { color: var(--faint); font: 600 12px/1.6 var(--mono); }
.results .depth { grid-column: 2; color: var(--faint); font-size: 12px; }
.tool-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.family { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; color: var(--faint); font-size: 13px; }
.select { position: relative; flex: 1; min-width: 0; }
.select-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; height: 34px; padding: 0 10px 0 12px;
  border: 0; border-radius: 9px; background: var(--well); box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text);
  font: inherit; font-size: 14px; text-align: left; cursor: pointer; transition: box-shadow 0.15s, background-color 0.15s;
}
.select-trigger:hover { background: color-mix(in srgb, var(--well) 82%, var(--text) 6%); }
.select-trigger:focus-visible, .select-trigger[aria-expanded='true'] { outline: none; box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 3px var(--accent-soft); }
.select-trigger svg { flex: none; color: var(--faint); transition: transform 0.15s; }
.select-trigger[aria-expanded='true'] svg { transform: rotate(180deg); }
.select-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-value.placeholder { color: var(--faint); }
.select-content {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0; min-width: 260px; border-radius: 12px; overflow: hidden;
  background: color-mix(in srgb, var(--panel-raised) 96%, transparent); backdrop-filter: blur(12px);
  box-shadow: inset 0 0 0 1px var(--line-strong), 0 16px 40px color-mix(in srgb, var(--shadow) 45%, transparent);
  transform-origin: top center; animation: select-in 0.14s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.select-search { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border-bottom: 1px solid var(--line); color: var(--faint); }
.select-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: none; color: var(--text); font: inherit; font-size: 14px; }
.select-search input::placeholder { color: var(--faint); }
.select-list { max-height: 320px; overflow-y: auto; overscroll-behavior: contain; padding: 4px; scrollbar-width: thin; }
.select-empty { margin: 0; padding: 18px 12px 20px; color: var(--faint); font-size: 13.5px; text-align: center; }
.select.up .select-content { top: auto; bottom: calc(100% + 6px); transform-origin: bottom center; }
@keyframes select-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.select.up .select-content { animation-name: select-in-up; }
@keyframes select-in-up { from { opacity: 0; transform: translateY(4px) scale(0.98); } }
.select-group:not([hidden]) ~ .select-group:not([hidden]) { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); }
.select-label { padding: 6px 8px 4px 30px; color: var(--faint); font-size: 12px; font-weight: 600; }
.select-item {
  position: relative; display: flex; align-items: center; padding: 6px 8px 6px 30px; border-radius: 7px;
  color: color-mix(in srgb, var(--text) 88%, var(--dim)); font-size: 14px; line-height: 1.35; cursor: pointer; user-select: none;
}
.select-item.active { background: var(--accent-soft); color: var(--text); }
.select-check { position: absolute; left: 9px; width: 14px; height: 14px; color: var(--accent); opacity: 0; }
.select-item[aria-selected='true'] { color: var(--text); font-weight: 550; }
.select-item[aria-selected='true'] .select-check { opacity: 1; }
.select-item[hidden], .select-group[hidden] { display: none; }
.segmented { display: inline-grid; grid-auto-flow: column; padding: 3px; border-radius: 10px; background: var(--well); box-shadow: inset 0 0 0 1px var(--line-strong); }
.segmented button { border: 0; padding: 4px 12px; border-radius: 7px; background: none; color: var(--faint); font-size: 13px; font-weight: 600; cursor: pointer; }
.segmented button[aria-pressed='true'] { background: var(--panel-raised); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong), 0 1px 2px color-mix(in srgb, var(--shadow) 30%, transparent); }

.explorer-line {
  display: flex; align-items: center; gap: 2px; min-height: 46px; padding: 8px 16px; overflow-x: auto; scrollbar-width: thin;
  border-bottom: 1px solid var(--line); font-size: 14px; white-space: nowrap;
}
.explorer-line:empty::before { content: '—'; color: var(--faint); padding-left: 4px; }
.explorer-line .num { color: var(--faint); font-size: 12.5px; padding: 0 2px 0 6px; font-variant-numeric: tabular-nums; }
.explorer-line .ply { border: 0; padding: 3px 6px; border-radius: 6px; background: none; color: var(--dim); font-weight: 560; cursor: pointer; }
.explorer-line .ply:hover { background: color-mix(in srgb, var(--glow) 7%, transparent); color: var(--text); }
.explorer-line .ply.current { background: var(--accent-soft); color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.explorer-line .ply.ahead { color: var(--faint); }

.explorer-panel { padding: 20px 22px 24px; overflow-y: auto; min-height: 0; animation: none; }
.explorer-panel > * + * { margin-top: 14px; }
.explorer-panel h3 { font-size: 19px; font-weight: 610; letter-spacing: -0.015em; line-height: 1.25; }
.position-head { display: flex; gap: 10px; align-items: center; }
.position-head .eco {
  flex: none; padding: 1px 7px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-light);
  font: 600 12px/1.6 var(--mono);
}
.coach-text { color: color-mix(in srgb, var(--text) 88%, var(--dim)); font-size: 15.5px; line-height: 1.68; text-wrap: pretty; }
.chip {
  display: inline; padding: 1px 6px; margin: 0 1px; border: 0; border-radius: 6px; cursor: pointer;
  background: var(--accent-soft); color: var(--text); font-weight: 600; font-size: 0.94em; white-space: nowrap;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 38%, transparent);
  transition: background-color 0.15s;
}
.chip:hover, .chip:focus-visible { background: color-mix(in srgb, var(--accent) 38%, transparent); }
.chip.later { background: none; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--dim); cursor: help; }
.chip.later:hover { color: var(--text); background: color-mix(in srgb, var(--glow) 6%, transparent); }
.square { padding: 0 2px; border-radius: 4px; font-weight: 600; color: var(--text); box-shadow: inset 0 -2px color-mix(in srgb, var(--accent) 55%, transparent); cursor: default; }
.square:hover { background: var(--accent-soft); }
.label { color: var(--faint); font-size: 12.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; margin-top: 20px; }
.label .hint { text-transform: none; letter-spacing: 0; font-weight: 450; }
.label + .moves { margin-top: 8px; }
.moves { display: flex; flex-wrap: wrap; gap: 7px; }
.move {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border: 0; border-radius: 9px; cursor: pointer;
  background: color-mix(in srgb, var(--glow) 5.5%, transparent); box-shadow: inset 0 0 0 1px var(--line-strong);
  font-size: 14px; font-weight: 600; transition: background-color 0.15s, transform 0.2s var(--hop);
}
.move:hover { background: color-mix(in srgb, var(--glow) 10%, transparent); }
.move:active { transform: scale(0.97); }
.move.theory { background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.move.theory:hover { background: color-mix(in srgb, var(--accent) 34%, transparent); }
.move.action { background: linear-gradient(var(--accent-top), var(--accent-low)); color: #fff; box-shadow: inset 0 1px #ffffff40, inset 0 -1px var(--accent-edge); }
.move.action.subtle { background: color-mix(in srgb, var(--glow) 5.5%, transparent); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.mark-icon { display: inline-block; flex: none; width: 20px; height: 20px; line-height: 0; vertical-align: middle; }
.mark-icon svg { display: block; width: 100%; height: 100%; }
.mark-icon.inline { width: 1.2em; height: 1.2em; margin: 0 0.1em; vertical-align: -0.24em; }
.position-head .mark-icon { width: 26px; height: 26px; }
.punish-line { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.punish-move { padding: 2px 8px; border-radius: 7px; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--faint); font-weight: 600; font-size: 14px; }
.punish-move.done { color: var(--text); background: color-mix(in srgb, var(--blunder) 22%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blunder) 50%, transparent); }
.study-link { display: inline-flex; margin-top: 22px !important; color: var(--dim); font-size: 13.5px; text-decoration: none; }
.study-link:hover { color: var(--accent-light); }
.muted { color: var(--faint); font-size: 14px; }
.explorer-note { margin-top: 14px; color: var(--faint); font-size: 13.5px; text-align: center; }

@media (min-width: 901px) {
  /* The board is as tall as the explorer leaves it; the side panel takes the rest and scrolls. */
  .explorer {
    --explorer-h: clamp(600px, calc(100vh - 120px), 760px);
    height: var(--explorer-h);
    grid-template-columns: minmax(0, calc(var(--explorer-h) - 60px)) minmax(340px, 1fr);
  }
  .explorer-side { height: var(--explorer-h); overflow: hidden; }
}
@media (max-width: 900px) {
  .explorer { grid-template-columns: 1fr; }
  .explorer-side { border-left: 0; border-top: 1px solid var(--line); }
  .explorer-panel { max-height: none; }
}

/* ---- the tiles ---- */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-top: 18px; }
.tile {
  padding: 22px 24px; border-radius: 20px;
  background: linear-gradient(oklch(calc(var(--l0) + 18.5% * var(--lk)) var(--tint) var(--hue)), oklch(calc(var(--l0) + 16.5% * var(--lk)) var(--tint) var(--hue)));
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px color-mix(in srgb, var(--glow) 3.9%, transparent);
}
.tile .value { font-size: 34px; font-weight: 640; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile .note { margin-top: 6px; color: var(--dim); font-size: 14px; line-height: 1.45; }
.marks-tiles .tile .value { display: flex; align-items: center; gap: 12px; }
.marks-tiles .mark-icon { width: 30px; height: 30px; }

/* ---- the paper ---- */

.paper { padding: clamp(96px, 12vw, 150px) 0 120px; }
.paper .eyebrow { margin-bottom: 14px; }
.paper h2 { font-size: clamp(30px, 3.6vw, 42px); line-height: 1.08; letter-spacing: -0.025em; margin: 96px 0 18px; }
.paper .eyebrow + h2 { margin-top: 0; }
.paper h2 .num { display: inline-block; min-width: 1.15em; color: var(--faint); font-weight: 500; }
.paper h3 { font-size: 18px; font-weight: 610; letter-spacing: -0.012em; margin: 34px 0 6px; }
.paper section p { margin: 14px 0; color: color-mix(in srgb, var(--text) 86%, var(--dim)); font-size: 16.5px; text-wrap: pretty; }
.paper section ul, .paper section ol { margin: 14px 0; padding-left: 22px; color: color-mix(in srgb, var(--text) 86%, var(--dim)); }
.paper section li { margin: 8px 0; }
.paper section li::marker { color: var(--faint); }
.center-link { text-align: left; }

.figure { margin-block: 30px; }
.figure .caption { margin: 12px 4px 0; color: var(--faint); font-size: 13.5px; line-height: 1.5; }
.card .caption { margin: 14px 0 0; }
.card {
  position: relative; padding: 22px 24px; border-radius: 20px;
  background: linear-gradient(oklch(calc(var(--l0) + 18.5% * var(--lk)) var(--tint) var(--hue)), oklch(calc(var(--l0) + 17% * var(--lk)) var(--tint) var(--hue)));
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px color-mix(in srgb, var(--glow) 3.9%, transparent);
}
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 14px; margin-bottom: 10px; }
.card-head h3 { margin: 0; font-size: 16px; font-weight: 610; }
.card-head .muted { font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(460px, 100%), 1fr)); gap: 14px; align-items: start; }

dl.defs { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 18px 0; }
dl.defs dt { font: 600 13.5px/1.6 var(--mono); color: var(--accent-light); white-space: nowrap; }
dl.defs dd { margin: 0; color: var(--dim); }

ol.flow { list-style: none; padding: 0 !important; counter-reset: flow; display: grid; gap: 10px; }
ol.flow li {
  position: relative; margin: 0 !important; padding: 16px 18px 16px 58px; border-radius: 16px; counter-increment: flow;
  background: color-mix(in srgb, var(--glow) 3%, transparent); box-shadow: inset 0 0 0 1px var(--line);
}
ol.flow li::before {
  content: counter(flow); position: absolute; left: 16px; top: 15px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px;
  background: linear-gradient(var(--accent-top), var(--accent-low)); color: #fff; font-size: 14px; font-weight: 700;
}

footer { margin-top: 80px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--faint); font-size: 14px; }
footer a { color: var(--dim); }

/* ---- charts and tables ---- */

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 2px 0 10px; color: var(--dim); font-size: 13px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.grid-line { stroke: var(--line); stroke-dasharray: 3 4; }
.axis-line { stroke: var(--line-strong); }
.tick { fill: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.axis-title { fill: var(--dim); font-size: 11.5px; }
.direct { fill: var(--dim); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.limit { stroke: var(--blunder); stroke-dasharray: 5 4; stroke-width: 1.2; }
.limit-label { fill: var(--blunder); font-size: 11px; font-weight: 600; }
.budget { stroke: var(--faint); stroke-dasharray: 2 4; stroke-width: 1.2; }
.budget-label { fill: var(--faint); font-size: 11px; }
.bar { transition: opacity 0.15s; }
.chart svg:hover .bar { opacity: 0.55; }
.chart svg .bar:hover, .chart svg .bar.on { opacity: 1; }
.tooltip {
  position: absolute; z-index: 4; pointer-events: none; padding: 8px 11px; border-radius: 10px; font-size: 13px; line-height: 1.45;
  background: color-mix(in srgb, var(--panel-raised) 92%, transparent); backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px var(--line-strong), 0 10px 28px color-mix(in srgb, var(--shadow) 40%, transparent);
  white-space: nowrap; opacity: 0; transition: opacity 0.12s; font-variant-numeric: tabular-nums;
}
.tooltip b { font-weight: 650; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th { color: var(--faint); font-size: 12.5px; font-weight: 600; }
th:first-child, td:first-child { text-align: left; white-space: normal; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--glow) 3%, transparent); }
td .meter-cell { display: inline-block; width: 64px; height: 6px; margin-left: 10px; border-radius: 3px; background: var(--series-2); vertical-align: middle; overflow: hidden; }
td .meter-cell i { display: block; height: 100%; border-radius: 3px; background: var(--series-1); }
td.share { color: var(--dim); }
.table-library td:first-child { font-weight: 550; }
.table-library th:last-child, .table-library td:last-child { text-align: left; white-space: normal; padding-left: 32px; }
@media (max-width: 640px) {
  .table-library thead { display: none; }
  .table-library tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .table-library tbody tr:last-child { border-bottom: 0; }
  .table-library td { padding: 0; border: 0; }
  .table-library td:last-child { grid-column: 1 / -1; padding-left: 0; }
}


@media (max-width: 760px) {
  .explorer-board { padding: 14px; }
  .explorer-tools, .explorer-panel { padding-inline: 16px; }
  dl.defs { grid-template-columns: 1fr; gap: 2px; }
  dl.defs dd { margin-bottom: 10px; }
}
@media (max-width: 520px) {
  .wrap, .column { width: calc(100% - 32px); }
  .card, .tile { padding: 18px; }
  .explorer { border-radius: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---- From the videos to the book ---- */

.funnel {
  position: relative; list-style: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 72px 44px; margin: 0; padding: 0;
}
.funnel li {
  position: relative; z-index: 1; grid-column: span 2; display: flex; flex-direction: column; padding: 22px 22px 20px; border-radius: 16px;
  background: color-mix(in srgb, var(--accent) calc(4% + var(--step, 0) * 2.4%), var(--panel));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) calc(10% + var(--step, 0) * 6%), var(--line));
}
/* Three cards, then two at the center, as a funnel. The second row goes from right to left, so that the path turns under the third card. */
.funnel li:nth-child(4) { grid-area: 2 / 4 / auto / span 2; }
.funnel li:nth-child(5) { grid-area: 2 / 2 / auto / span 2; }
.funnel li:nth-child(2) { --step: 1; } .funnel li:nth-child(3) { --step: 2; } .funnel li:nth-child(4) { --step: 3; } .funnel li:nth-child(5) { --step: 4; }
.funnel b { font-size: clamp(26px, 2.6vw, 34px); font-weight: 680; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.funnel .step-name { margin-top: 10px; color: var(--text); font-size: 15px; font-weight: 600; line-height: 1.3; }
.funnel .note { margin-top: 4px; color: var(--faint); font-size: 13.5px; line-height: 1.45; text-wrap: pretty; }
.funnel-links { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.funnel-link { fill: none; stroke: color-mix(in srgb, var(--accent) 55%, var(--line)); stroke-width: 1.5; stroke-linecap: round; }
.funnel-head { fill: none; stroke: color-mix(in srgb, var(--accent) 75%, var(--line)); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* The scene on each card (funnel.js). */
.funnel-art {
  position: relative; height: 128px; margin: -8px -10px 18px; border-radius: 12px; overflow: hidden;
  background: color-mix(in srgb, var(--ink) 60%, transparent); box-shadow: inset 0 0 0 1px var(--line);
}
.mini-board { display: block; flex: none; }
/* Softer than the main board, so that the small boards stay calm. */
.mini-board .light { fill: color-mix(in srgb, var(--board-light) 88%, var(--accent)); }
.mini-board .dark { fill: color-mix(in srgb, var(--board-dark) 70%, var(--board-light)); }
@keyframes scene-pop { from { opacity: 0; scale: 0.6; translate: 0 6px; } }
@keyframes scene-out { to { opacity: 0; scale: 0.5; } }

/* The fade is on the row of previews only, so that the scene's own edge stays whole. */
.video-window {
  position: absolute; inset: 0; display: flex; align-items: center; padding-left: 12px; overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 88%, transparent);
}
.video-track { display: flex; flex: none; gap: 8px; }
.video-tile {
  flex: none; display: grid; gap: 3px; width: 140px; padding: 5px 5px 6px; border-radius: 10px; color: inherit; text-decoration: none;
  background: var(--panel); box-shadow: inset 0 0 0 1px var(--line-strong), 0 2px 6px color-mix(in srgb, var(--shadow) 16%, transparent);
}
.video-tile.pop { animation: scene-pop 0.6s var(--hop) both; }
.video-thumb {
  position: relative; display: block; aspect-ratio: 16 / 9; margin-bottom: 2px; border-radius: 6px; overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 45%, #000), color-mix(in srgb, var(--accent) 15%, #000));
}
.video-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.video-play {
  position: absolute; right: 5px; bottom: 5px; width: 20px; height: 14px; border-radius: 4px; background: #f03;
  box-shadow: 0 1px 4px rgb(0 0 0 / 40%);
}
.video-play::after {
  content: ''; position: absolute; top: 3.5px; left: 8px; border-left: 6px solid #fff; border-block: 3.5px solid transparent;
}
.video-name, .video-meta { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.video-name { color: var(--text); font-size: 10.5px; font-weight: 600; line-height: 1.25; }
.video-meta { color: var(--faint); font-size: 9.5px; line-height: 1.2; }

.art-words { display: flex; align-items: center; gap: 14px; padding: 0 16px; }
.wave { display: flex; flex: none; align-items: center; gap: 3px; height: 44px; }
.wave i {
  width: 3px; height: 100%; border-radius: 2px; background: var(--accent-light);
  scale: 1 calc(0.25 + mod(var(--i) * 0.37, 0.75)); animation: wave 1.1s ease-in-out infinite; animation-delay: calc(var(--i) * -0.17s);
}
.wave.still i { animation: none; }
@keyframes wave { 0%, 100% { scale: 1 0.22; } 50% { scale: 1 1; } }
.transcript {
  position: relative; flex: 1; height: 60px; overflow: hidden;
  mask-image: linear-gradient(transparent, #000 45%);
}
.transcript-roll { position: absolute; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; gap: 8px; }
.transcript-line { display: flex; flex: none; gap: 4px; height: 7px; }
.transcript-line i { flex: none; height: 7px; border-radius: 4px; background: color-mix(in srgb, var(--text) 32%, transparent); }
.transcript-line i.pop { animation: word-in 0.3s ease-out both; transform-origin: left; }
@keyframes word-in { from { opacity: 0; scale: 0.3 1; } }

/* Ideas noted (funnel.js): the sources of an idea flow along wires into it. */
.flow { display: flex; align-items: center; height: 100%; padding: 0 12px; }
.flow-sources { position: relative; z-index: 1; display: grid; flex: 0 1 auto; gap: 7px; min-width: 0; min-height: 74px; }
.flow-src {
  display: flex; align-items: center; gap: 5px; min-width: 0; height: 20px; padding: 0 7px; border-radius: 6px;
  background: color-mix(in srgb, var(--text) 7%, transparent); box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--dim); font-size: 10.5px; font-weight: 600; white-space: nowrap; animation: flow-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.flow-sources.out .flow-src { animation: flow-out 0.3s ease-in forwards; }
.flow-name { overflow: hidden; text-overflow: ellipsis; }
.flow-src time { margin-left: auto; padding-left: 6px; color: var(--faint); font-variant-numeric: tabular-nums; }
.icon-yt { position: relative; flex: none; width: 12px; height: 9px; border-radius: 2.5px; background: #f03; }
.icon-yt::after { content: ''; position: absolute; top: 2px; left: 4.5px; border-left: 4px solid #fff; border-block: 2.5px solid transparent; }
.icon-ref { display: grid; flex: none; place-items: center; width: 12px; height: 12px; border-radius: 3px; background: #fff; color: #000; font: 700 8px/1 Georgia, serif; font-style: normal; }
.flow-wires { position: relative; z-index: 2; flex: 1; min-width: 28px; height: 74px; overflow: visible; pointer-events: none; }
.flow-wire { fill: none; stroke: color-mix(in srgb, var(--accent) 55%, var(--line)); stroke-width: 1.5; stroke-linecap: round; transition: stroke-dashoffset 0.5s ease-out; }
.flow-port { fill: var(--panel); stroke: color-mix(in srgb, var(--accent) 60%, var(--line)); stroke-width: 1.5; transition: fill 0.25s, stroke 0.25s; }
.flow-port.lit { fill: var(--accent-light); stroke: var(--accent-light); }
.flow-spark { fill: var(--accent-light); filter: drop-shadow(0 0 3px var(--accent)); }
.flow-card {
  position: relative; z-index: 1; display: grid; flex: none; justify-items: center; gap: 6px; padding: 7px; border-radius: 10px;
  background: var(--panel); box-shadow: inset 0 0 0 1px var(--line-strong), 0 2px 8px color-mix(in srgb, var(--shadow) 18%, transparent);
}
.flow-card.hit { animation: flow-hit 0.5s var(--hop); }
.flow-board { display: block; transition: opacity 0.35s, filter 0.35s; }
.flow-board .mini-board { border-radius: 5px; }
.flow-arrow { transition: opacity 0.3s; }
/* While the sources come in, three dots wait in the place of the tag, and the board stays dim. */
.flow-slot { display: grid; place-items: center; }
.flow-slot > * { grid-area: 1 / 1; }
.flow-slot .idea-chip { height: 20px; padding: 0 8px; font-size: 10.5px; font-weight: 700; transition: opacity 0.3s, scale 0.35s var(--hop); }
.flow-wait {
  display: flex; align-items: center; gap: 4px; height: 20px; padding: 0 9px; border-radius: 999px; opacity: 0; scale: 0.8; transition: opacity 0.3s, scale 0.3s;
  background: color-mix(in srgb, var(--accent) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent);
}
.flow-wait i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent-light); animation: flow-wait 1s ease-in-out infinite; }
.flow-wait i:nth-child(2) { animation-delay: 0.15s; }
.flow-wait i:nth-child(3) { animation-delay: 0.3s; }
.flow-card.empty .flow-board { opacity: 0.5; filter: saturate(0.4); }
.flow-card.empty .flow-arrow, .flow-card.empty .idea-chip { opacity: 0; }
.flow-card.empty .idea-chip { scale: 0.8; }
.flow-card.empty .flow-wait { opacity: 1; scale: 1; }
@keyframes flow-in { from { opacity: 0; translate: -14px 0; } }
@keyframes flow-out { to { opacity: 0; translate: -10px 0; } }
@keyframes flow-hit { 40% { scale: 1.06; box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); } }
@keyframes flow-wait { 0%, 60%, 100% { translate: 0 0; opacity: 0.45; } 30% { translate: 0 -3px; opacity: 1; } }
/* The tag colors, by kind. */
.idea-chip {
  --kind: var(--accent); display: inline-flex; align-items: center; border-radius: 999px; white-space: nowrap; line-height: 1.3;
  background: color-mix(in srgb, var(--kind) 15%, transparent); color: color-mix(in srgb, var(--kind) 65%, var(--text));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--kind) 28%, transparent);
}
.kind-mistake { --kind: #e69d00; } .kind-trap { --kind: #df5353; } .kind-idea { --kind: #53b2ea; }
.kind-history { --kind: #ba9978; } .kind-move-order { --kind: #8fbf3f; } .kind-structure { --kind: #c084fc; }

.check-list { display: grid; align-content: center; gap: 8px; height: 100%; padding: 0 16px; }
.check-row { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12.5px; font-weight: 500; transition: color 0.3s; }
.check-dot {
  position: relative; flex: none; width: 17px; height: 17px; border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--line-strong); transition: background-color 0.3s, box-shadow 0.3s;
}
.check-dot::after {
  content: ''; position: absolute; top: 4px; left: 5.5px; width: 3.5px; height: 6.5px; rotate: 45deg; scale: 0;
  border-right: 2px solid #fff; border-bottom: 2px solid #fff; transition: scale 0.35s var(--hop);
}
.check-row.done { color: var(--text); }
.check-row.done .check-dot { background: #629924; box-shadow: none; }
.check-row.done .check-dot::after { scale: 1; }

.write-board { display: flex; align-items: center; gap: 18px; height: 100%; padding: 0 18px; }
.write-squares { position: relative; flex: none; width: 76px; height: 76px; }
.write-squares .mini-board { border-radius: 5px; }
.write-piece { position: absolute; top: 0; left: 0; transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1); }
.write-badge { position: absolute; z-index: 1; width: 16px; height: 16px; transform: translate(-72%, -28%); animation: badge-in 0.45s var(--hop); }
.write-badge svg { display: block; width: 100%; height: 100%; border-radius: 25%; background: #1a1820; box-shadow: 0 2px 6px rgb(0 0 0 / 50%); }
.write-texts { display: grid; flex: 1; gap: 12px; }
.write-row { display: flex; align-items: center; gap: 8px; }
.write-lang { width: 18px; color: var(--faint); font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; }
.write-track { flex: 1; height: 7px; border-radius: 4px; background: color-mix(in srgb, var(--text) 8%, transparent); overflow: hidden; }
.write-bar { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent-light); transition: width 0.6s ease; }
@media (max-width: 760px) {
  .funnel { grid-template-columns: 1fr; row-gap: 44px; padding: 0; }
  .funnel li, .funnel li:nth-child(4), .funnel li:nth-child(5) {
    grid-area: auto; display: grid; grid-template-columns: minmax(96px, auto) 1fr; column-gap: 16px; align-items: baseline;
    margin: 0 48px 0 0; padding: 14px 16px;
  }
  .funnel li:nth-child(even) { margin: 0 0 0 48px; }
  .funnel .step-name { margin-top: 0; }
  .funnel-art { grid-column: 1 / -1; margin: -4px -6px 14px; }
  .funnel .note { grid-column: 2; margin-top: 2px; }
}

.sources-grid .chart svg { overflow: visible; }
.rank-name { fill: var(--dim); font-size: 12px; }

.trace { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.trace-title { margin: 0 0 10px; color: var(--faint); font-size: 12.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.trace-ideas { list-style: none; display: grid; gap: 10px; margin: 0; padding: 0; }
.trace-ideas li { padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--glow) 3%, transparent); box-shadow: inset 0 0 0 1px var(--line); }
.trace-ideas p { margin: 4px 0 0; font-size: 14px; line-height: 1.5; color: color-mix(in srgb, var(--text) 88%, var(--dim)); }
.trace-ideas .kind { display: inline-block; padding: 1px 7px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-text, var(--text)); font-size: 11.5px; font-weight: 650; letter-spacing: 0.02em; }
.trace-ideas .sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.source { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: 7px; background: var(--well); box-shadow: inset 0 0 0 1px var(--line); color: var(--dim); font-size: 12.5px; white-space: nowrap; text-decoration: none; }
.source.video { color: var(--text); transition: background-color 0.15s; }
.source.video:hover { background: var(--accent-soft); }
.source.video svg { color: #e5484d; }
.source span { color: var(--faint); font-variant-numeric: tabular-nums; }
.trace-book { position: sticky; top: 84px; padding: 18px 20px 20px; border-radius: 14px; background: var(--well); box-shadow: inset 0 0 0 1px var(--line-strong); }
.trace-text { margin: 0 0 16px; font-size: 15.5px; line-height: 1.65; text-wrap: pretty; }
.trace-text .move { font-weight: 650; color: var(--text); }
.trace-text .square { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
@media (max-width: 900px) { .trace { grid-template-columns: 1fr; } .trace-book { position: static; } }

.study-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin: 20px 0; }
.study-card { display: grid; gap: 2px; padding: 14px 16px; border-radius: 14px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text); text-decoration: none; transition: background-color 0.15s; }
.study-card:hover { background: var(--accent-soft); }
.study-card span { color: var(--faint); font-size: 13.5px; }

/* ---- The coach's card, as in Lichess Neo's review ---- */

.explorer-panel > .panel-body:empty { display: none; }
.panel-body > * + * { margin-top: 14px; }
.panel-body > .label:first-child { margin-top: 4px; }
/* The coach stands on the card's bottom edge on the left; its verdict and its words on the right, the words scrolling. */
.coach-card {
  position: relative; display: grid; grid-template-columns: clamp(118px, 34%, 180px) minmax(0, 1fr); column-gap: 10px;
  height: 268px; border-radius: 14px;
  background: oklch(calc(var(--l0) + 17.5% * var(--lk)) var(--tint) var(--hue));
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.coach-stage { position: relative; align-self: end; height: 100%; }
.coach-say { display: flex; flex-direction: column; min-height: 0; padding: 14px 16px 0 0; }
.coach-head { flex: none; display: flex; align-items: center; gap: 8px; min-height: 26px; }
.coach-title { flex: 1; min-width: 0; margin: 0; font-size: 15.5px !important; font-weight: 600 !important; letter-spacing: -0.01em; line-height: 1.3; }
.coach-head .mark-icon { width: 22px; height: 22px; }
.coach-head .eco {
  flex: none; padding: 3px 7px; border-radius: 5px; background: var(--text); color: var(--ink);
  font: 800 12.5px/1.2 var(--mono);
}
.coach-words {
  flex: 1; min-height: 0; overflow-y: auto; margin-top: 6px; padding: 0 8px 16px 0; scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent; overscroll-behavior: contain;
  /* The words fade under the card's edge, so a longer text reads as one to scroll. */
  mask-image: linear-gradient(#000 calc(100% - 28px), transparent);
}
.coach-words .coach-text { margin: 0; font-size: 15px; line-height: 1.52; color: color-mix(in srgb, var(--text) 90%, var(--dim)); }
.verdict-move { white-space: nowrap; }
.coach-avatar {
  position: absolute; bottom: 0; left: 50%; translate: -50% 0; width: 100%; max-width: 176px; aspect-ratio: 1.09; padding: 0; border: 0;
  background: none; cursor: pointer;
}
.coach-avatar:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 12px; }
.coach-face { position: absolute; inset: 0; transform-origin: 50% 100%; animation: coach-breathe 3.5s ease-in-out infinite; }
.coach-face::before { content: ''; position: absolute; inset: 0 -25%; background: var(--still) bottom center / auto 100% no-repeat; }
.coach-face canvas { position: absolute; top: -50%; left: -40%; width: 180%; height: 150%; pointer-events: none; }
.coach-avatar.live .coach-face { animation: none; }
.coach-avatar.live .coach-face::before { content: none; }
@keyframes coach-breathe { 50% { transform: scaleY(1.012); } }
/* Hidden words keep their place, then fade in (the review's .ln-ext-w--in). */
.coach-text .off { visibility: hidden; }
.coach-text .w:not(.off), .coach-text > .chip:not(.off), .coach-text > .square:not(.off) { animation: word-in 0.28s ease-out; }
@keyframes word-in { from { opacity: 0; filter: blur(2px); } }
/* Its words in the review's marks: a move a soft chip, a square in bold. */
.coach-words .chip {
  display: inline; padding: 0.05em 0.3em 0.05em 0.1em; margin: 0; border: 0; border-radius: 6px; box-shadow: none;
  background: color-mix(in srgb, var(--text) 12%, transparent); color: var(--text); font: inherit; font-weight: 700;
  line-height: 1.3; vertical-align: -0.05em; white-space: nowrap; cursor: pointer;
}
.coach-words .chip:hover, .coach-words .chip:focus-visible { background: color-mix(in srgb, var(--text) 22%, transparent); }
.coach-words .chip.later { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--dim); cursor: help; }
.coach-words .chip .pc { width: 1.3em; height: 1.3em; margin: 0 0.05em 0 0; vertical-align: top; }
.coach-words .square { padding: 0; border-radius: 3px; box-shadow: none; font-weight: 700; color: var(--text); }
.coach-words .square:hover { background: var(--accent-soft); }
.opening-line { display: flex; align-items: center; gap: 8px; margin-top: 12px !important; font-size: 14.5px; color: var(--dim); }
.opening-line .mark-icon { width: 22px; height: 22px; }
.opening-line b { color: var(--text); font-weight: 600; }
.opening-line .eco { flex: none; padding: 1px 7px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-light); font: 600 12px/1.6 var(--mono); }
@media (max-width: 520px) { .coach-card { height: 250px; grid-template-columns: 112px minmax(0, 1fr); } }

/* ---- Moves with their piece (the review's .ln-ext-pc) ---- */

.pc { display: inline-block; width: 1.3em; height: 1.3em; margin: 0 0.02em 0 -0.06em; vertical-align: -0.3em; background: center / contain no-repeat; }
.pc-wp { background-image: url(pieces/wP.svg); } .pc-wn { background-image: url(pieces/wN.svg); } .pc-wb { background-image: url(pieces/wB.svg); }
.pc-wr { background-image: url(pieces/wR.svg); } .pc-wq { background-image: url(pieces/wQ.svg); } .pc-wk { background-image: url(pieces/wK.svg); }
.pc-bp { background-image: url(pieces/bP.svg); } .pc-bn { background-image: url(pieces/bN.svg); } .pc-bb { background-image: url(pieces/bB.svg); }
.pc-br { background-image: url(pieces/bR.svg); } .pc-bq { background-image: url(pieces/bQ.svg); } .pc-bk { background-image: url(pieces/bK.svg); }
/* Black pieces keep an outline on a dark panel. */
:root:not([data-scheme='light']) :is(.pc-bp, .pc-bn, .pc-bb, .pc-br, .pc-bq, .pc-bk) {
  filter: drop-shadow(1px 0 0 #9a9cab) drop-shadow(-1px 0 0 #9a9cab) drop-shadow(0 1px 0 #9a9cab) drop-shadow(0 -1px 0 #9a9cab);
}
.chip { padding: 1px 6px 1px 3px; }
.move .pc { margin-right: 0; }
.mistake-move { gap: 6px; }

/* ---- The board, as the review draws it ---- */

.board .sq.last { fill: #8be9fd; opacity: 0.5; }
.board .dest { fill: color-mix(in srgb, var(--board-light) 50%, var(--board-dark)); opacity: 0.8; mix-blend-mode: luminosity; }
.board .dest.capture { fill: none; stroke: color-mix(in srgb, var(--board-light) 50%, var(--board-dark)); stroke-width: 0.11; opacity: 0.8; }
.board-frame { position: relative; }
.board-badge {
  position: absolute; z-index: 2; width: 5.2%; aspect-ratio: 1; transform: translate(-72%, -28%); pointer-events: none;
  animation: badge-in 0.45s var(--hop);
}
.board-badge svg { display: block; width: 100%; height: 100%; border-radius: 25%; background: #1a1820; box-shadow: 0 2px 6px rgb(0 0 0 / 50%); }
@keyframes badge-in { from { scale: 0.3; opacity: 0; } }
.sound-toggle .mute { display: none; }
.sound-toggle[aria-pressed='false'] .wave { display: none; }
.sound-toggle[aria-pressed='false'] .mute { display: inline; }
.sound-toggle[aria-pressed='false'] { color: var(--faint); }

/* ---- Try Lichess Neo, as the landing page's closing section ---- */

.try { padding: clamp(40px, 6vw, 72px) 0 0; }
.try-card {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; gap: 32px;
  overflow: hidden; padding: clamp(28px, 4.5vw, 56px); border-radius: 28px;
  background:
    radial-gradient(70% 90% at 85% 100%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 70%),
    radial-gradient(50% 60% at 0% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%),
    var(--panel);
  box-shadow: inset 0 0 0 1px var(--line-strong), inset 0 1px color-mix(in srgb, var(--glow) 6%, transparent),
    0 30px 80px -30px color-mix(in srgb, var(--accent) 35%, transparent);
}
.try-text { display: grid; gap: 16px; justify-items: start; }
.try-text .eyebrow { margin: 0; }
.try h2 {
  margin: 0; max-width: 16ch; font-size: clamp(32px, 4.2vw, 52px); line-height: 1.04; letter-spacing: -0.035em; font-weight: 680;
  background: linear-gradient(180deg, var(--text), color-mix(in srgb, var(--text) 62%, var(--accent-light))); -webkit-background-clip: text;
  background-clip: text; color: transparent;
}
.try-lead { margin: 0; max-width: 40em; color: var(--dim); font-size: clamp(16px, 1.4vw, 18px); line-height: 1.55; text-wrap: pretty; }
.install { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.button.store { height: 48px; padding: 0 20px; border-radius: 12px; font-size: 15.5px; }
.button.store.chrome, :root[data-browser='firefox'] .button.store.firefox {
  order: -1; background: linear-gradient(var(--accent-top), var(--accent-low)); color: #fff;
  box-shadow: inset 0 1px #ffffff4d, inset 0 -1px var(--accent-edge), 0 8px 24px color-mix(in srgb, var(--accent) 25%, transparent);
}
:root[data-browser='firefox'] .button.store.chrome {
  order: 0; background: color-mix(in srgb, var(--glow) 5.1%, transparent); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong);
}
.button.store.chrome:hover, :root[data-browser='firefox'] .button.store.firefox:hover { background: linear-gradient(color-mix(in oklch, var(--accent) 76%, #fff), var(--accent)); color: #fff; }
.browser-logo { filter: drop-shadow(0 1px 2px color-mix(in srgb, var(--shadow) 30%, transparent)); }
/* The hero button shows the logo of the store that the browser uses: Firefox, or Chrome for all others. */
.get-neo .browser-logo.firefox, :root[data-browser='firefox'] .get-neo .browser-logo.chrome { display: none; }
:root[data-browser='firefox'] .get-neo .browser-logo.firefox { display: block; }
.try .note { margin: 0; color: var(--faint); font-size: 14px; }
.try .note a { color: var(--dim); }
/* The coaches stand on the card's bottom edge, side by side, as on the review's card. */
.try-coaches {
  align-self: end; display: flex; align-items: flex-end; justify-content: center;
  margin-bottom: calc(-1 * clamp(28px, 4.5vw, 56px)); min-width: 0;
}
.try-coaches img {
  flex: none; width: 44%; height: auto; margin: 0 -10%;
  filter: drop-shadow(0 10px 18px color-mix(in srgb, var(--shadow) 35%, transparent));
  transform-origin: 50% 100%; animation: coach-bob 3.6s ease-in-out infinite;
}
.try-coaches img:nth-child(2) { animation-delay: -0.9s; z-index: 1; }
.try-coaches img:nth-child(3) { animation-delay: -1.8s; z-index: 1; }
.try-coaches img:nth-child(4) { animation-delay: -2.7s; }
@keyframes coach-bob { 50% { transform: scaleY(1.02) translateY(-2px); } }
@media (max-width: 860px) {
  .try-card { grid-template-columns: 1fr; }
  .try-coaches { width: min(100%, 440px); justify-self: center; }
}
@media (max-width: 520px) { .install { width: 100%; } .install .button.store { flex: 1 1 100%; justify-content: center; } }
