/* Little Dew Lane
   Layout concept: one lane that walks down the page, from a painted hero through
   arched windows onto each video. Morning is the light theme, evening the dark theme. */

@font-face {
  font-family: "Caprasimo";
  src: url("/assets/fonts/caprasimo.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("/assets/fonts/figtree.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}

:root {
  /* Morning */
  --bg: #f1f6e8;
  --surface: #fbfcf3;
  --text: #2a3d31;
  --heading: #173d2c;
  --muted: #4c6354;
  --line: #cbdabf;
  --accent: #a83322;
  --accent-text: #fffaf2;
  --accent-hover: #8c2819;
  --sun: #f6c64f;
  --sky-top: #bfe3e2;
  --sky-low: #f7ecc0;
  --hill-far: #a9cc9b;
  --hill-mid: #79aa6c;
  --hill-near: #4c8455;
  --hill-front: #2c6243;
  --band: #2c6243;
  --lane: #f6e9c8;
  --lane-edge: #dcc99c;
  --trunk: #6b4a33;
  --cap: #c8452f;
  --spot: #fff3dd;
  --hare: #f3ecdf;
  --star-opacity: 0;
  --firefly-opacity: 0;
  --moon-shade: 0;

  --display: "Caprasimo", "Cooper Black", Georgia, serif;
  --body: "Figtree", "Segoe UI", system-ui, sans-serif;

  --step--1: 0.9375rem;
  --step-0: 1.125rem;
  --step-1: 1.375rem;
  --step-2: 1.75rem;
  --step-3: clamp(2rem, 1.5rem + 2.2vw, 3rem);
  --step-4: clamp(2.6rem, 1.7rem + 4.4vw, 5rem);

  --page: 72rem;
  --reading: 40rem;
  --gutter-left: max(20px, env(safe-area-inset-left, 0px));
  --gutter-right: max(20px, env(safe-area-inset-right, 0px));
  --arch: 50% 50% 14px 14px / 40% 40% 14px 14px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f2327;
    --surface: #173036;
    --text: #d9e4d6;
    --heading: #f3f1d6;
    --muted: #a9bcb0;
    --line: #2f4c50;
    --accent: #f4b860;
    --accent-text: #15282a;
    --accent-hover: #f8cd86;
    --sun: #f4edc8;
    --sky-top: #14294a;
    --sky-low: #5a4a78;
    --hill-far: #2b4a58;
    --hill-mid: #1f3f46;
    --hill-near: #173437;
    --hill-front: #0f2327;
    --band: #1c3f44;
    --lane: #6f7c8a;
    --lane-edge: #4c5b69;
    --trunk: #1f2c30;
    --cap: #a8483f;
    --spot: #e7d9c4;
    --hare: #cfd3d4;
    --star-opacity: 1;
    --firefly-opacity: 1;
    --moon-shade: 1;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f2327;
  --surface: #173036;
  --text: #d9e4d6;
  --heading: #f3f1d6;
  --muted: #a9bcb0;
  --line: #2f4c50;
  --accent: #f4b860;
  --accent-text: #15282a;
  --accent-hover: #f8cd86;
  --sun: #f4edc8;
  --sky-top: #14294a;
  --sky-low: #5a4a78;
  --hill-far: #2b4a58;
  --hill-mid: #1f3f46;
  --hill-near: #173437;
  --hill-front: #0f2327;
  --band: #1c3f44;
  --lane: #6f7c8a;
  --lane-edge: #4c5b69;
  --trunk: #1f2c30;
  --cap: #a8483f;
  --spot: #e7d9c4;
  --hare: #cfd3d4;
  --star-opacity: 1;
  --firefly-opacity: 1;
  --moon-shade: 1;
  color-scheme: dark;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.6;
  transition: background-color 0.9s ease, color 0.9s ease;
}
img, svg { display: block; max-width: 100%; height: auto; }
h1, h2, h3 {
  margin: 0;
  color: var(--heading);
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.12;
  text-wrap: balance;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
p { margin: 0; }
a { color: inherit; text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -80px; z-index: 30;
  padding: 10px 16px; border-radius: 10px;
  background: var(--surface); color: var(--heading);
}
.skip-link:focus { top: calc(12px + env(safe-area-inset-top, 0px)); }

.wrap {
  width: 100%;
  max-width: calc(var(--page) + 40px);
  margin-inline: auto;
  padding-left: var(--gutter-left);
  padding-right: var(--gutter-right);
}
.band { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.stack { display: grid; gap: 1.1rem; }
.stack > * { min-width: 0; }
.lede { font-size: var(--step-1); line-height: 1.45; max-width: 34em; }
.reading { max-width: var(--reading); }

/* Header */
.site-header { position: relative; z-index: 5; }
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.5rem;
  padding-block: 1rem;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.5rem;
  color: var(--heading); font-family: var(--display); font-size: 1.45rem;
  line-height: 1; text-decoration: none; margin-right: auto;
}
.brand svg { width: 1.05rem; height: auto; }
.brand-drop { fill: var(--accent); }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.1rem; }
.nav a {
  padding: 0.3rem 0.1rem; color: var(--heading); font-size: var(--step--1); font-weight: 600;
  text-decoration: none;
}
.nav a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--accent); }

.time-toggle {
  display: inline-flex; align-items: center; gap: 0.45rem;
  min-height: 40px; padding: 0.3rem 0.85rem 0.3rem 0.5rem;
  border: 1.5px solid var(--heading); border-radius: 999px;
  background: transparent; color: var(--heading);
  font: 600 var(--step--1) var(--body); cursor: pointer;
}
.time-toggle:hover { background: var(--surface); }
.time-toggle svg { width: 1.3rem; height: 1.3rem; }
.toggle-orb { fill: var(--sun); stroke: var(--heading); stroke-width: 1.5; }
.toggle-shade { fill: var(--heading); opacity: var(--moon-shade); }

.home .site-header { background: var(--sky-top); transition: background-color 1.1s ease; }
@media (max-width: 40rem) {
  .brand { order: 1; }
  .time-toggle { order: 2; }
  .nav { order: 3; width: 100%; }
}

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0.7rem 1.5rem;
  border-radius: 999px 999px 999px 8px;
  background: var(--accent); color: var(--accent-text);
  font-weight: 700; text-decoration: none;
  transition: background-color 0.2s ease;
}
.button:hover { background: var(--accent-hover); }
.text-link { color: var(--heading); font-weight: 700; text-decoration-thickness: 2px; text-decoration-color: var(--accent); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem 1.5rem; }

/* Hero */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
}
.hero-sky { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; }
.hero-copy {
  padding-top: clamp(1.5rem, 4vw, 3.5rem);
  padding-bottom: clamp(1.5rem, 3vw, 2rem);
}
.hero-text { display: grid; gap: 1.2rem; max-width: 37rem; }
.hero-text p { font-size: var(--step-1); line-height: 1.42; color: var(--heading); }
.hero-scene {
  width: 100%; margin-top: clamp(-13rem, -15vw, -3rem); position: relative; z-index: -1;
}
.hero-scene svg { width: 100%; height: auto; }

.hero-scene { overflow: hidden; }
@media (max-width: 48rem) {
  .hero-scene { margin-top: -1rem; }
  .hero-scene svg { width: 210%; max-width: none; margin-left: -92%; }
}

.s-top { stop-color: var(--sky-top); }
.s-low { stop-color: var(--sky-low); }
.s-sun { fill: var(--sun); }
.s-far { fill: var(--hill-far); }
.s-mid { fill: var(--hill-mid); }
.s-near { fill: var(--hill-near); }
.s-front { fill: var(--hill-front); }
.s-lane { fill: var(--lane); }
.s-trunk { fill: var(--trunk); }
.s-cap { fill: var(--cap); }
.s-spot { fill: var(--spot); }
.s-hare { fill: var(--hare); }
.s-star { fill: #f8f2d0; opacity: var(--star-opacity); }
.s-dew { fill: var(--sky-top); stroke: var(--spot); stroke-width: 1.5; opacity: 0.9; }
.s-shine { fill: #fff; opacity: 0.85; }
.s-fly { fill: #ffe98a; opacity: var(--firefly-opacity); }
.s-glow { fill: #ffe98a; opacity: calc(var(--firefly-opacity) * 0.22); }
.s-far, .s-mid, .s-near, .s-front, .s-lane, .s-trunk, .s-cap, .s-sun, .s-star, .s-fly, .s-glow {
  transition: fill 1.1s ease, opacity 1.1s ease;
}
.s-top, .s-low { transition: stop-color 1.1s ease; }
@media (prefers-reduced-motion: no-preference) {
  .fly { animation: drift 7s ease-in-out infinite alternate; }
  .fly:nth-of-type(2) { animation-duration: 9s; animation-delay: -3s; }
  .fly:nth-of-type(3) { animation-duration: 6s; animation-delay: -5s; }
  .fly:nth-of-type(4) { animation-duration: 11s; animation-delay: -2s; }
  .fly:nth-of-type(5) { animation-duration: 8s; animation-delay: -6s; }
  @keyframes drift {
    from { transform: translate(-14px, 10px); }
    to { transform: translate(18px, -16px); }
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Compare: what stays on the lane and what does not */
.promise { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
.ledger { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 2rem 3rem; }
.ledger h3 { font-size: var(--step-1); padding-bottom: 0.6rem; border-bottom: 2px solid var(--line); }
.ledger ul { list-style: none; margin: 0; padding: 0; }
.ledger li { padding-block: 0.7rem; border-bottom: 1px solid var(--line); }

/* Video windows */
.walks {
  position: relative; list-style: none; margin: 0; padding: 0;
  display: grid; gap: 2.25rem 1.75rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15.5rem), 1fr));
}
.walk { min-width: 0; display: grid; gap: 0.5rem; align-content: start; }
.walk-link { display: grid; gap: 0.8rem; text-decoration: none; }
.walk-frame {
  display: block; overflow: hidden; aspect-ratio: 16 / 9; border-radius: var(--arch);
  background: var(--surface); border: 5px solid var(--surface);
  box-shadow: 0 0 0 2px var(--line);
  transition: box-shadow 0.2s ease;
}
.walk-frame img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.walk-title { color: var(--heading); font-family: var(--display); font-size: var(--step-1); line-height: 1.2; }
.walk-link:hover .walk-frame { box-shadow: 0 0 0 3px var(--accent); }
.walk-link:hover .walk-title { text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--accent); }
.walk-about { color: var(--muted); font-size: var(--step--1); }
.lane-row { position: relative; }
.section-head {
  display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between;
  gap: 0.75rem 2rem; margin-bottom: 2.25rem;
}
@media (min-width: 62rem) {
  .walks--lane { grid-template-columns: repeat(4, minmax(0, 1fr)); padding-bottom: 3rem; }
  .walks--lane .walk:nth-child(even) { transform: translateY(3rem); }
}
.lane-section { position: relative; isolation: isolate; }

/* Friends */
.friends { background: var(--surface); }
.friends-grid { display: grid; gap: 2.5rem; align-items: center; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); }
.friends-art { max-width: 26rem; justify-self: center; width: 100%; border-radius: var(--arch); background: var(--sky-top); }
.friends-grid > * { min-width: 0; }

/* Parents note */
.note { background: var(--band); }
.note .wrap { display: grid; gap: 1.4rem; }
.note h2, .note p { color: #f6f6e4; }
.note p { max-width: 36em; }
.note .button { background: #f6c64f; color: #173d2c; }
.note .button:hover { background: #ffd978; }
.note .actions { justify-self: start; }

/* Inner pages */
.page-head { padding-block: clamp(2rem, 6vw, 4rem) clamp(1.5rem, 4vw, 2.5rem); }
.page-head .stack { max-width: 44rem; }
.page-body { padding-bottom: clamp(3.5rem, 8vw, 6rem); }
.prose { max-width: var(--reading); display: grid; gap: 1rem; }
.prose > * { min-width: 0; }
.prose h2 { font-size: var(--step-2); margin-top: 1.5rem; }
.prose ul { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.5rem; }
.prose a { font-weight: 600; text-decoration-color: var(--accent); }
.updated { color: var(--muted); font-size: var(--step--1); }

.facts { margin: 0; display: grid; }
.facts > div {
  display: grid; gap: 0.15rem 2rem; padding-block: 1.1rem; border-top: 1px solid var(--line);
  grid-template-columns: minmax(0, 1fr);
}
.facts > div:last-child { border-bottom: 1px solid var(--line); }
.facts dt { color: var(--heading); font-family: var(--display); font-size: var(--step-1); line-height: 1.25; }
.facts dd { margin: 0; }
@media (min-width: 44rem) {
  .facts > div { grid-template-columns: 11rem minmax(0, 1fr); }
}

.faq { display: grid; max-width: var(--reading); }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  padding-block: 1rem; color: var(--heading); font-weight: 700; cursor: pointer;
}
.faq details p { padding-bottom: 1.1rem; }

.mail {
  display: grid; gap: 0.75rem; max-width: var(--reading); padding: clamp(1.25rem, 4vw, 2rem);
  border-radius: 14px 44px 14px 14px; background: var(--surface);
}
.mail-address { color: var(--heading); font-family: var(--display); font-size: var(--step-2); line-height: 1.2; overflow-wrap: anywhere; text-decoration-color: var(--accent); }

.lost { text-align: left; }

/* Footer */
.site-footer { background: var(--band); color: #e9eeda; }
.footer-hill { display: block; width: 100%; height: clamp(2.5rem, 6vw, 4.5rem); background: var(--bg); }
.footer-hill path { fill: var(--band); transition: fill 1.1s ease; }
.site-footer .wrap { display: grid; gap: 1.4rem; padding-block: 1.25rem 2.25rem; }
.footer-top { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; align-items: baseline; justify-content: space-between; }
.footer-name { color: #fbfaf0; font-family: var(--display); font-size: var(--step-1); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; }
.footer-nav a { color: #f4f4e2; font-size: var(--step--1); }
.footer-small { font-size: var(--step--1); max-width: 44em; }
