/* Walnut Chess marketing site. One stylesheet for every page. */
:root {
  --bg: #121417;
  --bg-2: #16191e;
  --card: #1c1f24;
  --text: #ece7df;
  --muted: #9aa0a8;
  --accent: #e0a458;
  --accent-ink: #1b1408;
  --accent-soft: rgba(224, 164, 88, .12);
  --light: #f0d9b5;
  --dark: #b58863;
  --border: #2f343c;
  --shadow: 0 20px 60px rgba(0, 0, 0, .45);
  --good: #34d399;
  --good-soft: rgba(52, 211, 153, .14);
  --warn: #f28c5b;
  --hl: rgba(224, 164, 88, .45);
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1100px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #faf7f2;
    --bg-2: #f3eee6;
    --card: #ffffff;
    --text: #1d1a16;
    --muted: #625c55;
    --accent: #b86f1c;
    --accent-ink: #ffffff;
    --accent-soft: rgba(184, 111, 28, .1);
    --border: #e3dccf;
    --shadow: 0 16px 40px rgba(60, 40, 10, .15);
    --good: #0f8a50;
    --good-soft: rgba(15, 138, 80, .12);
    --warn: #c2410c;
    --hl: rgba(205, 210, 106, .7);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
a { color: var(--accent); }
img, svg { max-width: 100%; }
.wrap { max-width: var(--max); width: 100%; margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { left: 16px; top: 8px; background: var(--card); padding: 8px 12px; border-radius: 8px; z-index: 10; }

/* Header */
.site-header { border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 650; text-decoration: none; color: var(--text); }
.brand svg { width: 22px; height: 22px; fill: var(--accent); }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--muted); text-decoration: none; font-size: 14px; padding: 8px 10px; border-radius: 8px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.nav a.btn { color: var(--accent-ink); background: var(--accent); font-weight: 600; margin-left: 6px; }
.menu-toggle { display: none; background: none; border: 1px solid var(--border); color: var(--text); border-radius: 8px; width: 40px; height: 40px; cursor: pointer; }
.menu-toggle svg { width: 18px; height: 18px; stroke: currentColor; }
@media (max-width: 719px) {
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; padding: 4px 0 14px; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 4px; font-size: 16px; border-bottom: 1px solid var(--border); border-radius: 0; }
  .nav a.btn { margin: 12px 0 0; text-align: center; border-radius: 10px; border: 0; }
}

/* Type */
.eyebrow { color: var(--accent); letter-spacing: .18em; text-transform: uppercase; font-size: 12px; font-weight: 650; margin: 0 0 14px; }
h1 { font-size: clamp(32px, 5vw, 54px); line-height: 1.08; letter-spacing: -.02em; margin: 0 0 18px; }
h2 { font-size: clamp(24px, 3vw, 32px); line-height: 1.2; letter-spacing: -.01em; margin: 0 0 12px; }
h3 { font-size: 18px; margin: 0 0 6px; }
.lead { color: var(--muted); font-size: 18px; max-width: 58ch; margin: 0 0 26px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Buttons */
.cta { display: flex; gap: 12px; flex-wrap: wrap; }
.button { display: inline-block; text-decoration: none; padding: 12px 18px; border-radius: 10px; font-weight: 600; font-size: 15px; border: 1px solid transparent; }
.button.primary { background: var(--accent); color: var(--accent-ink); }
.button.secondary { border-color: var(--border); color: var(--text); }
.button:hover { filter: brightness(1.06); }

/* Wait estimate */
.wait { display: inline-flex; align-items: center; gap: 8px; margin: 18px 0 0; padding: 8px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--text); font-size: 14px; font-weight: 550; }
.wait::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.wait[hidden] { display: none; }
.note { color: var(--muted); font-size: 13px; margin: 12px 0 0; }

/* Sections */
main { flex: 1; }
.section { padding: 56px 0; }
.section + .section { border-top: 1px solid var(--border); }
.section.alt { background: var(--bg-2); }
.hero { display: grid; grid-template-columns: 1fr; gap: 40px; align-items: center; padding: 40px 0 64px; }
@media (min-width: 860px) { .hero { grid-template-columns: 1.1fr 1fr; padding: 64px 0 80px; } }
.page-head { padding: 48px 0 8px; }
.page-head .lead { margin-bottom: 0; }

.grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 680px) { .grid.two { grid-template-columns: repeat(2, 1fr); } .grid.three { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.card .icon { display: inline-flex; width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); align-items: center; justify-content: center; margin-bottom: 14px; }
.card .icon svg { width: 20px; height: 20px; }
.grid .card, .post-card { transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.grid .card:hover, .post-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0, 0, 0, .12); }

.split { display: grid; grid-template-columns: 1fr; gap: 28px; align-items: start; }
@media (min-width: 860px) { .split { grid-template-columns: 1fr 1fr; gap: 48px; } }
.split ul, .feature-list { padding-left: 1.1em; margin: 0; color: var(--muted); }
.split li, .feature-list li { margin: 6px 0; }
.split li strong, .feature-list li strong { color: var(--text); }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps li { counter-increment: step; position: relative; padding: 16px 16px 16px 60px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; color: var(--muted); }
.steps li::after { content: ""; position: absolute; left: 30px; top: 46px; bottom: -13px; width: 2px; background: var(--border); }
.steps li:last-child::after { display: none; }
.steps li::before { content: counter(step); position: absolute; left: 16px; top: 14px; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; display: flex; align-items: center; justify-content: center; }
.steps li strong { display: block; color: var(--text); }

.band { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: clamp(20px, 4vw, 40px); display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; }
.band h2 { margin: 0 0 6px; }
.band p { margin: 0; color: var(--muted); }

/* Board */
.board { width: min(100%, 460px); aspect-ratio: 1; margin: 0 auto; display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); }
.board span { min-height: 0; }
.board span { display: flex; align-items: center; justify-content: center; font-size: clamp(26px, 7.5vw, 44px); line-height: 1; background: var(--dark); font-family: "Segoe UI Symbol", "Apple Symbols", "DejaVu Sans", system-ui, sans-serif; font-variant-emoji: text; }
.board span.l { background: var(--light); }
.board .w { color: #fff; -webkit-text-stroke: 3px #1a1a1a; paint-order: stroke fill; text-shadow: 0 1px 1px rgba(0, 0, 0, .25); }
.board .b { color: #111; }

/* Blog */
.post-list { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .post-list { grid-template-columns: repeat(2, 1fr); } }
.post-card { display: block; text-decoration: none; color: inherit; }
.post-card:hover { border-color: var(--accent); }
.post-card h3 { font-size: 19px; line-height: 1.3; margin: 6px 0 8px; }
.meta { color: var(--muted); font-size: 13px; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; color: var(--accent); letter-spacing: .06em; text-transform: uppercase; }

.article { max-width: 720px; margin: 0 auto; padding: 40px var(--gutter) 64px; }
.article h1 { font-size: clamp(30px, 4.5vw, 44px); }
.article .meta { margin-bottom: 28px; }
.prose { font-size: 17px; line-height: 1.75; }
.prose h2 { font-size: 24px; margin: 36px 0 10px; }
.prose p, .prose ul, .prose ol { margin: 0 0 18px; }
.prose li { margin: 6px 0; }
.prose blockquote { margin: 0 0 18px; padding: 4px 0 4px 16px; border-left: 3px solid var(--accent); color: var(--muted); }
.prose code { font-size: .92em; background: var(--card); border: 1px solid var(--border); padding: 1px 5px; border-radius: 5px; }
.cta-box { margin: 40px 0 0; padding: 24px; border-radius: 16px; background: var(--accent-soft); border: 1px solid var(--border); }
.cta-box h2 { margin: 0 0 6px; font-size: 22px; }
.cta-box p { margin: 0 0 16px; color: var(--muted); }
.related { margin-top: 36px; }
.related h2 { font-size: 18px; margin-bottom: 12px; }
.back { display: inline-block; margin-bottom: 20px; font-size: 14px; text-decoration: none; color: var(--muted); }
.back:hover { color: var(--text); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; padding: 28px 0; margin-top: 24px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }

/* Home: the hero's demo of the coach at work. site.js plays it; without JS it shows its first moment. */
.demo { margin: 0 auto; width: min(100%, 460px); }
.demo-phases { list-style: none; margin: 0 0 12px; padding: 4px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--card); border: 1px solid var(--border); border-radius: 999px; }
.demo-phases li { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 4px; border-radius: 999px; font-size: 13px; font-weight: 650; color: var(--muted); transition: background-color .35s ease, color .35s ease; }
.demo-phases li svg { width: 14px; height: 14px; flex: none; }
.demo-phases li.on { background: var(--accent); color: var(--accent-ink); }
.demo-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.demo-mode { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--text); font-weight: 600; }
.demo-mode svg { width: 14px; height: 14px; color: var(--accent); }
.demo-frame { position: relative; }
.demo-frame .board { width: 100%; }
.board span { position: relative; transition: background-color .3s ease; }
.board span.hl { background-image: linear-gradient(var(--hl), var(--hl)); }
.demo-arrows { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.demo-arrows g { color: rgb(26, 48, 138); }
.demo-arrows .best { opacity: .95; }
.demo-arrows .alt { opacity: .6; }
.demo-arrows path { fill: none; stroke: currentColor; stroke-width: .04; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.demo-arrows .shaft { animation: draw .5s cubic-bezier(.45, .05, .25, 1) forwards; }
.demo-arrows .head { stroke-width: .04; animation: draw .2s ease-out forwards; }
.demo-arrows .trail { opacity: .7; transition: opacity .8s ease; }
.demo-arrows .trail .shaft { stroke-width: .035; animation-duration: .56s; animation-timing-function: cubic-bezier(.33, 1, .68, 1); }
.demo-arrows .trail.b { color: #3b3b3b; }
.demo-arrows .trail.gone { opacity: 0; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.demo-piece { position: absolute; display: flex; align-items: center; justify-content: center; line-height: 1; pointer-events: none; font-family: "Segoe UI Symbol", "Apple Symbols", "DejaVu Sans", system-ui, sans-serif; z-index: 2; }
.demo-piece.w { color: #fff; -webkit-text-stroke: 3px #1a1a1a; paint-order: stroke fill; text-shadow: 0 1px 1px rgba(0, 0, 0, .25); }
.demo-piece.b { color: #111; }
.demo-grade { position: absolute; z-index: 3; transform: translate(-60%, -45%) scale(.6); opacity: 0; padding: 3px 8px; border-radius: 999px; background: var(--good); color: #fff; font-size: 12px; font-weight: 700; box-shadow: 0 4px 12px rgba(0, 0, 0, .25); transition: transform .3s cubic-bezier(.3, 1.6, .5, 1), opacity .2s ease; white-space: nowrap; }
.demo-grade.bad { background: var(--warn); }
.demo-grade.show { transform: translate(-60%, -45%) scale(1); opacity: 1; }
.demo-coach { display: flex; gap: 12px; align-items: flex-start; margin-top: 14px; padding: 14px 16px; min-height: 150px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .08); }
.demo-avatar { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font: 700 15px/30px Georgia, serif; text-align: center; }
.demo-who { margin: 0; font-size: 12px; font-weight: 650; color: var(--muted); }
.demo-say { margin: 2px 0 0; font-size: 15px; line-height: 1.5; min-height: 1.5em; }
.demo-opts { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.demo-opts:empty { display: none; }
.demo-opts li { display: flex; gap: 8px; align-items: baseline; color: var(--muted); animation: rise-in .35s ease both; }
.demo-opts li:nth-child(2) { animation-delay: .15s; }
.demo-opts b { color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; min-width: 30px; }
.demo-opts .g { color: var(--good); font-weight: 650; min-width: 48px; }
.demo-opts .g.warn { color: var(--warn); }
.demo-opts.found b { font-family: inherit; min-width: 92px; }
.demo-opts.found .g { min-width: 56px; }
.demo.resetting .demo-frame, .demo.resetting .demo-coach { opacity: .35; transition: opacity .4s ease; }
.demo .demo-frame, .demo .demo-coach { transition: opacity .4s ease; }

/* Home: watches, finds, trains */
.beats .card h3 { font-size: 22px; margin: 0 0 8px; }

/* Home: the facts under the hero */
.trust { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-2); }
.trust ul { list-style: none; margin: 0 auto; padding-top: 18px; padding-bottom: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; font-size: 14px; font-weight: 550; }
@media (min-width: 900px) { .trust ul { display: flex; justify-content: space-between; } }
.trust li { display: flex; align-items: center; gap: 8px; }
.trust svg { flex: none; width: 16px; height: 16px; color: var(--good); }

/* Home: app screenshots in phone frames */
.shots { display: grid; gap: 28px; grid-template-columns: 1fr; margin-top: 8px; }
@media (min-width: 760px) { .shots { grid-template-columns: repeat(3, 1fr); gap: 24px; } }
.shot { margin: 0; }
.phone { max-width: 300px; margin: 0 auto 16px; padding: 8px; border-radius: 34px; background: #0b0c0e; box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, .08); }
.phone img { display: block; width: 100%; height: auto; border-radius: 27px; }
.shot figcaption { max-width: 300px; margin: 0 auto; }
.shot figcaption p { margin: 0; color: var(--muted); font-size: 15px; }

/* Motion: the hero settles in once, and sections below the fold rise in as they arrive. */
@keyframes fade-in { to { opacity: 1; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.hero > * { animation: rise-in .7s cubic-bezier(.2, .7, .2, 1) both; }
.hero > :nth-child(2) { animation-delay: .12s; }
.reveal.pending { opacity: 0; transform: translateY(18px); }
.reveal.arriving { transition: opacity .6s ease var(--d, 0s), transform .6s cubic-bezier(.2, .7, .2, 1) var(--d, 0s); }
@media (prefers-reduced-motion: reduce) {
  .hero > *, .demo-opts li { animation: none; opacity: 1; }
  .demo-arrows path { animation: none; stroke-dashoffset: 0; }
  .reveal.pending { opacity: 1; transform: none; }
  .grid .card:hover, .post-card:hover { transform: none; }
}

/* Kids mode: the hero's pointer, the home page's kids section and the /kids/ page. The kids
   section keeps the app's kids colours (cream, orange, green) in both colour schemes. */
/* The hero's way into kids mode: a card in the kids colours (the same in both schemes), with
   Walnut bobbing, so it stands out next to the grown-up buttons without being one of them. */
.kids-pill { display: flex; align-items: center; gap: 12px; width: fit-content; max-width: 100%; margin-top: 16px; padding: 8px 10px 8px 8px;
  border-radius: 18px; background: #fff6e8; border: 2px solid #ff9600; box-shadow: 0 4px 0 #e08400; color: #3b2412; text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease; }
.kids-pill:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #e08400; }
.kids-pill:active { transform: translateY(2px); box-shadow: 0 2px 0 #e08400; }
.kids-pill:focus-visible { outline: 3px solid #ff9600; outline-offset: 3px; }
.kids-pill img { width: 46px; height: 54px; flex: none; animation: kid-bob 2.4s ease-in-out infinite; transform-origin: 50% 100%; }
.kids-pill > span:not(.go) { display: flex; flex-direction: column; min-width: 0; }
.kids-pill strong { font-size: 16px; font-weight: 800; line-height: 1.25; color: #3b2412; }
.kids-pill em { font-style: normal; display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 999px; background: #58cc02; color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; vertical-align: 2px; }
.kids-pill small { font-size: 14px; color: #7a5a3c; line-height: 1.35; }
.kids-pill .go { flex: none; display: grid; place-items: center; width: 34px; height: 34px; margin-left: 4px; border-radius: 50%; background: #ff9600; color: #fff; font-weight: 800; font-size: 18px; }
@keyframes kid-bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-4px) rotate(3deg); } }
@media (prefers-reduced-motion: reduce) { .kids-pill img { animation: none; } .kids-pill, .kids-pill:hover { transition: none; transform: none; } }
.kids-zone { --k-bg: #fff6e8; --k-card: #ffffff; --k-ink: #3b2412; --k-muted: #7a5a3c; --k-orange: #ff9600; --k-green: #58cc02; --k-border: #f0dfc4;
  background: var(--k-bg); color: var(--k-ink); color-scheme: light;
  /* the site's own tokens, in kids colours, so every part inside follows in both schemes */
  --bg: var(--k-bg); --bg-2: #fbefdc; --card: var(--k-card); --text: var(--k-ink); --muted: var(--k-muted);
  --border: var(--k-border); --accent: #c26a00; --accent-ink: #fff; --accent-soft: rgba(255, 150, 0, .14); }
.kids-zone .eyebrow { color: #c26a00; }
.kids-zone .lead, .kids-zone .muted, .kids-zone p { color: var(--k-muted); }
.kids-zone h1, .kids-zone h2, .kids-zone h3, .kids-zone strong { color: var(--k-ink); }
.kids-zone a:not(.button) { color: #c26a00; }
.kids-zone .card { background: var(--k-card); border-color: var(--k-border); box-shadow: 0 4px 0 var(--k-border); border-radius: 22px; }
.kids-zone .button.primary { background: var(--k-orange); color: #fff; border-color: var(--k-orange); box-shadow: 0 4px 0 #d97f00; border-radius: 16px; font-weight: 800; }
.kids-zone .button.secondary { background: var(--k-card); color: var(--k-ink); border-color: var(--k-border); border-radius: 16px; }
.kids-zone .phone { background: #3b2412; }
.kids-zone .feature-list li { border-color: var(--k-border); }
.kids-zone .band { background: var(--k-card); border-color: var(--k-border); border-radius: 22px; }
.kids-head { display: grid; gap: 24px; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 760px) { .kids-head { grid-template-columns: auto 1fr; gap: 36px; } }
.kids-head .walnut { width: 120px; height: 140px; }
@media (min-width: 760px) { .kids-head .walnut { width: 170px; height: 198px; } }
.kids-icon { font-size: 34px; line-height: 1; margin-bottom: 8px; }
.trust li.kids { font-weight: 650; }
.trust li.kids img { width: 18px; height: 20px; flex: none; }
.faq { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .faq { grid-template-columns: 1fr 1fr; } }
.kids-icon img { width: 34px; height: 40px; display: block; }
