/* Better at Chess: the shared look of every page (MAR-122). Tokens mirror the app's dark palette in
   ios/ChessCoach/ChessCoach/DesignSystem/CoachTokens.swift (CoachPalette.dark, CoachBoardPalette) and its type,
   Archivo (CoachTypography.swift, the OFL TTFs in /fonts/). The start page adds /landing.css. */
@font-face { font-family: "Archivo"; src: url("/fonts/Archivo-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("/fonts/Archivo-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("/fonts/Archivo-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --canvas: #0F1319; --raised: #212836; --raised-2: #2A313D; --ink: #F5F7FA; --ink-2: #A8B2C0; --ink-3: #8E9AAB;
  --link: #7FA5FF; --blue: #2C6BFF; --action: #2B64FD; --navy: #0E2C80;
  --good: #3FB57E; --inacc: #E5C24A; --mistake: #E0893D; --blunder: #F07070;
  --wood-light: #F0D9B5; --piece-black: #16120D; --tile: #F1DDB4;
  --font: "Archivo", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --margin: clamp(20px, 3.4vw, 48px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 400 18px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, figure, ul, ol { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; }
::selection { background: var(--blue); color: #fff; }
h1, h2, h3 { font-weight: 700; text-wrap: balance; letter-spacing: -0.03em; }
p { text-wrap: pretty; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 var(--margin); }

/* The bar: the lockup, Blog and one action (Get the app), at every width (MAR-152, 2026-11-11). */
.bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 92px; }
.bar .home img { height: 40px; width: auto; }
.bar nav { display: flex; align-items: center; gap: 28px; font-weight: 600; font-size: 16px; }
.bar nav a { text-decoration: none; }
.bar nav a:not(.pill) { color: var(--ink-2); }
.bar nav a:not(.pill):hover { color: var(--ink); }
.bar .pill { min-height: 44px; padding: 0 20px; font-size: 16px; }

/* Capsule buttons, as the app's actions and the cards' white pills. */
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 28px; border-radius: 999px; font-weight: 600; font-size: 18px; text-decoration: none; white-space: nowrap; transition: transform 160ms var(--ease), background-color 200ms; }
.pill:active { transform: scale(.97); }
.pill.blue { background: var(--action); color: #F5F7FA; }
.pill.blue:hover { background: #3A72FF; }
.pill.white { background: #FFFFFF; color: #1D4FD8; }
.pill.white:hover { background: #EAF0FF; }
.chev { width: 9px; height: 9px; border-right: 2.5px solid currentColor; border-top: 2.5px solid currentColor; transform: rotate(45deg); margin-left: 2px; }

/* Launch-email form. */
.join { display: flex; gap: 8px; max-width: 32rem; padding: 6px; border-radius: 999px; background: var(--raised); }
.join input { flex: 1; min-width: 0; height: 56px; padding: 0 22px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); font: inherit; font-size: 17px; }
.join input::placeholder { color: var(--ink-3); }
.join input:focus { outline: none; }
.join:focus-within { box-shadow: 0 0 0 3px var(--link); }
.join .pill { flex: none; }
.on-blue .join { background: var(--navy); }
.on-blue .join input { color: #fff; }
.on-blue .join input::placeholder { color: #C9D6FF; }
.on-blue .join:focus-within { box-shadow: 0 0 0 3px #fff; }
.consent { margin-top: 14px; max-width: 32rem; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.consent a { color: inherit; }
.on-blue .consent { color: #DCE6FF; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.note { margin-top: 16px; max-width: 32rem; font-size: 15px; color: var(--ink-2); }
.on-blue .note { color: #DCE6FF; }
/* App Store badge: Apple's artwork, unmodified and not animated; at least 40 px high on screen, with clear
   space of a quarter of its height around it. Once per page. */
.store a { display: inline-block; padding: 14px 0; }
.store img { display: block; width: auto; height: 54px; }

/* Footer: the name returns at full width. */
footer { padding: 90px 0 110px; }
footer .big { width: min(980px, 100%); height: auto; }
.inner footer .big { width: min(420px, 80%); }
.inner footer { padding-top: 120px; }
footer .row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; margin-top: 56px; font-size: 15px; color: var(--ink-2); }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 26px; }
footer a { text-decoration: none; color: var(--ink-2); }
footer a:hover { color: var(--ink); }
footer .fine { flex-basis: 100%; margin: 0; font-size: 13px; }

/* Inner pages: one readable column under a large title. */
.page { max-width: 46rem; padding: 64px var(--margin) 40px; margin: 0 auto; }
.page h1 { font-size: clamp(40px, 5.4vw, 72px); line-height: 1; }
.page h2 { font-size: clamp(28px, 3vw, 40px); line-height: 1.1; margin: 72px 0 8px; }
.page h3 { font-size: 21px; line-height: 1.3; letter-spacing: -0.015em; margin: 40px 0 8px; }
.page p, .page li { color: var(--ink); }
.page p + p { margin-top: 14px; }
.page h1 + p { margin-top: 24px; }
.page .lead { margin-top: 24px; font-size: clamp(20px, 1.8vw, 24px); line-height: 1.45; }
.page .meta { margin-top: 18px; font-size: 15px; color: var(--ink-2); }
.page a { color: var(--link); }
.page .store { margin-top: 24px; }
.page .store a { padding: 12px 0; }
.page .store img { height: 48px; }
.page ul.posts { margin-top: 40px; }
/* With no intro paragraph (2026-11-12) the list follows the heading: 16px here + the first card's 24px padding. */
.page h1 + ul.posts { margin-top: 16px; }
/* Each post a card: its share image (dimensions set, so nothing shifts as it loads), then kind, date, title and
   summary. The title's link covers the whole card, so the image is clickable with one link per post. */
.page ul.posts li { position: relative; display: grid; grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: 24px; align-items: center; padding: 24px 0; }
.page ul.posts li + li { border-top: 1px solid var(--raised-2); }
.page ul.posts li > img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; border-radius: 10px; border: 1px solid var(--raised-2); }
.page ul.posts a { font-weight: 600; font-size: 21px; text-decoration: none; color: var(--ink); }
.page ul.posts a::after { content: ""; position: absolute; inset: 0; }
.page ul.posts li:hover a { text-decoration: underline; }
.page ul.posts li p { margin-top: 6px; color: var(--ink-2); }
.page ul.posts + .hubs { margin-top: 24px; color: var(--ink-2); }
.page ul.posts .kind { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--link); }
/* A data post's "numbers in brief" (2026-11-11, option B): one row per number, a label and the sentence on
   the left, three small bars on the right (aria-hidden: the sentence says each number). Bars under the text on
   phones. Bar colours as in the charts: earlier levels grey, the top level in the link blue. */
.page ul.brief { margin: 16px 0 0; padding: 0; list-style: none; }
.page ul.brief li { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 28px; align-items: center; margin: 0; padding: 20px 0; border-top: 1px solid var(--raised-2); }
.page ul.brief li:last-child { border-bottom: 1px solid var(--raised-2); }
.page ul.brief .kind, .page .viz .kind { display: block; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--link); }
.page ul.brief .txt p { margin-top: 4px; font-size: 16px; line-height: 1.5; }
/* The brief's rows and the charts (scripts/data-chart.mjs) are one component (2026-11-17): a label, a track,
   the number, all page text at 13px with tabular figures. */
.page ul.brief .b, .page .viz .b { display: grid; grid-template-columns: 44px 1fr 56px; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.page ul.brief .b + .b, .page .viz .b + .b { margin-top: 6px; }
.page ul.brief .l, .page .viz .l { text-align: right; }
.page ul.brief .t, .page .viz .t { display: block; position: relative; height: 16px; }
.page ul.brief .f, .page .viz .f { display: block; height: 16px; border-radius: 0 4px 4px 0; background: #5B6577; }
.page ul.brief .f.top, .page .viz .f.top { background: var(--link); }
.page ul.brief .n, .page .viz .n { color: var(--ink); font-weight: 600; white-space: nowrap; }
.page p.src { margin-top: 20px; font-size: 15px; color: var(--ink-2); }
/* Data posts: one chart per finding (inline HTML, no script) and the numbers as a table under it. */
.page figure.chart { margin-top: 40px; }
.page .viz { max-width: 560px; }
.page .viz.wide .b { grid-template-columns: 132px 1fr 48px; }
/* Small multiples on one scale, side by side; each names itself in the brief's label style instead of a legend. */
.page .viz.panels { display: grid; grid-template-columns: repeat(var(--c), minmax(0, 1fr)); gap: 24px 32px; max-width: none; }
.page .viz .kind { margin-bottom: 10px; }
.page .viz .kind.quiet { color: var(--ink-2); }
/* A range on a 0-10 minute track: the middle half as a band, the median as a mark, minute ticks under it. */
.page .viz.range .b { grid-template-columns: 44px 1fr 64px; }
.page .viz.range .b + .b { margin-top: 10px; }
.page .viz.range .t { border-radius: 4px; background: var(--raised); }
.page .viz.range .band { position: absolute; top: 0; bottom: 0; border-radius: 4px; background: #5B6577; }
.page .viz.range .med { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--link); }
.page .viz.range .axis { margin-top: 6px; }
.page .viz.range .axis .t { background: none; }
.page .viz.range .axis .t span { position: absolute; transform: translateX(-50%); color: var(--ink-3); }
.page .viz.range .unit { margin-top: 2px; }
.page .viz.range .u { color: var(--ink-3); }
/* A grid of cells (head to head), its colours from the paper's ramp in data-chart.mjs. */
.page .viz.grid { display: grid; grid-template-columns: 44px repeat(var(--n), minmax(0, 1fr)); gap: 3px; max-width: 480px; font-size: 13px; font-variant-numeric: tabular-nums; }
.page .viz.grid .h { padding-bottom: 4px; text-align: center; color: var(--ink-2); }
.page .viz.grid .h.r { align-self: center; padding: 0 8px 0 0; text-align: right; }
.page .viz.grid .c { display: grid; place-items: center; height: 36px; border-radius: 4px; font-weight: 600; }
.page figcaption { margin-top: 10px; font-size: 15px; color: var(--ink-2); }
.page figure.chart + p { margin-top: 20px; }
.page th[scope="row"] { white-space: nowrap; }
.page table + p { margin-top: 20px; }
/* A data post's full table (2026-11-11, option 1): one table with every column, out of the text column to
   960 px on desktop; on phones it scrolls sideways in its own labelled, focusable region, with a line saying so and a
   soft edge on the side that has more. The page itself never scrolls sideways. */
.page .table-wide { position: relative; width: min(960px, calc(100vw - 2 * var(--margin) - 16px)); left: 50%; transform: translateX(-50%); margin-top: 20px; overflow-x: auto; }
.page .table-wide table { margin-top: 0; min-width: 640px; font-variant-numeric: tabular-nums; }
.page .table-wide th, .page .table-wide td { padding-right: 20px; }
.page .table-wide:focus-visible { outline: 2px solid var(--link); outline-offset: 4px; }
.page .table-wide + p { margin-top: 20px; }
.page .table-hint { display: none; }
.page article > .meta:first-child { margin-top: 0; }
.page article > .meta + h1 { margin-top: 12px; }
.page ul:not([class]), .page ol:not([class]) { margin: 12px 0 0; padding-left: 22px; }
.page li + li { margin-top: 8px; }
.page dl { display: grid; grid-template-columns: 14rem 1fr; gap: 10px 24px; margin: 32px 0 0; }
.page dt { font-weight: 600; }
.page dd { margin: 0; }
/* In a blog post the terms sit above their text: a long definition reads better full width (2026-11-11). */
.page article dl { grid-template-columns: 1fr; gap: 4px; }
.page article dt { margin-top: 16px; }
.page article dt:first-child { margin-top: 0; }
.page table { width: 100%; margin-top: 20px; border-collapse: collapse; font-size: 16px; }
.page th, .page td { padding: 12px 16px 12px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--raised-2); }
.page th { font-weight: 600; }
/* The one button on the leave page (the email's unsubscribe link lands there; the button does the change). */
form.leave { margin: 32px 0; }
form.leave button { font: inherit; font-weight: 600; color: #F5F7FA; background: var(--action); border-radius: 999px; min-height: 56px; padding: 0 28px; }
form.leave button:hover { background: #3A72FF; }

@media (max-width: 900px) {
  .bar .wrap { height: 72px; }
  .bar .home img { height: 32px; }
  .bar nav { gap: 18px; }
  footer { padding: 70px 0 90px; }
  .page { padding-top: 32px; }
  .page dl { grid-template-columns: 1fr; gap: 4px; }
  .page ul.posts li { grid-template-columns: 1fr; gap: 16px; }
  .page ul.brief li { grid-template-columns: 1fr; gap: 14px; }
  .page dt { margin-top: 12px; }
  .page table { display: block; overflow-x: auto; font-size: 15px; }
  .page th, .page td { padding-right: 10px; }
  .page th:last-child, .page td:last-child { padding-right: 0; }
  .page .table-wide table { display: table; }
}
@media (max-width: 640px) {
  .join { flex-direction: column; gap: 10px; padding: 0; background: transparent !important; border-radius: 0; }
  .join input { flex: none; width: 100%; background: var(--raised); }
  .on-blue .join input { background: var(--navy); }
  .join:focus-within, .on-blue .join:focus-within { box-shadow: none; }
  .join input:focus { box-shadow: 0 0 0 3px var(--link); }
  .on-blue .join input:focus { box-shadow: 0 0 0 3px #fff; }
  .join .pill { width: 100%; }
}

@media (max-width: 640px) {
  .page .viz.panels { grid-template-columns: 1fr; }
  .page .table-hint { display: block; margin-top: 20px; font-size: 13px; color: var(--ink-2); }
  .page .table-wide { width: auto; left: 0; transform: none; margin-top: 8px;
    background: linear-gradient(to left, var(--canvas), var(--canvas)) right / 24px 100% no-repeat local,
      linear-gradient(to left, rgba(127, 165, 255, 0.35), rgba(0, 0, 0, 0)) right / 16px 100% no-repeat scroll; }
  .page .table-wide th, .page .table-wide td { padding-right: 16px; }
  /* The Rating column stays put while the rest scrolls under it (2026-11-11); its thin shadow is the left edge. */
  .page .table-wide th:first-child { position: sticky; left: 0; z-index: 1; background: var(--canvas); box-shadow: 8px 0 8px -8px rgba(127, 165, 255, 0.45); }
}
