:root {
  --cream: #f4f8ef;
  --cream-deep: #e7f6ea;
  --sky: #d4f3fb;
  --ink: #0e3f24;
  --green: #025e2d;
  --leaf: #7fbf18;
  --bark: #5c3d22;
  --gold: #e2b423;
  --muted: #3d624c;
  --line: rgba(2, 94, 45, 0.22);
  --serif: "Fraunces", "Iowan Old Style", Palatino, "Palatino Linotype", serif;
  --text: "Literata", "Iowan Old Style", Palatino, Georgia, serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: clip; }

body {
  margin: 0;
  background: linear-gradient(180deg, var(--sky) 0%, var(--cream) 22rem);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.125rem;
  line-height: 1.55;
  font-optical-sizing: auto;
}

a { color: inherit; }

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--green);
  color: var(--cream);
  padding: 0.5rem 0.8rem;
}

.skip:focus { top: 1rem; }

.wrap {
  width: min(1120px, calc(100% - 2.5rem));
  margin: 0 auto;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0 0.5rem;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 560;
  letter-spacing: -0.02em;
}

.wordmark svg { width: 2rem; height: 2rem; display: block; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.nav-try {
  font-family: var(--serif);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.1rem;
}

.nav-try:hover,
.nav-try[aria-current="page"] { border-bottom-color: var(--green); }

.banner {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100vw;
  margin: 0.6rem 0 0 calc(50% - 50vw);
  line-height: 0;
  overflow: hidden;
  background: linear-gradient(#4dc4ec 0%, #6ad1ef 12%, #6ad1ef 100%);
}

.banner-wings {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

@media (orientation: landscape) {
  .banner-wings::before {
    content: "";
    position: absolute;
    left: -8%;
    width: 116%;
    top: -18%;
    height: 146%;
    background: url("/images/hero-wings.jpg") center bottom / cover no-repeat;
    filter: blur(22px);
    transform: scale(1.1);
  }
}

.banner-frame {
  position: relative;
  z-index: 1;
  width: 1024px;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.banner-photo {
  width: 1024px;
  max-width: 100%;
  height: auto;
  display: block;
}

.grow-tree {
  position: absolute;
  right: 8%;
  bottom: 0;
  height: 100%;
  width: auto;
  aspect-ratio: 520 / 400;
  z-index: 2;
  display: block;
  pointer-events: auto;
  cursor: pointer;
}

.tree-animate-wrap {
  position: absolute;
  right: 0.75rem;
  bottom: 0.65rem;
  z-index: 3;
  margin: 0;
  line-height: 0;
}

.tree-animate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(14, 32, 22, 0.55);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(4px);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
}

/* Author display:flex would otherwise override the hidden attribute. */
.tree-animate-btn[hidden] {
  display: none !important;
}

.tree-animate-btn:hover {
  background: rgba(14, 32, 22, 0.72);
}

.tree-animate-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.tree-animate-icon {
  width: 0.85rem;
  height: 0.85rem;
  margin-left: 0.1rem; /* optical center for play triangle */
  fill: currentColor;
  display: block;
}

.intro { padding: 3.2rem 0 4.2rem; }

.kicker {
  margin: 0 0 0.8rem;
  color: var(--gold);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 560;
  font-size: clamp(3.2rem, 7vw, 5.4rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
}

.lead {
  max-width: 38rem;
  margin: 1.4rem 0 0;
  font-size: 1.25rem;
  color: var(--muted);
}

.button {
  display: inline-block;
  margin-top: 2rem;
  background: var(--green);
  color: var(--cream);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.35rem;
  padding: 0.9rem 1.6rem;
  border-radius: 999px;
}

.button:hover { background: #014824; }

.button:focus-visible,
.nav-try:focus-visible,
.wordmark:focus-visible {
  outline: 2px solid var(--bark);
  outline-offset: 3px;
}

.band {
  border-top: 1px solid var(--line);
  padding: 4.5rem 0;
}

h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 560;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  max-width: 16ch;
}

.band p { max-width: 40rem; color: var(--muted); }

.map {
  margin-top: 2.2rem;
  display: grid;
  gap: 1rem;
}

/* .map { display:grid } would otherwise override the hidden attribute. */
#demo-chooser[hidden],
#demo-mount[hidden] {
  display: none !important;
}

.topic {
  font-family: var(--serif);
  font-size: 1.4rem;
  margin: 0;
}

.pair {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.8rem 1.2rem;
  padding-left: 1.2rem;
  border-left: 2px solid var(--leaf);
}

.pair span {
  font-family: var(--serif);
  font-size: 1.35rem;
  color: var(--green);
}

.pair .vs {
  font-family: var(--text);
  font-size: 0.95rem;
  color: var(--bark);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.closing {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: end;
}

.closing h2 { max-width: 12ch; }

footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.98rem;
}

.try-page {
  padding: 4rem 0 6rem;
  max-width: 40rem;
}

.try-page h1 { font-size: clamp(2.8rem, 6vw, 4.4rem); }

.path {
  font-family: var(--serif);
  color: var(--green);
  font-size: 1.2rem;
}

@media (max-width: 800px) {
  .closing { grid-template-columns: 1fr; }
  .intro { padding-top: 2rem; }
  h1 { font-size: 3rem; }
}

@media (orientation: portrait) {
  .banner { background: linear-gradient(#069fdb 0%, #68d5f6 16%, #68d5f6 100%); }
  .banner-wings { display: none; }
  .banner-frame,
  .banner-photo { width: 682px; }
  .grow-tree {
    right: auto;
    left: 50%;
    bottom: 0;
    height: 58%;
    transform: translateX(-50%);
  }
}

.try-page { max-width: none; padding-top: 2.2rem; }

.demo-only-banner {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid rgba(122, 72, 12, 0.35);
  border-radius: 0.35rem;
  background: rgba(196, 140, 48, 0.14);
  color: #5c3a08;
  font-size: 0.92rem;
  font-weight: 560;
  letter-spacing: 0.02em;
}

.demo-note {
  margin: 2.4rem 0 0;
  max-width: 40rem;
  padding: 1.1rem 0 0;
  border-top: 1px solid var(--line);
}

.demo-note p {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.55;
}

.lead-quiet {
  color: var(--bark);
  font-family: var(--serif);
  font-size: 1.35rem;
  margin: 0.8rem 0 0;
}

.ext-steps,
.ext-bullets {
  margin: 0.8rem 0 0;
  padding-left: 1.25rem;
  max-width: 40rem;
  color: var(--muted);
  line-height: 1.55;
}

.ext-steps li,
.ext-bullets li {
  margin: 0.35rem 0;
}

.ext-steps code,
.ext-bullets code,
.try-page code {
  font-size: 0.92em;
}

.topic-entry, #topic-blurb { color: var(--muted); max-width: 40rem; }

#composer {
  margin-top: 1.6rem;
  display: grid;
  gap: 0.7rem;
  max-width: 44rem;
}

#composer label {
  font-family: var(--serif);
  color: var(--green);
}

#post, #topic-name, #visitor-name {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  padding: 0.75rem 0.9rem;
}

#post:focus, #topic-name:focus, #visitor-name:focus, .slot:focus-visible, .vote:focus-visible, .text-button:focus-visible {
  outline: 2px solid var(--bark);
  outline-offset: 2px;
}

.suggestion, .hint, .status, .notice { max-width: 44rem; }

.hint, .suggestion { color: var(--muted); margin: 0; }

.status { font-family: var(--serif); color: var(--green); min-height: 1.4rem; }

.filing-line {
  font-family: var(--serif);
  font-size: 1.6rem;
  margin: 0.4rem 0 0;
}

.slots, .composer-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }

.slot, .text-button, .vote {
  font: inherit;
  background: transparent;
  color: var(--green);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
}

.slot[aria-pressed="true"], .vote[aria-pressed="true"] {
  background: var(--green);
  color: var(--cream);
  border-color: var(--green);
}

.composer-actions .button { margin-top: 0; border: 0; cursor: pointer; }

.pair-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin-top: 1.4rem;
}

.section {
  border-top: 1px solid var(--line);
  padding: 1.1rem 0 1.3rem;
}

.section.focused { background: rgba(62, 122, 82, 0.08); }

.section h2 {
  font-size: 1.7rem;
  max-width: none;
}

.comment { margin: 1rem 0; }

.byline { margin: 0; font-family: var(--serif); color: var(--bark); }

.placement { margin: 0.15rem 0 0.4rem; color: var(--green); }

.comment-body { white-space: pre-wrap; }

.suggestion-card {
  margin-top: 1.4rem;
  padding-left: 1rem;
  border-left: 2px solid var(--leaf);
}

.notice { color: var(--bark); }

@media (max-width: 800px) {
  .pair-row { grid-template-columns: 1fr; }
}

/* /trees — copy scrolls; hills + horizon forest stay pinned to the bottom */
.trees-body {
  position: relative;
  min-height: 100vh;
  background: linear-gradient(180deg, #4dc4ec 0%, #68d5f6 35%, #d4f3fb 70%, var(--cream) 100%);
}

.trees-bg {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  height: min(52vh, 34rem);
  pointer-events: none;
  background-color: #7ecf6a;
  background-image: url("/images/forest-horizon.jpg");
  background-image: url("/images/forest-horizon.webp");
  background-position: center bottom;
  background-size: cover;
  background-repeat: no-repeat;
}

.trees-wrap {
  position: relative;
  z-index: 2;
  padding-bottom: calc(min(52vh, 34rem) + 1.5rem);
}

.trees-page {
  padding: 1.2rem 0 2rem;
}

.trees-lead {
  max-width: 40rem;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(244, 248, 239, 0.55);
}

.trees-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem 1.2rem;
  margin: 1.2rem 0 1.4rem;
}

.forest-horizon {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  width: 100%;
  margin: 0;
  height: min(48vh, 30rem);
  overflow: visible;
  pointer-events: none;
}

.forest-horizon .forest-tree {
  pointer-events: auto;
}

.forest-tree {
  position: absolute;
  bottom: 0;
  margin: 0;
  transform: translateX(-50%);
  pointer-events: auto;
}

.forest-canvas {
  display: block;
  width: auto;
  height: 100%;
  aspect-ratio: 520 / 400;
  cursor: pointer;
  filter: drop-shadow(0 12px 16px rgba(14, 63, 36, 0.2));
}
