:root {
  color-scheme: light;
  --ink: #283a32;
  --muted-ink: #65746a;
  --line: #d4d9ca;
  --paper: #f3f3e8;
  --paper-deep: #e9ebdc;
  --coral: #c96f5c;
  --green: #477155;
  --mono: 'Consolas', 'Courier New', monospace;
  --serif: 'Noto Serif CJK SC', 'Songti SC', 'SimSun', serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--paper); }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { color: inherit; }

.page-shell {
  width: min(100%, 1600px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 4.3%;
  display: flex;
  flex-direction: column;
}

.masthead {
  height: 76px;
  flex: 0 0 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .04em;
}

.ring-mark { width: 24px; height: 24px; position: relative; display: inline-block; }
.ring-mark i { position: absolute; inset: 3px; border: 1px solid var(--coral); border-radius: 50%; }
.ring-mark i:nth-child(2) { inset: 7px; border-color: var(--green); }
.ring-mark i:nth-child(3) { inset: 10px; border: 0; background: var(--coral); }

.masthead-note, .edition { display: flex; align-items: center; gap: 11px; }
.masthead-note { color: var(--muted-ink); }
.masthead-note span:first-child { color: var(--coral); font-family: var(--serif); font-size: 12px; letter-spacing: .12em; }
.note-divider { width: 20px; height: 1px; background: #a8b1a1; }
.edition { color: #7b8479; }
.edition span { color: var(--coral); }

.garden {
  position: relative;
  min-height: 510px;
  height: clamp(510px, 63vh, 710px);
  overflow: hidden;
  isolation: isolate;
  background: #cbdfe0;
}

#gardenCanvas {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
}

.garden-copy {
  position: absolute;
  top: 13%;
  left: 7.1%;
  width: min(34%, 405px);
  pointer-events: none;
}

.eyebrow, .garden-caption, .sky-note, .ground-label, .season-stamp, .control-label,
.timeline-heading, .timeline-ticks, .readout-label, .ring-count, .page-footer {
  font-family: var(--mono);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 22px;
  color: #596f64;
  font-size: 10px;
  letter-spacing: .05em;
}

.eyebrow-dot, .footer-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--coral);
}

h1 {
  margin: 0;
  color: #263a31;
  font-size: clamp(43px, 5.2vw, 76px);
  line-height: 1.21;
  font-weight: 500;
  letter-spacing: .015em;
}

.garden-description {
  margin: 21px 0 0;
  color: #4d6559;
  font-size: 15px;
  line-height: 1.95;
}

.garden-caption {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 30px;
  color: #6d8070;
  font-size: 9px;
  letter-spacing: .07em;
}

.garden-caption span:nth-child(2) { color: var(--coral); }

.sky-note {
  position: absolute;
  top: 14%;
  right: 6.3%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  color: #667d77;
  font-size: 9px;
  letter-spacing: .04em;
}

.sky-note-line { width: 36px; height: 1px; background: #829994; }

.ground-label {
  position: absolute;
  left: 3.2%;
  bottom: 4.3%;
  display: flex;
  gap: 12px;
  align-items: center;
  color: #f1f0dc;
  font-size: 9px;
  letter-spacing: .06em;
}

.ground-label span:first-child { color: #f2d5a7; }

.season-stamp {
  position: absolute;
  right: 4.6%;
  bottom: 5%;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #f6f2dc;
  font-size: 10px;
}

.stamp-symbol { color: #f3cc75; font-size: 16px; }

.workbench {
  display: grid;
  grid-template-columns: minmax(142px, .72fr) minmax(230px, 1.36fr) minmax(190px, 1fr) minmax(246px, 1.2fr);
  gap: clamp(22px, 3.3vw, 56px);
  align-items: center;
  min-height: 152px;
  padding: 25px 1.6% 26px;
  border-bottom: 1px solid var(--line);
}

.age-readout { align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.readout-label, .control-label, .timeline-heading { color: #707b6d; font-size: 9px; letter-spacing: .08em; }
.age-line { display: flex; align-items: baseline; gap: 7px; margin-top: 3px; }
.age-line strong { color: var(--ink); font-family: var(--mono); font-size: 39px; font-weight: 400; line-height: 1; }
.age-line > span { color: #68776a; font-size: 13px; }
.ring-count { display: flex; align-items: center; gap: 7px; margin-top: 9px; color: #758174; font-size: 9px; }
.ring-count-dot { width: 5px; height: 5px; border: 1px solid var(--coral); border-radius: 50%; }

.timeline-control { min-width: 0; }
.timeline-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; }
.timeline-heading label { color: var(--ink); }
.timeline-heading > span { color: #81887d; }
.timeline-heading > span span { color: #b0b7a8; }

input[type="range"] {
  display: block;
  width: 100%;
  height: 18px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: ew-resize;
}

input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: #b8c0ad; }
input[type="range"]::-moz-range-track { height: 2px; background: #b8c0ad; }
input[type="range"]::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -6px;
  appearance: none;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 1px var(--coral);
}
input[type="range"]::-moz-range-thumb { width: 11px; height: 11px; border: 2px solid var(--paper); border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 1px var(--coral); }
input[type="range"]:focus-visible { outline: 2px solid var(--green); outline-offset: 5px; }

.timeline-ticks { display: flex; justify-content: space-between; margin-top: 8px; color: #899184; font-size: 8px; }

.season-switch { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; margin-top: 12px; }
.season-button {
  min-width: 0;
  height: 37px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: #68756a;
  cursor: pointer;
  font-size: 11px;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.season-button:hover { background: #e8e9d9; }
.season-button[aria-pressed="true"] { border-color: #cbd0c0; background: #e9ebde; color: var(--ink); }
.season-glyph { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.spring-glyph { background: #cc806c; }
.summer-glyph { background: #55815c; }
.autumn-glyph { background: #d39852; }
.winter-glyph { background: #8ca9b1; }

.action-row { display: flex; gap: 8px; margin-top: 12px; }
.quiet-button {
  min-width: 0;
  height: 37px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid #cbd1c1;
  border-radius: 2px;
  background: transparent;
  color: #46584d;
  cursor: pointer;
  font-size: 10px;
  white-space: nowrap;
  transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}

.quiet-button:hover { border-color: #99a894; background: #e8eadb; }
.quiet-button:active { transform: translateY(1px); }
.quiet-button:focus-visible, .season-button:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; }
.wind-mark { color: #66849a; font-family: var(--mono); font-size: 18px; line-height: 1; }
.export-mark { color: var(--coral); font-size: 15px; line-height: 1; }

.page-footer {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #7c8577;
  font-size: 8px;
  letter-spacing: .03em;
}

.page-footer p { margin: 0; }
.page-footer p:first-child { display: flex; align-items: center; gap: 8px; }
.footer-dot { width: 5px; height: 5px; background: #78936f; }
.footer-credit { color: #91988b; }
.footer-credit span { color: var(--coral); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 1050px) {
  .page-shell { padding: 0 3.3%; }
  .garden { height: clamp(470px, 60vh, 620px); }
  .workbench { grid-template-columns: minmax(120px, .7fr) minmax(200px, 1.25fr) minmax(176px, 1fr); gap: 25px; }
  .action-control { grid-column: 2 / 4; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 13px; }
  .action-row { margin-top: 0; }
  .workbench { padding-top: 20px; padding-bottom: 20px; }
}

@media (max-width: 680px) {
  .page-shell { padding: 0 18px; }
  .masthead { height: 64px; flex-basis: 64px; }
  .wordmark { flex: 0 0 auto; gap: 8px; white-space: nowrap; font-size: 14px; }
  .masthead-note { display: none; }
  .edition { max-width: 126px; font-size: 8px; line-height: 1.5; text-align: right; }
  .garden { height: 520px; min-height: 470px; margin: 0 -18px; }
  .garden-copy { top: 9%; left: 7%; width: 55%; }
  .eyebrow { margin-bottom: 15px; font-size: 8px; }
  h1 { font-size: clamp(37px, 10vw, 52px); }
  .garden-description { margin-top: 14px; font-size: 13px; }
  .garden-caption { margin-top: 19px; gap: 6px; font-size: 7px; }
  .sky-note { top: 7%; right: 5%; font-size: 7px; }
  .ground-label { left: 5%; bottom: 3%; gap: 7px; font-size: 7px; }
  .season-stamp { right: 5%; bottom: 3.2%; gap: 6px; font-size: 8px; }
  .stamp-symbol { font-size: 13px; }
  .workbench { grid-template-columns: minmax(85px, .7fr) minmax(0, 1.3fr); gap: 21px 17px; padding: 20px 2px; }
  .age-line strong { font-size: 35px; }
  .ring-count { font-size: 8px; }
  .timeline-heading { margin-bottom: 15px; font-size: 8px; }
  .timeline-ticks { font-size: 7px; }
  .season-control { grid-column: 1 / 3; }
  .action-control { grid-column: 1 / 3; align-items: flex-start; flex-direction: column; gap: 10px; padding-top: 15px; }
  .action-row { width: 100%; }
  .quiet-button { flex: 1; padding: 0 8px; }
  .season-switch { margin-top: 8px; }
  .season-button { height: 35px; }
  .page-footer { min-height: 53px; font-size: 7px; }
  .footer-credit { max-width: 110px; text-align: right; line-height: 1.6; }
}

@media (max-width: 380px) {
  .masthead-note { display: none; }
  .garden { height: 485px; }
  .garden-copy { width: 65%; }
  .ground-label span:last-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
