/* Kindly Made: the website for Spry. Plain CSS, no framework.
   Colours, type and pieces come from Spry's "Game Box" design (design/DESIGN.md): the oat board,
   espresso ink, the vermilion action, one pigment and one shape per skill area. The fonts are
   self-hosted, so the site makes no requests to anyone but its own host. */

@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('fonts/bricolage-grotesque-latin-opsz.woff2') format('woff2-variations'),
    url('fonts/bricolage-grotesque-latin-opsz.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  src: url('fonts/atkinson-hyperlegible-next-latin-wght.woff2') format('woff2-variations'),
    url('fonts/atkinson-hyperlegible-next-latin-wght.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
/* Digits from Bricolage, so no zero is slashed (as in the app). */
@font-face {
  font-family: 'Spry Figures';
  src: url('fonts/bricolage-grotesque-latin-opsz.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0030-0039;
}

:root {
  color-scheme: light dark;
  --font-display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Spry Figures', 'Atkinson Hyperlegible Next', 'Segoe UI', system-ui, sans-serif;

  --bg: #F6EFE3;
  --bg-deep: #EFE5D5;
  --surface: #FFFBF4;
  --surface-hero: #FFFCF7;
  --surface-line: #EADFCD;
  --hairline: #E3D5C0;
  --sunken: #ECE2D0;
  --control: #8A7B67;
  --text: #2B2118;
  --text-2: #574839;
  --text-3: #7A6A5A;
  --accent: #A2320C;
  --accent-hi: #BF4A1E;
  --accent-pressed: #8C2A09;
  --accent-edge: #661D05;
  --accent-ink: #862809;
  --accent-tint: #FADFD2;
  --on-accent: #FFFFFF;
  --raised: #FFFDF9;
  --raised-hi: #FFFFFF;
  --raised-edge: #D3BF9F;
  --piece-line: #E2D3BC;
  --success-ink: #1C5725;
  --success-tint: #DDEEDB;
  --gold-tint: #FBEDC6;
  --gold-ink: #6E4600;
  --gold-edge: #A87412;
  --focus: #2B2118;
  --shadow-card: 0 1px 2px rgba(70, 45, 20, 0.06), 0 8px 24px -12px rgba(70, 45, 20, 0.18);
  --shadow-shot: 0 0 0 1.5px var(--hairline), 0 18px 40px -18px rgba(70, 45, 20, 0.35);
  --grain-opacity: 0.06;

  --memory: #3551C6;
  --memory-ink: #2A41A5;
  --memory-tint: #E3E8FA;
  --attention: #E39B22;
  --attention-ink: #714400;
  --attention-tint: #FBECCB;
  --language: #0E7682;
  --language-ink: #07525B;
  --language-tint: #D4EBEB;
  --maths: #7B3C96;
  --maths-ink: #693083;
  --maths-tint: #EFE1F3;

  --gutter: 20px;
  --measure: 40rem;
  --wide: 68rem;
  --r-card: 28px;
  --r-btn: 20px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1A1613;
    --bg-deep: #15120F;
    --surface: #231D17;
    --surface-hero: #2E2620;
    --surface-line: #463A2F;
    --hairline: #3A3129;
    --sunken: #120F0C;
    --control: #8C7F6F;
    --text: #F6EDE1;
    --text-2: #CDBFAE;
    --text-3: #A39483;
    --accent: #C4430F;
    --accent-hi: #E06A38;
    --accent-pressed: #A93809;
    --accent-edge: #6E2306;
    --accent-ink: #EFA88D;
    --accent-tint: #43231A;
    --raised: #3A3129;
    --raised-hi: #463C33;
    --raised-edge: #0E0B09;
    --piece-line: #4F443A;
    --success-ink: #81CC8E;
    --success-tint: #1C3320;
    --gold-tint: #3A2D14;
    --gold-ink: #F0C766;
    --gold-edge: #8C5F0C;
    --focus: #FFE3A3;
    --shadow-card: 0 0 0 1px var(--surface-line);
    --shadow-shot: 0 0 0 1.5px var(--surface-line), 0 18px 40px -18px rgba(0, 0, 0, 0.6);
    --grain-opacity: 0.045;

    --memory: #8299F5;
    --memory-ink: #9DB7FF;
    --memory-tint: #232B47;
    --attention: #EFA23C;
    --attention-ink: #F2B25E;
    --attention-tint: #3A2D13;
    --language: #3FC0C8;
    --language-ink: #7FD0D5;
    --language-tint: #11393B;
    --maths: #C48BDF;
    --maths-ink: #D0A8E4;
    --maths-tint: #35233F;
  }
}

/* ---- Base ---------------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 1.25rem/1.55 var(--font-body); /* 20px */
  overflow-wrap: break-word;
}
/* The board's linen grain: one fixed layer behind everything, normal blending. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url('../img/grain.png') repeat;
  background-size: 96px;
  opacity: var(--grain-opacity);
  pointer-events: none;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--accent-ink); text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent-tint); color: var(--text); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 700;
  letter-spacing: -0.012em;
  line-height: 1.12;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.25rem); line-height: 1.05; }
h2 { font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.1rem); }
h3 { font-size: 1.4rem; line-height: 1.2; }
p, ul, ol, dl { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; }
li { margin-bottom: 0.4em; }
li::marker { color: var(--text-3); }
strong, b { font-weight: 700; }
small { font-size: 1.125rem; } /* 18px: the sentence floor */

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  padding: 12px 18px;
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  z-index: 10;
  font-weight: 700;
}
.skip:focus { top: 12px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wide)); margin-inline: auto; }
.measure { max-width: var(--measure); }

/* ---- Header and footer ---------------------------------------------------------------------- */

.site-head { border-bottom: 1.5px solid var(--hairline); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding-block: 18px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  color: var(--text);
  text-decoration: none;
  font: 700 1.5rem/1 var(--font-display);
  font-optical-sizing: auto;
  letter-spacing: -0.015em;
}
.brand svg { width: 28px; height: 28px; flex: none; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 4px 6px; list-style: none; margin: 0; padding: 0; }
.site-nav li { margin: 0; }
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--text-2);
  font-weight: 600;
  font-size: 1.125rem;
  text-decoration: none;
}
.site-nav a:hover { color: var(--text); background: var(--sunken); }
.site-nav a[aria-current='page'] { color: var(--text); background: var(--accent-tint); font-weight: 800; }

.site-foot { margin-top: 72px; border-top: 1.5px solid var(--hairline); color: var(--text-2); font-size: 1.125rem; }
.site-foot .wrap { display: grid; gap: 18px; padding-block: 32px 48px; }
.site-foot ul { display: flex; flex-wrap: wrap; gap: 4px 22px; list-style: none; margin: 0; padding: 0; }
.site-foot li { margin: 0; }
.site-foot a { color: var(--text); display: inline-flex; min-height: 44px; align-items: center; }
.site-foot p { margin: 0; }

main { display: block; }

/* ---- Pieces: the one rule, if it has an edge you can press it --------------------------------- */

.btn {
  --face: var(--accent);
  --face-down: var(--accent-pressed);
  --rim: var(--accent-hi);
  --edge: var(--accent-edge);
  --ink: var(--on-accent);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 64px;
  padding: 0 26px;
  margin-bottom: 6px;
  border-radius: var(--r-btn);
  background: var(--face);
  color: var(--ink);
  box-shadow: inset 0 1.5px 0 var(--rim), 0 6px 0 var(--edge), 0 11px 16px -8px rgba(70, 45, 20, 0.45);
  font: 700 1.3125rem/1.15 var(--font-body);
  text-decoration: none;
  transition: transform 160ms cubic-bezier(0.2, 1.35, 0.4, 1), box-shadow 160ms;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(4px); background: var(--face-down); box-shadow: inset 0 1.5px 0 var(--rim), 0 2px 0 var(--edge); transition-duration: 90ms; }
.btn svg { width: 26px; height: 26px; flex: none; }
.btn-quiet {
  --face: var(--raised);
  --face-down: var(--bg-deep);
  --rim: var(--raised-hi);
  --edge: var(--raised-edge);
  --ink: var(--text);
  box-shadow: inset 0 0 0 1.5px var(--piece-line), 0 6px 0 var(--edge), 0 11px 16px -8px rgba(70, 45, 20, 0.3);
}
.btn-quiet:active { box-shadow: inset 0 0 0 1.5px var(--piece-line), 0 2px 0 var(--edge); }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }

/* ---- Paper -------------------------------------------------------------------------------- */

.card {
  background: var(--surface-hero);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card), inset 0 0 0 1px var(--surface-line);
  padding: clamp(20px, 4vw, 32px);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 2px 14px;
  border-radius: 999px;
  background: var(--sunken);
  color: var(--text);
  font-weight: 700;
  font-size: 1.0625rem; /* 17px label */
}
.chip-good { background: var(--success-tint); color: var(--success-ink); }
.eyebrow { font-weight: 700; color: var(--text-2); font-size: 1.125rem; margin: 0 0 10px; }
.lead { font-size: clamp(1.25rem, 1.15rem + 0.5vw, 1.45rem); color: var(--text-2); }
.muted { color: var(--text-2); }

/* Area tokens: always solid, always with the area's name beside them. */
.token { width: 16px; height: 16px; flex: none; }
.token-memory { color: var(--memory); }
.token-attention { color: var(--attention); }
.token-language { color: var(--language); }
.token-maths { color: var(--maths); }

/* ---- Home --------------------------------------------------------------------------------- */

.hero { padding-block: clamp(36px, 7vw, 80px) clamp(28px, 5vw, 56px); }
.hero-grid { display: grid; gap: 36px; align-items: center; }
.app-id { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.app-id img { width: 88px; height: 88px; border-radius: 22%; box-shadow: 0 0 0 1px var(--surface-line), 0 10px 24px -12px rgba(70, 45, 20, 0.45); }
.app-id p { margin: 0; line-height: 1.25; }
.app-id .name { font: 800 1.75rem/1 var(--font-display); letter-spacing: -0.02em; display: block; margin-bottom: 4px; color: var(--text); }
.get { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-top: 28px; }
.get .note { margin: 0; color: var(--text-2); font-size: 1.125rem; }
.promises { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 26px 0 0; }
.promises li { margin: 0; }

.shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; list-style: none; padding: 0; margin: 0; }
.shots li { margin: 0; }
.shots img { width: 100%; border-radius: 22px; box-shadow: var(--shadow-shot); background: var(--bg-deep); aspect-ratio: 390 / 844; }
.shots li:nth-child(n + 3) { display: none; }

.section { padding-block: clamp(32px, 6vw, 64px); border-top: 1.5px solid var(--hairline); }
.games { display: grid; gap: 16px; list-style: none; padding: 0; margin: 0; }
.games li { margin: 0; }
.game { display: grid; grid-template-columns: 56px 1fr; gap: 12px 16px; align-content: start; height: 100%; }
.game > div { grid-column: 1 / -1; }
.glyph { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; }
.glyph svg { width: 26px; height: 26px; }
.game h3 { margin: 0 0 4px; }
.game > div p { margin: 0; color: var(--text-2); }
.area { display: inline-flex; align-items: center; align-self: center; gap: 7px; font-weight: 700; font-size: 1.125rem; margin: 0; }
.area-memory { color: var(--memory-ink); }
.area-attention { color: var(--attention-ink); }
.area-language { color: var(--language-ink); }
.area-maths { color: var(--maths-ink); }
.glyph-memory { background: var(--memory-tint); color: var(--memory-ink); }
.glyph-attention { background: var(--attention-tint); color: var(--attention-ink); }
.glyph-language { background: var(--language-tint); color: var(--language-ink); }
.glyph-maths { background: var(--maths-tint); color: var(--maths-ink); }

.ticks { list-style: none; padding: 0; display: grid; gap: 14px; }
.ticks li { display: grid; grid-template-columns: 30px 1fr; gap: 14px; margin: 0; align-items: start; }
.ticks li::before {
  content: '';
  width: 30px;
  height: 30px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--success-tint) no-repeat center / 18px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231C5725' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  .ticks li::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2381CC8E' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  }
}
.two { display: grid; gap: 28px; }
.private { display: grid; gap: 14px; align-content: start; }
.private p { margin: 0; }
.private .lock { display: flex; align-items: center; gap: 12px; font: 700 1.35rem/1.25 var(--font-body); margin: 0 0 6px; }
.private .lock svg { width: 28px; height: 28px; flex: none; color: var(--text-2); }

@media (min-width: 640px) {
  .shots { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .shots li:nth-child(n + 3) { display: block; }
  .games { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; }
  .hero .shots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero .shots li:nth-child(n + 3) { display: none; }
  .two { grid-template-columns: 1fr 1fr; gap: 48px; }
}

/* ---- Text pages (privacy, support, licences) --------------------------------------------- */

.page { padding-block: clamp(32px, 6vw, 64px) 0; }
.page header { margin-bottom: 28px; }
.page h2 { margin-top: 1.9em; padding-top: 0.2em; }
.page h3 { margin-top: 1.5em; }
.page .card h2:first-child, .page .card h3:first-child { margin-top: 0; }
.updated { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 8px; }
.summary { margin-block: 8px 12px; }
.summary h2 { margin-top: 0; font-size: 1.5rem; }
.summary ul { margin-bottom: 0; }
.toc { font-size: 1.125rem; }
.toc ol { padding-left: 1.4em; columns: 2 16rem; column-gap: 32px; margin: 0; }
.toc li { break-inside: avoid; }

/* FAQ: native details, so it works without script. */
.faq { display: grid; gap: 14px; margin-top: 8px; }
.faq details { background: var(--surface-hero); border-radius: 22px; box-shadow: var(--shadow-card), inset 0 0 0 1px var(--surface-line); }
.faq summary {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 14px 20px;
  cursor: pointer;
  list-style: none;
  font: 700 1.3125rem/1.3 var(--font-body);
  border-radius: 22px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '';
  margin-left: auto;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--sunken) no-repeat center / 18px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23574839' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E");
  transition: transform 160ms;
}
.faq details[open] summary::after { transform: rotate(180deg); }
@media (prefers-color-scheme: dark) {
  .faq summary::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23CDBFAE' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E");
  }
}
@media (prefers-reduced-motion: reduce) { .faq summary::after { transition: none; } }
.faq .answer { padding: 0 20px 20px; }
.faq .answer > :last-child { margin-bottom: 0; }
.path { font-weight: 700; color: var(--text); }
.contact { display: grid; gap: 6px; margin-top: 40px; }
.contact p { margin: 0; }
.email { font: 700 clamp(1.3rem, 1.1rem + 1vw, 1.6rem)/1.3 var(--font-body); }

/* Licences */
.credits { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; list-style: none; padding: 0; margin: 0 0 8px; }
.credit { overflow-wrap: anywhere; }
.credits > li { margin: 0; }
.credit h3 { margin: 0 0 4px; }
.credit .about { color: var(--text-2); margin-bottom: 12px; }
.credit dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; font-size: 1.125rem; margin: 0 0 12px; }
.credit dt { font-weight: 700; color: var(--text-2); }
.credit dd { margin: 0; min-width: 0; }
.credit details { border-top: 1.5px solid var(--hairline); padding-top: 10px; margin-top: 10px; }
.credit details summary { cursor: pointer; font-weight: 700; color: var(--accent-ink); min-height: 44px; display: flex; align-items: center; }
.licence-text { white-space: pre-wrap; font-size: 1.0625rem; line-height: 1.5; color: var(--text-2); margin: 8px 0 0; }
.licence-text + h4 { margin-top: 20px; }
.credit h4 { font: 700 1.125rem/1.3 var(--font-body); margin: 12px 0 0; }
@media (max-width: 420px) {
  .credit dl { grid-template-columns: 1fr; gap: 0; }
  .credit dd { margin-bottom: 8px; }
}

/* 404 */
.lost { text-align: center; padding-block: 72px 24px; }
.lost .btn { margin-top: 12px; }

/* Licence texts: the app's reflowed paragraphs, at a readable size. */
.licence-text p { margin: 0 0 0.8em; }
.licence-text .indent-1 { padding-left: 1.2em; }
.licence-text .indent-2 { padding-left: 2.4em; }
.licence-text .rule { color: var(--text-3); overflow: hidden; white-space: nowrap; }
.credits + section, section + section { margin-top: 8px; }
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
