/* Chess Opening Model Games: the companion site's only stylesheet. */
@font-face {
  font-family: "Noto Sans";
  src: url("/fonts/noto-sans-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Noto Sans";
  src: url("/fonts/noto-sans-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Arial reshaped to Noto Sans's metrics, so text doesn't jump when the font arrives. */
@font-face {
  font-family: "Noto Sans Fallback";
  src: local("Arial"), local("Liberation Sans"), local("Helvetica");
  size-adjust: 106%;
  ascent-override: 101%;
  descent-override: 27%;
  line-gap-override: 0%;
}

:root {
  --bg: #F3EBDD;
  --panel: #E9DFCF;
  --card: #FBF6EE;
  --ink: #392F27;
  --text2: #5A4D40;
  --muted: #6B5C4C;
  --accent: #71503A;
  --line: #CCBDA9;
  --line2: #E0D3C0;
  --field: #7D6E5C;
  --mark: #E7D3A8;
  --radius: 12px;
  --wrap: 1280px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 "Noto Sans", "Noto Sans Fallback", system-ui, sans-serif;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--ink); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { line-height: 1.15; margin: 0; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
.on-dark :focus-visible, .on-dark:focus-visible { outline-color: var(--bg); }
.vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 10; padding: 10px 16px; border-radius: 8px;
  background: var(--ink); color: var(--bg); font-weight: 600; }
.skip:focus { top: 12px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 780px; }
.kicker { font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.text2 { color: var(--text2); }
.lead { font-size: 18px; line-height: 1.65; color: var(--text2); max-width: 720px; }
.prose p + p { margin-top: 14px; }
.prose { font-size: 17px; line-height: 1.7; }
.h1 { font-size: clamp(30px, 4.5vw, 46px); line-height: 1.1; font-weight: 700; letter-spacing: -.02em; }
.h2 { font-size: 22px; font-weight: 700; }
.section { margin-top: 48px; }
.row-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 16px; }
.more { font-size: 15px; font-weight: 600; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.cols { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; }
.cols > .main { flex: 1 1 640px; min-width: 0; }
.cols > .side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

/* Header */
.site-head { background: var(--bg); border-bottom: 1px solid var(--line); }
.brandbar { display: flex; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-height: 44px; margin-right: auto; }
.brand svg { width: 22px; height: 30px; }
.brand span { display: flex; flex-direction: column; font-size: 11px; font-weight: 600; letter-spacing: .14em; line-height: 1.35; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); }
.sections { border-top: 1px solid var(--line2); }
.sections ul { list-style: none; display: flex; gap: 4px; overflow-x: auto; white-space: nowrap; }
.sections a { display: inline-flex; align-items: center; height: 46px; padding: 0 12px; font-size: 15px; font-weight: 500;
  color: var(--text2); text-decoration: none; border-bottom: 3px solid transparent; }
.sections a[aria-current="page"] { color: var(--ink); font-weight: 700; border-bottom-color: var(--accent); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px;
  border-radius: 10px; font-size: 15px; font-weight: 600; text-decoration: none; border: 1px solid transparent; }
/* a.btn-…: buttons keep their colours inside any container that styles its links. */
.btn-primary, a.btn.btn-primary, a.btn.btn-primary:hover { color: var(--bg); }
.btn-primary { background: var(--accent); }
.btn-primary:hover { background: var(--ink); }
.btn-dark, a.btn.btn-dark, a.btn.btn-dark:hover { color: var(--bg); }
.btn-dark { background: var(--ink); }
.btn-dark:hover { background: var(--accent); }
.btn-outline, a.btn.btn-outline { border-color: var(--accent); color: var(--accent); background: transparent; }
.btn-plain, a.btn.btn-plain { border-color: var(--line); color: var(--ink); background: var(--card); }
.btn svg { width: 16px; height: 16px; }

/* Breadcrumbs */
.crumbs { font-size: 13px; color: var(--muted); padding-top: 18px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li + li::before { content: "›"; margin-right: 6px; }
.crumbs a { color: var(--muted); }

/* Cards and lists */
.grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.vcard { display: flex; flex-direction: column; gap: 8px; color: var(--ink); text-decoration: none; }
.vcard img, .vrow img { border-radius: 10px; aspect-ratio: 16 / 9; object-fit: cover; background: var(--panel); width: 100%; }
.vcard .t { font-size: 16px; font-weight: 600; line-height: 1.35; }
.vcard .s, .vrow .s { font-size: 13px; color: var(--muted); line-height: 1.45; }
.vlist { list-style: none; }
.vrow { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.vrow img { width: 128px; flex: none; border-radius: 6px; }
.vrow .n { width: 24px; flex: none; text-align: center; font-size: 13px; font-weight: 600; color: var(--muted); }
.vrow .t { display: block; font-size: 15px; font-weight: 600; line-height: 1.3; }
.vrow .d { flex: none; margin-left: auto; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.vrow[aria-current="page"] { background: var(--panel); }
.vrow:hover { background: var(--panel); }
.panel { background: var(--panel); border-radius: 14px; padding: 18px 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border-radius: 12px; background: var(--card);
  border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.tile .t { font-size: 18px; font-weight: 700; }
.tile .s { font-size: 14px; color: var(--text2); }
.tile .c { font-size: 13px; font-weight: 600; color: var(--accent); }
.tile:hover { border-color: var(--accent); }
.facts { display: flex; flex-wrap: wrap; gap: 10px; }
.facts div { background: var(--panel); border-radius: 10px; padding: 10px 16px; }
.facts dt { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-size: 18px; font-weight: 700; }
.linklist { list-style: none; }
.linklist li { border-bottom: 1px solid var(--line); }
.linklist a { display: flex; justify-content: space-between; gap: 12px; align-items: center; min-height: 44px; padding: 8px 2px;
  color: var(--ink); text-decoration: none; }
.linklist a:hover { background: var(--panel); }
.linklist .c { flex: none; font-size: 13px; font-weight: 600; color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; }
.chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font-size: 14px; text-decoration: none; }
.chip[aria-current], .chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tag-soon { display: inline-block; font-size: 13px; font-weight: 600; color: var(--text2); background: var(--panel);
  border-radius: 999px; padding: 3px 10px; }
.tag-count { display: inline-block; font-size: 13px; font-weight: 600; color: var(--bg); background: var(--accent);
  border-radius: 999px; padding: 3px 10px; }

/* Chess board (inline SVG) */
.board { width: 100%; height: auto; border-radius: 6px; aspect-ratio: 1; }
.board .cl { fill: #F0D9B5; }
.board .cd { fill: #B58863; }
.board .lm { fill: #CDD26A; stroke: #8C8A2E; stroke-width: .04; }
.board .lm.dk { fill: #AAA23A; }
.board text { font-size: .21px; font-weight: 600; fill: #241D18; font-family: "Noto Sans", sans-serif; }
.boardbox { max-width: 470px; }

/* Home */
.hero { display: flex; flex-wrap: wrap; gap: 40px 56px; align-items: center; padding: 56px 0 40px; }
.hero h1 { font-size: clamp(34px, 5vw, 54px); line-height: 1.08; font-weight: 700; letter-spacing: -.02em; margin-bottom: 16px; }
.hero .lead { font-size: 19px; margin-bottom: 26px; }
.searchbar { display: flex; flex-wrap: wrap; gap: 10px; max-width: 600px; }
.searchbar input { flex: 1 1 240px; min-width: 0; height: 54px; padding: 0 18px; border: 1px solid var(--field); border-radius: 12px;
  background: var(--card); font-size: 16px; }
.searchbar input::placeholder { color: var(--muted); opacity: 1; }
.searchbar button { height: 54px; padding: 0 24px; border: 0; border-radius: 12px; background: var(--ink); color: var(--bg);
  font-size: 16px; font-weight: 600; }
.ways { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.way { display: flex; flex-direction: column; gap: 8px; padding: 22px 24px; border-radius: 14px; background: var(--card);
  border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.way .t { font-size: 20px; font-weight: 700; }
.way .s { font-size: 15px; color: var(--text2); }
.way .c { font-size: 14px; font-weight: 600; color: var(--accent); margin-top: 6px; }
.way.dark { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.way.dark .s { color: #E0D3C0; }
.way.dark .c { color: var(--bg); }
.band { background: var(--panel); }
.steps { list-style: none; display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.steps li { display: flex; gap: 14px; font-size: 16px; }
.steps b { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--bg);
  display: flex; align-items: center; justify-content: center; }

/* Video page */
.vhead h1 { font-size: 30px; line-height: 1.18; letter-spacing: -.01em; margin: 10px 0 6px; }
.modebar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin: 18px 0 12px; }
.modes { display: inline-flex; padding: 4px; gap: 4px; background: var(--panel); border-radius: 12px; }
.modes button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 0;
  border-radius: 9px; background: transparent; font-size: 14px; font-weight: 600; border-bottom: 2px solid transparent; }
.modes button[aria-selected="true"] { background: var(--card); border-bottom-color: var(--ink); }
/* The two modes share the width; on a phone each label may wrap inside its own button. */
.modes { max-width: 100%; }
.modes button { flex: 1 1 0; min-width: 0; text-align: left; line-height: 1.25; padding: 6px 14px; }
.modes svg { width: 16px; height: 16px; flex: none; }
@media (max-width: 520px) {
  .modebar .modes { width: 100%; }
}
.no-js .modes, .no-js .js-only { display: none; }
.player { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--ink); }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.jumpnote { position: absolute; left: 14px; bottom: 14px; padding: 8px 14px; border-radius: 999px;
  background: rgba(57, 47, 39, .92); color: var(--bg); font-size: 14px; font-weight: 600; pointer-events: none; }
.replay { background: var(--panel); border-radius: 12px; padding: 16px; display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.replay .boardcol { flex: 1 1 320px; max-width: 470px; min-width: 0; }
.replay .info { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.pl { display: flex; justify-content: space-between; font-size: 14px; padding: 6px 2px; }
.pl b { font-weight: 600; }
.big { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ctrls { display: flex; gap: 6px; }
.ctrls button { flex: 1; height: 46px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.ctrls svg { margin: auto; width: 18px; height: 18px; }
.games { display: flex; flex-wrap: wrap; gap: 12px; }
.gtab { flex: 1 1 260px; text-align: left; padding: 14px 16px; border-radius: 12px; border: 2px solid var(--line);
  background: var(--card); }
.gtab[aria-selected="true"] { border-color: var(--accent); }
.gtab .k { display: block; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.gtab .p { display: block; font-size: 17px; font-weight: 700; margin: 4px 0 2px; }
.gtab .m { display: block; font-size: 14px; color: var(--text2); }
.gamebox { margin-top: 18px; }
.gamebox[hidden] { display: none; }
.movebox { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.moves { list-style: none; display: flex; flex-wrap: wrap; column-gap: 10px; row-gap: 2px; font-size: 15px;
  font-variant-numeric: tabular-nums; line-height: 1.9; }
.moves li { display: inline-flex; align-items: baseline; gap: 2px; }
.moves .num { color: var(--muted); font-size: 13px; margin-right: 2px; }
.moves button { border: 0; border-radius: 4px; padding: 1px 5px; min-height: 28px; background: transparent; font-size: 15px; }
.moves button.book { text-decoration: underline dotted var(--muted); text-underline-offset: 4px; color: var(--text2); }
.moves button[aria-current="step"] { background: var(--accent); color: var(--bg); text-decoration: none; }
.moves button:hover { background: var(--panel); }
.moves button[aria-current="step"]:hover { background: var(--ink); }
.graph { position: relative; height: 120px; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; touch-action: none; }
.graph svg { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
.graph .area { fill: var(--ink); fill-opacity: .12; }
.graph .eline { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.graph .axis { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.graph .low { fill: var(--panel); }
.graph .mark { stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.graph:focus-visible { outline-offset: 2px; }
.moments { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.moments a, .moments button { display: flex; gap: 12px; align-items: baseline; width: 100%; text-align: left; padding: 8px 10px;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink); text-decoration: none; font-size: 15px; }
.moments a:hover, .moments button:hover { background: var(--panel); }
.moments .lbl { flex: none; min-width: 84px; font-weight: 700; }
.moments .tm { flex: none; margin-left: auto; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.chapters { list-style: none; border-top: 1px solid var(--line); }
.chapters li { border-bottom: 1px solid var(--line); }
.chapters a { display: flex; gap: 16px; padding: 12px 4px; color: var(--ink); text-decoration: none; font-size: 15px; }
.chapters a span { width: 44px; flex: none; color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.next { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-radius: 12px;
  background: var(--ink); color: var(--bg); text-decoration: none; }
.next:hover { background: var(--accent); color: var(--bg); }
.next .k { display: block; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #E0D3C0; }
.next .t { display: block; font-size: 18px; font-weight: 700; margin-top: 4px; }
.upnext { max-width: 420px; }
.upnext .head { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.upnext ol { list-style: none; padding: 6px; }
.upnext .vrow img { width: 104px; }
.postext summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); font-size: 13px; font-weight: 600; }
.toggle[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Explorer */
.path { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 44px; margin-bottom: 10px; list-style: none; }
.path button { min-height: 36px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; font-size: 15px; font-weight: 600; }
.path button[aria-current="step"] { background: var(--accent); color: var(--bg); }
.nextmoves { list-style: none; border-top: 1px solid var(--line); }
.nextmoves li { border-bottom: 1px solid var(--line); }
.nextmoves button { width: 100%; display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 10px 4px; border: 0; background: transparent; text-align: left; }
.nextmoves button:hover { background: var(--panel); }
.nextmoves .mv { font-size: 17px; font-weight: 700; }
.nextmoves .nm { font-size: 14px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.bar { display: block; height: 6px; border-radius: 3px; background: var(--panel); margin-top: 6px; }
.bar i { display: block; height: 6px; border-radius: 3px; background: var(--accent); }

/* Search */
.results mark { background: var(--mark); color: inherit; padding: 0 2px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.tabs button { min-height: 44px; padding: 0 12px; border: 0; border-bottom: 3px solid transparent; background: transparent;
  font-size: 15px; color: var(--text2); }
.tabs button[aria-selected="true"] { border-bottom-color: var(--accent); color: var(--ink); font-weight: 700; }

/* Player page */
.res { min-width: 52px; text-align: center; font-weight: 700; border-radius: 6px; padding: 3px 8px; font-size: 13px; }
.res.w { background: var(--accent); color: var(--bg); }
.res.l { background: var(--panel); color: var(--ink); }
.res.d { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.gamerow { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 12px 2px; color: var(--ink);
  text-decoration: none; }
.gamerow:hover { background: var(--panel); }
.gamerow[hidden] { display: none; }
.meter { display: block; height: 6px; border-radius: 3px; background: var(--card); margin-top: 4px; }
.meter i { display: block; height: 6px; border-radius: 3px; background: var(--accent); }

/* FAQ */
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0 18px; }
.faq details + details { margin-top: 8px; }
.faq summary { min-height: 56px; display: flex; align-items: center; font-weight: 600; cursor: pointer; }
.faq details p { padding-bottom: 16px; color: var(--text2); }

/* Footer */
.site-foot { margin-top: 64px; background: var(--panel); border-top: 1px solid var(--line); }
.site-foot .cols4 { display: flex; flex-wrap: wrap; gap: 32px 56px; padding: 44px 0 28px; }
.site-foot nav { flex: 1 1 160px; }
.site-foot ul { list-style: none; font-size: 15px; line-height: 2.1; }
.site-foot a { color: var(--ink); text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }
.site-foot .about { flex: 1 1 260px; }
.site-foot h2 { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }

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