:root {
  color-scheme: light;
  --ink: #202a25;
  --muted: #66716a;
  --paper: #edf0e9;
  --surface: #f8f8f2;
  --line: #c9d0c6;
  --green: #4f8056;
  --gold: #d8ad42;
  --red: #ad5147;
  --russet: #87513b;
  --evergreen: #214b38;
  --bare: #82796c;
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 0;
  background: var(--paper);
}

.masthead {
  min-height: 58px;
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  align-items: center;
  padding: 0 clamp(18px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 1.2px;
}

.wordmark { color: var(--evergreen); font-weight: 800; text-decoration: none; }
.masthead-note { color: var(--muted); text-align: center; }
.masthead-region { text-align: right; font-weight: 700; }

main { max-width: 1480px; margin: 0 auto; padding: 42px clamp(18px, 5vw, 76px) 30px; }
.intro { max-width: 720px; margin: 0 0 32px; animation: enter 500ms ease-out both; }
.eyebrow { margin: 0 0 8px; color: var(--evergreen); font-size: 11px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; }
h1, h2 { margin: 0; font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif; font-weight: 500; letter-spacing: 0; }
h1 { font-size: 42px; line-height: 1.08; }
.intro-copy { max-width: 580px; margin: 12px 0 0; color: #505b54; font-size: 15px; line-height: 1.6; }

.experience {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 280px);
  grid-template-areas: "map tree" "map controls";
  gap: 24px clamp(24px, 4vw, 64px);
  align-items: center;
}
.map-column { min-width: 0; grid-area: map; }
.map-heading { display: flex; justify-content: space-between; align-items: end; border-top: 1px solid var(--line); padding: 15px 0 10px; }
.map-heading .eyebrow { margin-bottom: 3px; }
h2 { font-size: 25px; }
.map-index { padding-bottom: 3px; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.map-figure { position: relative; margin: 0; overflow: hidden; background: #e2e5dc; aspect-ratio: 1.28 / 1; }
.map-figure img, .map-figure video { display: block; width: 100%; height: 100%; object-fit: contain; }
.map-figure [hidden] { display: none; }
.map-figure img { opacity: 0; }
.map-figure img.loaded { opacity: 1; }
.map-figure figcaption { position: absolute; left: 12px; bottom: 10px; color: var(--muted); font-size: 11px; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 18px; padding: 13px 0 0; color: #39453d; font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.swatch { width: 11px; height: 11px; display: inline-block; border-radius: 50%; }
.swatch.green { background: var(--green); } .swatch.gold { background: var(--gold); }
.swatch.red { background: var(--red); } .swatch.russet { background: var(--russet); }
.swatch.evergreen { background: var(--evergreen); } .swatch.bare { background: var(--bare); }

.tree-panel { min-width: 0; grid-area: tree; align-self: end; padding-top: 15px; border-top: 1px solid var(--line); }
.tree-heading { display: flex; justify-content: space-between; align-items: end; gap: 8px; }
.tree-heading .eyebrow { margin-bottom: 3px; }
.tree-heading h2 { font-size: 22px; }
.tree-count { padding-bottom: 3px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
#tree-canvas { display: block; width: 100%; height: auto; margin-top: 8px; background: #e7ebe2; }
.tree-caption { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }

.controls { grid-area: controls; align-self: start; padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); animation: enter 600ms 100ms ease-out both; }
.season-range { display: flex; justify-content: space-between; margin: 25px 0 11px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; height: 24px; margin: 0; accent-color: var(--red); cursor: pointer; }
input[type="range"]:disabled { cursor: progress; }
.transport { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 7px; margin-top: 17px; }
.transport button { min-height: 40px; padding: 7px 8px; border: 1px solid #9da99f; background: transparent; color: var(--ink); font: inherit; font-size: 12px; cursor: pointer; }
.transport button:hover:not(:disabled) { background: #dce4da; }
.transport button:focus-visible, input:focus-visible { outline: 3px solid #b14f3e; outline-offset: 3px; }
.transport button:disabled { color: #8a938b; cursor: not-allowed; }
#play { border-color: var(--evergreen); background: var(--evergreen); color: white; font-weight: 700; }
#play:hover:not(:disabled) { background: #173c2c; }
.model-note { margin: 24px 0 22px; color: #535f57; font-size: 13px; line-height: 1.55; }
.source-line { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.source-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
footer { display: flex; justify-content: space-between; gap: 18px; max-width: 1480px; margin: 24px auto 0; padding: 15px clamp(18px, 5vw, 76px) 25px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@keyframes enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 760px) {
  .masthead { grid-template-columns: 1fr 1fr; min-height: 52px; }
  .masthead-note { display: none; }
  main { padding-top: 30px; }
  h1 { font-size: 35px; }
  .experience {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "map" "tree" "controls";
    gap: 22px;
  }
  .map-figure { aspect-ratio: 1 / 1; }
  .tree-panel { order: 2; }
  .controls { order: 3; }
  #tree-canvas { max-height: 320px; }
  .controls { padding: 17px 0; }
  .season-range { margin-top: 16px; }
  .model-note { margin: 16px 0; }
  footer { flex-direction: column; gap: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}