/* Cum respiră România turistică — semantic tokens, dual theme. */

:root {
  color-scheme: light;
  --bg: #f6f2e9;
  --bg-raised: #fffdf8;
  --bg-sunken: #ece3d1;
  --fg: #201d17;
  --fg-soft: #4a4438;
  --fg-faint: #6b6455;
  --line: rgba(32, 29, 23, 0.15);
  --line-strong: rgba(32, 29, 23, 0.38);
  --shadow: rgba(32, 29, 23, 0.12);
  --accent: #0f6e6b;
  --accent-soft: #d9ece9;
  --accent-ink: #0a4d4b;
  --on-accent: #ffffff;
  --link: #0a5f8a;
  --focus: #0f6e6b;
  --sun: #c8791e;
  --sun-soft: #f3ddb8;
  --sea: #14708f;
  --sea-soft: #d3e7ee;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --container: 72ch;
  --wide: 1180px;
  --radius: 14px;
  /* cluster colors, k2 */
  --c2-0: #7a6e52; --c2-0-soft: #e8e0cd;
  --c2-1: #c8791e; --c2-1-soft: #f3ddb8;
  /* cluster colors, k3 */
  --c3-0: #7a6e52; --c3-0-soft: #e8e0cd;
  --c3-1: #c8791e; --c3-1-soft: #f3ddb8;
  --c3-2: #14708f; --c3-2-soft: #d3e7ee;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #16181a; --bg-raised: #1e2123; --bg-sunken: #0f1112;
    --fg: #ece7db; --fg-soft: #c9c3b4; --fg-faint: #b1aa98;
    --line: rgba(236, 231, 219, 0.15); --line-strong: rgba(236, 231, 219, 0.4); --shadow: rgba(0, 0, 0, 0.55);
    --accent: #6fc9c3; --accent-soft: #1c3634; --accent-ink: #a3e0da; --on-accent: #08201e; --link: #8fc7e6; --focus: #6fc9c3;
    --sun: #eba24a; --sun-soft: #4a3418; --sea: #6bb6d1; --sea-soft: #1c3944;
    --c2-0: #b7ab8c; --c2-0-soft: #34302320; --c2-1: #eba24a; --c2-1-soft: #4a3418;
    --c3-0: #b7ab8c; --c3-0-soft: #302c20; --c3-1: #eba24a; --c3-1-soft: #4a3418; --c3-2: #6bb6d1; --c3-2-soft: #1c3944;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #16181a; --bg-raised: #1e2123; --bg-sunken: #0f1112;
  --fg: #ece7db; --fg-soft: #c9c3b4; --fg-faint: #b1aa98;
  --line: rgba(236, 231, 219, 0.15); --line-strong: rgba(236, 231, 219, 0.4); --shadow: rgba(0, 0, 0, 0.55);
  --accent: #6fc9c3; --accent-soft: #1c3634; --accent-ink: #a3e0da; --on-accent: #08201e; --link: #8fc7e6; --focus: #6fc9c3;
  --sun: #eba24a; --sun-soft: #4a3418; --sea: #6bb6d1; --sea-soft: #1c3944;
  --c2-0: #b7ab8c; --c2-0-soft: #302c20; --c2-1: #eba24a; --c2-1-soft: #4a3418;
  --c3-0: #b7ab8c; --c3-0-soft: #302c20; --c3-1: #eba24a; --c3-1-soft: #4a3418; --c3-2: #6bb6d1; --c3-2-soft: #1c3944;
}

*, *::before, *::after { 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(--bg); color: var(--fg); font-family: var(--serif); font-size: 1.0625rem; line-height: 1.6; text-rendering: optimizeLegibility; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 3px; }
.wrap { max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }
.wrap.wide { max-width: var(--wide); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.18; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4.4vw, 3rem); margin: 0.2em 0 0.4em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 1.9rem); margin: 0 0 0.6em; }
h3 { font-size: 1.15rem; margin: 1.2em 0 0.4em; }
p { margin: 0 0 1.1em; }
.kicker { font-family: var(--sans); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--fg-faint); margin: 0 0 0.6em; }
strong { color: var(--fg); }
.deck { font-size: 1.18rem; color: var(--fg-soft); max-width: 62ch; }

header#top { background: linear-gradient(180deg, var(--sea-soft), var(--bg) 70%); border-bottom: 1px solid var(--line); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 1.25rem; font-family: var(--sans); font-size: 0.9rem; max-width: var(--wide); margin: 0 auto; }
.brand { font-weight: 600; color: var(--fg); text-decoration: none; }
.topbar-tools { display: flex; align-items: center; gap: 0.9rem; }
.lang-switch { display: flex; gap: 0.4rem; }
.lang-switch a { padding: 0.25rem 0.55rem; border-radius: 999px; border: 1px solid var(--line); color: var(--fg-soft); text-decoration: none; }
.lang-switch a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.theme-toggle { font-family: var(--sans); font-size: 0.85rem; padding: 0.3rem 0.7rem; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-raised); color: var(--fg-soft); cursor: pointer; }
.hero { padding: 2.2rem 0 2.6rem; }
.hero .wrap { max-width: var(--wide); }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-top: 1.8rem; font-family: var(--sans); }
.stat { background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1rem; }
.stat b { display: block; font-family: var(--serif); font-size: 1.5rem; color: var(--accent-ink); }
.stat span { font-size: 0.86rem; color: var(--fg-soft); }

main section { padding: 2.6rem 0; border-top: 1px solid var(--line); }
main section.wide-section .wrap { max-width: var(--wide); }

/* signature glyphs: 12 bars, pure CSS, no JS required */
.sig { display: flex; align-items: flex-end; gap: 2px; height: 48px; }
.sig .bar { flex: 1 1 0; background: var(--accent); border-radius: 2px 2px 0 0; min-height: 2px; }
.sig.small { height: 30px; }
.sig-card { background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem 1rem; }
.sig-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; margin: 1.4rem 0; }
.sig-card h3 { margin-top: 0; }
.sig-meta { font-family: var(--sans); font-size: 0.82rem; color: var(--fg-faint); display: flex; justify-content: space-between; margin-top: 0.5rem; }
.sig-months { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 0.62rem; color: var(--fg-faint); margin-top: 0.25rem; }

/* national trend chart */
.trend-wrap { overflow-x: auto; }
.trend-svg { width: 100%; height: auto; min-width: 640px; }
.trend-legend { display: flex; gap: 1.2rem; font-family: var(--sans); font-size: 0.82rem; color: var(--fg-soft); margin-top: 0.6rem; flex-wrap: wrap; }
.trend-legend .sw { display: inline-block; width: 0.8em; height: 0.8em; border-radius: 2px; margin-right: 0.35em; vertical-align: -0.08em; }

/* cluster cards */
.cluster-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.1rem; margin: 1.4rem 0; }
.cluster-card { background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; border-top: 5px solid var(--accent); }
.cluster-card .sig .bar { background: var(--accent); }
.cluster-card h3 { margin-top: 0.2em; }
.cluster-card .n { font-family: var(--sans); font-size: 0.85rem; color: var(--fg-faint); }
.cluster-card ul { margin: 0.6em 0 0; padding-left: 1.15em; font-size: 0.94rem; }
.cluster-card ul li { margin-bottom: 0.25em; }

/* explorer */
.explorer-controls { display: flex; gap: 0.7rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; font-family: var(--sans); }
.explorer-controls input[type="search"] { font-family: var(--sans); font-size: 0.95rem; padding: 0.5rem 0.8rem; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--bg-raised); color: var(--fg); min-width: 220px; flex: 1 1 220px; }
.explorer-controls select { font-family: var(--sans); font-size: 0.9rem; padding: 0.45rem 0.6rem; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--bg-raised); color: var(--fg); }
.explorer-count { font-family: var(--sans); font-size: 0.85rem; color: var(--fg-faint); margin-bottom: 0.6rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.explorer { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 0.88rem; background: var(--bg-raised); }
table.explorer th, table.explorer td { padding: 0.5rem 0.7rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.explorer th { position: sticky; top: 0; background: var(--bg-sunken); cursor: pointer; user-select: none; font-weight: 600; }
table.explorer th button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 0.3em; }
table.explorer td.sig-cell { min-width: 130px; }
table.explorer .sig { height: 22px; width: 120px; }
table.explorer tbody tr:hover { background: var(--bg-sunken); }
table.explorer td.num { text-align: right; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; font-size: 0.72rem; padding: 0.12em 0.55em; border-radius: 999px; font-family: var(--sans); }

.method ul { padding-left: 1.2em; }
.method li { margin-bottom: 0.8em; }
.method code { font-family: var(--mono); font-size: 0.88em; background: var(--bg-sunken); padding: 0.1em 0.35em; border-radius: 4px; }

footer { border-top: 1px solid var(--line); padding: 1.6rem 0 3rem; font-family: var(--sans); font-size: 0.85rem; color: var(--fg-faint); }
.back-top { position: fixed; right: 1.1rem; bottom: 1.1rem; background: var(--accent); color: var(--on-accent); font-family: var(--sans); font-size: 0.85rem; padding: 0.5rem 0.85rem; border-radius: 999px; text-decoration: none; box-shadow: 0 4px 14px var(--shadow); }

.linkbtn { all: unset; cursor: pointer; color: var(--link); text-decoration: underline; text-underline-offset: 0.15em; }

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; }
  table.explorer { font-size: 0.82rem; }
}

.js-only { display: none; }
.no-js-note { font-family: var(--sans); font-size: 0.82rem; color: var(--fg-faint); margin-top: 0.5rem; }
