:root {
  --paper: #f4f6f3;
  --ink: #22313a;
  --ink-soft: #4d5d66;
  --sky-top: #b9d0de;
  --sky-low: #e4edf1;
  --park: #3e6b4f;
  --park-soft: #9fb79f;
  --build: #c8a04a;
  --build-dark: #9d7a2c;
  --shade: #3f4677;
  --line: #c9d1cc;
  --focus: #1b5fa8;
  --measure: 38rem;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Atkinson Hyperlegible", system-ui, sans-serif;
  font-size: 1.125rem;
  line-height: 1.55;
}

a { color: var(--park); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: #fff; padding: 0.5rem 1rem;
}
.skip:focus { left: 1rem; }

.top, main > section, .foot {
  padding-inline: max(1rem, calc((100vw - 72rem) / 2));
}

.top {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1.5rem;
  padding-block: 1rem;
  border-bottom: 1px solid var(--line);
}
.site-name { margin: 0; font-weight: 700; }
.site-note { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }

/* Viewer: the address question and the drawing are the page. */
.viewer { padding-block: 2.5rem 3rem; }

h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  max-width: 14ch;
}
h2 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 0.75rem; }
h3 { font-size: 1.25rem; margin: 2rem 0 0.75rem; }

.lede { max-width: var(--measure); margin: 0 0 1.5rem; }
.section-lede { max-width: var(--measure); color: var(--ink-soft); }

.lookup { position: relative; max-width: 36rem; }
.lookup label { display: block; font-weight: 700; margin-bottom: 0.35rem; }
.lookup-row { display: flex; gap: 0.5rem; }
.lookup input {
  flex: 1; min-width: 0;
  font: inherit; padding: 0.7rem 0.85rem;
  border: 2px solid var(--ink); border-radius: 6px; background: #fff; color: var(--ink);
}
.lookup button, .suggestions button {
  font: inherit; cursor: pointer;
}
.lookup button {
  padding: 0.7rem 1.1rem; border: 2px solid var(--ink); border-radius: 6px;
  background: var(--ink); color: #fff; font-weight: 700; white-space: nowrap;
}
.lookup button:hover { background: var(--park); border-color: var(--park); }
.hint { font-size: 0.9rem; color: var(--ink-soft); margin: 0.5rem 0 0; }
.error { color: #8a2413; font-weight: 700; margin: 0.5rem 0 0; }

.suggestions {
  list-style: none; margin: 0.25rem 0 0; padding: 0;
  position: absolute; left: 0; right: 0; z-index: 1000;
  background: #fff; border: 2px solid var(--ink); border-radius: 6px; overflow: hidden;
}
.suggestions button {
  display: block; width: 100%; text-align: left; padding: 0.6rem 0.85rem;
  border: 0; background: none; color: var(--ink);
}
.suggestions button:hover, .suggestions button:focus-visible { background: var(--sky-low); }

.stage { margin-top: 2.25rem; }
.stage-where { margin: 0 0 0.5rem; font-weight: 700; }

.panorama { margin: 0; }
.panorama svg {
  display: block; width: 100%; height: auto;
  border-radius: 8px; background: var(--sky-low);
}
.panorama figcaption { color: var(--ink-soft); font-size: 0.95rem; margin-top: 0.5rem; max-width: 60rem; }

.controls { display: flex; flex-wrap: wrap; gap: 1rem 2rem; margin-top: 1.25rem; }
.seg { border: 0; padding: 0; margin: 0; }
.seg legend { font-weight: 700; font-size: 0.95rem; margin-bottom: 0.35rem; padding: 0; }
.seg label {
  display: inline-block; position: relative; cursor: pointer;
  padding: 0.4rem 0.8rem; border: 1.5px solid var(--ink);
  margin-right: -1.5px; background: #fff;
}
.seg label:first-of-type { border-radius: 6px 0 0 6px; }
.seg label:last-of-type { border-radius: 0 6px 6px 0; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg label:has(input:checked) { background: var(--ink); color: #fff; }
.seg label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; z-index: 1; }

.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1rem 2rem; margin: 2rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--line);
}
.facts div { margin: 0; }
.facts dt { color: var(--ink-soft); font-size: 0.95rem; }
.facts dd { margin: 0; font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.facts dd small { display: block; font-size: 0.95rem; font-weight: 400; color: var(--ink-soft); }

/* Shadow calendar */
.calendar { padding-block: 3rem; background: #fff; border-block: 1px solid var(--line); }
.cal-wrap { overflow-x: auto; margin-top: 1.25rem; }
.cal { width: 100%; min-width: 40rem; border-collapse: separate; border-spacing: 1px; font-size: 0.85rem; table-layout: fixed; }
.cal thead th:first-child { width: 7.5rem; }
.cal th { font-weight: 400; color: var(--ink-soft); padding: 0 0.4rem 0 0; text-align: right; white-space: nowrap; }
.cal thead th { text-align: left; padding: 0 0 0.25rem; }
.cal td { height: 1.35rem; padding: 0; }
.cal td.sun { background: #f3dd8d; }
.cal td.shade { background: var(--shade); }
.cal td.night { background: #e3e6e8; }
.legend { font-size: 0.95rem; color: var(--ink-soft); display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; }
.key { display: inline-block; width: 1rem; height: 1rem; border-radius: 2px; vertical-align: -0.15em; margin-left: 0.6rem; }
.key:first-child { margin-left: 0; }
.key-shade { background: var(--shade); }
.key-sun { background: #f3dd8d; }
.key-night { background: #e3e6e8; }

/* Plan */
.plan { padding-block: 3rem; }
.plan-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 2rem; align-items: start; }
.plan-text p { max-width: var(--measure); }
.scenarios { margin: 0 0 1rem; }
.scenarios dt { font-weight: 700; margin-top: 0.6rem; }
.scenarios dd { margin: 0; max-width: var(--measure); }
.map { height: 26rem; border-radius: 8px; border: 1px solid var(--line); }
.map-hint { font-size: 0.95rem; color: var(--ink-soft); }

.timeline { list-style: none; padding: 0; margin: 0; max-width: 46rem; border-left: 3px solid var(--park-soft); }
.timeline li { padding: 0 0 0.9rem 1.1rem; position: relative; }
.timeline li::before {
  content: ""; position: absolute; left: -0.5rem; top: 0.45rem;
  width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--park);
}
.timeline b { display: inline-block; min-width: 3.2rem; }

.act, .about { padding-block: 2.5rem; border-top: 1px solid var(--line); }
.actions { padding-left: 1.2rem; max-width: 46rem; }
.actions li { margin-bottom: 0.7rem; }
.about p { max-width: var(--measure); }
.status { font-weight: 700; }

.foot { padding-block: 2rem 3rem; font-size: 0.95rem; color: var(--ink-soft); border-top: 1px solid var(--line); }

@media (max-width: 760px) {
  body { font-size: 1.0625rem; }
  .lookup-row { flex-direction: column; }
  .plan-grid { grid-template-columns: 1fr; }
  .map { height: 20rem; }
  .seg label { padding: 0.4rem 0.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.top { align-items: center; }
.lang {
  order: 3; margin-left: auto;
  font: inherit; font-size: 0.95rem; cursor: pointer;
  padding: 0.3rem 0.75rem; border: 1.5px solid var(--ink); border-radius: 6px;
  background: #fff; color: var(--ink); min-height: 44px;
}
.lang:hover { background: var(--ink); color: #fff; }
.site-note { order: 2; }

/* Looking around */
.panorama-stage {
  position: relative; cursor: grab; border-radius: 8px; overflow: hidden;
  /* one finger up/down scrolls the page; everything else (turn, pinch, two-finger tilt) is ours */
  touch-action: pan-y;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.panorama-stage.dragging { cursor: grabbing; }
.panorama-stage:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.look { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-top: 0.6rem; }
.look button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
  min-height: 2.75rem; min-width: 2.75rem;
  font: inherit; font-size: 0.95rem; cursor: pointer; touch-action: manipulation;
  padding: 0.35rem 0.8rem; border: 1.5px solid var(--ink); border-radius: 6px;
  background: #fff; color: var(--ink);
}
.look button:hover { background: var(--ink); color: #fff; }
.look button:active { background: var(--ink); color: #fff; }
.look .ico {
  display: block; width: 1.1rem; height: 1.1rem; flex: none; background: none; border-radius: 0;
  fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
}
.look-hint { flex-basis: 100%; margin: 0.2rem 0 0; font-size: 0.95rem; color: var(--ink-soft); }
.look-hint-touch { display: none; }
@media (pointer: coarse) {
  .look-hint-pointer { display: none; }
  .look-hint-touch { display: block; }
}
.eye-marker {
  border-radius: 50%; background: #fff; border: 4px solid var(--ink);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.8); cursor: grab;
}

/* 3D view */
.view3d { display: none; position: relative; width: 100%; aspect-ratio: 2 / 1; background: var(--sky-low); }
@media (max-width: 760px) { .view3d { aspect-ratio: 4 / 3; } }
.has-3d .view3d { display: block; }
.has-3d #view { display: none; }
.view3d canvas { display: block; }
.view3d-label {
  position: absolute; white-space: nowrap; pointer-events: none;
  background: rgba(255,255,255,0.88); color: var(--ink); font-weight: 700; font-size: 0.95rem;
  padding: 0.15rem 0.5rem; border-radius: 4px;
}
@media (max-width: 760px) { .view3d-label { white-space: normal; max-width: 70%; font-size: 0.85rem; } }
.when { display: none; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; }
.has-3d .when { display: flex; }
.when label { font-weight: 700; font-size: 0.95rem; }
.when select { font: inherit; padding: 0.35rem 0.5rem; border: 1.5px solid var(--ink); border-radius: 6px; background: #fff; color: var(--ink); }
.when select { min-height: 2.75rem; }
.time-row { display: inline-flex; align-items: center; gap: 0.6rem; }
.when input[type=range] { width: 12rem; min-height: 2.75rem; margin: 0; accent-color: var(--ink); touch-action: pan-y; cursor: pointer; }
.when output { font-weight: 700; min-width: 3.2rem; font-variant-numeric: tabular-nums; }
.seg label { min-height: 2.75rem; display: inline-flex; align-items: center; vertical-align: top; }
.has-3d fieldset.seg:has(input[name=season]) { display: none; }

/* Phones: large targets, no sideways scrolling */
@media (max-width: 760px) {
  .look { display: grid; grid-template-columns: repeat(4, minmax(2.75rem, 1fr)); gap: 0.4rem; }
  .look button { padding: 0.35rem; min-height: 3rem; }
  .look .look-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .look .ico { width: 1.35rem; height: 1.35rem; }
  .look .look-reset { grid-column: 1 / -1; padding-inline: 0.8rem; }
  .look-hint { grid-column: 1 / -1; }

  .controls { flex-direction: column; gap: 1.25rem; }
  .seg { min-width: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
  .seg legend { margin-bottom: 0.4rem; }
  .seg label, .seg label:first-of-type, .seg label:last-of-type {
    flex: 1 1 auto; border-radius: 6px; margin: 0; padding: 0.4rem 0.85rem; justify-content: center;
  }
  .has-3d .when { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.6rem 0.75rem; align-items: center; }
  .when select { width: 100%; min-width: 0; }
  .time-row { display: flex; min-width: 0; }
  .when input[type=range] { flex: 1; width: auto; min-width: 0; }
}
@media (pointer: coarse) {
  /* A bigger, easier thumb for fingers */
  .when input[type=range] { -webkit-appearance: none; appearance: none; height: 2.75rem; background: transparent; }
  .when input[type=range]::-webkit-slider-runnable-track { height: 0.4rem; border-radius: 0.2rem; background: var(--line); }
  .when input[type=range]::-moz-range-track { height: 0.4rem; border-radius: 0.2rem; background: var(--line); }
  .when input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 1.75rem; height: 1.75rem; margin-top: -0.675rem;
    border-radius: 50%; background: var(--ink); border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--ink);
  }
  .when input[type=range]::-moz-range-thumb {
    width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--ink); border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--ink);
  }
}
