/* The clock controls illumination; page-specific drawings retain their own composition. */
:root[data-environment-ready] body:not(.games-page):not(.photography-page) { --paper:var(--env-paper); background:var(--paper); }
:root[data-environment-ready] .chapter-story { --ink:#373e40; --muted:#656865; --line:#a7a69c70; }
:root[data-theme=dark][data-environment-ready] .chapter-story { --ink:#f0eae0; --muted:#d1d5d7; --line:#a8b1c75c; --ember:#e6b78b; --moss:#b4c8c5; }
:root[data-theme=dark][data-environment-ready] .travel-campus { --ink:#f0eae0; --muted:#c5cdd5; --ember:#e8b593; --moss:#b0c3c8; --line:#8093ad60; }
.environment-scene .environment-canvas { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; object-position:center 65%; opacity:0; transition:opacity .9s ease; pointer-events:none; }
.environment-scene.environment-loaded .environment-canvas { opacity:var(--chapter-opacity,1); filter:saturate(.87); }
.environment-scene[data-artwork=sketch].environment-loaded .environment-canvas { filter:none; }
.campus-home .campus-art { filter:saturate(.87); }
.environment-scene.environment-loaded :is(.chapter-art,.campus-art) { opacity:0!important; }
.campus-scene.environment-loaded .environment-canvas { object-position:center 55%; }
.chapter-story .environment-scene::after { background:radial-gradient(ellipse at 45% 30%,color-mix(in oklch,var(--paper) 10%,transparent),transparent 65%); }
.chapter-story .environment-scene.environment-loaded .environment-canvas { transition:none; }
.travel-scenery.environment-loaded .environment-canvas { opacity:var(--landscape-opacity,.32); mask-image:linear-gradient(transparent,#000 35%); object-position:center bottom; }
.weather-effects { position:fixed; inset:0; width:100%; height:100%; z-index:7; pointer-events:none; user-select:none; contain:strict; }
/* Indoor scenes receive the same sun direction, seasonal window and ambient cycle. */
:root[data-environment-ready] .room-stage .room-scene--day { opacity:1; z-index:0; }
:root[data-environment-ready] .room-stage .room-scene--night { opacity:var(--room-night,0); z-index:1; }
:root[data-environment-ready] .room-stage .room-daylight { opacity:var(--room-daylight,0); }
:root[data-environment-ready] .games-page { --paper:color-mix(in srgb,var(--env-paper) 35%,#eee9df); }
:root[data-environment-ready][data-theme=dark] .games-page { --paper:#252e2c; }
.room-season-view { pointer-events:none; }
.room-season-view > g { transition:opacity 1.5s ease; }
:root[data-environment-ready] .photography-page { --paper:color-mix(in srgb,var(--env-paper) 75%,#eee5d3); }
:root[data-environment-ready][data-theme=dark] .photography-page { --paper:#242d3d; --ink:#eee8da; --muted:#c1c5c5; --line:#77859760; }
:root[data-environment-ready] .photography-page .atmosphere { background:radial-gradient(ellipse at 85% 5%,color-mix(in srgb,var(--env-horizon) 24%,transparent),transparent 65%),linear-gradient(145deg,var(--paper),color-mix(in srgb,var(--env-sky) 18%,var(--paper))); }
:root[data-environment-ready] .photo-window-light { opacity:var(--env-sun-strength); rotate:var(--env-shadow-angle); transition:rotate 3s,opacity 1.5s; }
:root[data-environment-ready] .photo-window-shadow { opacity:calc(var(--env-sun-strength) * .8); transform:rotate(calc(-28deg + var(--env-shadow-angle))); transition:transform 3s,opacity 1.5s; }
:root[data-environment-ready] .photo-color-mist--warm { opacity:calc(.12 + var(--env-golden) * .32); background:radial-gradient(ellipse,var(--env-horizon),transparent 68%); }
:root[data-environment-ready] .photo-color-mist--cool { background:radial-gradient(ellipse,color-mix(in srgb,var(--env-sky) 36%,transparent),transparent 68%); }
:root[data-environment-ready] .photo-leaf-shadow { opacity:calc(.05 + var(--env-sun-strength) * .17); }
:root[data-environment-season=winter] .photo-leaf-shadow { background-image:var(--yilun-image-686afda0a6c8, url(assets/environment/winter-branches.svg)); }
:root[data-environment-season=spring] .photo-leaf-shadow { background-image:var(--yilun-image-6a1f2aff52ef, url(assets/environment/spring-branches.svg)); }
:root[data-environment-ready][data-theme=dark] .photo-light-water { opacity:.17; background:radial-gradient(ellipse at 82% 25%,#c5d6ed40,transparent 45%); }
:root[data-environment-ready] .photo-air-dust { opacity:calc(var(--env-sun-strength) * .5); }
@media (prefers-reduced-motion:reduce) {
  .environment-canvas,.photo-window-light,.photo-window-shadow,.room-season-view > g { transition:none!important; }
}

/* Weather drifts directly behind the text, with no panel or glass frame. */
.daily-panel .weather.weather-window {
  position:relative; isolation:isolate; display:flex; align-items:center; justify-content:flex-end;
  align-self:flex-end; width:230px; max-width:100%; min-height:42px; margin-top:2px; padding:8px 0;
  overflow:visible; border:0; border-radius:0; background:none; color:var(--ink);
  box-shadow:none; backdrop-filter:none; -webkit-backdrop-filter:none;
}
.weather-window-canvas {
  position:absolute; inset:0; width:100%; height:100%; pointer-events:none; z-index:-1; opacity:.65;
  mask-image:radial-gradient(ellipse at 64% 50%,#000 28%,transparent 76%);
  -webkit-mask-image:radial-gradient(ellipse at 64% 50%,#000 28%,transparent 76%);
}
.weather-caption { position:relative; text-align:right; font-size:12px; line-height:1.8; letter-spacing:.015em; text-shadow:0 1px 7px var(--paper),0 0 3px var(--paper); }
.games-page .daily-panel .weather.weather-window,.photography-page .daily-panel .weather.weather-window { margin-top:0; }
@media(max-width:700px){.games-page .daily-panel .weather.weather-window{align-self:flex-start;}}
