/* Ce știm despre noi — mariuscomper.uk/ce-stim-despre-noi */

:root {
  color-scheme: light;
  --paper: #f5f1e8;
  --paper-2: #ece6d8;
  --card: #fbf9f3;
  --ink: #16140f;
  --ink-2: #3a352c;
  --ink-3: #6b6558;
  --rule: #d6ccb9;
  --rule-2: #bcb09a;
  --accent: #1f3a5f;
  --accent-soft: #dfe6ef;
  --ochre: #b7791f;
  --ochre-soft: #f1e4c8;
  --link: #1f3a5f;
  --focus: #0a5ad6;
  --serif: "Spectral", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: 46rem;
  --wide: 66rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #14120f;
    --paper-2: #1c1915;
    --card: #1f1c17;
    --ink: #f0eadf;
    --ink-2: #d3ccbe;
    --ink-3: #9a9184;
    --rule: #3a342b;
    --rule-2: #4f4739;
    --accent: #8fb3e0;
    --accent-soft: #23304a;
    --ochre: #e0a740;
    --ochre-soft: #3d2f14;
    --link: #9fc0ea;
    --focus: #7fb2ff;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #14120f;
  --paper-2: #1c1915;
  --card: #1f1c17;
  --ink: #f0eadf;
  --ink-2: #d3ccbe;
  --ink-3: #9a9184;
  --rule: #3a342b;
  --rule-2: #4f4739;
  --accent: #8fb3e0;
  --accent-soft: #23304a;
  --ochre: #e0a740;
  --ochre-soft: #3d2f14;
  --link: #9fc0ea;
  --focus: #7fb2ff;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.04rem, 0.98rem + 0.25vw, 1.18rem);
  line-height: 1.62;
  overflow-x: hidden;
}
img, svg, canvas { max-width: 100%; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--accent); color: #fff; padding: 0.6rem 1rem; z-index: 99; }
.skip-link:focus { left: 1rem; top: 1rem; }

.wrap { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.8rem 0; font-family: var(--sans); font-size: 0.9rem; width: min(100% - 2rem, var(--wide)); }
.brand { color: var(--ink); text-decoration: none; font-weight: 600; }
.brand .tag { font-weight: 400; color: var(--ink-3); margin-left: 0.4rem; }
.header-controls { display: flex; gap: 0.5rem; }
.btn { font-family: var(--sans); font-size: 0.85rem; border: 1px solid var(--rule-2); background: var(--card); color: var(--ink); padding: 0.4rem 0.7rem; border-radius: 999px; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--ink-3); }

.hero { padding: clamp(2.5rem, 7vw, 5rem) 0 1.5rem; }
.eyebrow { font-family: var(--sans); font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 1rem; }
h1 { font-family: var(--serif); font-weight: 800; font-size: clamp(2.6rem, 3rem + 3.5vw, 6rem); line-height: 0.98; letter-spacing: -0.02em; margin: 0 0 1.2rem; }
.standfirst { font-size: clamp(1.15rem, 1.05rem + 0.6vw, 1.5rem); line-height: 1.45; color: var(--ink-2); margin: 0 0 1rem; max-width: 40rem; }
.byline { font-family: var(--sans); font-size: 0.88rem; color: var(--ink-3); margin: 0; }

.prose p { margin: 0 0 1.1rem; }
.letter { margin: 1.5rem 0 2rem; padding: 1.2rem 1.4rem; border-left: 3px solid var(--ochre); background: var(--card); font-style: italic; font-size: 1.05em; }
.letter p { margin: 0 0 0.6rem; }
.letter footer { font-style: normal; font-family: var(--sans); font-size: 0.82rem; color: var(--ink-3); }

.section-title { font-size: clamp(1.6rem, 1.4rem + 1vw, 2.2rem); margin: 2.5rem 0 0.4rem; font-weight: 800; letter-spacing: -0.01em; }
.section-lede { color: var(--ink-2); margin: 0 0 1rem; }

/* Table of contents */
.toc { margin: 1rem auto 0; font-family: var(--sans); }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 0.35rem 1rem; counter-reset: toc; }
.toc li { counter-increment: toc; display: flex; justify-content: space-between; gap: 0.5rem; border-bottom: 1px dotted var(--rule); padding: 0.3rem 0; font-size: 0.92rem; }
.toc li::before { content: counter(toc, upper-roman) " "; color: var(--ochre); font-family: var(--mono); min-width: 2em; }
.toc li a { flex: 1; text-decoration: none; color: var(--ink); }
.toc li a:hover { text-decoration: underline; }
.toc li span { color: var(--ink-3); font-family: var(--mono); font-size: 0.8rem; }
.toc li:last-child::before { content: "· "; }

/* Map */
.wrap.wide { width: min(100% - 2rem, var(--wide)); }
.wrap.wide .section-lede { max-width: 46rem; }
.map-figure { margin: 0 0 1rem; }
.map { width: 100%; aspect-ratio: 1 / 1; max-height: 78vh; background: var(--card); border: 1px solid var(--rule); border-radius: 12px; position: relative; overflow: hidden; }
.map svg { width: 100%; height: 100%; display: block; }
.map .edge { stroke: var(--rule-2); stroke-width: 0.8; opacity: 0.55; fill: none; transition: opacity 0.2s, stroke-width 0.2s; }
.map .edge.on { stroke: var(--ochre); stroke-width: 1.8; opacity: 1; }
.map .edge.dim { opacity: 0.1; }
.map .node { cursor: pointer; }
.map .node circle { fill: var(--accent); stroke: var(--paper); stroke-width: 1.5; transition: r 0.15s; }
.map .node.src circle { fill: var(--card); stroke: var(--accent); stroke-width: 1.6; }
.map .node.src.site circle { fill: var(--accent); }
.map .node.on circle { fill: var(--ochre) !important; stroke: var(--ochre); }
.map .node.dim { opacity: 0.25; }
.map .node text { font-family: var(--sans); font-size: 11.5px; fill: var(--ink-2); pointer-events: none; }
.map .node.prop text { font-family: var(--mono); font-size: 8.5px; fill: var(--paper); font-weight: 600; text-anchor: middle; dominant-baseline: central; }
.map .node.prop circle { fill: var(--ch, var(--accent)); }
.map .ring { fill: none; stroke: var(--rule); stroke-width: 1; }
.map .chlab { font-family: var(--sans); font-size: 11px; fill: var(--ink-3); text-anchor: middle; }
.map .node.on text { fill: var(--ink); font-weight: 600; }
.map .node.prop.on text { fill: #16140f; }
.map-caption { font-family: var(--sans); font-size: 0.86rem; color: var(--ink-3); margin: 0.6rem 0 0; min-height: 2.4em; }
.map-caption strong { color: var(--ink); }
.note { font-family: var(--sans); font-size: 0.9rem; color: var(--ink-3); }
@media (max-width: 640px) {
  .map { aspect-ratio: 1 / 1.25; max-height: none; }
  .map .node text { font-size: 15px; }
}

/* Chapters and propositions */
.chapter { margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.chapter-num { font-family: var(--mono); color: var(--ochre); font-size: 0.95rem; margin: 0 0 0.2rem; letter-spacing: 0.1em; }
.chapter h2 { font-size: clamp(2rem, 1.6rem + 2vw, 3.2rem); font-weight: 800; margin: 0 0 1.5rem; letter-spacing: -0.015em; }
.prop { margin: 0 0 3rem; scroll-margin-top: 2rem; }
.prop h3 { font-size: clamp(1.35rem, 1.2rem + 0.9vw, 1.9rem); line-height: 1.22; font-weight: 600; margin: 0 0 1rem; letter-spacing: -0.01em; display: flex; gap: 0.7rem; align-items: baseline; }
.prop h3 .n { font-family: var(--mono); font-weight: 600; font-size: 0.68em; color: var(--paper); background: var(--accent); border-radius: 999px; min-width: 1.9em; height: 1.9em; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; transform: translateY(-0.08em); }
.prop p { margin: 0 0 1rem; }
.prop.flash h3 .n { background: var(--ochre); color: #16140f; }

.fig { margin: 1.4rem 0 1.4rem; padding: 0.9rem 0.9rem 0.6rem; background: var(--card); border: 1px solid var(--rule); border-radius: 10px; }
.fig svg { width: 100%; height: auto; display: block; }
.fig figcaption { font-family: var(--sans); font-size: 0.84rem; color: var(--ink-3); margin: 0.5rem 0 0; }
.fig .axis { font-family: var(--mono); font-size: 10px; fill: var(--ink-3); }
.fig .lab { font-family: var(--sans); font-size: 11px; fill: var(--ink-2); }
.fig .lab.b { font-weight: 600; fill: var(--ink); }
.fig .bar { fill: var(--accent); }
.fig .bar.hi { fill: var(--ochre); }
.fig .bar.mute { fill: var(--rule-2); }
.fig .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.fig .line.alt { stroke: var(--ochre); }
.fig .grid { stroke: var(--rule); stroke-width: 1; }
.fig .mark { fill: var(--ochre); }
.fig .val { font-family: var(--mono); font-size: 11px; fill: var(--ink); }
.fig table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 0.9rem; }
.fig th, .fig td { text-align: left; padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--rule); }
.fig td.num, .fig th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.fig .sw { display: inline-block; width: 0.7em; height: 0.7em; border-radius: 2px; margin-right: 0.4em; vertical-align: -0.05em; }
.fig .sw.antic { background: var(--ochre); }
.fig .sw.slav { background: var(--accent); }
.fig .sw.discutat { background: var(--rule-2); }
.fig-fallback { font-family: var(--sans); font-size: 0.9rem; color: var(--ink-2); margin: 0; }

.ded { margin: 0.6rem 0 0; border-top: 1px dashed var(--rule-2); padding-top: 0.6rem; font-size: 0.92em; }
.ded summary { font-family: var(--sans); font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); cursor: pointer; padding: 0.3rem 0; }
.ded summary::marker { color: var(--ochre); }
.ded ol { margin: 0.6rem 0 0.4rem; padding-left: 1.4rem; color: var(--ink-2); }
.ded li { margin: 0 0 0.5rem; }
.ded .lim { color: var(--ink-3); margin: 0.6rem 0 0.4rem; font-style: italic; }

.result { background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: 1.5rem clamp(1rem, 4vw, 2.5rem) 1.2rem; margin-top: 4rem; }
.result h2 { margin-bottom: 1rem; }
.result p { font-size: 1.04em; margin: 0 0 1.1rem; }

.method { margin-top: 3rem; }
.method h2, .sources h2 { font-size: 1.6rem; margin: 0 0 0.8rem; }
.sources { margin-top: 2.5rem; padding-bottom: 4rem; font-family: var(--sans); font-size: 0.9rem; color: var(--ink-2); }
.sources h3 { font-family: var(--serif); font-size: 1.1rem; margin: 1.4rem 0 0.5rem; }
.src { padding-left: 1.2rem; margin: 0; }
.src li { margin: 0 0 0.45rem; }
.colophon { margin-top: 1.5rem; color: var(--ink-3); }

.to-top { position: fixed; right: 1rem; bottom: 1rem; width: 2.6rem; height: 2.6rem; border-radius: 999px; background: var(--card); border: 1px solid var(--rule-2); color: var(--ink); display: flex; align-items: center; justify-content: center; text-decoration: none; font-family: var(--sans); opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.to-top.show { opacity: 1; pointer-events: auto; }

/* Chapter colours (one hue per chapter, used by the map and the numbered badges) */
#pamantul { --ch: #5b7a3a; } #locul { --ch: #1f3a5f; } #neamul { --ch: #8a3b4a; } #casa { --ch: #b7791f; } #regula { --ch: #6b4a8c; }
#statul { --ch: #3d3d3d; } #timpul { --ch: #2f7f8a; } #trupul { --ch: #b23a2c; } #limba { --ch: #2b6b8f; } #cuvantul { --ch: #7a5c2e; }
.prop h3 .n { background: var(--ch, var(--accent)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #statul { --ch: #8d8d8d; } }
:root[data-theme="dark"] #statul { --ch: #8d8d8d; }
.fig .pair { font-family: var(--sans); font-size: 12px; fill: var(--ink-2); }
