:root { --bg:#f5efe4; --card:#fffaf2; --ink:#2a2119; --dim:#7a6a58; --line:#e3d6c1; --accent:#a0461f; --chip:#efe3cf;
  --tram:#c0392b; --train:#1f6fb2; --metro:#7d3c98; --bus:#e67e22; --mapbg:#e9dfcf; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg:#16120e; --card:#211a14; --ink:#f1e8da; --dim:#b3a28c; --line:#3a2f24; --accent:#e79a5c; --chip:#2c231b; --mapbg:#2a221b; }
}
:root[data-theme="dark"] { --bg:#16120e; --card:#211a14; --ink:#f1e8da; --dim:#b3a28c; --line:#3a2f24; --accent:#e79a5c; --chip:#2c231b; --mapbg:#2a221b; }
* { box-sizing:border-box; }
[hidden] { display:none !important; }
body { margin:0; background:var(--bg); color:var(--ink); font:16px/1.6 system-ui,-apple-system,"Segoe UI",sans-serif; }
a { color:var(--accent); }
.wrap { max-width:1180px; margin:0 auto; padding:36px 16px 64px; }
.back { font-size:14px; font-weight:600; text-decoration:none; }
h1 { font:700 clamp(34px,7vw,58px)/1.05 Georgia,"Times New Roman",serif; margin:14px 0 10px; }
h2 { font:700 clamp(24px,4vw,32px)/1.2 Georgia,"Times New Roman",serif; margin:0 0 8px; }
h3 { font:700 20px/1.25 Georgia,serif; margin:0 0 6px; }
.lead { color:var(--dim); max-width:760px; font-size:18px; margin:0 0 10px; }
.note { font-size:13.5px; color:var(--dim); border-left:3px solid var(--accent); padding:4px 10px; max-width:760px; }
section { margin-top:34px; }
.card { background:var(--card); border:1px solid var(--line); border-radius:16px; padding:22px; }
.muted { color:var(--dim); }

/* year bar */
.yearbar { position:sticky; top:0; z-index:20; background:var(--bg); padding:10px 0; border-bottom:1px solid var(--line);
  display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-top:22px; }
.yearbar .lbl { font-size:13px; color:var(--dim); margin-right:4px; }
.ybtn { font:700 16px/1 Georgia,serif; padding:10px 16px; border-radius:24px; border:1px solid var(--line); background:var(--card);
  color:inherit; cursor:pointer; }
.ybtn[aria-pressed="true"] { background:var(--accent); color:var(--card); border-color:var(--accent); }
.ybtn.y2100 { border-style:dashed; }

/* map */
.mapgrid { display:grid; grid-template-columns:minmax(0,1.6fr) minmax(0,1fr); gap:18px; }
@media (max-width:860px) { .mapgrid { grid-template-columns:1fr; } }
.mapbox { position:relative; background:var(--mapbg); border-radius:14px; overflow:hidden; border:1px solid var(--line); }
.mapbox svg { display:block; width:100%; height:auto; }
.mapbox path.area { stroke:var(--bg); stroke-width:.6; vector-effect:non-scaling-stroke; cursor:pointer; transition:fill .4s; }
.mapbox path.area:hover { stroke:var(--ink); stroke-width:1.6; }
.mapbox .ln { fill:none; stroke-linecap:round; stroke-linejoin:round; vector-effect:non-scaling-stroke; }
.mapbox .ln.new { filter:drop-shadow(0 0 3px #fff); }
.mapbox .stop { fill:#fff; stroke:#0006; vector-effect:non-scaling-stroke; }
.maptools { position:absolute; top:10px; left:10px; display:flex; gap:6px; }
.maptools button { font:600 13px system-ui; padding:6px 10px; border-radius:16px; border:1px solid var(--line); background:var(--card); color:inherit; cursor:pointer; }
.maptools button[aria-pressed="true"] { border-color:var(--accent); color:var(--accent); }
.tip { position:absolute; pointer-events:none; background:var(--card); border:1px solid var(--line); border-radius:10px; padding:8px 10px;
  font-size:13.5px; box-shadow:0 6px 18px #0003; max-width:240px; }
.tip b { font-family:Georgia,serif; font-size:15px; }
.legend { display:flex; gap:2px; margin:10px 0 2px; }
.legend span { flex:1; height:10px; }
.legend-l { display:flex; justify-content:space-between; font-size:12px; color:var(--dim); }
.kinds { display:flex; flex-wrap:wrap; gap:10px; font-size:13px; margin-top:10px; color:var(--dim); }
.kinds i { display:inline-block; width:18px; height:4px; border-radius:2px; vertical-align:middle; margin-right:4px; }
select { font:inherit; padding:8px 10px; border-radius:10px; border:1px solid var(--line); background:var(--card); color:inherit; width:100%; }
.metrics { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:14px; }
.metric { background:var(--chip); border-radius:12px; padding:10px 12px; }
.metric b { display:block; font:700 26px/1.1 Georgia,serif; }
.metric small { color:var(--dim); font-size:12.5px; }
.delta { font-size:13px; font-weight:600; }
.delta.good { color:#3c8d40; } .delta.bad { color:#c0392b; }

/* diary */
.diary-intro { font:400 19px/1.6 Georgia,serif; max-width:820px; }
.diary-intro::before { content:"“"; color:var(--accent); font-size:40px; line-height:0; vertical-align:-14px; margin-right:4px; }
.changes { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,340px),1fr)); gap:14px; margin-top:18px; }
.change { background:var(--card); border:1px solid var(--line); border-radius:14px; overflow:hidden; display:flex; flex-direction:column; }
.change .body { padding:14px 16px 16px; }
.change .tag { display:inline-block; font-size:12px; font-weight:600; padding:2px 9px; border-radius:12px; background:var(--chip); margin-bottom:6px; }
.change p { margin:6px 0 0; font-size:15px; }
.change .facts { font-size:13px; color:var(--dim); margin-top:8px; }
.lesson { margin-top:18px; padding:14px 16px; border-left:4px solid var(--accent); background:var(--chip); border-radius:0 12px 12px 0; }
.lesson b { font-family:Georgia,serif; }

/* compare slider */
.cmp { position:relative; overflow:hidden; background:#000; user-select:none; touch-action:pan-y; }
.cmp img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; display:block; }
.cmp .top { clip-path:inset(0 0 0 50%); }
.cmp .bar { position:absolute; top:0; bottom:0; left:50%; width:3px; background:#fff; box-shadow:0 0 6px #0008; transform:translateX(-1px); }
.cmp .bar::after { content:"‹ ›"; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); background:#fff; color:#222;
  font:700 14px/1 system-ui; padding:8px 7px; border-radius:16px; white-space:nowrap; }
.cmp .lab { position:absolute; top:8px; font:600 12px system-ui; color:#fff; background:#0008; padding:3px 8px; border-radius:10px; }
.cmp .lab.l { left:8px; } .cmp .lab.r { right:8px; }
.cmp input { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:ew-resize; margin:0; }

/* places */
.placegrid { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,180px),1fr)); gap:10px; margin-top:14px; }
.place { border:2px solid transparent; border-radius:12px; padding:0; background:var(--card); cursor:pointer; overflow:hidden; text-align:left;
  color:inherit; font:inherit; box-shadow:0 0 0 1px var(--line); }
.place[aria-pressed="true"] { border-color:var(--accent); }
.place img { width:100%; aspect-ratio:4/3; object-fit:cover; display:block; background:var(--line); }
.place span { display:block; padding:6px 9px 8px; font-size:13.5px; line-height:1.3; }
.place small { color:var(--dim); }
.viewer { margin-top:16px; }
.vchips { display:flex; flex-wrap:wrap; gap:6px; margin:10px 0; }
.vchips button { font:600 14px system-ui; padding:6px 12px; border-radius:16px; border:1px solid var(--line); background:var(--card); color:inherit; cursor:pointer; }
.vchips button[aria-pressed="true"] { background:var(--accent); color:var(--card); border-color:var(--accent); }
.filters { display:flex; flex-wrap:wrap; gap:6px; }
.filters button { font:600 13px system-ui; padding:5px 11px; border-radius:16px; border:1px solid var(--line); background:transparent; color:inherit; cursor:pointer; }
.filters button[aria-pressed="true"] { border-color:var(--accent); color:var(--accent); }
.credit { font-size:12.5px; color:var(--dim); margin-top:6px; }
details { margin-top:8px; font-size:13.5px; color:var(--dim); }

/* chart */
.chart svg { width:100%; height:auto; display:block; }
.chart text { fill:var(--dim); font:12px system-ui; }
.chart .ax { stroke:var(--line); }

/* table */
table { border-collapse:collapse; width:100%; font-size:14px; }
th, td { text-align:left; padding:6px 8px; border-bottom:1px solid var(--line); }
th { color:var(--dim); font-weight:600; }
td.num, th.num { text-align:right; font-variant-numeric:tabular-nums; }
.scroll { overflow-x:auto; }
footer { margin-top:44px; color:var(--dim); font-size:14px; border-top:1px solid var(--line); padding-top:18px; }

/* ------------------------------------------------------------------ skin: linjakartta (transit-map style) */
html:root[data-skin="linjakartta"]:not([data-theme="none"]) { --bg:#f2f0eb; --card:#fbfaf7; --ink:#141414; --dim:#5a5853; --line:#141414;
  --accent:#e30613; --chip:#e9e6df; --mapbg:#e8e5de; --accent2:#0064b4; }
html[data-skin] body { background:var(--bg); }
html[data-skin] h1, html[data-skin] h2, html[data-skin] h3, html[data-skin] .ybtn, html[data-skin] .metric b, html[data-skin] .diary-intro {
  font-family:"Space Grotesk", system-ui, sans-serif; letter-spacing:-.01em; }
html[data-skin] .diary-intro { font-weight:500; }
html[data-skin] .ybtn[aria-pressed="true"] { color:#fff; }
html[data-skin] .lesson { border-left-color:var(--accent2); }
html[data-skin="linjakartta"] .card, html[data-skin="linjakartta"] .change, html[data-skin="linjakartta"] .mapbox, html[data-skin="linjakartta"] .place {
  border:3px solid #141414; border-radius:6px; box-shadow:6px 6px 0 #141414; }
html[data-skin="linjakartta"] h2 { border-left:10px solid var(--accent); padding-left:12px; }
html[data-skin="linjakartta"] .ybtn { border:3px solid #141414; border-radius:6px; }
html[data-skin="linjakartta"] .hero h1, html[data-skin="linjakartta"] .hero .lead { color:#fff; }
html[data-skin="linjakartta"] .hero::after { background:linear-gradient(180deg,#0000 35%,#000c 100%); }
html[data-skin="linjakartta"] .hero { border-bottom:10px solid var(--accent); }

/* hero with the 2100 image */
.hero { position:relative; margin:14px -16px 0; min-height:min(62vh,560px); display:flex; align-items:flex-end; overflow:hidden; border-radius:0 0 20px 20px; }
.hero img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.hero::after { content:""; position:absolute; inset:0; background:linear-gradient(180deg,#0000 30%,var(--bg) 96%); }
.hero .inner { position:relative; z-index:1; padding:0 16px 18px; max-width:860px; }
.hero h1 { margin:0 0 10px; font-size:clamp(40px,8vw,76px); text-shadow:0 2px 24px #0006; }
.hero .lead { color:var(--ink); text-shadow:0 1px 12px #0008; }
@media (min-width:1212px) { .hero { margin:14px calc((1180px - 100vw) / 2) 0; } .hero .inner { margin-left:calc((100vw - 1180px) / 2 + 16px); } }

