/* limes-orasul-tau: parchment + stitched thread */
@font-face {
  font-family: "Newsreader"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/newsreader-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2013-2014, U+2018-201F, U+2212;
}
@font-face {
  font-family: "Newsreader"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/newsreader-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-024F, U+1E00-1EFF;
}
@font-face {
  font-family: "Atkinson"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/atkinson-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2013-2014, U+2018-201F, U+2212;
}
@font-face {
  font-family: "Atkinson"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/atkinson-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-024F, U+1E00-1EFF;
}
@font-face {
  font-family: "PlexMono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/plexmono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2013-2014, U+2018-201F, U+2212;
}
@font-face {
  font-family: "PlexMono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/plexmono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-024F, U+1E00-1EFF;
}
:root {
  --bg:#f6efe0; --paper2:#efe4cf; --ink:#2b2118; --ink-2:#5c4c3c;
  --accent:#b3202a; --band: rgba(179, 32, 42, 0.14); --wash: rgba(179, 32, 42, 0.05);
  --green:#1f4a43; --muted:#6b6259; --link:#2a6f97; --card:#fffdf6;
  --line:#d8c9ab; --serif: "Newsreader", Georgia, serif; --sans: "Atkinson", system-ui, sans-serif;
  --mono: "PlexMono", ui-monospace, monospace;
}
:root[data-theme="dark"]{
  --bg:#1d150c; --paper2:#2a2013; --ink:#f0e6d4; --ink-2:#c9b99c;
  --accent:#e0606a; --band: rgba(224, 96, 106, 0.18); --wash: rgba(224, 96, 106, 0.07);
  --green:#7fc4b2; --muted:#a89c88; --link:#6fb3d8; --card:#2a2013; --line:#4a3d2a;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--serif); font-size: 19px; line-height: 1.65;
}
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; z-index: 99; background: var(--card); padding: 6px 12px; }
.topbar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 12px;
  padding: 8px 16px; background: var(--paper2); border-bottom: 1px solid var(--line);
  font-family: var(--sans); font-size: 15px;
}
.topbar a { color: var(--ink); text-decoration: none; }
.topbar .home { font-size: 20px; }
.topbar .crumb { color: var(--ink-2); }
.topbar .spacer { flex: 1; }
.topbar .lang { border: 1px solid var(--line); border-radius: 20px; padding: 2px 12px; }
.topbar .them { background: none; border: 1px solid var(--line); border-radius: 20px; width: 34px; height: 24px; cursor: pointer; }
.rail { display: none; }
main { max-width: 1200px; margin: 0 auto; padding: 0 20px 60px; }
.beat { max-width: 680px; margin: 0 auto; padding: 36px 0; }
.beat.wide { max-width: none; }
.kicker {
  font-family: var(--sans); font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 6px;
}
h1 { font-size: clamp(34px, 6vw, 58px); line-height: 1.08; margin: 12px 0; font-weight: 650; }
h2 { font-size: clamp(26px, 4vw, 36px); line-height: 1.15; margin: 0 0 14px; font-weight: 650; }
h3 { font-size: 22px; margin: 0 0 8px; }
.deck { font-size: 21px; color: var(--ink-2); }
.hero { text-align: left; }
.hero figure { margin: 22px -20px 0; }
figure.still { margin: 22px 0 0; }
figure.still img { width: 100%; height: auto; display: block; border-radius: 6px; }
figcaption { font-family: var(--sans); font-size: 14px; color: var(--ink-2); margin-top: 8px; }
figcaption .credit { opacity: 0.8; }
.hint, .skipstory { font-family: var(--sans); font-size: 15px; color: var(--ink-2); }
.nw { white-space: nowrap; }

/* ---- pinned story ---- */
.story { display: grid; grid-template-columns: minmax(0, 640px) minmax(0, 1fr); gap: 28px; align-items: start; }
.story .col { min-width: 0; }
.step {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 18px 20px; margin: 0 0 70vh;
}
.step:first-child { margin-top: 12px; }
.step:last-child { margin-bottom: 12px; }
.step p { margin: 10px 0; font-size: 18px; }
.step figure.still { margin: 14px -8px 0; }
.stage {
  position: sticky; top: 56px; height: calc(100vh - 72px); min-height: 480px;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden; display: flex; flex-direction: column;
}
.stagebar {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border-bottom: 1px solid var(--line); font-family: var(--sans); font-size: 14px;
}
.stagebar .date { font-family: var(--mono); background: var(--accent); color: #fff; border-radius: 4px; padding: 1px 8px; }
:root[data-theme="dark"] .stagebar .date { color: #1d150c; }
.stagebar .hud-step { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#map { flex: 1; width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: manipulation; }
#g-traj[hidden], #g-pin[hidden] { display: none; }
.county { fill: none; stroke: var(--line); stroke-width: 1; }
.river { fill: none; stroke: var(--link); stroke-width: 1.4; opacity: 0.75; }
.wash { fill: var(--wash); stroke: none; }
.band { fill: none; stroke: var(--band); stroke-width: 14; stroke-linejoin: round; }
.thread { fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linejoin: round; stroke-dasharray: 9 5; }
.sector { fill: none; stroke: var(--accent); stroke-width: 0; }
.sector.lit { stroke-width: 5; opacity: 0.35; }
.sector.alt.lit { stroke-dasharray: 3 6; }
.fort { fill: var(--accent); stroke: var(--card); stroke-width: 1; }
.fort.apx { fill: var(--card); stroke: var(--accent); stroke-width: 1.6; }
.traj { fill: none; stroke: var(--ink-2); stroke-width: 1.6; stroke-dasharray: 3 3; }
.tether { stroke: var(--ink-2); stroke-width: 1.2; stroke-dasharray: 4 4; }
.pin { fill: var(--accent); stroke: #fff; stroke-width: 1.5; }
.pin.inside { fill: var(--green); }
.pin.outside { fill: var(--muted); }
.pinring { fill: none; stroke: var(--accent); stroke-width: 1.5; opacity: 0.7; }
.pinring.inside { stroke: var(--green); }
.pinring.outside { stroke: var(--muted); }
.lbl rect { fill: var(--card); stroke: var(--line); opacity: 0.94; }
.lbl text { font-family: var(--sans); fill: var(--ink); }
.lbl.big text { font-weight: 700; }
@media (prefers-reduced-motion: no-preference) {
  .pinring { animation: ping 2s ease-out infinite; transform-box: fill-box; transform-origin: center; }
  @keyframes ping { 0% { transform: scale(0.6); opacity: 0.9; } 100% { transform: scale(1.8); opacity: 0; } }
  .thread { animation: stitch 1.2s linear infinite; }
  @keyframes stitch { to { stroke-dashoffset: -14; } }
}

/* ---- lookup + verdict ---- */
.lookup { position: relative; padding: 10px 12px 4px; }
.lookup label { font-family: var(--sans); font-size: 14px; display: block; margin-bottom: 4px; }
.lookup .row { display: flex; gap: 8px; }
.lookup input {
  flex: 1; font: inherit; font-family: var(--sans); font-size: 16px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink);
}
.lookup button.go {
  font-family: var(--sans); font-size: 16px; padding: 8px 16px; border: none; border-radius: 6px;
  background: var(--accent); color: #fff; cursor: pointer;
}
#town-list {
  position: absolute; z-index: 20; left: 12px; right: 12px; top: 100%; margin: 2px 0 0; padding: 4px;
  list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: 6px;
  font-family: var(--sans); font-size: 15px; max-height: 240px; overflow: auto;
}
#town-list button { width: 100%; text-align: left; background: none; border: none; padding: 6px 8px; cursor: pointer; color: var(--ink); font: inherit; }
#town-list button:hover { background: var(--paper2); }
#town-list .none { padding: 6px 8px; color: var(--ink-2); }
.verdict {
  margin: 10px 12px; padding: 12px 14px; border-radius: 8px; background: var(--paper2);
  border-left: 6px solid var(--accent); font-family: var(--sans);
}
.verdict[data-v="inside"], .verdict:has(.v-verdict[data-v="inside"]) { border-color: var(--green); }
.verdict:has(.v-verdict[data-v="outside"]) { border-color: var(--muted); }
.v-verdict { font-size: 26px; font-weight: 700; margin: 0; font-family: var(--serif); }
.v-town { margin: 2px 0 6px; color: var(--ink-2); }
.v-rows { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 15px; }
.v-note { font-size: 13px; color: var(--ink-2); margin: 6px 0 0; }
.v-link { font-size: 14px; }
.seats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.seats button {
  font-family: var(--sans); font-size: 13px; padding: 3px 10px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer;
}
.examples { font-size: 18px; }
.examples li { margin-bottom: 8px; }
.qa dt { font-weight: 700; margin-top: 14px; }
.qa dd { margin: 4px 0 0; }
.related ul { list-style: none; display: flex; gap: 16px; padding: 0; font-family: var(--sans); }
footer { border-top: 1px solid var(--line); margin-top: 40px; padding-top: 12px; font-family: var(--sans); font-size: 14px; color: var(--ink-2); }

@media (max-width: 900px) {
  .story { grid-template-columns: 1fr; }
  .stage { position: sticky; top: 48px; height: 40vh; min-height: 200px; order: -1; }
  .step { margin-bottom: 46vh; }
  body { font-size: 18px; }
  .topbar { font-size: 13px; gap: 8px; }
  .topbar .crumb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
}
@media (max-width: 420px) {
  main { padding: 0 14px 50px; }
  .v-verdict { font-size: 22px; }
}


/* share row (standards/v2/tools/share_row.py) */
.share-row{display:flex;flex-wrap:wrap;gap:.35rem;align-items:center}
.share-row .lab{font-size:.95rem;margin-inline-end:.3rem}
.share-row a,.share-row button{display:inline-grid;place-items:center;flex:none;width:2.5rem;height:2.5rem;padding:0;border-radius:50%;border:1px solid var(--sr-line,color-mix(in srgb,currentColor 28%,transparent));background:transparent;color:var(--sr-ink,inherit);text-decoration:none;cursor:pointer;font:inherit;transition:color .15s,border-color .15s}
.share-row a:hover,.share-row button:hover,.share-row a:focus-visible,.share-row button:focus-visible{color:var(--sr-acc,inherit);border-color:var(--sr-acc,currentColor)}
.share-row [hidden]{display:none}
@media (pointer:coarse){.share-row a,.share-row button{width:2.75rem;height:2.75rem}}
@media (max-width:30rem){.share-row .lab{flex-basis:100%;margin:0 0 .15rem}}
.share-status{font-size:.92rem;color:var(--sr-ok,inherit);min-height:1.2em;margin:.4rem 0 0}
.share-status:empty{display:none}
.share-field{display:block;width:100%;max-width:36rem;margin-top:.4rem;font:inherit;font-size:.9rem}
