.winter-page {
  --winter-fir: #294e43;
  --winter-line: #bfcec5;
  --winter-paper: #f7f6ed;
  --winter-snow: #e3ebe2;
  background: radial-gradient(ellipse 38rem 26rem at 84% 8rem, #f2ebda, transparent);
}

.winter-page [aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 0.35em;
}

.winter-page button { font-family: inherit; }
.winter-page button:focus-visible { outline: 2px solid var(--winter-fir); outline-offset: 3px; }

.winter-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: end;
  gap: clamp(1.05rem, 5vw, 4.75rem);
  padding-block: clamp(2.3rem, 5vw, 4.5rem) clamp(1.9rem, 3.8vw, 3.35rem);
}

.winter-intro h1 {
  text-wrap: balance;
  font-size: clamp(3.1rem, 6.05vw, 5.7rem);
  line-height: 1.06;
  letter-spacing: -0.055em;
}

.winter-lede {
  max-width: 24rem;
  padding-bottom: 0.3rem;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.75;
}

.winter-island { margin-bottom: clamp(2.7rem, 6vw, 5.5rem); }

.map-top {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 0.45rem 1.3rem;
  padding-block: 0.9rem 0.85rem;
  border-top: 1px solid var(--winter-line);
}

.map-top h2 { font-size: clamp(1.6rem, 2.5vw, 2.45rem); }
.map-top p { margin-top: 0.3rem; color: var(--muted); font-size: 0.94rem; line-height: 1.6; }

.map-actions { display: flex; flex-wrap: wrap; gap: 0.15rem 1rem; }
.map-actions .text-link,
.story-actions .text-link {
  min-height: 2.65rem;
  padding: 0.3rem 0;
  border: 0;
  border-bottom: 1px solid var(--winter-line);
  background: none;
  cursor: pointer;
  font-size: 0.875rem;
}

.map-actions .text-link:hover,
.story-actions .text-link:hover { border-color: currentColor; }

.island-frame {
  position: relative;
  isolation: isolate;
  border: 1px solid #c1d1c9;
  border-radius: clamp(0.85rem, 2.6vw, 2rem) 0.4rem;
  background: #d3e1dc;
  box-shadow: 0 0.65rem 2rem #38584a14;
}

.island-art {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 100 / 62;
  border-radius: inherit;
}

.island-spots { position: absolute; inset: 0; }

.track {
  position: absolute;
  display: grid;
  place-items: center;
  width: clamp(2.75rem, 4.5vw, 3.55rem);
  height: clamp(2.75rem, 4.5vw, 3.55rem);
  padding: 0;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #364d42;
  cursor: pointer;
}

.track:hover,
.track:focus-visible,
.track[data-hint] { z-index: 1; }

.track-mark {
  position: relative;
  display: block;
  width: 1.8rem;
  height: 1.8rem;
  border: 1px solid rgb(77 106 90 / 54%);
  border-radius: 50%;
  background: rgb(250 249 236 / 85%);
  box-shadow: 0 1px 9px rgb(43 68 53 / 20%);
  color: #466558;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.track-mark canvas {
  display: block;
  width: 100%;
  height: auto;
}

.track[data-landmark] .track-mark {
  display: grid;
  place-items: center;
  width: clamp(1.8rem, 3vw, 2.3rem);
  height: clamp(1.8rem, 3vw, 2.3rem);
  background: #fbf7e9ed;
}

.track[data-landmark] .track-mark canvas { width: 78%; }
.track[data-landmark]:is(:hover, :focus-visible, [data-hint]) .track-mark { background: #f7e9c7; }

.track[data-found] .track-mark {
  border-color: #8b825c;
  background: #f3e6be;
  color: #69613d;
}

.track:hover .track-mark,
.track:focus-visible .track-mark,
.track[data-hint] .track-mark {
  border-color: #776644;
  background: #f4e6bb;
  color: #534322;
}

.track[data-hint] .track-mark { box-shadow: 0 0 0 5px rgb(246 232 185 / 69%), 0 2px 12px #4a684c60; }

.track-label {
  position: absolute;
  bottom: calc(100% - 0.13rem);
  left: 50%;
  width: max-content;
  max-width: 13rem;
  padding: 0.25rem 0.55rem;
  transform: translateX(-50%);
  border: 1px solid var(--winter-line);
  border-radius: 0.65rem 0.25rem;
  background: var(--winter-paper);
  color: #33483b;
  opacity: 0;
  font-size: 0.78rem;
  line-height: 1.4;
  text-align: center;
  pointer-events: none;
}

.track:hover .track-label,
.track:focus-visible .track-label,
.track[data-hint] .track-label { opacity: 1; }

.map-status {
  min-height: 1.9rem;
  padding-block: 0.42rem;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.55;
}

.encounter-dialog {
  width: min(36rem, calc(100% - 1.25rem));
  max-height: calc(100% - 1.25rem);
  padding: 0;
  border: 1px solid var(--winter-line);
  border-radius: clamp(1.15rem, 3vw, 2rem) 0.5rem;
  background: var(--paper);
  color: var(--ink);
  overscroll-behavior: contain;
}

.encounter-dialog::backdrop { background: rgb(22 44 35 / 60%); }
body:has(.encounter-dialog[open]) { overflow: hidden; }

.encounter-story { padding: clamp(1.05rem, 3.2vw, 2.05rem); }

.encounter-close {
  position: sticky;
  z-index: 3;
  top: 0.35rem;
  display: grid;
  place-items: center;
  float: right;
  width: 2.7rem;
  height: 2.7rem;
  padding: 0;
  border: 1px solid var(--winter-line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--forest);
  cursor: pointer;
  font-size: 1.7rem;
  line-height: 1;
}

.story-heading { padding-right: 2.85rem; }
.story-heading .eyebrow { margin-bottom: 0.25rem; }
.story-heading h2 {
  font-size: clamp(1.85rem, 4.1vw, 2.65rem);
  line-height: 1.18;
  hyphens: auto;
  overflow-wrap: anywhere;
}
.motif-title {
  margin-top: .12rem;
  color: var(--muted);
  font: italic 1rem/1.45 Georgia, serif;
}
.story-figure { margin-top: .85rem; }
.story-copy { margin: 1.2rem 0 1.4rem; }
.gift-label {
  display: flex;
  gap: .4rem;
  align-items: center;
  font: italic .95rem/1.4 Georgia, serif;
  color: #56674e;
}
.gift-label canvas { width: 1.15rem; height: 1.15rem; }
.story-copy h3 {
  margin: .28rem 0 .38rem;
  color: var(--winter-fir);
  font: normal clamp(1.35rem, 3.2vw, 1.7rem)/1.23 Georgia, serif;
  text-wrap: balance;
}
.story-pause { font-size: 1.05rem; line-height: 1.65; }

.story-figure canvas {
  display: block;
  width: 100%;
  height: auto;
  background: var(--winter-snow);
}

.scene-replay {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  padding: 0;
  border: 1px solid #c9d7cb;
  border-radius: 0.4rem clamp(1rem, 2.4vw, 1.7rem);
  background: var(--winter-snow);
  cursor: pointer;
}

.scene-repeat {
  position: absolute;
  right: 0.53rem;
  bottom: 0.53rem;
  display: grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  border: 1px solid #bfcbbd;
  border-radius: 50%;
  background: #fcf9eced;
  color: #355347;
  font: 1.2rem/1 Georgia, serif;
  transition: background-color 160ms ease;
}

.scene-replay:hover .scene-repeat,
.scene-replay:focus-visible .scene-repeat { background: #f6e7bf; }

.scene-replay:disabled { cursor: default; }
.scene-replay:disabled .scene-repeat { display: none; }

.story-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1.25rem;
  margin-top: 0.45rem;
}

.winter-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 1.25rem;
}

@media (max-width: 46rem) {
  .winter-intro { grid-template-columns: 1fr; }
  .winter-intro h1 { font-size: clamp(2.7rem, 9.65vw, 4.3rem); }
  .winter-lede { padding-bottom: 0; }
}

@media (max-width: 36rem) {
  .map-top { align-items: start; flex-direction: column; }
  .map-top p, .map-status { font-size: 0.875rem; }
  .island-frame { margin-inline: calc(var(--gutter) * -0.56); }
  .track-mark { width: 1.64rem; height: 1.64rem; }
  .track-label { max-width: 9rem; }
}

.winter-letter {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  max-width: 27rem;
  margin-top: 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid #dbd3b9;
  border-radius: 1rem 0.3rem;
  background: linear-gradient(125deg, #faf2df, #f5f0e3);
  color: #4a493b;
  font-size: 0.875rem;
  line-height: 1.55;
}

.calendar-leaf {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.16rem;
  width: 4.5rem;
  min-height: 5rem;
  padding-top: 0.55rem;
  border: 1px solid #c5bda6;
  border-top: .32rem solid #486455;
  border-radius: .18rem .18rem .5rem .15rem;
  box-shadow: 0 2px 0 #e7ddc7, 0 3px 0 #cfc6ae;
  background: #fffaf0;
  color: var(--winter-fir);
}
#calendar-reverse { grid-column: 1 / -1; }
.calendar-leaf { cursor: pointer; }
.calendar-leaf:hover, .calendar-leaf[aria-expanded="true"] {
  box-shadow: 0 3px 0 #e7ddc7, 0 4px 0 #cfc6ae;
}
.calendar-leaf::before {
  content: "";
  position: absolute;
  top: .23rem;
  left: .75rem;
  right: .75rem;
  height: 2px;
  border-inline: 3px solid #bcaf95;
}
.leaf-day { font: 2.35rem/.95 Georgia, serif; }
.leaf-month { font-size: .75rem; letter-spacing: .035em; }
.letter-date {
  display: block;
  margin-bottom: 0.13rem;
  color: #654d30;
  font-weight: 600;
}

.letter-date:empty { display: none; }

.island-snow {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

.island-snow::before,
.island-snow::after {
  content: "";
  position: absolute;
  inset: calc(0px - var(--fall)) -12px 0;
  background-size: var(--spacing) var(--fall);
}

.island-snow::before {
  --spacing: 291px;
  --fall: 223px;
  --sway: 5px;
  background-image:
    radial-gradient(circle at 9% 32%, #fffcf0a6 .7px, transparent 1.6px),
    radial-gradient(circle at 37% 13%, #fffdf29c .6px, transparent 1.4px),
    radial-gradient(circle at 68% 82%, #fffdf2ad .8px, transparent 1.8px),
    radial-gradient(circle at 87% 47%, #ffffff80 .6px, transparent 1.5px);
}

.island-snow::after {
  --spacing: 377px;
  --fall: 317px;
  --sway: -9px;
  background-image:
    radial-gradient(circle at 17% 68%, #fffff4c4 1px, transparent 2.4px),
    radial-gradient(circle at 43% 37%, #fffff2b8 1.2px, transparent 2.7px),
    radial-gradient(circle at 79% 9%, #fffdf1c2 1px, transparent 2.3px),
    radial-gradient(circle at 95% 86%, #fffef3a3 .9px, transparent 2px);
}

.track[data-fresh] .track-mark {
  border-color: #9a7742;
  background: #fff0c7;
  box-shadow: 0 0 0 3px rgb(255 235 176 / 55%), 0 1px 9px rgb(73 64 39 / 23%);
  color: #715536;
}

.track[data-fresh][data-hint] .track-mark {
  box-shadow: 0 0 0 6px rgb(246 225 162 / 78%), 0 2px 12px #4a684c60;
}

.story-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.75rem;
}

.story-place::before {
  margin-right: 0.75rem;
  color: #8b6d46;
  content: "·";
}

@media (prefers-reduced-motion: no-preference) {
  .island-snow::before { animation: snowfall 33s linear -13s infinite; }
  .island-snow::after { animation: snowfall 26s linear -17s infinite; }
  .encounter-dialog[open] .story-figure { animation: meeting-appears 380ms ease-out; }
}

/* Each layer descends one full tile, so the repeat has no visible seam. */
@keyframes snowfall {
  from { transform: translate(0, 0); }
  50% { transform: translate(var(--sway), calc(var(--fall) / 2)); }
  to { transform: translate(0, var(--fall)); }
}

@keyframes meeting-appears {
  from { opacity: 0.45; transform: translateY(0.3rem); }
  to { opacity: 1; transform: translateY(0); }
}

.goat-replay { background: #f8f5e9; }
.goat-illustration { position: relative; display: block; width: 100%; aspect-ratio: 3 / 2; }
.goat-illustration img,
.goat-illustration .goat-canvas { position: absolute; inset: 0; width: 100%; height: 100%; background: transparent; }
.goat-illustration .goat-canvas { opacity: 0; }
.goat-illustration[data-goat-enhanced] img { opacity: 0; }
.goat-illustration[data-goat-enhanced] .goat-canvas { opacity: 1; }
.meeting-notes details { border-top: 1px solid var(--winter-line); }
.meeting-notes details:last-child { border-bottom: 1px solid var(--winter-line); }
.meeting-notes summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-height: 2.75rem;
  color: var(--winter-fir);
  font-size: .97rem;
  list-style: none;
  cursor: pointer;
}
.meeting-notes summary::-webkit-details-marker { display: none; }
.meeting-notes summary::after {
  content: "";
  width: .44rem;
  height: .44rem;
  margin-right: .3rem;
  border: solid currentColor;
  border-width: 0 1px 1px 0;
  transform: rotate(45deg);
}
.meeting-notes details[open] summary::after { transform: rotate(225deg); }
.meeting-notes summary:focus-visible { outline: 2px solid var(--winter-fir); outline-offset: 2px; }
.meeting-notes h3 { margin-top: .75rem; color: var(--winter-fir); font: italic 1.06rem/1.4 Georgia, serif; }
.meeting-notes p { max-width: 59ch; font-size: 1rem; line-height: 1.6; }
.meeting-notes details[open] { padding-bottom: 1rem; }
.story-scene { white-space: pre-line; }

/* The marker layer stays above this transparent, world-aligned light pass. */
.map-sky {
  position:absolute; inset:0; overflow:hidden; border-radius:inherit;
  pointer-events:none;
}
.map-sky-world, .map-sky-world span { position:absolute; inset:0; }
.map-twilight { background:linear-gradient(174deg,#e6b28e9e 0%,#c99c9429 18%,#ad929131 100%); }
.map-night { background:linear-gradient(176deg,#102138f5 0%,#162d48de 16%,#1b3755b5 54%,#173b55c9 100%); }
.map-sky-world .map-sunless-paper {
  inset: 0 auto auto 1.6%; width: 36.2%; height: 18.7096774%;
  background: url("./insel/sonnenhimmel.webp") center / 100% 100% no-repeat;
}
.map-sun-field { display: block; width: 100%; height: 100%; }
.map-sun { transform-box: view-box; }
.map-sun-sky { mask: url("./insel/dunstsaum.webp") center / 100% 100% no-repeat; }
.map-air { mask: url("./insel/himmelsmaske.webp") center / 100% 100% no-repeat; }
.map-air { background:linear-gradient(#0c2035 0%,#344f61 12%,#809994 18%); }
.map-sky-world .map-stars { bottom:auto; height:17%; background:url("./insel/sternensaum.svg") center / 100% 100% no-repeat; }
.map-sky-world .map-aurora,.map-sky-world .map-veil {
  top:-3%; bottom:auto; height:25%;
  background:url("./nordlicht.webp") center / 100% 100% no-repeat; transform-origin:50% 45%;
}
.map-windowlight { opacity:0; background:url("./insel/fensterlicht.svg") center / 100% 100% no-repeat; }
.map-ice { mask:url("./insel/eismaske.webp") center / 100% 100% no-repeat; }
.map-shimmer {
  background:radial-gradient(ellipse 27% 48% at 38% 32%,#97dcaf80,transparent),
             radial-gradient(ellipse 16% 39% at 72% 31%,#8fcdb88f,transparent);
  mask-image:repeating-linear-gradient(178deg,#000a 0,#0005 2px,#0001 4px,#0006 6px);
}
.island-replay { isolation: isolate; }
.island-replay canvas { filter: saturate(.8) blur(1.2px); }
.island-replay::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, #f9f5e46b 18%, #f9f5e454 53%, #f8f1e56b 100%);
}
.island-replay[data-light="night"]::after {
  background: radial-gradient(ellipse at 50% 55%, #e6ebdd4a, #e8e9dc12 73%);
}
.wildlife-portrait {
  position: absolute;
  z-index: 1;
  inset: 3% 8% 7%;
  display: block;
  transform-origin: 50% 91%;
  pointer-events: none;
}
.island-replay .scene-repeat { z-index: 2; }
.island-replay[data-grounded]::before {
  content: "";
  position: absolute;
  z-index: 1;
  left: 31%;
  right: 31%;
  bottom: 11%;
  height: 4%;
  border-radius: 50%;
  background: radial-gradient(ellipse, #625e4c38, #625e4c00 73%);
  pointer-events: none;
}

#calendar-reverse:not([hidden]) { display: flex; flex-wrap: wrap; gap: .45rem 1.2rem; }

.animal-plates { margin:1.5rem 0; scroll-margin-top:var(--header-height); }
.animal-plates summary { width:fit-content; color:var(--forest); cursor:pointer; padding:.4rem 0; }
.plate-list { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,14rem),1fr)); gap:.65rem; padding:.65rem 0; }
.plate-list button { display:flex; align-items:center; gap:.75rem; min-width:0; padding:.65rem; text-align:left; background:#fcfaf3; color:var(--forest); border:1px solid var(--line); border-radius:.3rem 1rem .3rem .3rem; cursor:pointer; font:inherit; line-height:1.3; }
.plate-list button:hover,.plate-list button:focus-visible { border-color:var(--forest); }
.plate-list img { width:34%; height:4.3rem; object-fit:contain; }
.plate-list small { display:block; margin-top:.25rem; color:var(--muted); font:.9rem/1.35 Georgia,serif; }
.summer-story { position:absolute; z-index:1; inset:0; background:#ede3c9 url("./insel/sommerlichtung.webp") center/cover; }
.summer-story img { position:absolute; object-fit:contain; }
.distant-elephant { width:23%; height:23%; left:6%; bottom:36%; filter:saturate(.72); opacity:.87; }
.little-bee { width:5%; height:5%; right:11%; bottom:17%; }
[data-animal="elephant"] .distant-elephant,[data-animal="bee"] .little-bee { display:none; }
[data-animal="elephant"] .wildlife-portrait { inset:7% 24% 13% 6%; }
[data-animal="beeEater"] .wildlife-portrait { inset:12% 15% 12% 30%; }
[data-animal="bee"] .wildlife-portrait { inset:24% 13% 25% 47%; }
[data-animal="gecko"] .wildlife-portrait { inset:22% 15% 14%; }

.island-replay[data-animal="kite"]::after { background:linear-gradient(168deg,#66878e45,#70857d2b); }

.perch-branch { display:none; position:absolute; inset:0; width:100%; height:100%; }
[data-animal="beeEater"] .perch-branch { display:block; }
.summer-story:has(.distant-elephant)::before { content:""; position:absolute; left:7%; bottom:36%; width:21%; height:2.5%; background:radial-gradient(ellipse,#76684a38,transparent 70%); }
[data-animal="elephant"] .summer-story::before { display:none; }

/* Give the island its own opening screen. All artwork and traces share one plane. */
.winter-page .site-header { position: relative; }
.winter-page .header-inner {
  width: 100%; min-height: 3.75rem; padding: .35rem var(--gutter);
  flex-direction: row; align-items: center; justify-content: space-between;
}

.winter-island { margin-bottom: 0; }
.map-top {
  display: block;
  padding: clamp(1.15rem, 3vw, 3rem) var(--gutter) clamp(1.2rem, 2.6vw, 2.6rem);
  border: 0;
  text-align: center;
}
.map-top > div { max-width: 65rem; margin-inline: auto; }
.map-top .island-edition { margin: 0 0 .65rem; font-size: .8rem; }
.map-top h1 { font-size: clamp(1.85rem, 3.2vw, 3.25rem); line-height: 1.12; text-wrap: balance; }
.map-captions { display: grid; }
.map-caption { grid-area: 1 / 1; align-self: start; min-width: 0; }
.map-caption[inert] { visibility: hidden; }
.map-caption p { margin: .65rem auto 0; max-width: 62ch; font-size: 1rem; line-height: 1.55; text-wrap: pretty; }
.map-actions { display: grid; grid-template-columns: auto auto; justify-content: center; align-items: center; margin-top: .9rem; gap: .25rem 1rem; }
.map-actions .map-hint { grid-column: 1; }
.map-actions .open-letter { grid-column: 2; }
.map-actions button, .winter-page .map-back {
  min-height: 2.75rem; padding: .35rem .2rem; border: 0;
  background: none; color: var(--forest); font: inherit; font-size: .95rem;
  text-decoration: underline; text-underline-offset: .25em; cursor: pointer;
}
.map-actions .map-hint {
  padding-inline: 1rem; border: 1px solid #a6b6ac; border-radius: 1.5rem;
  background: #edf2eb; text-decoration: none;
}
.map-actions .map-hint:hover { background: #e0e9e1; }
.island-panorama { width: 100%; overflow: clip; }
.island-frame {
  width: 100%; aspect-ratio: 100 / 62; margin: 0;
  border: 0; border-radius: 0; box-shadow: none;
}
.winter-island .map-status { margin: .8rem auto; }
.winter-island .map-status:empty { display: none; }
.winter-island .animal-plates { margin: 1.15rem auto 2rem; }
.calendar-dialog {
  width: min(32rem, calc(100% - 2rem)); max-height: calc(100% - 2rem);
  padding: clamp(1.3rem, 4vw, 2.4rem); color: var(--ink); background: var(--paper);
  border: 1px solid var(--winter-line); border-radius: 1.2rem .4rem;
}
.calendar-dialog::backdrop { background: rgb(22 44 35 / 60%); }
.calendar-dialog h2 { font-size: 2rem; margin-bottom: .8rem; }
.calendar-dialog .winter-lede { font-size: 1rem; line-height: 1.6; }
body:has(.calendar-dialog[open]) { overflow: hidden; }
@media (max-width: 48rem) {
  .map-top { text-align: left; }
  .map-caption p { margin-inline: 0; }
  .map-actions { justify-content: flex-start; }
  .track-label[data-edge="left"] { left: 0; transform: none; }
  .track-label[data-edge="right"] { left: auto; right: 0; transform: none; }
}

@media (max-width: 23rem) {
  .map-actions { grid-template-columns: 1fr; justify-items: start; }
  .map-actions .open-letter { grid-column: 1; }
  .map-actions:has(.map-hint[hidden]) { min-height: 5.75rem; align-content: center; }
}
