/* numerotarea-strazilor-bucuresti: a night map where light runs along every street in the direction its numbers rise */
:root {
  --bg: #f5f1e8; --bg2: #ece6d8; --card: #fffdf8; --fg: #14181f; --mut: #3e4653; --line: #cfc7b4; --line-soft: #ddd6c4;
  --acc: #6b3200; --alt: #00566a; --link: #0a4478;
  --map-bg: #ede7d9; --map-line: #b9b09b; --map-ring: #9d927a; --f: #d9730d; --b: #0f7e8c; --r: #8c8574; --sel: #14181f; --odd: #14181f; --even: #8c4a00;
  --topbar: 52px; --serif: 'Fraunces', Georgia, serif; --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --radius: 12px; --shadow: 0 1px 0 rgba(20, 24, 31, .05), 0 12px 32px -14px rgba(20, 24, 31, .35);
  color-scheme: light;
}
:root.dark {
  --bg: #0b1017; --bg2: #121a24; --card: #121a25; --fg: #eef0ea; --mut: #bcc4cf; --line: #2a3647; --line-soft: #1f2a39;
  --acc: #ffbd5c; --alt: #6fe0e8; --link: #8cc4ff;
  --map-bg: #080d13; --map-line: #243241; --map-ring: #2e3d50; --f: #ffb347; --b: #4fd8e0; --r: #5d6b7c; --sel: #ffffff; --odd: #ffffff; --even: #ffb347;
  --shadow: 0 1px 0 rgba(0, 0, 0, .4), 0 14px 38px -14px rgba(0, 0, 0, .8);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
svg[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar) + 14px); }
body { margin: 0; background: var(--bg); color: var(--fg); font: 17px/1.62 var(--sans); overflow-anchor: none; }
a { color: var(--link); text-underline-offset: 2px; }
.skip { position: absolute; left: -9999px; top: 0; z-index: 99; background: var(--fg); color: var(--bg); padding: 8px 12px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
section[id], .anchor-target { scroll-margin-top: calc(var(--topbar) + 14px); }

.topbar { position: sticky; top: 0; z-index: 40; height: calc(var(--topbar) + var(--browser-safe-top, env(safe-area-inset-top))); padding: var(--browser-safe-top, env(safe-area-inset-top)) 16px 0; display: flex; align-items: center; gap: 14px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px) saturate(1.2); -webkit-backdrop-filter: blur(8px) saturate(1.2); border-bottom: 1px solid var(--line-soft); font: 500 14px/1 var(--sans); }
.home { display: flex; align-items: center; gap: 8px; color: var(--fg); text-decoration: none; font-weight: 600; white-space: nowrap; }
.motif { width: 24px; height: 24px; color: var(--fg); }
.topnav { display: flex; gap: 16px; overflow-x: auto; scrollbar-width: none; min-width: 0; flex: 0 1 auto; }
.home, .chip, .icon-btn { flex: none; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a { color: var(--mut); text-decoration: none; white-space: nowrap; padding: 8px 0; }
.topnav a:hover { color: var(--fg); }
.spacer { flex: 1 1 0; min-width: 0; }
.chip { color: var(--fg); text-decoration: none; border: 1px solid var(--line); border-radius: 99px; padding: 7px 11px; font-weight: 600; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); color: var(--fg); cursor: pointer; font: 600 18px/1 var(--sans); padding: 0; }
@media (pointer: coarse) { .icon-btn { width: 44px; height: 44px; } }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1.5px solid var(--fg); background: var(--fg); color: var(--bg); border-radius: 9px; padding: 10px 16px; font: 600 15px/1.2 var(--sans); cursor: pointer; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn.small { padding: 6px 10px; font-size: 13px; }
@media (pointer: coarse) { .btn { min-height: 44px; } }

/* hero */
.hero { max-width: 1180px; margin: 0 auto; padding: 30px 16px 10px; display: flex; flex-direction: column; }
.hero > * { order: 0; }
.kicker { font: 600 13px/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--acc); margin: 0 0 12px; }
h1 { font: 640 clamp(32px, 4.6vw, 54px)/1.06 var(--serif); letter-spacing: -.015em; margin: 0 0 14px; max-width: 24ch; font-variation-settings: 'opsz' 96, 'SOFT' 20; }
.deck { font-size: 18.5px; color: var(--mut); margin: 0 0 18px; max-width: 62ch; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 20px; padding: 0; list-style: none; max-width: 860px; }
.stats li { border-top: 3px solid var(--line); padding: 8px 0 0; }
.stats li:nth-child(1) { border-color: var(--fg); } .stats li:nth-child(2) { border-color: var(--f); } .stats li:nth-child(3) { border-color: var(--b); }
.stats b { display: block; font: 600 clamp(26px, 3.4vw, 38px)/1.05 var(--serif); }
.stats span { display: block; font-size: 14.5px; color: var(--mut); line-height: 1.35; margin-top: 4px; }
.finder { display: grid; grid-template-columns: minmax(0, 1fr) 128px auto; gap: 10px; align-items: end; max-width: 860px; }
.finder label { display: block; font: 600 14px/1.2 var(--sans); margin-bottom: 6px; }
.finder .f { position: relative; min-width: 0; }
.finder input { width: 100%; font: 500 18px/1.2 var(--sans); padding: 14px 14px; border: 2.5px solid var(--fg); border-radius: 10px; background: var(--card); color: var(--fg); }
.finder input::placeholder { color: var(--mut); opacity: .8; }
.finder input:focus { outline: 3px solid var(--link); outline-offset: 1px; }
.sugg { list-style: none; margin: 6px 0 0; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); box-shadow: var(--shadow); max-height: 320px; overflow: auto; position: absolute; left: 0; right: 0; z-index: 30; }
.sugg li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 10px; border-radius: 7px; cursor: pointer; }
.sugg li:hover, .sugg li.act { background: var(--bg2); }
.sugg .l { font-weight: 600; } .sugg .p { color: var(--mut); font-size: 14px; white-space: nowrap; }
.status { font-size: 14.5px; color: var(--mut); margin: 6px 0 0; min-height: 0; }
@media (max-width: 640px) { h1 { font-size: clamp(28px, 8vw, 34px); } .deck { font-size: 16.5px; } .hero .stats { order: 6; margin-top: 18px; } .hero .status { order: 5; } .finder { margin-bottom: 4px;} .finder { grid-template-columns: minmax(0, 1fr) 96px; } .finder .go { grid-column: 1 / -1; } .finder .btn { width: 100%; } }

/* stage */
.stagewrap { position: relative; max-width: 1180px; margin: 14px auto 0; padding: 0 16px; }
.stage { position: relative; height: clamp(440px, calc(var(--vh, 1vh) * 76), 800px); margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--map-bg); border: 1px solid var(--line); }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.stage canvas.grabbing { cursor: grabbing; }
.map-tools { position: absolute; top: 12px; right: 12px; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 70%; }
.map-tools .btn.small { background: var(--card); color: var(--fg); border-color: var(--line); }
.stage .legend { position: absolute; left: 12px; top: 12px; display: flex; flex-direction: column; gap: 4px; background: color-mix(in srgb, var(--card) 86%, transparent); padding: 8px 10px; border-radius: 9px; font: 500 13px/1.25 var(--sans); color: var(--mut); border: 1px solid var(--line-soft); max-width: 62%; }
.legend span { display: flex; align-items: center; gap: 8px; }
.legend i { width: 18px; height: 3px; border-radius: 2px; display: inline-block; flex: none; }
.legend i.f { background: var(--f); } .legend i.b { background: var(--b); } .legend i.r { background: var(--r); }
.hint { position: absolute; left: 12px; bottom: 10px; font: 500 13px/1.2 var(--sans); color: var(--mut); background: color-mix(in srgb, var(--card) 80%, transparent); padding: 5px 9px; border-radius: 7px; pointer-events: none; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--mut); font-size: 15px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 14px; box-shadow: var(--shadow); }
.stagewrap .card { position: absolute; left: 28px; bottom: 14px; width: min(410px, calc(100% - 56px)); max-height: calc(100% - 128px); overflow: auto; z-index: 5; }
.card h3 { font: 600 24px/1.15 var(--serif); margin: 0 0 6px; }
.card .sub { margin: 0 0 8px; color: var(--mut); font-size: 14.5px; }
.card p { margin: 8px 0; font-size: 16px; line-height: 1.5; }
.card .k { border-left: 3px solid var(--r); padding-left: 10px; }
.card .k.f { border-color: var(--f); } .card .k.b { border-color: var(--b); }
.card .you { font-weight: 600; }
.card .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.card .num { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.card .num label { font: 600 14px/1.2 var(--sans); } .card .num input { width: 96px; font: 500 16px/1.2 var(--sans); padding: 8px 10px; border: 2px solid var(--fg); border-radius: 8px; background: var(--card); color: var(--fg); }
@media (max-width: 860px) { .stagewrap .card { position: static; width: auto; max-height: none; margin-top: 12px; } .stage { height: clamp(380px, calc(var(--vh, 1vh) * 62), 640px); }
  .stage .legend { top: auto; bottom: 10px; left: 10px; right: 10px; max-width: none; flex-direction: row; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; padding: 6px 9px; }
  .map-tools { top: 10px; right: 10px; max-width: calc(100% - 20px); } .map-tools .btn.small { padding: 6px 9px; } }
.share-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.share-row .lbl { font-size: 13.5px; color: var(--mut); margin-right: 2px; }
.share-row a, .share-row button { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 99px; border: 1px solid var(--line-soft); background: transparent; color: var(--fg); cursor: pointer; padding: 0; }
.share-row svg { width: 19px; height: 19px; }
.share-row a:hover, .share-row button:hover { color: var(--acc); border-color: var(--acc); }
@media (pointer: coarse) { .share-row a, .share-row button { width: 44px; height: 44px; } }
.page-share { max-width: 1180px; margin: 6px auto 0; padding: 0 16px; }

/* reading sections */
.block { padding: 36px 0 6px; }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.wide { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
h2 { font: 620 clamp(26px, 3vw, 34px)/1.15 var(--serif); margin: 0 0 14px; letter-spacing: -.01em; }
h2 { position: relative; }
h2 .anchor { position: absolute; left: -1.05em; color: var(--mut); text-decoration: none; font-weight: 400; opacity: 0; }
h2:hover .anchor, h2 .anchor:focus { opacity: 1; }
.wrap p, .wrap li { max-width: 68ch; }
.rule { margin: 14px 0; padding: 4px 0 4px 18px; border-left: 4px solid var(--f); }
.rule li { margin: 8px 0; }
.fig { margin: 22px 0; }
.fig figcaption { font: 600 14.5px/1.35 var(--sans); margin-bottom: 8px; color: var(--fg); }
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: 112px minmax(0, 1fr) 118px; gap: 12px; align-items: center; font-size: 14.5px; }
.bar .t { background: var(--bg2); border-radius: 5px; height: 22px; position: relative; overflow: hidden; border: 1px solid var(--line-soft); }
.bar .t i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--f); }
.bar .v { font: 600 14.5px/1 var(--mono); }
.bar .n { color: var(--mut); font-size: 13px; white-space: nowrap; }
.twofig { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media (max-width: 820px) { .twofig { grid-template-columns: 1fr; } .bar { grid-template-columns: 92px minmax(0, 1fr) 108px; } }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table.data { border-collapse: collapse; width: 100%; font-size: 15px; min-width: 760px; }
table.data th { text-align: left; font: 600 13px/1.2 var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--mut); padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--bg2); }
table.data td { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.data td.n { font-family: var(--mono); white-space: nowrap; } table.data tr:last-child td { border-bottom: 0; }
table.data tr[data-extra] { display: none; } table.data.open tr[data-extra] { display: table-row; }
.more { margin: 12px 0 0; }
.plain { padding-left: 20px; } .plain li { margin: 8px 0; }
.sources a { overflow-wrap: anywhere; }
footer { margin-top: 56px; padding: 24px 16px 44px; border-top: 1px solid var(--line); display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; font-size: 14.5px; color: var(--mut); }
footer a { color: var(--fg); }

/* reading rail */
.rail { display: none; }
@media (min-width: 1300px) {
  .rail { --col: 1180px; --gut: 1.25rem; display: flex; flex-direction: column; position: fixed; top: 50%; left: calc(50% + var(--col) / 2 + var(--gut)); transform: translateY(-50%); z-index: 40; margin: 0; padding: .4rem 0; max-height: calc(100vh - 7rem); }
  .rail::before { content: ""; position: absolute; left: calc(.875rem - .5px); top: 1.1rem; bottom: 1.1rem; width: 1px; background: var(--line); }
  .rail-dot { position: relative; display: flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.75rem; text-decoration: none; border-radius: 50%; }
  .rail-dot .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mut); box-shadow: 0 0 0 3px var(--bg); transition: transform .2s, background .2s; flex: none; }
  .rail-dot:hover .dot, .rail-dot:focus-visible .dot { background: var(--acc); transform: scale(1.25); }
  .rail-dot[aria-current=true] .dot { background: var(--acc); transform: scale(1.45); }
  .rail-label { position: absolute; left: calc(100% + .15rem); top: 50%; transform: translate(-4px, -50%); max-width: calc(50vw - var(--col) / 2 - var(--gut) - 3.25rem); overflow: hidden; text-overflow: ellipsis; padding: .1rem .2rem; color: var(--mut); font-size: .82rem; font-weight: 600; line-height: 1.3; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; }
  .rail-dot:hover .rail-label, .rail-dot:focus-visible .rail-label { opacity: 1; transform: translate(0, -50%); color: var(--acc); }
}
@media (prefers-reduced-motion: reduce) { .rail .dot, .rail-label { transition: none; } }
@media (forced-colors: active) { .rail::before { background: CanvasText; } .rail-dot .dot { background: CanvasText; box-shadow: none; } .rail-dot[aria-current=true] .dot { background: Highlight; } }
@media print { .topbar, .rail, .share-row, .map-tools { display: none; } }

.note { margin: -8px 0 18px; font-size: 14.5px; color: var(--mut); max-width: 62ch; }
.sidefig svg { width: 100%; max-width: 520px; height: auto; display: block; }
.sidefig .road { fill: var(--bg2); stroke: var(--line); }
.sidefig .dash { stroke: var(--mut); stroke-width: 2; stroke-dasharray: 10 10; fill: none; }
.sidefig .arr { stroke: var(--f); stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.sidefig .odd circle { fill: var(--fg); } .sidefig .odd text { fill: var(--bg); }
.sidefig .even circle { fill: var(--bg); stroke: var(--even); stroke-width: 2.4; } .sidefig .even text { fill: var(--fg); }
.sidefig g text { font: 700 13px var(--mono); text-anchor: middle; }
.sidefig .lab { font: 600 13px var(--sans); fill: var(--mut); text-anchor: start; }
.sidefig .lab.e { text-anchor: end; }

.attrib { position: absolute; right: 10px; bottom: 8px; margin: 0; font: 500 11.5px/1.2 var(--sans); color: var(--mut); background: color-mix(in srgb, var(--card) 78%, transparent); padding: 3px 7px; border-radius: 6px; pointer-events: none; z-index: 2; }
@media (max-width: 860px) { .attrib { bottom: auto; top: 54px; right: 10px; } }
