/* monkeytype.id — editorial layout on a dark graphite palette.
 *
 * Graphite background, darker inset surfaces, warm light ink, the logo's
 * mustard yellow as the only accent (a soft red marks typing errors).
 * Editorial serif for headings, clean sans for everything else, soft corners
 * (8px on controls, 14px on photos and cards, capsules for buttons), hairline
 * dividers, one reading column under a translucent sticky top bar.
 *
 * Motion is brief and follows the system: with Reduce Motion on, nothing
 * zooms or slides (see the end of this file and static/article.js).
 *
 * Loaded by every web page. The news pages use it alone; the typing app loads
 * it after the desktop stylesheet, and the rules under
 * html[data-platform="web"] restyle the app without touching the desktop build.
 */

/* ------------------------------------------------------------------ fonts */
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('/static/fonts/newsreader-latin-opsz-normal.woff2') format('woff2-variations');
  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: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/static/fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  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: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/static/fonts/inter-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Roboto Mono';
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url('/static/fonts/roboto-mono-latin-wght-normal.woff2') format('woff2-variations');
  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: 'Roboto Mono';
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url('/static/fonts/roboto-mono-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ----------------------------------------------------------------- tokens */
:root {
  color-scheme: dark;
  --paper: #36373a;
  --sand: #2f3033;
  --raise: #424347;
  --field: #2b2c2f;
  --ink: #ecebe6;
  --body: #d4d3cd;
  --muted: #b0afa9;
  --faint: #a3a29d;
  --typed: #dddccc;
  --untyped: #606265;
  --hair: #48494d;
  --accent: #d6b531;
  --accent-deep: #e6c84f;
  --on-accent: #232427;
  --error: #d4374d;
  --serif: 'Newsreader', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Roboto Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --r: 8px;
  --r-lg: 14px;
  --pill: 999px;
  --ease-out: cubic-bezier(0.2, 0.9, 0.25, 1);
  --column: 680px;
  --bar-h: 60px;
  /* The test and the top bar grow with the screen: 1040px up to a 1224px
     window, then 85% of the width, at most 1600px. Reading columns keep
     --column, since long lines are tiring to read. */
  --page: clamp(1040px, 85vw, 1600px);
}

/* ---------------------------------------------------- top bar and footer */
/* A translucent layer over the content, which scrolls under it; its hairline
   appears only once something has scrolled beneath (a scroll edge, not a
   permanent divider). Solid when Reduce Transparency is on. */
.site-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  flex: 0 0 auto;
  height: var(--bar-h);
  background: color-mix(in srgb, var(--paper) 76%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--hair);
}
@supports (animation-timeline: scroll()) {
  .site-bar { animation: bar-edge linear both; animation-timeline: scroll(root); animation-range: 0 48px; }
}
@keyframes bar-edge { from { border-bottom-color: transparent; } to { border-bottom-color: var(--hair); } }
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .site-bar { background: var(--paper); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
.site-bar-in {
  max-width: var(--page);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.site-brand img { height: 28px; width: auto; }
/* Where you are: the current section sits in a soft capsule. */
.site-nav { display: flex; gap: 4px; margin-left: auto; font-family: var(--sans); font-size: 14.5px; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 34px; padding: 0 13px; border-radius: var(--pill);
  color: var(--muted); text-decoration: none; white-space: nowrap;
  transition: background-color .2s, color .2s;
}
.site-nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 7%, transparent); }
.site-nav a[aria-current="page"] { color: var(--ink); background: color-mix(in srgb, var(--ink) 12%, transparent); font-weight: 550; }
.site-nav a:active { background: color-mix(in srgb, var(--ink) 16%, transparent); }
.nav-short { display: none; }
.site-tools { display: flex; align-items: center; gap: 4px; }
.site-tools-sep { width: 1px; height: 18px; margin: 0 4px; background: var(--hair); }
/* ID | EN: this page in the other language (lib/pages.js, siteBar), drawn as
   a two-part segmented control. */
.lang-switch {
  display: flex; align-items: center; gap: 2px; margin-left: 4px; padding: 3px;
  border-radius: var(--pill); background: color-mix(in srgb, var(--ink) 6%, transparent);
  font: 600 12px/1 var(--sans); letter-spacing: 0.04em;
}
.site-nav + .lang-switch { margin-left: 14px; }
.lang-switch a { padding: 6px 9px; border-radius: var(--pill); text-decoration: none; transition: background-color .2s, color .2s; }
.lang-switch a, .page .lang-switch a { color: var(--muted); }
.lang-switch a:hover, .page .lang-switch a:hover { color: var(--ink); }
.lang-switch a[aria-current="true"], .page .lang-switch a[aria-current="true"] { color: var(--ink); background: var(--raise); box-shadow: 0 1px 2px rgb(0 0 0 / 0.3); }

.site-foot {
  margin-top: 64px;
  padding: 22px 0 40px;
  border-top: 1px solid var(--hair);
  color: var(--faint);
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.6;
  display: grid;
  gap: 8px;
}
.site-foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-foot a { color: var(--muted); }
.site-foot p { margin: 0; }

/* ======================================================== news pages ===== */
body.page {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font: 17px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.page *, .page *::before, .page *::after { box-sizing: border-box; }
.page a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.page a:hover { color: var(--accent-deep); }
.page .site-brand, .page .site-nav a { text-decoration: none; }
.page .site-brand { color: var(--ink); }
.page .site-nav a { color: var(--muted); }
.page .site-nav a:hover, .page .site-nav a[aria-current="page"] { color: var(--ink); }

.column { max-width: var(--column); margin: 0 auto; padding: 0 24px; }
.page main.column { padding-top: 56px; }

/* Tracking tightens as type grows; leading loosens as it shrinks. */
.page h1, .page h2, .page h3 { color: var(--ink); text-wrap: balance; }
.page h1, .page h2 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.015em; font-optical-sizing: auto; }
.page h1 { font-size: clamp(36px, 6vw, 52px); line-height: 1.06; letter-spacing: -0.022em; margin: 0 0 16px; }
.page h2 { font-size: 30px; line-height: 1.18; margin: 52px 0 12px; }
.page h3 { font-family: var(--sans); font-size: 18px; font-weight: 650; line-height: 1.35; letter-spacing: -0.005em; margin: 32px 0 8px; }
.page :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
@media (prefers-reduced-motion: no-preference) {
  html:has(body.page) { scroll-behavior: smooth; }
}

.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--faint); margin: 0 0 18px;
}
.eyebrow a { color: var(--faint); text-decoration: none; }
.eyebrow a:hover { color: var(--ink); }
.lede { font-size: 20px; line-height: 1.55; color: var(--muted); margin: 0 0 24px; text-wrap: pretty; }
.meta { font-size: 13.5px; color: var(--faint); }

/* index */
.post-list { list-style: none; margin: 36px 0 0; padding: 0; border-top: 1px solid var(--hair); }
.post-list li { padding: 28px 0; border-bottom: 1px solid var(--hair); }
.post-list h2 { font-size: 26px; margin: 0 0 6px; }
.post-list h2 a { color: var(--ink); text-decoration: none; transition: color .2s; }
.post-list p { margin: 0 0 10px; color: var(--muted); text-wrap: pretty; }
/* The whole entry is one target: the title link stretches over it. */
.post-item { position: relative; }
.post-item h2 a::after { content: ''; position: absolute; inset: 0; }
.post-item:hover h2 a { color: var(--accent); }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 28px 0 0; font-size: 14px; color: var(--faint); }

/* article */
.post-head { padding-bottom: 28px; border-bottom: 1px solid var(--hair); margin-bottom: 8px; }
.post-head .meta > * { white-space: nowrap; }
.prose { font-size: 18px; line-height: 1.75; color: var(--body); }
.prose p, .prose ul, .prose ol { margin: 0 0 22px; }
.prose p, .prose li { text-wrap: pretty; }
/* More air above a heading than below: it belongs to the text it opens. */
.prose h2 { margin: 60px 0 14px; }
.prose h3 { margin: 38px 0 8px; }
.prose :is(h2, h3) { scroll-margin-top: calc(var(--bar-h) + 24px); }
.prose a { text-decoration-color: color-mix(in srgb, var(--accent) 50%, transparent); transition: text-decoration-color .2s; }
.prose a:hover { text-decoration-color: currentColor; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--faint); }
.prose strong { color: var(--ink); font-weight: 650; }
.prose blockquote {
  margin: 30px 0; padding: 2px 0 2px 22px; border-left: 2px solid var(--accent);
  font-family: var(--serif); font-size: 22px; line-height: 1.5; font-style: italic; color: var(--ink);
}
.prose code {
  font: 500 0.86em/1 'JetBrains Mono', 'Cascadia Code', ui-monospace, monospace;
  background: var(--sand); border: 1px solid var(--hair); border-radius: 3px; padding: 2px 5px;
}
.prose pre { background: var(--sand); border: 1px solid var(--hair); border-radius: var(--r); padding: 16px 18px; overflow: auto; }
.prose pre code { background: none; border: 0; padding: 0; font-size: 14.5px; line-height: 1.6; }
.prose img { max-width: 100%; height: auto; border-radius: var(--r); }
.prose hr { border: 0; border-top: 1px solid var(--hair); margin: 40px 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 28px 0; font-size: 15.5px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.prose th, .prose td { text-align: left; padding: 11px 12px 11px 0; border-bottom: 1px solid var(--hair); vertical-align: top; }
.prose th { color: var(--ink); font-weight: 650; border-bottom-color: var(--ink); }

.page kbd, .home-extra kbd {
  font: 600 0.8em/1 var(--sans); padding: 3px 6px; border-radius: 3px;
  background: var(--sand); border: 1px solid var(--hair); color: var(--ink);
}

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 34px 0 0; }
.tags span {
  font-size: 12.5px; padding: 5px 11px; border-radius: var(--pill);
  background: var(--sand); border: 1px solid var(--hair); color: var(--muted);
}

.cta {
  margin: 56px 0 0; padding: 30px 30px 28px; border-radius: var(--r-lg);
  background: var(--sand); border: 1px solid var(--hair);
}
.cta h2 { font-size: 26px; margin: 0 0 6px; }
.cta p { margin: 0 0 18px; color: var(--muted); }
.cta .button + p { margin: 18px 0 0; font-size: 15px; }
/* Buttons answer the press itself, at once; the colour eases. */
.button {
  display: inline-block; padding: 13px 24px; border-radius: var(--pill);
  background: var(--accent); color: var(--on-accent) !important; text-decoration: none !important;
  font: 600 15px/1.2 var(--sans); border: 1px solid var(--accent);
  transition: background-color .2s, border-color .2s, transform .12s var(--ease-out);
}
.button:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.button:active { transform: scale(0.97); transition-duration: 0s; }

.related { margin-top: 56px; }
.related h2 { font-size: 24px; margin: 0 0 6px; }

/* Lists of article links, used on the article page and under the app. */
.link-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hair); }
.link-list li { border-bottom: 1px solid var(--hair); }
.link-list a { display: block; padding: 16px 0; text-decoration: none !important; }
.link-list b { transition: color .2s; }
.link-list b { display: block; font-family: var(--serif); font-size: 20px; font-weight: 500; color: var(--ink); line-height: 1.3; }
.link-list span { display: block; margin-top: 4px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.link-list a:hover b { color: var(--accent); }

/* ================================================= the app, on the web ===== */
/* The app's theme engine writes its colours inline on <html>; !important keeps
   the editorial palette whatever theme a browser had saved. */
html[data-platform="web"] {
  --base: var(--paper) !important;
  --text: var(--ink) !important;
  --dim: var(--faint) !important;
  --accent: #d6b531 !important;
  --accent-2: #d6b531 !important;
  --glass: var(--sand);
  --glass-line: var(--hair);
  --glass-hi: var(--sand);
  --titlebar: 0px;
  --radius: var(--r);
}
html[data-platform="web"],
html[data-platform="web"] body { background: var(--paper); color: var(--ink); }
/* The desktop app is one fixed window. The web page scrolls: the drill fills
   the first screen under the bar, and the reading column follows below it. */
/* Only the root scrolls. If body also had a non-visible overflow it would
   become the scroll container the sticky bar sticks to, and the bar would
   scroll away with the page. */
html[data-platform="web"] { height: auto; overflow-x: hidden; overflow-y: auto; }
html[data-platform="web"] body { height: auto; min-height: 100%; overflow: visible; display: block; }
html[data-platform="web"] .mesh,
html[data-platform="web"] .drag-strip,
html[data-platform="web"] .home-chrome { display: none; }

/* the bar's settings buttons */
html[data-platform="web"] .site-tools .icon-btn { width: 36px; height: 32px; }

/* --- home ----------------------------------------------------------- */
html[data-platform="web"] .home {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  padding: 0 24px;
  gap: 0;
  justify-content: flex-start;
}
html[data-platform="web"] .home-main {
  width: min(var(--column), 100%);
  min-height: 100%;
  height: auto;
  flex: 0 0 auto;
  align-items: stretch;
  justify-content: center;
  gap: 26px;
  padding: 48px 0 40px;
}
html[data-platform="web"] .home-hero { align-items: flex-start; text-align: left; gap: 10px; }
html[data-platform="web"] .home-title {
  font-family: var(--serif);
  font-size: clamp(42px, 6.5vw, 64px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.04;
  background: none;
  color: var(--ink);
  -webkit-text-fill-color: currentColor;
}
.home-dek { margin: 0; max-width: 520px; font-size: 19px; line-height: 1.55; color: var(--muted); }
html[data-platform="web"] .home-board {
  width: 100%;
  max-height: 46vh;
  padding: 18px 22px 8px;
  border-radius: var(--r);
  background: var(--sand);
  border: 1px solid var(--hair);
  backdrop-filter: none;
  box-shadow: none;
}
html[data-platform="web"] .btn-xl {
  align-self: flex-start;
  padding: 14px 30px;
  font-size: 16px;
  border-radius: var(--r);
  box-shadow: none;
  letter-spacing: 0;
}
html[data-platform="web"] .touch-note { text-align: left; }

/* the server-rendered reading column under the app */
.home-extra {
  width: min(var(--column), 100%);
  flex: 0 0 auto;
  padding: 8px 0 0;
  border-top: 1px solid var(--hair);
  color: var(--body);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  user-select: text;
  cursor: auto;
}
.page-extra { padding: 0 24px; }
.page-extra .home-extra { margin: 0 auto; padding-top: 24px; }
.home-extra h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(34px, 5vw, 44px); letter-spacing: -0.02em; line-height: 1.1; color: var(--ink); margin: 24px 0 14px; }
.home-extra h2 { font-family: var(--serif); font-weight: 500; font-size: 30px; letter-spacing: -0.015em; line-height: 1.2; color: var(--ink); margin: 48px 0 12px; }
.home-extra h3 { font-size: 17.5px; font-weight: 650; color: var(--ink); margin: 28px 0 6px; }
.home-extra p { margin: 0 0 18px; }
.home-extra ul { padding-left: 22px; margin: 0 0 18px; }
.home-extra li { margin: 6px 0; }
.home-extra a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* --- leaderboard ---------------------------------------------------- */
html[data-platform="web"] .board-caption {
  text-align: left; margin: 0 0 12px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint);
}
html[data-platform="web"] .board-picker { justify-content: flex-start; margin-bottom: 8px; }
html[data-platform="web"] .board-picker .seg-choice { justify-content: flex-start; }
html[data-platform="web"] .board { gap: 0; margin-top: 6px; }
html[data-platform="web"] .board-row {
  padding: 12px 2px;
  border: 0;
  border-bottom: 1px solid var(--hair);
  border-radius: 0;
  background: transparent;
}
html[data-platform="web"] .board-row:last-child { border-bottom: 0; }
html[data-platform="web"] .board-row.me { background: transparent; box-shadow: inset 2px 0 0 var(--accent); padding-left: 12px; }
html[data-platform="web"] .board-rank {
  width: auto; height: auto; border-radius: 0; background: none !important;
  font-family: var(--font-stack); font-size: 18px; font-weight: 500; color: var(--faint);
}
html[data-platform="web"] .medal-1 .board-rank { color: var(--accent); }
html[data-platform="web"] .medal-2 .board-rank,
html[data-platform="web"] .medal-3 .board-rank { color: var(--ink); }
html[data-platform="web"] .board-name { font-weight: 600; }
html[data-platform="web"] .board-wpm { color: var(--ink); font-size: 20px; font-weight: 650; }

/* --- controls ------------------------------------------------------- */
html[data-platform="web"] .btn {
  border-radius: var(--r);
  border: 1px solid var(--hair);
  background: var(--paper);
  color: var(--ink);
}
html[data-platform="web"] .btn:hover { background: var(--sand); }
html[data-platform="web"] .btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
html[data-platform="web"] .btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); filter: none; }
html[data-platform="web"] kbd {
  border-radius: 3px; background: var(--sand); border: 1px solid var(--hair); color: var(--muted);
}
html[data-platform="web"] .btn-primary kbd,
html[data-platform="web"] .btn-primary .btn-count {
  background: rgb(0 0 0 / 0.12); border-color: rgb(0 0 0 / 0.22); color: var(--on-accent);
}

html[data-platform="web"] .pill-group {
  padding: 3px; gap: 2px;
  border-radius: var(--r);
  background: var(--paper);
  border: 1px solid var(--hair);
  backdrop-filter: none;
  box-shadow: none;
}
html[data-platform="web"] .icon-btn { border-radius: var(--r); color: var(--muted); width: 38px; height: 32px; transition: background-color .15s, color .15s; }
html[data-platform="web"] .icon-btn:hover { background: var(--sand); color: var(--ink); }
/* On the web the panels open from the site bar, and the test is set up from
   the settings bar above the text (app.js, buildConfigBar). The app's own top
   row, its mode and length chips and its layout and keymap chips give way. */
html[data-platform="web"] .topbar,
html[data-platform="web"] #langBtn,
html[data-platform="web"] #modeChip,
html[data-platform="web"] #countChip,
html[data-platform="web"] .shell > .footer { display: none; }
html[data-platform="web"] .statusbar { grid-template-columns: 1fr; justify-items: center; }

/* --- settings bar ----------------------------------------------------- */
.config-bar {
  flex: 0 0 auto;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
}
.cfg-group {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 4px 6px; border-radius: var(--r);
  background: var(--sand);
}
.cfg {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 9px; border: 0; border-radius: 6px; background: none;
  color: var(--faint); font: 450 13.5px/1 var(--font-stack, var(--mono)); text-transform: lowercase;
  white-space: nowrap; cursor: pointer;
  transition: color .15s ease, background-color .15s ease;
}
.cfg svg { width: 14px; height: 14px; flex: 0 0 auto; }
.cfg:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.cfg[aria-pressed="true"] { color: var(--accent); }
.cfg:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
html[data-platform="web"] .cfg select {
  appearance: none; -webkit-appearance: none;
  margin: 0; padding: 0 16px 0 0; border: 0; border-radius: 0;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%23a3a29d' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right center / 12px;
  field-sizing: content;
  color: inherit; font: inherit; text-transform: lowercase; cursor: pointer; outline: none;
}
html[data-platform="web"] .cfg select option { text-transform: none; }
.cfg-select:focus-within, .cfg-lang:focus-within { color: var(--ink); }
.cfg-lang { font-size: 14.5px; padding: 6px 8px; }
.cfg-custom svg { width: 15px; height: 15px; }

/* --- custom length popup ---------------------------------------------- */
/* Rises in like the results card, and sinks back out (modules/layers.js). */
.custom-card {
  animation: rise .26s var(--ease, ease-out);
  width: min(440px, calc(100vw - 40px));
  padding: 26px 28px 24px;
  border-radius: var(--r-lg);
  background: var(--paper);
  border: 1px solid var(--hair);
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.4);
  font-family: var(--font-stack, var(--mono));
  color: var(--body);
}
.custom-card h2 { margin: 0 0 4px; font: 500 24px/1.2 var(--font-stack, var(--mono)); color: var(--ink); }
.custom-read { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.custom-read.bad { color: var(--error); }
#customInput {
  display: block; width: 100%; box-sizing: border-box;
  padding: 11px 12px; font: 500 18px/1.2 var(--font-stack, var(--mono));
  color: var(--ink); background: var(--field);
  border: 1px solid var(--hair); border-radius: var(--r); outline: none;
  user-select: text; cursor: text;
}
#customInput:focus { border-color: var(--accent); }
.custom-help { margin: 14px 0 18px; font-size: 13px; line-height: 1.55; color: var(--faint); }
.custom-help p { margin: 0 0 8px; }
.custom-apply { width: 100%; justify-content: center; }
.custom-apply:disabled { opacity: 0.5; cursor: default; }
.cfg-lang svg { width: 15px; height: 15px; }
/* Until app.js has built the drill, its frame holds its place but shows
   nothing, so the first thing anyone sees is the finished test. */
html[data-platform="web"]:not([data-ready]) .shell { visibility: hidden; }
html[data-platform="web"] .shell { animation: drill-in .18s ease-out; }
@keyframes drill-in { from { opacity: 0; } }
html[data-platform="web"] #homeBtn,
html[data-platform="web"] .chip-player { display: none; }
html[data-platform="web"] .shell > .touch-note { margin: 0 auto; text-align: center; }

.panel-note {
  margin: 0 0 18px; padding: 10px 12px; border-radius: var(--r);
  background: var(--sand); border: 1px solid var(--hair); color: var(--muted); font-size: 13px; line-height: 1.5;
}

/* --- saving a score (results screen) -------------------------------- */
.save-score {
  margin-top: 22px;
  padding: 18px 20px;
  border: 1px solid var(--hair);
  border-radius: var(--r);
  background: var(--sand);
}
.save-title { font-family: var(--font-stack); font-size: 21px; font-weight: 500; color: var(--ink); }
.save-sub { margin: 2px 0 12px; font-size: 13px; color: var(--faint); }
.save-row { display: flex; gap: 8px; flex-wrap: wrap; }
#saveName {
  flex: 1 1 200px;
  min-width: 0;
  padding: 10px 12px;
  font: 500 15px/1.3 var(--font-stack, var(--mono));
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--hair);
  border-radius: var(--r);
  outline: none;
  user-select: text;
  cursor: text;
}
#saveName:focus { border-color: var(--accent); }
html[data-platform="web"] .btn-quiet { background: transparent; border-color: transparent; color: var(--muted); }
html[data-platform="web"] .btn-quiet:hover { background: var(--paper); color: var(--ink); }
html[data-platform="web"] .btn:disabled { opacity: 0.55; cursor: default; }
.save-msg { margin-top: 10px; font-size: 13.5px; color: var(--accent); }
.save-done { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 10px; }

html[data-platform="web"] .chip {
  border-radius: var(--r);
  border: 1px solid var(--hair);
  background: var(--paper);
  color: var(--ink);
  backdrop-filter: none;
  font-weight: 550;
}
html[data-platform="web"] .chip:hover { background: var(--sand); border-color: var(--hair); }
html[data-platform="web"] .chip-lang { color: var(--ink); }
html[data-platform="web"] .chip-lang .chip-ico { color: var(--accent); }

html[data-platform="web"] .seg-choice button {
  border-radius: 6px; border: 1px solid var(--hair); background: var(--paper); color: var(--muted); font-weight: 550;
}
html[data-platform="web"] .seg-choice button:hover { color: var(--ink); background: var(--sand); }
html[data-platform="web"] .seg-choice button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

html[data-platform="web"] select,
html[data-platform="web"] input[type="number"] { border-radius: var(--r); background: var(--field); border: 1px solid var(--hair); color: var(--ink); }
html[data-platform="web"] select option { background: var(--field); color: var(--ink); }
html[data-platform="web"] input[type="range"] { background: var(--hair); }
html[data-platform="web"] input[type="range"]::-webkit-slider-thumb { box-shadow: none; background: var(--accent); }
html[data-platform="web"] .switch { background: var(--raise); }
html[data-platform="web"] .switch::after { background: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / 0.35); }
html[data-platform="web"] .switch[aria-checked="true"] { background: var(--accent); }
html[data-platform="web"] .switch[aria-checked="true"]::after { background: var(--on-accent); }

/* --- typing --------------------------------------------------------- */
html[data-platform="web"] .shell {
  height: calc(100vh - var(--bar-h));
  height: calc(100dvh - var(--bar-h));
  min-height: 520px;
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: 20px 24px 18px;
}
/* Regular weight, faint text still to come, and a gap of one character
   between words: the text reads light and the line being typed stands out. */
html[data-platform="web"] .words { font-weight: 400; }
html[data-platform="web"] .word { margin-right: 0.6em; }
html[data-platform="web"] .ch { color: var(--untyped); }
html[data-platform="web"] .ch.correct { color: var(--typed); }
html[data-platform="web"] .ch.wrong { color: var(--error); }
html[data-platform="web"] .ch.extra { color: color-mix(in srgb, var(--error) 70%, transparent); }
html[data-platform="web"] .word.flagged { box-shadow: inset 0 -2px 0 0 var(--error); }
html[data-platform="web"] .caret { width: 2px; border-radius: 1px; box-shadow: none; }
html[data-platform="web"] .caret.block { background: color-mix(in srgb, var(--accent) 25%, transparent); }
html[data-platform="web"] .focus-veil { backdrop-filter: none; background: color-mix(in srgb, var(--paper) 80%, transparent); color: var(--muted); }
html[data-platform="web"] .live-metric b { color: var(--ink); }
html[data-platform="web"] .live-metric:first-child b { color: var(--accent); }

html[data-platform="web"] .keymap-stack { padding: 0; border-radius: 0; }
html[data-platform="web"] .keycap {
  border-radius: 3px;
  border: 1px solid var(--hair);
  background: var(--sand);
  color: var(--muted);
  font-weight: 550;
}
html[data-platform="web"] .keycap.next {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, var(--paper));
  color: var(--accent);
  box-shadow: none;
}
html[data-platform="web"] .keycap.down { background: var(--raise); color: var(--ink); border-color: var(--raise); }
html[data-platform="web"] .keycap.miss { background: color-mix(in srgb, var(--error) 18%, var(--paper)); color: var(--error); border-color: transparent; }

/* --- overlays ------------------------------------------------------- */
html[data-platform="web"] .overlay { background: rgb(0 0 0 / 0.45); backdrop-filter: none; }
html[data-platform="web"] .results,
html[data-platform="web"] .name-card {
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.4);
}
html[data-platform="web"] .results { padding: 32px 34px 28px; }
html[data-platform="web"] .hero-value {
  font-family: var(--font-stack);
  font-size: 68px;
  font-weight: 500;
  letter-spacing: -0.03em;
  background: none;
  color: var(--ink);
  -webkit-text-fill-color: currentColor;
}
html[data-platform="web"] .hero-metric:first-child .hero-value { color: var(--accent); }
html[data-platform="web"] .hero-label { font-size: 11.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
html[data-platform="web"] .chart-card { border-radius: var(--r); background: var(--sand); border: 1px solid var(--hair); }
html[data-platform="web"] #chart .grid { stroke: var(--hair); }
html[data-platform="web"] #chart .line-raw,
html[data-platform="web"] .sw-raw { stroke: var(--faint); background: var(--faint); }
html[data-platform="web"] #chart .area-wpm { fill: color-mix(in srgb, var(--accent) 9%, transparent); }
/* Monospace figures are wide: four columns, so "152/3/0/1" fits its cell. */
html[data-platform="web"] .result-grid { gap: 0 24px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
html[data-platform="web"] .stat { padding: 14px 0 12px; border: 0; border-top: 1px solid var(--hair); border-radius: 0; background: transparent; }
html[data-platform="web"] .stat-k { text-transform: uppercase; letter-spacing: 0.1em; font-size: 10.5px; font-weight: 600; }
html[data-platform="web"] .stat-v { font-family: var(--font-stack); font-weight: 500; font-size: 22px; overflow-wrap: anywhere; }
html[data-platform="web"] .pk { border-radius: 3px; background: var(--sand); border: 1px solid var(--hair); }
html[data-platform="web"] .pk b { color: var(--accent); }

html[data-platform="web"] .panel {
  background: var(--paper);
  border-left: 1px solid var(--hair);
  box-shadow: -20px 0 50px rgb(0 0 0 / 0.35);
}
html[data-platform="web"] .panel-head { background: var(--paper); backdrop-filter: none; border-bottom: 1px solid var(--hair); }
html[data-platform="web"] .panel-head h2,
html[data-platform="web"] .name-card h2 { font-family: var(--font-stack); font-weight: 500; font-size: 26px; letter-spacing: -0.01em; }
html[data-platform="web"] .group-title { font-weight: 600; letter-spacing: 0.12em; }
html[data-platform="web"] .row { border-bottom-color: var(--hair); }
html[data-platform="web"] .pack { border-radius: var(--r); background: var(--paper); border: 1px solid var(--hair); }
html[data-platform="web"] .pack:hover { background: var(--sand); }
html[data-platform="web"] .pack[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, var(--paper)); }
html[data-platform="web"] .pack-fam { border-radius: 3px; background: var(--sand); }
html[data-platform="web"] .pack-play { border-radius: var(--r); border-color: var(--hair); }
html[data-platform="web"] .hist { gap: 0; }
html[data-platform="web"] .hist-row { padding: 11px 0; border: 0; border-bottom: 1px solid var(--hair); border-radius: 0; background: transparent; }
html[data-platform="web"] .hist-wpm { color: var(--ink); }

html[data-platform="web"] #nameInput { border-radius: var(--r); background: var(--field); border: 1px solid var(--hair); color: var(--ink); }
html[data-platform="web"] #nameInput:focus { background: var(--field); border-color: var(--accent); }
html[data-platform="web"] .name-pill { border-radius: 3px; background: var(--paper); border: 1px solid var(--hair); color: var(--muted); }
html[data-platform="web"] .name-pill:hover { background: var(--sand); color: var(--ink); border-color: var(--hair); }

html[data-platform="web"] .toast {
  border-radius: var(--r); background: var(--ink); color: var(--paper); border: 0;
  backdrop-filter: none; box-shadow: 0 12px 32px rgb(0 0 0 / 0.4);
}
html[data-platform="web"] ::-webkit-scrollbar-thumb { background: rgb(255 255 255 / 0.16); background-clip: content-box; }
html[data-platform="web"] :focus-visible { outline-color: var(--accent); border-radius: 2px; }

@media (max-width: 640px) {
  /* A phone cannot take the test (no keyboard), so the bar keeps only the
     leaderboard and settings there. */
  .site-tools [data-panel="stats"],
  .site-tools [data-panel="history"],
  .site-tools [data-panel="customize"],
  .site-tools-sep { display: none; }
  .lang-switch { margin-left: 0; }
  .site-nav + .lang-switch { margin-left: 6px; }
  .lang-switch a { padding: 6px 7px; }
  .site-bar-in { gap: 10px; padding: 0 14px; }
  .site-nav { gap: 2px; font-size: 14.5px; }
  .site-nav a { padding: 0 10px; }
  .site-tools .icon-btn { width: 34px; }
  .site-brand span { display: none; }
  /* One word per link; the full name stays for screen readers. */
  .nav-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .nav-short { display: inline; }
  html[data-platform="web"] .home { padding: 0 18px; }
  html[data-platform="web"] .home-main { padding-top: 32px; }
}

/* ======================================================== draft preview ===== */
/* /news/pratinjau/<slug>: private, never linked from the site. */
.review-flag {
  margin: 0 0 28px; padding: 12px 16px; border-radius: var(--r);
  background: var(--sand); border: 1px solid var(--hair); border-left: 3px solid var(--accent);
  font-size: 15px; color: var(--ink);
}
.review-notes, .review-box {
  margin: 48px 0 0; padding: 24px 28px; border-radius: var(--r-lg);
  background: var(--sand); border: 1px solid var(--hair);
}
.review-notes h2, .review-box h2 { font-size: 24px; margin: 0 0 6px; }
.review-notes .prose { font-size: 16px; }
.review-box p { margin: 0 0 18px; color: var(--muted); }
.review-box form + form { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--hair); }
.review-box label { display: block; margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.review-box textarea {
  display: block; width: 100%; box-sizing: border-box; margin: 0 0 12px; padding: 10px 12px;
  font: 15px/1.5 var(--sans); color: var(--ink); background: var(--paper);
  border: 1px solid var(--hair); border-radius: var(--r); resize: vertical;
}
.button.quiet { background: transparent; color: var(--ink) !important; border-color: var(--ink); }
.button.quiet:hover { background: var(--ink); color: var(--paper) !important; border-color: var(--ink); }
button.button { cursor: pointer; }
.share-preview { display: block; width: 100%; max-width: 600px; height: auto; margin-top: 14px; border: 1px solid var(--hair); border-radius: var(--r); }

/* ========================================== article diagrams and photos ===== */
/* Drawn by lib/figures.js from ```peta-tombol and ```grafik blocks. */
.post-cover { margin: 28px 0 8px; }
.post-cover img { display: block; width: 100%; height: auto; border-radius: var(--r-lg); }
/* ![alt](src "caption") on its own line, with the "Sumber foto" line under it:
   one <figure> (lib/markdown.js). Inside running text: span.photo. */
.prose .photo { display: block; margin: 34px 0; }
.prose .photo img { display: block; width: 100%; height: auto; border-radius: var(--r-lg); background: var(--sand); }
.prose .photo figcaption { margin-top: 12px; }
.prose .photo-cap, .prose .photo-src { display: block; font-size: 14px; line-height: 1.55; color: var(--muted); }
.prose .photo-cap { margin-top: 10px; }
.prose figcaption .photo-cap { margin-top: 0; }
.prose .photo-src { margin-top: 3px; color: var(--faint); }
.prose .photo-src a { color: var(--muted); text-decoration-color: color-mix(in srgb, var(--muted) 45%, transparent); }
.prose .photo-src a:hover { color: var(--ink); }
.prose .fig {
  margin: 34px 0; padding: 22px 24px; border-radius: var(--r-lg);
  background: var(--sand); border: 1px solid var(--hair);
}
.prose .fig-title { margin: 0 0 16px; font: 650 15px/1.45 var(--sans); color: var(--ink); }
.prose .fig figcaption { margin-top: 14px; font-size: 14px; line-height: 1.55; color: var(--muted); }
.fig-keyboard { display: block; width: 100%; height: auto; }
.fig-keyboard .k rect { fill: var(--paper); stroke: var(--hair); stroke-width: 1.5; }
.fig-keyboard .k text { fill: var(--faint); font: 600 17px var(--sans); text-anchor: middle; }
.fig-keyboard .k text.small { font-size: 12px; font-weight: 550; }
.fig-keyboard .k line { stroke: var(--faint); stroke-width: 2; stroke-linecap: round; }
.fig-keyboard .k.on rect { fill: color-mix(in srgb, var(--accent) 16%, var(--paper)); stroke: var(--accent); stroke-width: 2.5; }
.fig-keyboard .k.on text { fill: var(--accent); }
.fig-keyboard .k.on line { stroke: var(--accent); }
/* One colour per finger, the same on both hands; never the accent, which marks highlighted keys. */
.fig .j-kelingking, .ar .j-kelingking { --jc: #d0919f; }
.fig .j-manis, .ar .j-manis { --jc: #8ea9d8; }
.fig .j-tengah, .ar .j-tengah { --jc: #7dbba9; }
.fig .j-telunjuk, .ar .j-telunjuk { --jc: #b89fd9; }
.fig .j-jempol, .ar .j-jempol { --jc: #a3a29d; }
.fig-keyboard .k[class*="j-"] rect { fill: color-mix(in srgb, var(--jc) 18%, var(--paper)); stroke: color-mix(in srgb, var(--jc) 45%, var(--paper)); }
.fig-keyboard .k[class*="j-"] text { fill: var(--jc); }
.fig-keyboard .k[class*="j-"] line { stroke: var(--jc); }
.fig-keyboard .k[class*="j-"].on rect { fill: color-mix(in srgb, var(--jc) 42%, var(--paper)); stroke: var(--accent); stroke-width: 3; }
.fig-keyboard .k[class*="j-"].on text { fill: var(--ink); }
.prose .fig-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 14px 0 0; padding: 0; font-size: 14px; color: var(--muted); }
.prose .fig-legend li { display: flex; align-items: center; gap: 7px; margin: 0; }
.fig-legend .sw { width: 13px; height: 13px; border-radius: 3px; background: color-mix(in srgb, var(--jc) 42%, var(--paper)); border: 1px solid var(--jc); }
.prose .bars { list-style: none; display: grid; gap: 16px; margin: 0; padding: 0; }
.prose .bars li { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 14px; margin: 0; }
.bars .bar-label { grid-column: 1 / -1; font-size: 15px; line-height: 1.4; color: var(--body); }
.bars .bar-track svg { display: block; width: 100%; height: 12px; }
.bars .bar-track rect { fill: var(--accent); }
.bars.has-on li:not(.on) .bar-track rect { fill: color-mix(in srgb, var(--accent) 38%, var(--paper)); }
.bars .bar-value { min-width: 4.5em; text-align: right; font: 650 15px/1 var(--sans); font-variant-numeric: tabular-nums; color: var(--ink); }
@media (max-width: 560px) {
  .prose .fig { padding: 16px 14px; margin-left: -4px; margin-right: -4px; }
  .fig-keyboard .k text { font-size: 19px; }
  .fig-keyboard .k text.small { font-size: 0; }
}

/* Article list pictures (lib/illustrations.js): a drawing per topic, or the cover photo. */
.post-list li.post-item { display: grid; grid-template-columns: minmax(0, 1fr) 208px; gap: 0 28px; align-items: start; }
.post-item .post-art {
  order: 2; display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--r-lg);
  background: var(--sand); border: 1px solid var(--hair); transition: border-color .2s;
}
.post-item:hover .post-art { border-color: color-mix(in srgb, var(--accent) 55%, var(--hair)); }
.post-item .post-art svg, .post-item .post-art img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s var(--ease-out);
}
.post-item:hover .post-art :is(svg, img) { transform: scale(1.03); }
.post-list li.post-item.featured { grid-template-columns: minmax(0, 1fr); }
.post-item.featured .post-art { order: 0; aspect-ratio: 16 / 7; margin-bottom: 22px; }
.post-item.featured h2 { font-size: 32px; }
.ar .ar-key { fill: var(--paper); stroke: var(--hair); stroke-width: 1.5; }
.ar .ar-key[class*="j-"] { fill: color-mix(in srgb, var(--jc) 30%, var(--paper)); stroke: color-mix(in srgb, var(--jc) 60%, var(--paper)); }
.ar .ar-key.on { stroke: var(--accent); stroke-width: 2.5; }
.ar .ar-bump, .ar .ar-angle { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.ar .ar-line { stroke: var(--hair); stroke-width: 2.5; stroke-linecap: round; }
.ar .ar-accent { fill: var(--accent); }
.ar .ar-soft { fill: color-mix(in srgb, var(--accent) 28%, var(--paper)); }
.ar .ar-trend { fill: none; stroke: var(--ink); stroke-width: 2; stroke-dasharray: 3 6; stroke-linecap: round; }
.ar .ar-track, .ar .ar-arc { fill: none; stroke-width: 14; stroke-linecap: round; }
.ar .ar-track { stroke: var(--hair); }
.ar .ar-arc { stroke: var(--accent); }
.ar .ar-tick { stroke: var(--faint); stroke-width: 2; }
.ar .ar-needle { stroke: var(--ink); stroke-width: 4; stroke-linecap: round; }
.ar .ar-hub { fill: var(--ink); }
.ar .ar-label { fill: var(--faint); font: 650 17px var(--sans); text-anchor: middle; letter-spacing: 0.14em; }
.ar .ar-axis, .ar .ar-guide { stroke-width: 1.5; stroke-dasharray: 3 5; }
.ar .ar-axis { stroke: var(--hair); }
.ar .ar-guide { stroke: var(--accent); }
.ar .ar-cap { fill: var(--raise); stroke: var(--muted); stroke-width: 2; }
.ar .ar-cap-top { fill: var(--paper); }
.ar .ar-spring { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linejoin: round; }
.ar .ar-house { fill: var(--paper); stroke: var(--muted); stroke-width: 2; }
.ar .ar-pin { stroke: var(--faint); stroke-width: 3; stroke-linecap: round; }
.ar .ar-arm { stroke: var(--muted); stroke-width: 18; stroke-linecap: round; }
.ar .ar-arm.hand { stroke-width: 12; }
@media (max-width: 560px) {
  .post-list li.post-item { grid-template-columns: minmax(0, 1fr); }
  .post-item .post-art { order: 0; aspect-ratio: 16 / 8; margin-bottom: 16px; }
  .post-item.featured h2 { font-size: 26px; }
}

/* ===================================================== belajar mengetik */
.learn-page { user-select: text; }
.learn-wide { max-width: 900px; margin: 0 auto; padding: 48px 24px 0; }
.learn-start { margin: 8px 0 6px; }
.unit { margin-top: 48px; }
.unit h2 { margin: 0 0 4px; }
.unit-note { margin: 0 0 14px; color: var(--muted); }
.lesson-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hair); }
.lesson-list li { border-bottom: 1px solid var(--hair); }
.lesson-list a {
  display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px;
  padding: 13px 8px 13px 4px; border-radius: var(--r); color: var(--ink) !important; text-decoration: none !important;
  transition: background-color .15s;
}
.lesson-list a:hover { background: var(--sand); }
.lesson-list a:active { background: var(--raise); }
.lesson-n { font-family: var(--serif); font-size: 19px; color: var(--faint); text-align: right; }
.lesson-title { font-weight: 550; }
.lesson-stars { letter-spacing: 2px; color: #67686c; font-size: 15px; }
.is-done .lesson-stars { color: var(--accent); }
.is-next .lesson-n { color: var(--accent); }
.is-next .lesson-title::after { content: '  ← lanjut di sini'; font-weight: 450; color: var(--accent); font-size: 13.5px; }
.learn-tips { padding-left: 20px; color: var(--body); }
.learn-tips li { margin: 6px 0; }

.learn-title { margin-bottom: 10px !important; }
.learn-card {
  margin-top: 8px; padding: 26px 28px 18px; border-radius: var(--r-lg);
  background: var(--sand); border: 1px solid var(--hair);
}
.learn-progress { height: 3px; background: var(--hair); border-radius: 2px; overflow: hidden; margin-bottom: 22px; }
.learn-progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s ease-out; }
.learn-text {
  font: 400 28px/1.75 var(--mono); letter-spacing: 0; color: var(--untyped);
  white-space: pre-wrap; word-break: break-word; user-select: none; min-height: 3.5em;
}
.lc { border-bottom: 2px solid transparent; border-radius: 2px; }
.lc.ok { color: var(--typed); }
.lc.ok.miss { color: var(--error); }
.lc.cur { color: var(--ink); border-bottom-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.lc.cur.miss { background: color-mix(in srgb, var(--error) 25%, transparent); }
.learn-meta { display: flex; justify-content: space-between; gap: 16px; margin-top: 16px; font-size: 14px; color: var(--muted); }
.learn-meta b { color: var(--ink); }
.learn-keys { margin: 20px auto 0; width: min(100%, 760px); }
.learn-keys .keycap.learn-new { box-shadow: inset 0 -3px 0 var(--accent); color: var(--ink); }
.learn-page .touch-note { margin-top: 16px; }

.learn-done {
  margin-top: 8px; padding: 36px 28px; text-align: center; border-radius: var(--r-lg);
  background: var(--sand); border: 1px solid var(--hair);
}
.done-stars { font-size: 44px; letter-spacing: 8px; color: var(--accent); line-height: 1; }
.done-stats { display: flex; justify-content: center; gap: 48px; margin: 22px 0 8px; }
.done-stats > div > span { display: block; font-size: 11.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.done-stats b { font-family: var(--serif); font-weight: 500; font-size: 36px; color: var(--ink); }
.done-stats small { font-family: var(--sans); font-size: 14px; color: var(--muted); }
.done-note { color: var(--muted); margin: 8px 0 22px; }
.done-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.btn-plain {
  font: 600 15px/1.2 var(--sans); padding: 13px 24px; border-radius: var(--pill);
  background: var(--paper); color: var(--ink); border: 1px solid var(--hair); cursor: pointer;
}
.btn-plain:active { transform: scale(0.97); }
.btn-plain:hover { background: var(--raise); }

@media (max-width: 640px) {
  .learn-text { font-size: 24px; }
  .learn-wide { padding-top: 32px; }
}
@media (max-width: 400px) {
  .site-bar-in { gap: 6px; padding: 0 10px; }
  .site-nav a { padding: 0 8px; }
  .site-tools .icon-btn { width: 32px; }
}
/* Fingers need bigger targets than a pointer. */
@media (pointer: coarse) {
  .site-nav a { min-height: 40px; }
  .lang-switch a { padding-block: 9px; }
}

/* ===================================================== reading tools ===== */
/* static/article.js: progress, contents, section links, enlarged photos. */

/* Reading progress: a hairline under the bar that fills as the text is read. */
.read-progress { position: fixed; top: var(--bar-h); left: 0; right: 0; z-index: 31; height: 2px; margin-top: -1px; pointer-events: none; }
.read-progress span { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; }

/* Contents: folded under the header on narrow screens... */
.toc { margin: 4px 0 30px; font-family: var(--sans); }
.toc-box { border: 1px solid var(--hair); border-radius: var(--r-lg); background: var(--sand); }
.toc-box > summary {
  display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 18px;
  list-style: none; cursor: pointer; border-radius: var(--r-lg);
  font-size: 15px; font-weight: 600; color: var(--ink);
}
.toc-box > summary::-webkit-details-marker { display: none; }
.toc-box > summary::after {
  content: ''; width: 8px; height: 8px; margin: -3px 2px 0 auto;
  border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted);
  transform: rotate(45deg); transition: transform .25s var(--ease-out);
}
.toc-box[open] > summary::after { transform: translateY(3px) rotate(-135deg); }
/* The list opens and folds at the same pace, and can be reversed midway.
   Browsers that cannot animate to an automatic height open it at once, both
   ways. A jump from the list folds it instantly (.no-anim, static/article.js). */
@supports (interpolate-size: allow-keywords) {
  .toc-box { interpolate-size: allow-keywords; }
  .toc-box::details-content {
    block-size: 0; overflow: clip;
    transition: block-size .32s var(--ease-out), content-visibility .32s allow-discrete;
  }
  .toc-box[open]::details-content { block-size: auto; }
  .toc-box.no-anim::details-content { transition: none; }
}
.toc-count { font-weight: 450; font-size: 13.5px; color: var(--faint); }
.toc ol { position: relative; list-style: none; margin: 0; padding: 0 8px 10px; }
.toc li { margin: 0; }
.toc a {
  display: block; padding: 9px 10px; border-radius: var(--r);
  color: var(--muted); text-decoration: none; font-size: 15px; line-height: 1.4;
  transition: color .2s, background-color .2s;
}
.toc a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.toc a[aria-current] { color: var(--ink); }
.toc-marker { display: none; }

/* ...and a rail beside the text on wide ones, marking the section in view. */
@media (min-width: 1280px) {
  .post-body { position: relative; }
  .toc { position: absolute; top: 0; bottom: 0; left: calc(100% + 56px); width: 216px; margin: 0; }
  .toc-box {
    position: sticky; top: calc(var(--bar-h) + 36px);
    max-height: calc(100vh - var(--bar-h) - 72px); overflow: auto;
    border: 0; border-radius: 0; background: none;
  }
  .toc-box > summary { min-height: 0; padding: 0 0 12px 16px; cursor: default; font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
  .toc-box > summary::after, .toc-count { display: none; }
  .toc ol { padding: 0; border-left: 1px solid var(--hair); }
  .toc a { padding: 6px 0 6px 16px; border-radius: 0; font-size: 13.5px; line-height: 1.45; }
  .toc a:hover { background: none; }
  .toc-marker {
    display: block; position: absolute; left: -1px; top: 0; width: 2px; height: 0;
    background: var(--accent); border-radius: 1px; opacity: 0;
    transition: transform .35s var(--ease-out), height .35s var(--ease-out), opacity .2s;
  }
  .toc-marker.on { opacity: 1; }
}

/* Section links: shown beside a heading on hover or focus; always faintly on touch. */
.h-anchor {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
  width: 30px; height: 30px; margin-left: 6px; border-radius: var(--r);
  color: var(--faint) !important; opacity: 0; transition: opacity .15s, background-color .15s, color .15s;
}
.h-anchor svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
:is(h2, h3):hover > .h-anchor, .h-anchor:focus-visible { opacity: 1; }
.h-anchor:hover { color: var(--accent) !important; background: color-mix(in srgb, var(--ink) 7%, transparent); }
@media (hover: none) { .h-anchor { opacity: 0.55; } }

/* A short note at the bottom ("Tautan disalin"). */
.toast-note {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 60;
  padding: 10px 18px; border-radius: var(--pill);
  background: var(--ink); color: var(--paper); font: 600 14px/1.2 var(--sans);
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.35);
  opacity: 0; transform: translate(-50%, 8px); pointer-events: none;
  transition: opacity .2s, transform .3s var(--ease-out);
}
.toast-note.on { opacity: 1; transform: translate(-50%, 0); }
.toast-note:empty { display: none; }

/* Photos open large: the photo is a button. */
.zoom {
  display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit;
  border-radius: var(--r-lg); cursor: zoom-in;
}
.zoom img { transition: transform .2s var(--ease-out), filter .2s; }
.zoom:hover img { filter: brightness(1.06); }
.zoom:active img { transform: scale(0.985); transition-duration: .08s; }
.photo .zoom + figcaption { margin-top: 12px; }

html.lb-open { overflow: hidden; }
dialog.lightbox {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; color: var(--body); overflow: hidden;
}
dialog.lightbox[open] { display: grid; place-items: center; }
dialog.lightbox::backdrop { background: transparent; }
.lb-scrim { position: absolute; inset: 0; background: rgb(18 19 21 / 0.96); }
.lb-fig { position: relative; margin: 0; display: grid; justify-items: center; gap: 16px; padding: 44px 12px 12px; touch-action: pinch-zoom; user-select: none; -webkit-user-select: none; }
.lb-img { display: block; border-radius: var(--r-lg); background: var(--sand); cursor: grab; will-change: transform; transform-origin: 50% 50%; }
.lb-img:active { cursor: grabbing; }
.lb-cap { max-width: min(680px, 92vw); text-align: center; font: 14.5px/1.55 var(--sans); color: var(--muted); user-select: text; -webkit-user-select: text; }
.lb-cap .photo-cap, .lb-cap .photo-src { display: block; }
.lb-cap .photo-cap { color: var(--body); }
.lb-cap .photo-src { margin-top: 3px; color: var(--faint); }
.lb-cap a { color: var(--muted); }
.lb-close {
  position: fixed; top: max(14px, env(safe-area-inset-top)); right: 14px; z-index: 2;
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: var(--pill); cursor: pointer;
  background: rgb(255 255 255 / 0.12); color: var(--ink);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: background-color .2s, transform .12s var(--ease-out);
}
.lb-close:hover { background: rgb(255 255 255 / 0.2); }
.lb-close:active { transform: scale(0.94); transition-duration: 0s; }
.lb-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.lb-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-transparency: reduce) {
  .lb-scrim { background: rgb(20 21 23); }
  .lb-close { background: var(--raise); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* Reduce Motion: no zooming, sliding or easing positions; colour and opacity
   changes stay, since they carry meaning. */
@media (prefers-reduced-motion: reduce) {
  .post-item .post-art :is(svg, img), .zoom img, .button, .lb-close, .toc-box > summary::after { transition: none; }
  .post-item:hover .post-art :is(svg, img), .zoom:active img, .button:active { transform: none; }
  .toc-marker { transition: opacity .2s; }
  .toc-box::details-content { transition: none; }
  .toast-note { transition: opacity .2s; transform: translate(-50%, 0); }
}

@media (max-width: 560px) {
  .prose { font-size: 17px; line-height: 1.72; }
  .lede { font-size: 18px; }
  .page h2, .prose h2 { font-size: 26px; }
  .prose h2 { margin-top: 48px; }
}

/* ================================================ moving between pages ===== */
/* Same-site links cross-fade instead of cutting; the top bar stays put while
   the page under it changes. Off with Reduce Motion. Browsers without view
   transitions simply load the next page. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .site-bar { view-transition-name: site-bar; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }
}
