@font-face { font-family: Literata; font-style: italic; font-weight: 300 700; font-display: swap; src: url("fonts/literata-italic-cyrillic-ext.woff2") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: Literata; font-style: italic; font-weight: 300 700; font-display: swap; src: url("fonts/literata-italic-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Literata; font-style: italic; font-weight: 300 700; font-display: swap; src: url("fonts/literata-italic-greek.woff2") format("woff2"); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: Literata; font-style: italic; font-weight: 300 700; font-display: swap; src: url("fonts/literata-italic-latin-ext.woff2") format("woff2"); 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: Literata; font-style: italic; font-weight: 300 700; font-display: swap; src: url("fonts/literata-italic-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Literata; font-style: normal; font-weight: 300 700; font-display: swap; src: url("fonts/literata-normal-cyrillic-ext.woff2") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: Literata; font-style: normal; font-weight: 300 700; font-display: swap; src: url("fonts/literata-normal-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Literata; font-style: normal; font-weight: 300 700; font-display: swap; src: url("fonts/literata-normal-greek.woff2") format("woff2"); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: Literata; font-style: normal; font-weight: 300 700; font-display: swap; src: url("fonts/literata-normal-latin-ext.woff2") format("woff2"); 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: Literata; font-style: normal; font-weight: 300 700; font-display: swap; src: url("fonts/literata-normal-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* Harta cuvintelor v2 — tokens first; the map reads the same tokens through getComputedStyle. */
:root {
  --bg: #f3efe6; --surface: #fbf8f2; --surface-2: #ece6da;
  --ink: #1c1a16; --ink-2: #47423a; --ink-3: #4f4a41;
  --line: #d6cdbd; --land: #e3dbc9; --coast: #cbbfa6; --grid: #e9e3d6;
  --accent: #6f3d00; --focus: #0b5cad;
  --g0: #a96c00; --g1: #0085b4; --g2: #bf4a7c; --g3: #3c9028; --g4: #8364ca; --g5: #c65026; --g6: #5572d4; --solo: #8b8476;
  --halo: rgba(243, 239, 230, 0.92);
  --shadow: 0 1px 2px rgba(40, 30, 10, 0.08), 0 8px 24px rgba(40, 30, 10, 0.08);
  --serif: Literata, "Iowan Old Style", Georgia, "Noto Serif", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --bar: 46px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e131c; --surface: #151c28; --surface-2: #1b2433;
    --ink: #f1ece2; --ink-2: #c9c2b4; --ink-3: #b8b1a4;
    --line: #2a3446; --land: #1a2231; --coast: #2f3b50; --grid: #151c29;
    --accent: #f0b35e; --focus: #8cc4ff;
    --g0: #c48600; --g1: #32a0cf; --g2: #dd6595; --g3: #57ab45; --g4: #9c7ee6; --g5: #e36b42; --g6: #6c8cf0; --solo: #6f7888;
    --halo: rgba(14, 19, 28, 0.9);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e131c; --surface: #151c28; --surface-2: #1b2433;
  --ink: #f1ece2; --ink-2: #c9c2b4; --ink-3: #b8b1a4;
  --line: #2a3446; --land: #1a2231; --coast: #2f3b50; --grid: #151c29;
  --accent: #f0b35e; --focus: #8cc4ff;
  --g0: #c48600; --g1: #32a0cf; --g2: #dd6595; --g3: #57ab45; --g4: #9c7ee6; --g5: #e36b42; --g6: #6c8cf0; --solo: #6f7888;
  --halo: rgba(14, 19, 28, 0.9);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar) + 8px); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.0625rem/1.6 var(--serif); font-optical-sizing: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }
[hidden] { display: none !important; }
html:not(.js) .js-only { display: none !important; }
.js .no-js { display: none !important; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 30; height: var(--bar); display: flex; align-items: center; gap: 14px; padding: 0 16px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); font: 500 0.875rem/1 var(--sans); }
.topbar .home { text-decoration: none; font-weight: 600; white-space: nowrap; }
.topnav { display: flex; gap: 16px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; -webkit-mask-image: linear-gradient(90deg, #000 80%, transparent); mask-image: linear-gradient(90deg, #000 80%, transparent); padding-right: 18px; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a { text-decoration: none; color: var(--ink-2); white-space: nowrap; padding: 14px 0; }
.topnav a[aria-current] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.lang { text-decoration: none; color: var(--ink-2); white-space: nowrap; }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn svg { display: block; }
.icon-btn svg[hidden] { display: none; }

/* opening */
.hero { max-width: 1180px; margin: 0 auto; padding: 36px 20px 18px; }
.kicker { font: 600 0.78rem/1.2 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin: 0 0 12px; }
h1 { font-weight: 480; font-size: clamp(2.3rem, 6.4vw, 4.6rem); line-height: 1.02; letter-spacing: -0.02em; margin: 0 0 16px; max-width: 17ch; font-variation-settings: "opsz" 72; }
.deck { font-size: clamp(1.1rem, 1.9vw, 1.35rem); line-height: 1.45; color: var(--ink-2); max-width: 40rem; margin: 0; }

/* story: sticky stage + flowing column */
.story { position: relative; max-width: 1400px; margin: 0 auto; }
.stage { position: sticky; top: var(--bar); z-index: 5; height: calc(52svh); display: flex; flex-direction: column; background: var(--bg); border-bottom: 1px solid var(--line); }
.flow { position: relative; z-index: 1; padding: 0 20px 40px; }
@media (min-width: 980px) {
  .story { display: grid; grid-template-columns: minmax(380px, 460px) 1fr; gap: 0 36px; padding: 0 24px 0 28px; }
  .stage { grid-column: 2; grid-row: 1; height: calc(100svh - var(--bar) - 16px); top: calc(var(--bar) + 8px); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
  .flow { grid-column: 1; grid-row: 1; padding: 0 0 20vh; }
}

.controls { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--surface); flex-wrap: nowrap; font-family: var(--sans); }
.combo { position: relative; flex: 1 1 0; min-width: 0; }
.combo input { width: 100%; font: 500 1rem/1.2 var(--sans); padding: 9px 12px 9px 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.combo svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.combo ul { position: absolute; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); z-index: 20; max-height: 50svh; overflow: auto; }
.combo li { padding: 8px 10px; border-radius: 7px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; }
.combo li small { color: var(--ink-3); }
.combo li[aria-selected="true"] { background: var(--surface-2); }
.you { flex: 0 1 auto; min-width: 0; max-width: 46%; display: flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--ink-2); }
.you select { font: 500 0.9rem/1.2 var(--sans); padding: 8px 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); max-width: 100%; min-width: 0; }
.canvas-wrap { position: relative; flex: 1; min-height: 0; }
#map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: crosshair; }
.zoom { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; gap: 4px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; font: 500 0.75rem/1 var(--sans); }
.zoom::-webkit-scrollbar { display: none; }
.zoom button { flex: none; }
.zoom button { font: inherit; padding: 6px 9px; border-radius: 999px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--ink-2); cursor: pointer; }
.zoom button[aria-pressed="true"] { color: var(--ink); border-color: var(--ink-3); }
.zoom .replay { color: var(--ink); border-color: var(--ink-3); }
.tip { position: absolute; z-index: 8; pointer-events: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; box-shadow: var(--shadow); font: 0.85rem/1.35 var(--sans); max-width: 240px; color: var(--ink-2); }
.tip b { color: var(--ink); font-weight: 600; }
.tip .w { font: 500 1.15rem/1.2 var(--serif); color: var(--ink); display: block; margin: 2px 0; }
.tip .ipa { color: var(--ink-3); }
.ruler { position: relative; height: 66px; border-top: 1px solid var(--line); flex: none; }
.ruler .rtitle { position: absolute; left: 10px; top: 5px; margin: 0; font: 600 0.7rem/1 var(--sans); color: var(--ink-2); pointer-events: none; }
#ruler { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ruler .ends { position: absolute; left: 10px; right: 10px; bottom: 4px; display: flex; justify-content: space-between; font: 0.7rem/1 var(--sans); color: var(--ink-3); pointer-events: none; }
.stage-note { font: 0.8rem/1.35 var(--sans); color: var(--ink-2); padding: 6px 10px; border-top: 1px solid var(--line); min-height: 2.6em; flex: none; }
.stage-note b { color: var(--ink); }
.loading { position: absolute; inset: 0; display: grid; place-items: center; font: 0.9rem var(--sans); color: var(--ink-3); pointer-events: none; }

/* text column */
.step { padding: 28px 0 8px; }
.step + .step { border-top: 1px solid var(--line); }
@media (min-width: 980px) { .step { min-height: 70svh; padding: 48px 0 24px; } .step.explore { min-height: 0; padding-top: 12px; } }
.step h2 { font-weight: 520; font-size: clamp(1.55rem, 3vw, 2.1rem); line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 14px; }
.step p { margin: 0 0 14px; }
.step .num { font: 600 0.75rem/1 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin: 0 0 10px; }
.w { font-style: italic; }
.act { font: 600 0.9rem/1 var(--sans); display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--ink-3); background: var(--surface); color: var(--ink); cursor: pointer; margin: 4px 6px 10px 0; }
.act:hover { background: var(--surface-2); }
.result { font-size: 1.15rem; line-height: 1.45; margin: 18px 0 12px; }
.result b { font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 16px; font-family: var(--sans); }
.chips button { font: 500 0.9rem/1 var(--sans); padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.chips button:hover { border-color: var(--ink-3); }
.groups { margin: 8px 0 18px; }
.group { padding: 10px 0; border-top: 1px solid var(--line); }
.group h3 { font: 600 0.95rem/1.3 var(--sans); margin: 0 0 4px; display: flex; align-items: baseline; gap: 8px; }
.group h3 i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; transform: translateY(1px); }
.group h3 span { color: var(--ink-3); font-weight: 500; }
.group p { margin: 0; font-size: 0.95rem; line-height: 1.55; color: var(--ink-2); }
.group p span { white-space: nowrap; }
.group p em { color: var(--ink); }
.more { font: 600 0.88rem/1 var(--sans); background: none; border: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; padding: 8px 0; cursor: pointer; }
.near { font-size: 0.95rem; color: var(--ink-2); }
.near ol { margin: 6px 0 0; padding-left: 1.3em; }
.colex { font-size: 1rem; }
.colex button { font: inherit; font-style: italic; background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* blue line */
.hue { margin: 12px 0 16px; font-family: var(--sans); }
.hue .strip { position: relative; height: 64px; border-radius: 10px; touch-action: none; cursor: ew-resize; outline-offset: 3px; }
.hue .handle { position: absolute; top: -6px; bottom: -6px; width: 4px; margin-left: -2px; background: var(--ink); border-radius: 2px; box-shadow: 0 0 0 2px var(--bg); }
.hue .ticks { position: relative; height: 54px; margin-top: 8px; }
.hue .ticks i { position: absolute; bottom: 0; width: 2px; margin-left: -1px; background: var(--ink-3); border-radius: 1px; }
.hue .legend { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--ink-3); margin-top: 4px; }
.hue output { display: block; font: 1rem/1.45 var(--serif); margin-top: 10px; color: var(--ink); }

/* prose sections after the story */
.prose { max-width: 42rem; margin: 0 auto; padding: 48px 20px 12px; }
.prose h2 { font-weight: 520; font-size: clamp(1.5rem, 2.6vw, 1.9rem); line-height: 1.2; margin: 0 0 14px; }
.prose h3 { font: 600 1rem/1.3 var(--sans); margin: 22px 0 6px; }
.prose p, .prose li { color: var(--ink); }
.prose .small, .prose .sources li { font-size: 0.93rem; color: var(--ink-2); }
.prose .sources { padding-left: 1.1em; }
.prose .sources li { margin-bottom: 8px; }
table.fig { border-collapse: collapse; width: 100%; font: 0.9rem/1.4 var(--sans); margin: 10px 0 18px; }
table.fig th, table.fig td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); }
table.fig td.n { text-align: right; font-variant-numeric: tabular-nums; }
.ending { font-size: 1.25rem; line-height: 1.45; }
.foot { max-width: 42rem; margin: 30px auto 0; padding: 22px 20px 40px; border-top: 1px solid var(--line); font: 0.85rem var(--sans); color: var(--ink-2); }

/* reading rail (desktop) */
.rail { display: none; }
@media (min-width: 1500px) {
  .rail { display: flex; flex-direction: column; gap: 10px; position: fixed; right: 14px; top: 50%; transform: translateY(-50%); z-index: 20; font: 0.72rem/1.1 var(--sans); }
  .rail a { display: flex; align-items: center; justify-content: flex-end; gap: 8px; text-decoration: none; color: var(--ink-3); }
  .rail a::after { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--ink-3); }
  .rail a span { opacity: 0; transition: opacity .2s; }
  .rail:hover a span, .rail a[aria-current] span { opacity: 1; }
  .rail a[aria-current] { color: var(--ink); }
  .rail a[aria-current]::after { background: var(--accent); border-color: var(--accent); }
}

@media (max-width: 979px) {
  .controls { padding: 6px 8px; }
  .you span.lab { display: none; }
  .ruler { height: 56px; }
  .stage-note { font-size: 0.76rem; padding: 5px 8px; }
}
@media (max-height: 700px) and (max-width: 979px) { .stage { height: 56svh; } .ruler { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.sw.k0 { background: var(--g0); } .sw.k1 { background: var(--g1); } .sw.k2 { background: var(--g2); } .sw.k3 { background: var(--g3); }
.sw.k4 { background: var(--g4); } .sw.k5 { background: var(--g5); } .sw.k6 { background: var(--g6); } .sw.solo { background: var(--solo); }
.sw.hollow { background: none; box-shadow: inset 0 0 0 1.5px var(--solo); }
@media (max-width: 979px) { .flow .step { scroll-margin-top: calc(var(--bar) + 52svh + 8px); } }
@media (max-height: 700px) and (max-width: 979px) { .flow .step { scroll-margin-top: calc(var(--bar) + 56svh + 8px); } }
