/* haze - visual system. Knots-derived tokens, own identity:
   dusty smog paper, ink, one smog-amber accent. */

:root {
  --ink: #241f19;
  --muted: #6b6357;
  --paper: #f1ebdd;
  --stage: #e8e0cd;
  --panel: #fdf9ec;
  --line: #241f1922;
  --accent: #b45309;
  --accent-soft: #b4530926;
  --radius: 14px;
  --shadow: 0 14px 34px -18px #2e241759;
  --shadow-soft: 0 1px 2px #2e241714, 0 6px 18px -8px #2e241738;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: ui-serif, "Iowan Old Style", Georgia, serif;
}
:root[data-theme="dark"] {
  --ink: #ece7db;
  --muted: #a39a8a;
  --paper: #16130e;
  --stage: #201c14;
  --panel: #26221a;
  --line: #ece7db24;
  --accent: #e8a257;
  --accent-soft: #e8a25729;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding: 0 max(16px, env(safe-area-inset-right, 0px)) 32px max(16px, env(safe-area-inset-left, 0px));
}
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } html { scroll-behavior: auto; } }

.icon { fill: none; stroke: currentColor; stroke-width: 1.8px; stroke-linecap: round; stroke-linejoin: round; width: 20px; height: 20px; }

/* Header: wordmark and theme toggle only. */
.site-head { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto; padding-block: 20px; font-size: 14px; }
.mark { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 18px; letter-spacing: 0; }
.theme-toggle { position: relative; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: none; overflow: hidden; transition: border-color .15s; }
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle .sun, .theme-toggle .moon { position: absolute; inset: 0; margin: auto; transition: transform 1.1s cubic-bezier(.34,1.2,.64,1), opacity .7s; }
.theme-toggle .sun { color: #e0a21b; }
.theme-toggle .moon { opacity: 0; transform: translateY(150%) rotate(-60deg); }
html[data-theme="dark"] .theme-toggle .sun { opacity: 0; transform: translateY(150%) rotate(90deg); }
html[data-theme="dark"] .theme-toggle .moon { opacity: 1; transform: none; }

.page { max-width: 1200px; margin: 0 auto; }

/* Promise block: one sentence, one sub, one honest line. */
.hero { display: grid; gap: 14px; margin: 6px 0 clamp(24px, 4vw, 44px); max-width: 46em; }
.hero h1 { margin: 0; font-family: var(--serif); font-size: clamp(1.9rem, 4.2vw, 3.2rem); font-weight: 600; line-height: 1.06; letter-spacing: -0.02em; text-wrap: balance; }
.hero .sub { margin: 0; font-size: clamp(1rem, 1.6vw, 1.15rem); color: var(--muted); max-width: 42em; text-wrap: pretty; }
.hero .how { margin: 0; font-size: 13.5px; color: var(--muted); }

/* Stage: the map is the hero. */
.stage { position: relative; background: var(--stage); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.map-wrap { position: relative; height: clamp(380px, 58vh, 620px); }
#map { position: absolute; inset: 0; background: var(--stage); }
.leaflet-tile-pane { filter: sepia(.34) saturate(.78) hue-rotate(-12deg) brightness(.97); }
html[data-theme="dark"] .leaflet-tile-pane { filter: sepia(.3) saturate(.7) hue-rotate(-10deg) brightness(.82) contrast(1.02); }
.leaflet-container { font: inherit; }
.leaflet-control-attribution { background: var(--panel) !important; color: var(--muted); font-size: 10px; border-radius: 8px 0 0 0; padding: 1px 6px; }
.leaflet-control-attribution a { color: var(--muted); }

/* Gesture hint inside the stage. */
.hint { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 500; background: var(--panel); color: var(--muted); font-size: 12.5px; padding: 6px 12px; border-radius: 999px; box-shadow: var(--shadow-soft); pointer-events: none; transition: opacity .5s; white-space: nowrap; max-width: calc(100% - 24px); }
@media (max-width: 560px) { .hint { white-space: normal; text-align: center; border-radius: 12px; } }
.hint.gone { opacity: 0; }

/* Caption card inside the stage: one sentence at a time. */
.caption { position: absolute; left: 14px; bottom: 14px; z-index: 500; max-width: min(460px, calc(100% - 28px)); background: var(--panel); border-radius: 12px; box-shadow: var(--shadow-soft); padding: 10px 14px; pointer-events: none; }
.caption .step-sentence { margin: 0; font-size: 14.5px; line-height: 1.45; text-wrap: pretty; }
.caption .micro { margin: 4px 0 0; font-size: 11.5px; color: var(--muted); }

/* Poster cover until the first frame draws. */
.poster { position: absolute; inset: 0; z-index: 600; background: var(--stage); display: grid; place-content: center; gap: 8px; text-align: center; transition: opacity .45s; }
.poster.gone { opacity: 0; pointer-events: none; }
.poster .p-mark { font-family: var(--serif); font-style: italic; font-size: 30px; }
.poster .p-sub { font-size: 13px; color: var(--muted); }

/* Stage overlays driven by the timeline. */
.fx { position: absolute; z-index: 500; pointer-events: none; opacity: 0; transition: opacity .2s linear; }
.counter-card { top: 14px; right: 14px; background: var(--panel); border-radius: 12px; box-shadow: var(--shadow-soft); padding: 12px 16px; text-align: right; }
.counter-card .big { font-size: 40px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.counter-card .lbl { font-size: 11.5px; color: var(--muted); margin-top: 4px; max-width: 180px; }
.dots { display: grid; grid-template-columns: repeat(8, 9px); gap: 4px; margin-top: 8px; justify-content: end; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--accent); }
.readout { top: 14px; left: 14px; background: var(--panel); border-radius: 12px; box-shadow: var(--shadow-soft); padding: 10px 14px; font-variant-numeric: tabular-nums; }
.readout .row { display: flex; justify-content: space-between; gap: 14px; font-size: 13px; }
.readout .row b { font-weight: 650; }
.readout .row .k { color: var(--muted); }
.epilogue-card { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(480px, calc(100% - 32px)); background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.epilogue-card p { margin: 0 0 8px; font-size: 14.5px; }
.epilogue-card p:last-child { margin-bottom: 0; }
.epilogue-card .quiet { color: var(--muted); font-size: 13px; }

/* Map markers. */
.aq-dot { display: grid; place-content: center; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: var(--c, #999); color: #fff; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 2px #fff9, 0 2px 8px #0003; transition: background .3s; }
.aq-dot.measured { box-shadow: 0 0 0 2px var(--accent), 0 2px 8px #0004; }
.city-tag { display: inline-block; background: var(--panel); color: var(--ink); border-radius: 8px; box-shadow: var(--shadow-soft); padding: 2px 8px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.city-tag.above { transform: translate(-50%, -175%); }
.city-tag.side { transform: translate(24px, -50%); }
.fire-dot { display: block; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #f6c453, var(--accent) 70%); box-shadow: 0 0 6px #b4530988; }
.haze-veil { position: absolute; inset: 0; z-index: 400; pointer-events: none; background: radial-gradient(120% 90% at 50% 40%, #c9a86a00 30%, #c9a86a55 65%, #b08a4a99 100%); opacity: 0; transition: opacity .3s linear; }
html[data-theme="dark"] .haze-veil { background: radial-gradient(120% 90% at 50% 40%, #6b5a3800 30%, #6b5a3855 65%, #54441f99 100%); }
.wind-arrow { stroke: var(--accent); stroke-width: 2.5; fill: none; stroke-dasharray: 7 8; opacity: .85; animation: windflow 1.2s linear infinite; }
@keyframes windflow { to { stroke-dashoffset: -15; } }
.name-tag { display: inline-block; background: var(--panel); color: var(--ink); border-radius: 8px; box-shadow: var(--shadow-soft); padding: 3px 9px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.name-tag .alt { display: block; font-weight: 400; font-size: 11px; color: var(--muted); }
.date-chip { background: var(--panel); border-radius: 7px; padding: 1px 7px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.place-tag { font-size: 11.5px; color: var(--muted); background: var(--panel); border-radius: 6px; padding: 1px 6px; white-space: nowrap; }

/* Dock: the timeline controls. */
.dock { display: grid; gap: 10px; padding: 14px 16px 16px; }
.rail-row { display: flex; align-items: center; gap: 12px; }
.play-btn { flex: none; width: 46px; height: 46px; border: none; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-content: center; box-shadow: var(--shadow-soft); transition: transform .12s; }
.play-btn:hover { transform: scale(1.06); }
.play-btn svg { fill: currentColor; stroke: none; width: 22px; height: 22px; }
.rail { position: relative; flex: 1; height: 44px; display: flex; align-items: center; }
.rail-track { position: absolute; left: 0; right: 0; height: 4px; border-radius: 2px; background: var(--line); }
.played { position: absolute; left: 0; height: 4px; border-radius: 2px; background: var(--accent); }
.ticks { position: absolute; left: 0; right: 0; top: 0; bottom: 0; margin: 0; padding: 0; list-style: none; z-index: 3; pointer-events: none; }
.ticks li { position: absolute; top: 0; bottom: 0; width: 0; }
.ticks button { pointer-events: auto; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 44px; height: 44px; border: none; border-radius: 50%; background: transparent; display: grid; place-content: center; }
.ticks button::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.ticks button:hover::after, .ticks button:focus-visible::after { transform: scale(1.4); background: var(--accent); }
.ticks button[aria-current="step"]::after { background: var(--accent); transform: scale(1.5); }
.scrub { position: absolute; left: 0; right: 0; top: 0; bottom: 0; width: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 2; }
.meta-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.meta-left, .meta-right { display: flex; align-items: center; gap: 10px; }
.clock, .step-num { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.speeds { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.speeds label { padding: 4px 10px; min-height: 44px; display: inline-flex; align-items: center; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.speeds input { position: absolute; opacity: 0; pointer-events: none; }
.speeds label:has(input:checked) { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.pill-btn { border: 1px solid var(--line); background: none; border-radius: 999px; padding: 4px 12px; min-height: 44px; font-size: 12.5px; color: var(--muted); }
.pill-btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 650; }
.pill-btn:hover, .speeds label:hover { color: var(--accent); }
.step-sentence-dock { margin: 0; font-size: 14px; color: var(--ink); min-height: 1.5em; }

@media (max-width: 560px) {
  .clock, .speeds { display: none; }
  .map-wrap { height: 66vh; }
  .counter-card .big { font-size: 30px; }
}

/* Sections after the experience. */
.sections { max-width: 1200px; margin: clamp(28px, 5vw, 52px) auto 0; display: grid; gap: clamp(22px, 3.4vw, 36px); }
.sections section { max-width: 46em; }
.sections h2 { margin: 0 0 8px; font-family: var(--serif); font-weight: 600; font-size: 1.25rem; }
.sections p { margin: 0 0 8px; font-size: 15px; }
.sections ul { margin: 0; padding-left: 1.1em; font-size: 15px; }
.sections li { margin-bottom: 6px; }
.quiet { color: var(--muted); }
.step-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-width: none; }
.step-list button { display: flex; gap: 12px; width: 100%; text-align: left; background: none; border: none; border-radius: 10px; padding: 8px 10px; font-size: 14.5px; color: var(--muted); transition: background .15s, color .15s; }
.step-list button:hover { background: var(--accent-soft); }
.step-list button.current { color: var(--ink); background: var(--accent-soft); }
.step-list .n { flex: none; width: 22px; font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 650; }
.site-foot { max-width: 1200px; margin: 40px auto 0; font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
/* Visual-first story budget: one short line; original prose on demand. */
.mark{margin:0;font-size:24px;line-height:1.2}
.site-head{padding-block:12px}
.map-wrap{height:clamp(380px,calc(100dvh - 236px),740px)}
.story-line{display:flex;gap:12px;align-items:center;justify-content:space-between;min-height:44px}
.story-line .step-sentence-dock{flex:1;font-size:15px;line-height:1.45;min-height:0}
.story-line #detailToggle{flex:none}
.step-details{border-top:1px solid var(--line);padding-top:12px;max-width:46em;font-size:15px;line-height:1.6}
.step-details p{margin:0 0 10px}
[hidden]{display:none!important}
.story-notes{margin:16px 0 0;font-size:15px;max-width:52em}
.story-notes>summary{cursor:pointer;min-height:44px;display:list-item;padding:10px 0;color:var(--muted)}
.story-notes .hero{margin:20px 0;gap:12px}
.story-notes .hero h2{font:600 1.5rem/1.2 var(--serif);margin:0}
.story-notes :is(.story-disclaimer,.story-epilogue){position:static;opacity:1!important;pointer-events:auto;margin:20px 0;padding:0;background:none;box-shadow:none;width:auto;transform:none;font-size:15px}
.story-disclaimer .micro{font-size:15px;color:var(--muted)}
.story-notes .sections{margin-top:24px}
.site-foot{margin-top:14px;font-size:14px}
.name-tag .alt,.date-chip{display:none}
.counter-card .lbl,.place-tag,.name-tag,.readout .row,.clock,.step-num,.speeds label,.pill-btn{font-size:14px}
.leaflet-control-attribution{font-size:14px;line-height:1.4;background:var(--paper)!important;color:var(--ink);max-width:100%;padding:2px 6px}
.leaflet-control-attribution a{color:inherit}
:root{--panel:#fffdf6;--muted:#574f44}
:root[data-theme=dark]{--panel:#26221a;--muted:#c4bbab}
.story-notes .hero .how{font-size:14px}
@media(max-width:560px){.map-wrap{height:calc(100dvh - 262px);min-height:380px}.dock{padding:10px 12px;gap:8px}.story-line{align-items:flex-start}.story-line #detailToggle{margin-top:0}.story-line .step-sentence-dock{padding-top:9px}.counter-card .lbl{max-width:150px}.place-tag{white-space:normal;display:block;max-width:150px}}
.story-notes :is(.quiet,.how,.p-sub){font-size:14px}
.poster .p-sub{font-size:14px}
.pill-btn:hover,.speeds label:hover{color:var(--ink)}
.speeds label:has(input:checked),.pill-btn[aria-pressed=true]{color:var(--ink)}
