/* Fern & Field / night garden. Core surfaces, field notes, calendar and navigation. */
:root {
  --bg: #101516;
  --sheet: #1c2726;
  --line: #475751;
  --txt: #fff1dc;
  --muted: #c3cfc1;
  --green: #c6e6a5;
  --orange: #f6bd80;
  --ink: #182320;
  --gold: #ffd092;
  --light-line: #728171;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Avenir Next", "Segoe UI", system-ui, sans-serif;
}
body {
  background-color: var(--bg);
  background-image: radial-gradient(ellipse at 95% 3%, #362b3675, transparent 40rem), radial-gradient(ellipse at 5% 20%, #233b3296, transparent 36rem);
  background-repeat: no-repeat;
  color: var(--txt);
  font: 1rem/1.54 var(--sans);
  -webkit-font-smoothing: antialiased;
}
#root > header, #main {
  max-width: 1152px;
  padding-inline: clamp(16px, 3.7vw, 44px);
}
#root > header { min-height: 76px; padding-block: 12px; gap: 14px; }
.brand { gap: 9px; color: #f7ebcf; font: 500 clamp(23px, 3vw, 31px)/1 var(--serif); letter-spacing: -.055em; }
.brand svg { color: var(--orange); width: 36px; height: 36px; }
.brand i { font-weight: 400; color: var(--orange); }
.guide {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-color: #677163;
  background: #1b2725;
  color: #f8e0b9;
  font-weight: 600;
  padding-inline: 15px;
}
.guide:hover { background: #354039; }
h1, h2, h3 { text-wrap: balance; }
h2, .viewtitle { color: #fff0d6; }
h2 { font-family: var(--serif); letter-spacing: -.038em; }
.viewtitle { margin-top: 20px; font: 400 clamp(40px, 6vw, 66px)/1.04 var(--serif); letter-spacing: -.054em; }
.sub { color: var(--muted); max-width: 59ch; }
.eyebrow, .pill { color: var(--orange); letter-spacing: .075em; }
.eyebrow { font-size: .73rem; }
.sectionline { align-items: baseline; }
.sectionline .count, .trail-heading .count { color: #c9d5c8; font-variant-numeric: tabular-nums; }
.panel, .meal, .card {
  background: linear-gradient(145deg,#25312e,#1d2827 74%);
  border-color: var(--line);
  border-radius: 16px;
}
.panel { padding: clamp(16px,2.5vw,27px); margin-block: 20px; }
.panel > p, .card > p { max-width: 71ch; }
.panel strong, .card strong, .meal strong { color: var(--txt); }
.panel .eyebrow + h2 { margin-top: 4px; }
.primary, .check[aria-pressed=true], .meal-picker-actions button:last-child {
  background: var(--gold);
  color: #211e18;
  border-color: var(--gold);
}
.primary, .outline, .linkbtn, .switchbtn, .daytools button, .trail-weeks button { min-height: 44px; }
.primary, .outline, .switchbtn, .meal-swap-trigger { border-radius: 10px; }
.primary { font-weight: 750; }
.primary[aria-pressed=true] { color: #d9f5b3; background: #334936; outline: 1px solid #758a62; }
.outline, .switchbtn, .daytools button { border-color: var(--light-line); background: #1e2c28; }
.linkbtn { color: var(--orange); text-underline-offset: 4px; }
button:disabled { cursor: default; }
:where(select, textarea, input) { font: inherit; }
textarea, input[type=date], input[type=number], .swaplabel select, .daytools select {
  color: var(--txt);
  background-color: #141f1d;
  border: 1px solid #6c7f71;
  min-height: 44px;
}
textarea::placeholder { color: #aeb8ae; }
#field-notes label { color: var(--txt); font-weight: 650; margin-bottom: 8px; }
details:not(.mc-panel):not(.day-basket) > summary { min-height: 44px; align-content: center; font-weight: 650; }
details > summary::marker { color: var(--orange); }
details[open] > summary { color: var(--orange); }
.chapter-art, .session-scene { border-radius: 12px; }
#meals .meal { padding: clamp(12px,2vw,19px); }
.mealhead > .dish-thumb { border-radius: 10px; border: 1px solid #52644d; }
.mealhead h3 { font: 500 clamp(18px,2.2vw,24px)/1.2 var(--serif); color: var(--txt); }
.mealhead .pill { display: block; line-height: 1.3; margin-bottom: 4px; }
.check { width: 44px; height: 44px; color: var(--green); border-color: #819778; border-radius: 50%; }
.check:empty::before { content: "+"; display: block; font-size: 24px; line-height: 1; color: var(--green); }
.meal-swap-trigger { background: #25332c; color: var(--gold); border-color: #6d7b64; }
.meal-dialog { color: var(--txt); background: #182321; border-color: #82917f; }
.meal-option { background: #23332b; }
.meal-option.selected { border-color: var(--gold); }
.meal-option img { aspect-ratio: 1.65; }
.meal-option small { color: var(--gold); font-size: .75rem; }
.day-basket summary, .mc-panel > summary { min-height: 44px; }
.weekgrid { gap: clamp(4px, 1vw, 9px); margin-top: 18px; }
.weekgrid .tile {
  background: #16221f;
  color: var(--txt);
  border: 1px solid #536356;
  border-radius: 10px;
  min-height: 72px;
}
.weekgrid .tile strong { font: 500 1.4rem/1.18 var(--serif); }
.weekgrid .tile.current { border-color: var(--gold); background: #493d2c; color: #ffebc8; }
.weekgrid .tile.done { border-color: #a5c88e; background: #324635; }
.weekgrid .tile.current.done { box-shadow: inset 0 0 0 1px var(--gold); }
.tile span, .week-kind { margin-top: 2px; font-size: .75rem; }
.progressbar { background: #12201d; border: 1px solid #546559; height: 10px; }
.progressbar i { background: linear-gradient(90deg,#839e67,#d4e9a2); }
.stats { border: 0; background: linear-gradient(125deg,#31362c,#292d30); gap: 0; }
.stats div { padding: 0 clamp(8px,1.4vw,18px); border-radius: 0; background: transparent; }
.stats div + div { border-left: 1px solid #5c6356; }
.stats b { color: var(--gold); font: 400 clamp(25px,4vw,40px)/1.12 var(--serif); font-variant-numeric: lining-nums; }
.stats span { color: var(--muted); }
.trail-weeks button { color: var(--muted); border-color: #697864; background: #16221e; }
.trail-weeks [aria-pressed=true] { color: #261f14; background: var(--gold); border-color: var(--gold); }
.trail-heading h2 { margin-bottom: 0; }
.trail-help, .footnote { color: var(--muted); }
.trail-line { pointer-events: none; }
#main { padding-bottom: max(118px,calc(105px + env(safe-area-inset-bottom))); }
#root > nav, .main-dock {
  backdrop-filter: blur(15px);
  background: #101a18f5;
  box-shadow: 0 -8px 32px #0509084d;
  border-top: 1px solid #556354;
}
#nav { display: flex; justify-content: center; gap: clamp(2px,1.5vw,10px); padding: 6px 8px; }
#nav button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  min-height: 46px;
  padding: 6px 5px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #c6d1c4;
  line-height: 1.15;
}
#nav button[aria-current=page] { color: #ffdc9f; background: #37382b; border-color: #727255; }
#nav .dock-icon, #nav svg { width: 21px; height: 21px; flex: none; }
:where(a, button, select, summary, input, textarea):focus-visible { outline: 3px solid #ffcd88; outline-offset: 3px; }
@media (hover:hover) {
  .primary:hover, .meal-picker-actions button:last-child:hover { filter: brightness(1.09); }
  .outline:hover, .switchbtn:hover, .meal-swap-trigger:hover, .weekgrid .tile:hover, .daytools button:enabled:hover { background: #34463a; border-color: #adc39d; }
  .linkbtn:hover, summary:hover { text-decoration: underline; text-underline-offset: 3px; }
  #nav button:hover { border-color: var(--light-line); }
}
@media (max-width:700px) {
  #root > header { min-height: 61px; padding-block: 8px; }
  .brand svg { width: 30px; height: 30px; }
  .panel { margin-block: 14px; }
  .guide { padding-inline: 11px; }
  .weekgrid { gap: 3px; }
  .weekgrid .tile { min-height: 59px; }
  #nav button { font-size: .78rem; }
  .stats span { font-size: .79rem; }
}
@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
@media (forced-colors:active) {
  #nav button[aria-current=page], .weekgrid .tile.current, .meal-option.selected, .trail-weeks [aria-pressed=true] { outline: 2px solid Highlight; outline-offset: -2px; }
}

/* The calendar reads like a sequence of illustrated chapter openings. */
#main > .panel:has(.weekgrid) {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #1b2824;
}
#main > .panel:has(.weekgrid)::before {
  position: absolute;
  content: "";
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image: linear-gradient(90deg,#182620 21%,#182620e8 46%,#18262030 100%), linear-gradient(0deg,#182620 7%,#1826209e 40%,transparent 70%), var(--chapter-image);
  background-size: cover;
  background-position: center,center,50% 54%;
}
#main > .panel:has(.weekgrid):nth-of-type(1) { --chapter-image: url('route-forest-edge.webp'); }
#main > .panel:has(.weekgrid):nth-of-type(2) { --chapter-image: url('route-fern-hollow.webp'); }
#main > .panel:has(.weekgrid):nth-of-type(3) { --chapter-image: url('route-mossy-creek.webp'); }
#main > .panel:has(.weekgrid):nth-of-type(4) { --chapter-image: url('route-lantern-clearing.webp'); }
#main > .panel:has(.weekgrid) > p { max-width: 52ch; color: #e0e9d9; }
@media (max-width:700px) {
  #main > .panel:has(.weekgrid)::before {
    background-image: linear-gradient(90deg,#182620f7 0%,#182620e6 48%,#18262038 100%),linear-gradient(0deg,#182620 11%,#182620ac 48%,transparent 80%),var(--chapter-image);
  }
  #main > .panel:has(.weekgrid) > p { max-width: 31ch; }
}
