/* ------------------------------------------------------------------
   londonsystemchess.com: what every page shares.
   One rule for depth: a hard ink shadow means "you can press this".
   Containers get an ink outline and no shadow.
   ------------------------------------------------------------------ */

/* Fonts, served from this site (latin subsets from Google Fonts, SIL Open Font License). */
@font-face {
  font-family: "Fredoka";
  font-style: normal;
  font-weight: 300 700;
  font-stretch: 75% 125%;
  font-display: swap;
  src: url("/assets/fonts/fredoka-latin-v17.woff2") format("woff2");
  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+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("/assets/fonts/figtree-latin-v9.woff2") format("woff2");
  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+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --yellow: #F5C84C;        /* the app icon's highlighter yellow: the ground */
  --yellow-deep: #ECB52E;   /* the same yellow, one step down, for rays and rules */
  --ink: #121314;           /* outlines, type */
  --ink-soft: #3B3420;      /* secondary text, 7.8:1 on yellow */
  --paper: #FFFDF6;         /* bubbles, cards, stickers */
  --green: #2B6E57;         /* Bertie's bowler */
  --mint: #3FCF8E;          /* the app's green: !! and ! */
  --coral: #FF8C7A;         /* Bertie's cheeks, used sparingly */
  --display: "Fredoka", ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  --text: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --stroke: 3px;
  --gutter: clamp(16px, 4.5vw, 56px);
  --maxw: 1240px;
  --header-h: 68px;
  --section: clamp(56px, 6.8vw, 96px);
  --press: 4px 5px 0 var(--ink);
  --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3.2 3.2L15 7' fill='none' stroke='%23121314' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html, body { background: var(--yellow); color: var(--ink); font: 400 18px/1.55 var(--text); }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; }
img, svg { max-width: 100%; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 2px; }
::selection { background: var(--ink); color: var(--yellow); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.on-dark :focus-visible { outline-color: var(--yellow); }
[hidden] { display: none !important; }
[id] { scroll-margin-top: calc(var(--header-h) + 12px); }

h1, h2, h3 { font-family: var(--display); font-weight: 700; margin: 0; line-height: 1.04; letter-spacing: -0.012em; text-wrap: balance; }
h1 { font-size: clamp(42px, 5.3vw, 80px); font-stretch: 88%; line-height: .98; }
h2 { font-size: clamp(34px, 4.3vw, 60px); font-stretch: 92%; }
h3 { font-size: clamp(21px, 1.9vw, 26px); font-weight: 600; line-height: 1.15; }
.lead { font-size: clamp(18px, 1.45vw, 21px); line-height: 1.5; color: var(--ink-soft); max-width: 34em; }
.lead + .lead { margin-top: 14px; }

.wrap { width: 100%; max-width: calc(var(--maxw) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.nw { white-space: nowrap; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -80px; z-index: 100; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 12px; font: 600 16px var(--display); text-decoration: none; }
.skip:focus { top: 12px; }

/* Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 18px/1.1 var(--display); text-decoration: none; color: var(--ink);
  background: var(--paper); border: var(--stroke) solid var(--ink); border-radius: 999px;
  padding: 13px 22px 14px; cursor: pointer; box-shadow: var(--press);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translate(-1px, -2px); box-shadow: 6px 8px 0 var(--ink); }
.btn:active { transform: translate(3px, 4px); box-shadow: 1px 1px 0 var(--ink); }
.btn-ink { background: var(--ink); color: var(--paper); box-shadow: 4px 5px 0 var(--green); }
.btn-ink:hover { box-shadow: 6px 8px 0 var(--green); }
.btn-ink:active { box-shadow: 1px 1px 0 var(--green); }
.btn-store { flex-direction: column; align-items: flex-start; gap: 3px; padding: 12px 28px 14px 26px; font-size: 20px; }
.btn-store small { font: 600 13.5px/1.2 var(--text); color: var(--yellow); letter-spacing: .01em; }
.btn-small {
  font: 600 16px/1 var(--display); color: var(--ink); background: var(--paper);
  border: 2.5px solid var(--ink); border-radius: 999px; padding: 10px 16px 11px;
  box-shadow: 3px 4px 0 var(--ink); cursor: pointer; text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-small:hover { transform: translate(-1px, -1px); box-shadow: 4px 5px 0 var(--ink); }
.btn-small:active { transform: translate(2px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn-small[aria-disabled="true"] { box-shadow: none; transform: none; cursor: default; color: var(--ink-soft); border-style: dashed; }
.btn-small.is-ink { background: var(--ink); color: var(--paper); box-shadow: 3px 4px 0 var(--green); }

/* Header ----------------------------------------------------------- */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40; background: var(--yellow); border-bottom: var(--stroke) solid var(--ink); }
.site-header .wrap { display: flex; align-items: center; gap: 20px; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 11px; font: 700 21px/1 var(--display); font-stretch: 94%; text-decoration: none; white-space: nowrap; }
.brand img { width: 38px; height: 38px; border-radius: 10px; box-shadow: 0 0 0 2.5px var(--ink); }
.nav { display: flex; gap: clamp(14px, 2.2vw, 30px); margin-left: auto; }
.nav a { font: 600 17px/1 var(--display); text-decoration: none; white-space: nowrap; padding: 9px 1px; background: linear-gradient(var(--ink), var(--ink)) 0 100% / 0 3px no-repeat; transition: background-size .2s ease; }
.nav a:hover, .nav a[aria-current="page"] { background-size: 100% 3px; }
.header-cta { padding: 9px 18px 10px; font-size: 16.5px; white-space: nowrap; box-shadow: 3px 4px 0 var(--green); }

/* Speech bubbles --------------------------------------------------- */
.bubble { position: relative; background: var(--paper); border: var(--stroke) solid var(--ink); border-radius: 26px; padding: 18px 22px 20px; }
.bubble::before {
  content: ""; position: absolute; width: 24px; height: 24px; background: inherit;
  border: var(--stroke) solid var(--ink); border-left: 0; border-bottom: 0;
}
.tail-right::before { right: -13.5px; top: calc(50% - 12px); transform: rotate(45deg); }
.tail-left::before { left: -13.5px; top: calc(50% - 12px); transform: rotate(-135deg); }

/* Bertie treatments. .cut: a die-cut sticker on the yellow (paper edge, hard ink shadow).
   .lined: an extra ink contour, for Bertie on paper, so his thought bubbles still read.
   The filters live in each page's inline <svg> defs. */
bertie-coach { display: inline-block; aspect-ratio: 120 / 128; }
bertie-coach.cut, bertie-coach.lined { --bertie-shadow: transparent; --bertie-spark: #121314; }
bertie-coach.cut { filter: url(#cut); }
bertie-coach.lined { filter: url(#lined); }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* The eyebrow tag: an ink label stuck on at a slight angle. */
.tag { display: inline-block; font: 600 16px/1 var(--display); background: var(--ink); color: var(--yellow); padding: 8px 14px 9px; border-radius: 999px; transform: rotate(-2deg); margin-bottom: 20px; }

/* The grade symbols chess books use (!!, !, ?!, ?), as stickers. */
.sym {
  display: inline-grid; place-items: center; min-width: 40px; height: 32px; padding: 0 8px; flex: none;
  border: 2.5px solid var(--ink); border-radius: 10px; background: var(--c, var(--mint));
  font: 700 18px/1 var(--display); letter-spacing: .02em;
}
.c-mint { --c: var(--mint); }
.c-yellow { --c: var(--yellow); }
.c-coral { --c: var(--coral); }

/* Ticked lists. */
.ticks { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 32px; font-size: 16.5px; line-height: 1.4; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 1px; width: 21px; height: 21px; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--mint) var(--tick) center / 13px no-repeat; }

/* Chess diagrams (the guide, and its section on the home page) ----- */
/* An ink frame, like a diagram in a chess book. The square box holds the space before board.js draws. */
.board-frame { aspect-ratio: 1; border: var(--stroke) solid var(--ink); border-radius: 12px; overflow: hidden; background: #D9DED6; }
.diagram { margin: 0; }
.diagram figcaption { margin-top: 10px; font-size: 15px; line-height: 1.45; color: var(--ink-soft); }
.diagram .moves { display: block; font: 700 17px/1.3 var(--display); color: var(--ink); }

/* Question lists (home FAQ and the support page) ------------------- */
.faq-list { display: grid; gap: 14px; }
.faq-list details { background: var(--paper); border: var(--stroke) solid var(--ink); border-radius: 22px; }
.faq-list summary { list-style: none; cursor: pointer; position: relative; padding: 18px 70px 19px 22px; font: 600 20px/1.3 var(--display); border-radius: 19px; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: ""; position: absolute; right: 18px; top: 50%; width: 32px; height: 32px; margin-top: -16px; border-radius: 50%;
  border: 2.5px solid var(--ink); box-shadow: 2px 3px 0 var(--ink); transition: transform .2s ease;
  background: var(--yellow) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 4.5v11M4.5 10h11' fill='none' stroke='%23121314' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") center / 16px no-repeat;
}
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list summary:focus-visible { outline-offset: -6px; }
.answer { padding: 0 22px 20px; font-size: 17px; line-height: 1.55; color: var(--ink-soft); max-width: 40em; }
.answer p + p, .answer p + ul, .answer ul + p { margin-top: 10px; }
.answer ul { margin: 10px 0 0; padding-left: 1.2em; }
.answer li + li { margin-top: 6px; }
.answer a, .answer strong { color: var(--ink); }
.answer a { font-weight: 600; }

/* Footer ----------------------------------------------------------- */
.site-footer { background: var(--ink); color: var(--paper); padding: 52px 0 44px; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px 48px; align-items: start; }
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand img { width: 48px; height: 48px; border-radius: 12px; }
.footer-brand strong { display: block; font: 700 21px/1.1 var(--display); }
.footer-brand span { display: block; font-size: 15px; color: #CFCABB; margin-top: 3px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 26px; list-style: none; margin: 0; padding: 0; font: 600 17px/1.2 var(--display); }
.footer-links a { text-decoration: none; background: linear-gradient(var(--yellow), var(--yellow)) 0 100% / 0 2.5px no-repeat; padding: 6px 0; transition: background-size .2s ease; }
.footer-links a:hover, .footer-links a[aria-current="page"] { background-size: 100% 2.5px; }
.footer-small { grid-column: 1 / -1; border-top: 2px dashed rgba(255, 253, 246, .28); padding-top: 22px; display: grid; gap: 6px; font-size: 14px; line-height: 1.5; color: #CFCABB; }
.footer-small .copy { color: var(--paper); font-weight: 600; }

/* Document pages: privacy, terms, support -------------------------- */
.doc-hero { padding: clamp(32px, 4.5vw, 64px) 0 clamp(28px, 3.5vw, 48px); overflow: hidden; overflow: clip; }
.doc-hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "head bertie" "intro bertie"; gap: 0 clamp(24px, 5vw, 72px); align-items: center; }
.doc-head { grid-area: head; align-self: end; }
.doc-intro { grid-area: intro; align-self: start; }
.doc-hero h1 { font-size: clamp(42px, 5.6vw, 76px); max-width: 11em; }
.doc-hero .lead { margin-top: 20px; }
.doc-meta { margin-top: 18px; font: 600 15px/1.35 var(--text); color: var(--ink-soft); }
.doc-hero bertie-coach { grid-area: bertie; width: clamp(150px, 19vw, 260px); margin-right: 12px; }
.doc { padding-bottom: var(--section); }
.doc-grid { display: grid; grid-template-columns: minmax(0, 250px) minmax(0, 1fr); gap: 28px clamp(28px, 4vw, 56px); align-items: start; }
.toc { position: sticky; top: calc(var(--header-h) + 28px); font: 600 16px/1.3 var(--display); }
.toc p { font: 600 14px/1.3 var(--text); color: var(--ink-soft); margin-bottom: 12px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.toc a { display: block; text-decoration: none; padding: 6px 12px 7px; border-radius: 12px; border: 2px solid transparent; }
.toc a:hover { border-color: var(--ink); background: var(--paper); }
.sheet-doc { background: var(--paper); border: var(--stroke) solid var(--ink); border-radius: 30px; padding: clamp(24px, 3.6vw, 52px) clamp(18px, 4.4vw, 64px) clamp(28px, 4vw, 56px); min-width: 0; }

.prose { font-size: 17.5px; line-height: 1.62; }
.prose > * { max-width: 42em; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: clamp(26px, 2.5vw, 32px); font-stretch: 94%; line-height: 1.1; margin: 48px 0 14px; }
.prose h3 { font-size: 20px; margin: 30px 0 8px; }
.prose p, .prose ul, .prose ol { margin: 0; }
.prose * + p, .prose * + ul, .prose * + ol { margin-top: 14px; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li + li { margin-top: 8px; }
.prose li::marker { color: var(--ink-soft); }
.prose a { font-weight: 600; overflow-wrap: anywhere; }
.prose strong { font-weight: 700; }
.prose .muted { color: var(--ink-soft); }

/* "The short version": a yellow card at the top of a document. */
.short { background: var(--yellow); border: 2.5px solid var(--ink); border-radius: 24px; padding: 20px clamp(18px, 2.6vw, 28px) 22px; }
.short h2 { font-size: 22px; margin: 0; }
.short .ticks { margin-top: 14px; }
.short .ticks li { font-size: 16.5px; }

/* Contact card on the support page. */
.contact { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 28px; align-items: center; background: var(--paper); border: var(--stroke) solid var(--ink); border-radius: 30px; padding: clamp(22px, 3vw, 36px) clamp(18px, 3.4vw, 44px); }
.contact h2 { font-size: clamp(26px, 2.6vw, 34px); font-stretch: 94%; }
.contact p { margin-top: 10px; font-size: 17px; line-height: 1.55; color: var(--ink-soft); max-width: 36em; }
.contact .btn { justify-self: start; }
.email { font-family: var(--display); font-weight: 600; overflow-wrap: anywhere; }
.help-group { margin-top: clamp(40px, 5vw, 64px); display: grid; grid-template-columns: minmax(0, 280px) minmax(0, 1fr); gap: 20px clamp(28px, 4vw, 56px); align-items: start; }
.help-group h2 { font-size: clamp(28px, 3vw, 38px); font-stretch: 92%; position: sticky; top: calc(var(--header-h) + 28px); }
.help-group h2 small { display: block; margin-top: 10px; font: 500 16px/1.45 var(--text); color: var(--ink-soft); letter-spacing: 0; }

/* Not found. */
.lost { padding: clamp(40px, 7vw, 96px) 0 var(--section); }
.lost .wrap { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px clamp(28px, 6vw, 88px); align-items: center; }
.lost bertie-coach { width: clamp(180px, 24vw, 300px); }
.lost h1 { font-size: clamp(48px, 7vw, 96px); }
.lost .lead { margin-top: 18px; }
.lost .cta-row { margin-top: 30px; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 18px; margin-top: 30px; }

/* Responsive ------------------------------------------------------- */
@media (max-width: 980px) {
  .doc-grid, .help-group { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; }
  .toc ol { display: flex; flex-wrap: wrap; gap: 8px; }
  .toc a { border-color: var(--ink); background: var(--paper); padding: 6px 12px 7px; font-size: 15px; }
  .help-group h2 { position: static; }
}
@media (max-width: 1000px) {
  .nav { display: none; }
  .header-cta { margin-left: auto; }
}
@media (max-width: 760px) {
  :root { --header-h: 62px; }
  .contact { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .faq-list summary { font-size: 18.5px; padding: 16px 64px 17px 18px; }
  .answer { padding: 0 18px 18px; font-size: 16.5px; }
  .doc-hero .wrap { grid-template-columns: minmax(0, 1fr) 100px; grid-template-areas: "head bertie" "intro intro"; column-gap: 12px; }
  .doc-hero bertie-coach { width: 100px; margin: 0 4px 0 0; align-self: end; }
  .sheet-doc { padding: 22px 16px 28px; }
  .short { padding: 16px 14px 18px; }
  .doc-hero h1 { font-size: clamp(36px, 10vw, 48px); }
  .prose { font-size: 17px; }
  .sheet-doc { border-radius: 24px; }
  .lost .wrap { grid-template-columns: minmax(0, 1fr); justify-items: start; }
  .lost bertie-coach { width: 170px; }
}
@media (max-width: 400px) {
  .brand { font-size: 18px; gap: 9px; }
  .brand img { width: 34px; height: 34px; }
  .header-cta { padding: 8px 14px 9px; font-size: 15.5px; }
  .btn-store { font-size: 19px; }
  .cta-row .btn { width: 100%; }
  .cta-row .btn-store { align-items: center; }
  .cta-row .btn:not(.btn-store) { justify-content: center; }
}
@media (max-width: 380px) {
  .site-header .wrap { gap: 10px; }
  .brand { font-size: 16.5px; gap: 8px; }
  .brand img { width: 32px; height: 32px; }
  .header-cta { padding: 8px 13px 9px; font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
}
