/* =========================================================================
   TypeAtlas — design tokens
   The palette is taken from the finger-zone colours a typing tutor already
   needs, so colour carries meaning instead of decorating the page.
   ========================================================================= */
:root {
  --ink: #16181f;
  --ink-2: #2b3040;
  --slate: #5a6472;
  --slate-2: #8c94a3;
  --paper: #ffffff;
  --page: #edeff3;
  --line: #dbdfe7;
  --line-soft: #e9ecf1;

  --f-pinky-l: #e05c8b;
  --f-ring-l: #e8963c;
  --f-mid-l: #2fa97c;
  --f-index-l: #3b7de0;
  --f-index-r: #7c5ce0;
  --f-mid-r: #2fa97c;
  --f-ring-r: #e8963c;
  --f-pinky-r: #e05c8b;
  --f-thumb: #8a93a3;

  --accent: #3b7de0;
  --accent-dark: #2a5fb4;
  --ok: #1f8f66;
  --err: #d93b34;
  --warn: #c97a15;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --shadow-1: 0 1px 2px rgba(22, 24, 31, .06), 0 1px 3px rgba(22, 24, 31, .04);
  --shadow-2: 0 4px 16px rgba(22, 24, 31, .08);
  --shadow-key: 0 2px 0 var(--line), 0 3px 6px rgba(22, 24, 31, .07);

  --display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --wrap: 1120px;
  --gut: 20px;
}

[data-theme="dark"] {
  --ink: #eef1f6;
  --ink-2: #c8cede;
  --slate: #98a1b2;
  --slate-2: #6f7a8c;
  --paper: #1b1e27;
  --page: #12141b;
  --line: #2c313e;
  --line-soft: #232733;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 4px 20px rgba(0, 0, 0, .45);
  --shadow-key: 0 2px 0 #10131a, 0 3px 6px rgba(0, 0, 0, .5);
  --ok: #3fc494;
  --err: #ff6a63;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.015em; }
h1 { font-size: clamp(1.9rem, 5vw, 3.1rem); font-weight: 700; }
h2 { font-size: clamp(1.35rem, 3.2vw, 2rem); font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0 0 1em; }
ul { margin: 0 0 1em; padding-left: 1.15em; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }
.wrap-narrow { max-width: 760px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 200;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-sm);
  transition: top .15s;
}
.skip-link:focus { top: 8px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .bar {
  display: flex; align-items: center; gap: 14px;
  height: 60px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 1.06rem; color: var(--ink); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-key {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--ink); color: #fff;
  font-family: var(--mono); font-size: .82rem; font-weight: 700;
  box-shadow: inset 0 -2px 0 rgba(255, 255, 255, .18);
}
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a, .nav button {
  font: inherit; font-size: .93rem; color: var(--slate);
  padding: 8px 11px; border-radius: var(--r-sm);
  background: none; border: 0; cursor: pointer;
}
.nav a:hover, .nav button:hover { background: var(--line-soft); color: var(--ink); text-decoration: none; }
.nav a.is-active { color: var(--ink); font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: .94rem;
  padding: 10px 18px; border-radius: var(--r-sm);
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: transform .06s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: var(--paper); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-1); }
.btn-ghost:hover { border-color: var(--slate-2); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 13px; font-size: .86rem; }

/* ---------- hero ---------- */
.hero { padding: 52px 0 40px; }
.hero-grid { display: grid; gap: 34px; }
.eyebrow {
  font-family: var(--mono); font-size: .76rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--slate); margin-bottom: 14px;
}
.hero h1 .accent-rule {
  display: block; width: 64px; height: 5px; margin-top: 18px; border-radius: 3px;
  background: linear-gradient(90deg, var(--f-pinky-l), var(--f-ring-l), var(--f-mid-l), var(--f-index-l), var(--f-index-r));
}
.hero-lede { font-size: 1.1rem; color: var(--slate); max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

.stat-row { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.stat-row .n { font-family: var(--mono); font-size: 1.45rem; font-weight: 700; display: block; }
.stat-row .l { font-size: .8rem; color: var(--slate); }

/* ---------- typing surface (shared by hero demo + lesson) ---------- */
.type-card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-2);
  overflow: hidden;
}
.type-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--line-soft);
  background: var(--line-soft);
}
.type-head .title { font-family: var(--display); font-weight: 600; font-size: .95rem; }
.type-head .spacer { margin-left: auto; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: .75rem; font-weight: 500;
  padding: 4px 9px; border-radius: 999px;
  background: var(--paper); border: 1px solid var(--line); color: var(--slate);
}
.chip-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }

/* live metrics */
.metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line-soft); }
.metric { background: var(--paper); padding: 12px 14px; text-align: center; }
.metric .v { font-family: var(--mono); font-size: 1.5rem; font-weight: 700; line-height: 1.1; display: block; font-variant-numeric: tabular-nums; }
.metric .k { font-size: .7rem; letter-spacing: .07em; text-transform: uppercase; color: var(--slate); }
.metric.is-time .v { color: var(--accent); }
.metric.is-acc.low .v { color: var(--err); }

/* the text itself */
.type-body { position: relative; padding: 26px 20px 22px; }
.type-text {
  font-family: var(--mono); font-size: clamp(1.05rem, 2.6vw, 1.42rem);
  line-height: 2.05; letter-spacing: .01em;
  color: var(--slate-2); word-break: break-word; white-space: pre-wrap;
  position: relative;
  user-select: none;
}
.type-text[dir="rtl"] { text-align: right; }
.type-text .g { position: relative; transition: color .04s linear; }
.type-text .g.done { color: var(--ink); }
.type-text .g.bad {
  color: var(--err);
  background: color-mix(in srgb, var(--err) 14%, transparent);
  border-radius: 3px;
}
.type-text .g.bad.is-space { background: color-mix(in srgb, var(--err) 32%, transparent); }
.type-text .g.extra { color: var(--err); opacity: .6; text-decoration: line-through; }
.type-text .g.now::before {
  content: ""; position: absolute; left: -2px; top: .1em; bottom: .1em;
  width: 2px; background: var(--accent); border-radius: 2px;
  animation: caret 1.05s steps(1) infinite;
}
.type-text[dir="rtl"] .g.now::before { left: auto; right: -2px; }
@keyframes caret { 0%, 55% { opacity: 1 } 56%, 100% { opacity: 0 } }

.type-input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; border: 0; resize: none; padding: 0;
  font-size: 16px; /* stops iOS zooming on focus */
  cursor: text;
}
.type-overlay {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(2px); text-align: center; padding: 20px;
  font-size: .95rem; color: var(--slate); cursor: pointer; z-index: 3;
}
.type-overlay strong { color: var(--ink); display: block; font-family: var(--display); font-size: 1.05rem; margin-bottom: 4px; }
.type-overlay[hidden] { display: none; }

.type-foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 12px 16px; border-top: 1px solid var(--line-soft);
}
.hint { font-size: .8rem; color: var(--slate); }
.hint kbd {
  font-family: var(--mono); font-size: .74rem;
  background: var(--line-soft); border: 1px solid var(--line);
  border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px;
}

/* progress bar */
.type-progress { height: 3px; background: var(--line-soft); }
.type-progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .12s linear; }

/* ---------- duration picker ---------- */
.durations { display: flex; flex-wrap: wrap; gap: 6px; }
.durations button {
  font-family: var(--mono); font-size: .8rem; font-weight: 500;
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  background: var(--paper); border: 1px solid var(--line); color: var(--slate);
}
.durations button:hover { border-color: var(--slate-2); color: var(--ink); }
.durations button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* ---------- signature: finger-coded keyboard ---------- */
.kb { margin-top: 18px; }
.kb-rows { display: grid; gap: 6px; }
.kb-row { display: flex; gap: 5px; justify-content: center; }
.kb-key {
  flex: 1 1 0; min-width: 0; max-width: 60px;
  height: 42px; display: grid; place-items: center;
  border-radius: 7px; background: var(--paper);
  border: 1px solid var(--line); box-shadow: var(--shadow-key);
  font-family: var(--mono); font-size: .82rem; color: var(--ink-2);
  position: relative; transition: transform .07s ease, box-shadow .07s ease;
}
.kb-key::after {
  content: ""; position: absolute; left: 7px; right: 7px; bottom: 4px;
  height: 2px; border-radius: 2px; background: var(--finger); opacity: .32;
}
.kb-key.wide { flex: 2.2 1 0; max-width: none; }
.kb-key.space { flex: 7 1 0; max-width: none; }
.kb-key.is-next {
  background: color-mix(in srgb, var(--finger) 16%, var(--paper));
  border-color: var(--finger);
  transform: translateY(-3px);
  box-shadow: 0 5px 0 color-mix(in srgb, var(--finger) 45%, transparent), 0 8px 14px rgba(22, 24, 31, .13);
  color: var(--ink);
  font-weight: 700;
}
.kb-key.is-next::after { opacity: 1; height: 3px; }
.kb-key.is-hit { transform: translateY(2px); box-shadow: none; }

.kb-legend { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 12px; font-size: .74rem; color: var(--slate); }
.kb-legend span { display: inline-flex; align-items: center; gap: 5px; }
.kb-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* fallback when we have no layout map for a script */
.next-char {
  display: grid; place-items: center; gap: 6px;
  margin-top: 18px; padding: 20px; border-radius: var(--r-lg);
  background: var(--paper); border: 1px dashed var(--line);
}
.next-char .c { font-size: 2.6rem; line-height: 1; font-family: var(--mono); }
.next-char .l { font-size: .76rem; color: var(--slate); text-transform: uppercase; letter-spacing: .08em; }

/* ---------- result panel ---------- */
.result { display: none; }
.result.is-open { display: block; }
.result-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 16px 0; }
.result-cell { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; text-align: center; }
.result-cell .v { font-family: var(--mono); font-size: 1.9rem; font-weight: 700; display: block; font-variant-numeric: tabular-nums; }
.result-cell .k { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--slate); }
.verdict { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: var(--r-md); font-weight: 600; }
.verdict.pass { background: color-mix(in srgb, var(--ok) 12%, var(--paper)); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); }
.verdict.fail { background: color-mix(in srgb, var(--warn) 12%, var(--paper)); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }

/* ---------- cards / grids ---------- */
.section { padding: 46px 0; }
.section-head { margin-bottom: 24px; }
.section-head p { color: var(--slate); margin: 0; max-width: 60ch; }

.grid { display: grid; gap: 14px; }
.grid-lang { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); }
.grid-levels { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
.grid-3 { grid-template-columns: 1fr; }

.lang-card {
  display: block; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 14px; color: var(--ink);
  box-shadow: var(--shadow-1); transition: border-color .14s, transform .14s;
}
.lang-card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.lang-card .native { font-size: 1.22rem; font-weight: 600; line-height: 1.25; margin-bottom: 2px; }
.lang-card .en { font-size: .84rem; color: var(--slate); }
.lang-card .meta { font-family: var(--mono); font-size: .68rem; color: var(--slate-2); margin-top: 8px; text-transform: uppercase; letter-spacing: .05em; }

.level-card {
  display: block; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 12px 13px; color: var(--ink);
  box-shadow: var(--shadow-1); position: relative;
  transition: border-color .14s, transform .14s;
}
.level-card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.level-card.is-done { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.level-card .n { font-family: var(--mono); font-size: .72rem; color: var(--slate); }
.level-card .t { font-weight: 600; font-size: .93rem; margin: 2px 0 6px; }
.level-card .d { font-size: .74rem; color: var(--slate); font-family: var(--mono); }
.level-card .tick { position: absolute; top: 10px; right: 10px; color: var(--ok); font-size: .9rem; }

.stage-block { margin-bottom: 30px; }
.stage-title { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.stage-title h3 { margin: 0; }
.stage-title .range { font-family: var(--mono); font-size: .76rem; color: var(--slate); }

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-1); }
.panel + .panel { margin-top: 14px; }

/* ---------- table ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 560px; }
table.data th, table.data td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
table.data th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--slate); font-weight: 600; }
table.data td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
table.data tbody tr:hover { background: var(--line-soft); }

/* ---------- sparkline ---------- */
.spark { width: 100%; height: 120px; display: block; }
.spark .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.spark .area { fill: color-mix(in srgb, var(--accent) 12%, transparent); }
.spark .dot { fill: var(--accent); }

/* ---------- forms ---------- */
.field { margin-bottom: 15px; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; }
.field input, .field select {
  width: 100%; font: inherit; font-size: 16px;
  padding: 11px 13px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
}
.field input:focus, .field select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.field .err { color: var(--err); font-size: .8rem; margin-top: 5px; display: block; }
.form-note { font-size: .86rem; color: var(--slate); }

.alert { padding: 12px 14px; border-radius: var(--r-sm); font-size: .9rem; margin-bottom: 16px; }
.alert-info { background: color-mix(in srgb, var(--accent) 10%, var(--paper)); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }

/* ---------- ads ---------- */
.ad-slot { margin: 22px 0; text-align: center; min-height: 1px; }
.ad-slot[data-empty="1"] { display: none; }
.ad-label { font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--slate-2); margin-bottom: 5px; }
body.is-typing .ad-slot { visibility: hidden; }

/* ---------- FAQ (also feeds FAQ schema) ---------- */
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); color: var(--slate); }
.faq details[open] summary::after { content: "\2212"; }
.faq p { margin: 10px 0 0; color: var(--slate); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--paper); margin-top: 50px; padding: 34px 0 26px; }
.foot-grid { display: grid; gap: 24px; }
.foot-grid h4 { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--slate); margin-bottom: 10px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .88rem; }
.foot-links a { color: var(--slate); }
.foot-links a:hover { color: var(--ink); }
.foot-base { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line-soft); font-size: .82rem; color: var(--slate); display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; }

/* ---------- responsive ---------- */
@media (min-width: 640px) {
  .metrics { grid-template-columns: repeat(4, 1fr); }
  .result-grid { grid-template-columns: repeat(4, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .foot-grid { grid-template-columns: 2fr 1fr 1fr; }
  .kb-key { height: 46px; font-size: .9rem; }
}
@media (min-width: 900px) {
  :root { --gut: 28px; }
  .hero { padding: 72px 0 54px; }
  .hero-grid { grid-template-columns: 1fr 1.05fr; align-items: center; gap: 48px; }
  .type-body { padding: 32px 30px 26px; }
  .with-aside { display: grid; grid-template-columns: 1fr 300px; gap: 26px; align-items: start; }
}

/* phones: keyboard shrinks, extra rows drop away */
@media (max-width: 639px) {
  .kb-key { height: 34px; font-size: .7rem; border-radius: 5px; }
  .kb-row { gap: 3px; }
  .kb-rows { gap: 4px; }
  .type-text { line-height: 1.95; max-height: 7.4em; }
  .nav a, .nav button { padding: 7px 8px; font-size: .86rem; }
  .nav .hide-xs { display: none; }
}
@media (max-width: 400px) {
  .kb { display: none; } /* on-screen keys are noise beside a real touch keyboard */
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
  .type-text .g.now::before { animation: none; opacity: 1; }
}

@media print {
  .site-header, .site-footer, .ad-slot, .kb, .type-foot { display: none; }
}

/* ---------- typing viewport (added by the engine's scroll behaviour) ---------- */
.type-viewport { overflow: hidden; max-height: 8.2em; }
.type-inner { display: block; transition: transform .16s ease; will-change: transform; }
@media (max-width: 639px) { .type-viewport { max-height: 7.4em; } }
@media (prefers-reduced-motion: reduce) { .type-inner { transition: none; } }

/* ---------- ad slots ---------- */
.ad-hide-mobile { display: none; }
@media (min-width: 640px) { .ad-hide-mobile { display: block; } }
body.is-typing .ad-hide-typing { visibility: hidden; }

.ad-sticky {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  background: var(--paper); border-top: 1px solid var(--line);
  padding: 6px 10px; box-shadow: 0 -2px 12px rgba(22, 24, 31, .1);
}
.ad-sticky .ad-slot { margin: 0; }
.ad-sticky-close {
  position: absolute; top: -13px; right: 10px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--line);
  color: var(--slate); font-size: 1rem; line-height: 1; cursor: pointer;
}
body.is-typing .ad-sticky { display: none; }

/* ---------- admin-authored page copy ---------- */
.prose { line-height: 1.7; }
.prose h2 { font-size: 1.25rem; margin: 1.4em 0 .5em; }
.prose h3 { font-size: 1.05rem; margin: 1.2em 0 .4em; }
.prose ul, .prose ol { margin: 0 0 1em; padding-left: 1.2em; }
.prose li { margin-bottom: .35em; }
.prose img { border-radius: var(--r-md); margin: 1em 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.prose th, .prose td { padding: 8px 10px; border: 1px solid var(--line); text-align: left; }

/* ---------- brand lockup ---------- */
.brand-mark { border-radius: 7px; flex-shrink: 0; }
.brand-text { display: block; line-height: 1.15; }
.brand-text em {
  display: block; font-style: normal;
  font-family: var(--mono); font-size: .58rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--slate);
}
@media (max-width: 420px) { .brand-text em { display: none; } }

/* ---------- admin-authored page layout ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.slug-row { display: flex; align-items: center; gap: 0; }
.slug-row span {
  font-family: var(--mono); font-size: .9rem; color: var(--slate);
  padding: 11px 4px 11px 13px; border: 1px solid var(--line); border-right: 0;
  border-radius: var(--r-sm) 0 0 var(--r-sm); background: var(--line-soft);
}
.slug-row input { border-radius: 0 var(--r-sm) var(--r-sm) 0; }

/* ---------- announcement bar ---------- */
.announce { background: var(--ink); color: #fff; font-size: .9rem; }
.announce-inner { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.announce a { color: #9fc0f5; }
.announce button {
  margin-left: auto; background: none; border: 0; color: rgba(255,255,255,.6);
  font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 0 4px;
}
.announce button:hover { color: #fff; }

/* ---------- cookie bar ---------- */
.cookie-bar {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 80;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-2); padding: 16px;
}
.cookie-inner { display: grid; gap: 12px; max-width: var(--wrap); margin: 0 auto; }
.cookie-bar p { margin: 0; font-size: .89rem; color: var(--slate); }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (min-width: 760px) {
  .cookie-inner { grid-template-columns: 1fr auto; align-items: center; }
  .cookie-bar { left: 20px; right: 20px; bottom: 20px; }
}
/* the sticky ad and the cookie bar must never stack on top of each other */
body:has(#cookie-bar:not([hidden])) .ad-sticky { bottom: 96px; }

/* ---------- breadcrumbs ---------- */
.crumbs { font-size: .82rem; margin-bottom: 10px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; color: var(--slate-2); margin-right: 6px; }
.crumbs a { color: var(--slate); }
.crumbs a:hover { color: var(--ink); }
.crumbs [aria-current] { color: var(--ink); font-weight: 600; }

/* ---------- language filter on the home page ---------- */
.lang-filter {
  width: 100%; max-width: 340px; font: inherit; font-size: 16px;
  padding: 11px 14px; margin-bottom: 16px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--paper); color: var(--ink);
}
.lang-filter:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.lang-card[hidden] { display: none; }
.lang-empty { color: var(--slate); font-size: .92rem; }
