/* =========================================================================
   Oconee Together · scenery.css
   Illustration tokens (--sc-*), theme switching, film grain and ambient
   motion for the scenes injected by assets/js/scenery.js.
   Light = "Dawn", dark = "Night". High contrast hides every scene.
   ========================================================================= */

/* ---------- Dawn ---------- */
:root {
  /* sky: pale sage-blue at the top, warm cream at the horizon */
  --sc-sky-0: #DCE6E2;
  --sc-sky-1: #E8ECE2;
  --sc-sky-2: #F4EAD6;
  --sc-sky-3: #F7E2C2;
  --sc-glow: #FBE4BE;
  --sc-halo: #FBE2B2;
  --sc-sun: #F7D9A2;
  --sc-sun-core: #FFF6E2;
  --sc-sun-rim: #F2C98A;
  --sc-moon: #F1F1DF;
  --sc-moon-glow: #CFE0D4;
  --sc-star: #F2F4EA;
  --sc-cloud: #FFFFFF;
  --sc-cloud-2: #F6E6D0;
  --sc-mist: #F1F2EA;
  --sc-bird: #4A5750;

  /* hills, far to near: crest color, then the misty base it fades into */
  --sc-h1: #C5D2CF;  --sc-h1b: #DFE5DD;
  --sc-h2: #ABC0BC;  --sc-h2b: #CCD8D0;
  --sc-h3: #8FAA9F;  --sc-h3b: #B7C8BB;
  --sc-h4: #739381;  --sc-h4b: #97AF9B;
  --sc-h5: #4F725D;  --sc-h5b: #6C8B72;
  --sc-h6: #2F4E3C;  --sc-h6b: #253F31;  --sc-h6-lit: #4A6A4C;
  --sc-h7: #223A2D;  --sc-h7b: #1E3529;

  --sc-field: #C4C795;
  --sc-meadow: #A9BC8A;
  --sc-meadow-2: #8DA772;
  --sc-meadow-3: #6F8E5C;
  --sc-path: #DFC6A6;
  --sc-path-2: #C49B78;
  --sc-clay: #B06A47;
  --sc-post: #6E5644;
  --sc-blaze: #C8643C;
  --sc-bridge: #8C5541;
  --sc-bridge-2: #6E4232;
  --sc-roof: #4F5A52;
  --sc-stone: #8E9389;

  --sc-water-0: #F6EEDB;
  --sc-water-1: #CFDCD7;
  --sc-water-2: #A9C1C0;
  --sc-glint: #FFF9EC;
  --sc-ripple: #FFFFFF;
  --sc-shore: #9DAEA9;
  --sc-shore-2: #B9C6C1;

  --sc-fl-gold: #E3B04B;
  --sc-fl-gold-2: #D49A35;
  --sc-fl-white: #FAF6EC;
  --sc-fl-clay: #C2603C;
  --sc-fl-blue: #9DB2C4;
  --sc-fl-eye: #5A4330;
  --sc-stem: #6F8D5E;

  --sc-ff: #F4F0A8;
  --sc-ff-glow: #DDE884;

  /* dusk over still water (Get help now) */
  --sc-dusk-0: #DDE5E5;
  --sc-dusk-1: #E8E7DF;
  --sc-dusk-2: #F1E1CE;
  --sc-dusk-3: #F2D6BC;
  --sc-dwater-0: #EDDCC9;
  --sc-dwater-1: #D9DDD6;
  --sc-dwater-2: #C3CFCD;

  --sc-ground: var(--ground, #1E3529);
  --sc-ridge-1: #C9D6CA;
  --sc-ridge-2: #7D9A86;
  --sc-ray: #FFF3D6;

  --sc-grain: .5;
  --sc-mist-a: 1;
  --sc-grain-blend: soft-light;
}

/* ---------- Night ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sc-sky-0: #06100D;
    --sc-sky-1: #0B1714;
    --sc-sky-2: #13241F;
    --sc-sky-3: #182A25;
    --sc-glow: #1C2E28;
    --sc-halo: #2A3B33;
    --sc-sun: #F7D9A2;
    --sc-sun-core: #FFF6E2;
    --sc-sun-rim: #F2C98A;
    --sc-moon: #ECEEDA;
    --sc-moon-glow: #9FB8A8;
    --sc-star: #E4EADC;
    --sc-cloud: #23352F;
    --sc-cloud-2: #1A2A25;
    --sc-mist: #20322C;
    --sc-bird: #33433C;

    --sc-h1: #15261F;  --sc-h1b: #14241F;
    --sc-h2: #11211B;  --sc-h2b: #13221D;
    --sc-h3: #0F1C17;  --sc-h3b: #111E19;
    --sc-h4: #0D1814;  --sc-h4b: #0F1A16;
    --sc-h5: #0A1310;  --sc-h5b: #09110E;
    --sc-h6: #080F0C;  --sc-h6b: #070D0A;  --sc-h6-lit: #111B16;
    --sc-h7: #090E0C;  --sc-h7b: #080C0A;

    --sc-field: #182620;
    --sc-meadow: #15231D;
    --sc-meadow-2: #111D18;
    --sc-meadow-3: #0E1814;
    --sc-path: #2B302A;
    --sc-path-2: #232822;
    --sc-clay: #3A2A22;
    --sc-post: #1F2420;
    --sc-blaze: #6E4A38;
    --sc-bridge: #2A211D;
    --sc-bridge-2: #1E1916;
    --sc-roof: #18201C;
    --sc-stone: #232A26;

    --sc-water-0: #1F3330;
    --sc-water-1: #142420;
    --sc-water-2: #0E1A17;
    --sc-glint: #C9D8CC;
    --sc-ripple: #9FB4A8;
    --sc-shore: #0B1512;
    --sc-shore-2: #13211C;

    --sc-fl-gold: #5E5734;
    --sc-fl-gold-2: #4E482B;
    --sc-fl-white: #8D968A;
    --sc-fl-clay: #4F3A2E;
    --sc-fl-blue: #3E4C55;
    --sc-fl-eye: #151A16;
    --sc-stem: #1F2E26;

    --sc-dusk-0: #06100D;
    --sc-dusk-1: #0A1613;
    --sc-dusk-2: #11201C;
    --sc-dusk-3: #152520;
    --sc-dwater-0: #16251F;
    --sc-dwater-1: #0F1C18;
    --sc-dwater-2: #0B1512;
    --sc-dusk-0: #06100D;
  --sc-dusk-1: #0A1613;
  --sc-dusk-2: #11201C;
  --sc-dusk-3: #152520;
  --sc-dwater-0: #16251F;
  --sc-dwater-1: #0F1C18;
  --sc-dwater-2: #0B1512;
  --sc-ground: var(--ground, #0A0E0C);
    --sc-ridge-1: #1A2721;
    --sc-ridge-2: #131D18;
    --sc-ray: #CFE0D2;

    --sc-grain: .6;
    --sc-mist-a: .55;
  }
}
:root[data-theme="dark"] {
  --sc-sky-0: #06100D;
  --sc-sky-1: #0B1714;
  --sc-sky-2: #13241F;
  --sc-sky-3: #182A25;
  --sc-glow: #1C2E28;
  --sc-halo: #2A3B33;
  --sc-moon: #ECEEDA;
  --sc-moon-glow: #9FB8A8;
  --sc-star: #E4EADC;
  --sc-cloud: #23352F;
  --sc-cloud-2: #1A2A25;
  --sc-mist: #20322C;
  --sc-bird: #33433C;

  --sc-h1: #15261F;  --sc-h1b: #14241F;
  --sc-h2: #11211B;  --sc-h2b: #13221D;
  --sc-h3: #0F1C17;  --sc-h3b: #111E19;
  --sc-h4: #0D1814;  --sc-h4b: #0F1A16;
  --sc-h5: #0A1310;  --sc-h5b: #09110E;
  --sc-h6: #080F0C;  --sc-h6b: #070D0A;  --sc-h6-lit: #111B16;
  --sc-h7: #090E0C;  --sc-h7b: #080C0A;

  --sc-field: #182620;
  --sc-meadow: #15231D;
  --sc-meadow-2: #111D18;
  --sc-meadow-3: #0E1814;
  --sc-path: #2B302A;
  --sc-path-2: #232822;
  --sc-clay: #3A2A22;
  --sc-post: #1F2420;
  --sc-blaze: #6E4A38;
  --sc-bridge: #2A211D;
  --sc-bridge-2: #1E1916;
  --sc-roof: #18201C;
  --sc-stone: #232A26;

  --sc-water-0: #1F3330;
  --sc-water-1: #142420;
  --sc-water-2: #0E1A17;
  --sc-glint: #C9D8CC;
  --sc-ripple: #9FB4A8;
  --sc-shore: #0B1512;
  --sc-shore-2: #13211C;

  --sc-fl-gold: #5E5734;
  --sc-fl-gold-2: #4E482B;
  --sc-fl-white: #8D968A;
  --sc-fl-clay: #4F3A2E;
  --sc-fl-blue: #3E4C55;
  --sc-fl-eye: #151A16;
  --sc-stem: #1F2E26;

  --sc-dusk-0: #06100D;
  --sc-dusk-1: #0A1613;
  --sc-dusk-2: #11201C;
  --sc-dusk-3: #152520;
  --sc-dwater-0: #16251F;
  --sc-dwater-1: #0F1C18;
  --sc-dwater-2: #0B1512;
  --sc-ground: var(--ground, #0A0E0C);
  --sc-ridge-1: #1A2721;
  --sc-ridge-2: #131D18;
  --sc-ray: #CFE0D2;

  --sc-grain: .6;
  --sc-mist-a: .55;
}

/* ---------- Container ---------- */
.scene {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  contain: paint;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  /* the sky shows before the script runs, and if it never does */
  background: linear-gradient(180deg, var(--sc-sky-0), var(--sc-sky-1) 58%, var(--sc-sky-2));
}
.scene > .scene-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  overflow: hidden;
}
/* film grain: a static noise tile, zero-mean (soft-light), so it never shifts contrast */
.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: var(--sc-grain);
  mix-blend-mode: var(--sc-grain-blend);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 1.6 0 0 0 -.3'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 240px 240px;
}

.scene--ridge,
.scene[data-scene="ridge"] {
  height: clamp(56px, 7.5vw, 120px);
  margin-bottom: -1px; /* tuck under the footer: no hairline seam */
  background: none;
}
.scene--ridge::after,
.scene[data-scene="ridge"]::after { display: none; }
.scene[data-scene="water"] {
  background: linear-gradient(180deg, var(--sc-dusk-0, var(--sc-sky-0)), var(--sc-dusk-2, var(--sc-sky-2)));
}

/* ---------- Theme-specific elements ---------- */
.scene .sc-night { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .scene .sc-night { display: inline; }
  :root:not([data-theme="light"]) .scene .sc-day { display: none; }
}
:root[data-theme="dark"] .scene .sc-night { display: inline; }
:root[data-theme="dark"] .scene .sc-day { display: none; }

/* ---------- Ambient motion (breath and wind) ---------- */
/* Each animated element carries its own rhythm as --t (duration) and
   --o (a negative offset), so no two clouds, birds or blades move in step. */
.scene .sc-halo { transform-box: fill-box; transform-origin: center; animation: sc-halo var(--t, 8s) var(--ease-in-out, cubic-bezier(.65, 0, .35, 1)) var(--o, 0s) infinite; }
.scene .sc-drift { animation: sc-drift var(--t, 100s) ease-in-out var(--o, 0s) infinite alternate; }
.scene .sc-mist { animation: sc-mist var(--t, 32s) ease-in-out var(--o, 0s) infinite alternate; }
.scene .sc-soar-x { animation: sc-soar-x var(--t, 36s) ease-in-out var(--o, 0s) infinite alternate; }
.scene .sc-soar-y { animation: sc-soar-y var(--t, 36s) ease-in-out var(--o, 0s) infinite alternate; }
.scene .sc-flap { transform-box: view-box; transform-origin: 0 0; animation: sc-flap var(--t, 9s) ease-in-out var(--o, 0s) infinite; }
.scene .sc-sway { transform-box: fill-box; transform-origin: 50% 100%; animation: sc-sway var(--t, 12s) ease-in-out var(--o, 0s) infinite; }
.scene .sc-twinkle { animation: sc-twinkle var(--t, 7s) ease-in-out var(--o, 0s) infinite; }
.scene .sc-wander { animation: sc-wander-a var(--t, 22s) ease-in-out var(--o, 0s) infinite; }
.scene .sc-wander-b { animation-name: sc-wander-b; }
.scene .sc-wander-c { animation-name: sc-wander-c; }
.scene .sc-blink { animation: sc-blink var(--t, 5s) ease-in-out var(--o, 0s) infinite; }
.scene .sc-glint { animation: sc-glint var(--t, 8s) ease-in-out var(--o, 0s) infinite alternate; }
.scene .sc-ripple { transform-box: fill-box; transform-origin: center; animation: sc-ripple var(--t, 18s) ease-in-out var(--o, 0s) infinite alternate; }
.scene .sc-current { animation: sc-current var(--t, 14s) linear var(--o, 0s) infinite; }
.scene .sc-ray { animation: sc-ray var(--t, 28s) ease-in-out var(--o, 0s) infinite alternate; }

@keyframes sc-halo {
  0%, 100% { transform: scale(1); opacity: .82; }
  50% { transform: scale(1.07); opacity: 1; }
}
@keyframes sc-drift {
  from { transform: translateX(0); }
  to { transform: translateX(var(--d, 60px)); }
}
@keyframes sc-mist {
  from { transform: translateX(calc(var(--mx, 30px) * -1)); opacity: .55; }
  to { transform: translateX(var(--mx, 30px)); opacity: 1; }
}
@keyframes sc-soar-x {
  from { transform: translateX(calc(var(--sx, 40px) * -1)); }
  to { transform: translateX(var(--sx, 40px)); }
}
@keyframes sc-soar-y {
  from { transform: translateY(calc(var(--sy, 12px) * -1)); }
  to { transform: translateY(var(--sy, 12px)); }
}
@keyframes sc-flap {
  0%, 22%, 100% { transform: scaleY(1); }
  4% { transform: scaleY(-.5); }
  8% { transform: scaleY(1); }
  12% { transform: scaleY(-.4); }
  16% { transform: scaleY(.95); }
}
/* irregular gusts rather than a metronome; skew bends like a stem in wind */
@keyframes sc-sway {
  0%, 100% { transform: skewX(0deg); }
  18% { transform: skewX(-4deg); }
  30% { transform: skewX(-1deg); }
  46% { transform: skewX(-6deg); }
  62% { transform: skewX(1.5deg); }
  80% { transform: skewX(-2.5deg); }
}
@keyframes sc-twinkle {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}
@keyframes sc-wander-a {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(16px, -10px); }
  50% { transform: translate(30px, 3px); }
  75% { transform: translate(12px, 12px); }
}
@keyframes sc-wander-b {
  0%, 100% { transform: translate(0, 0); }
  30% { transform: translate(-18px, -14px); }
  55% { transform: translate(-6px, -26px); }
  80% { transform: translate(10px, -8px); }
}
@keyframes sc-wander-c {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(10px, 8px); }
  45% { transform: translate(-14px, 14px); }
  70% { transform: translate(-22px, -4px); }
}
@keyframes sc-blink {
  0%, 38%, 100% { opacity: .12; }
  52% { opacity: 1; }
  66% { opacity: .55; }
  80% { opacity: .2; }
}
@keyframes sc-glint {
  from { transform: translateX(calc(var(--gx, 6px) * -1)); opacity: .25; }
  to { transform: translateX(var(--gx, 6px)); opacity: .95; }
}
@keyframes sc-ripple {
  from { transform: scaleX(.86); opacity: .25; }
  to { transform: scaleX(1.12); opacity: .8; }
}
@keyframes sc-ray {
  from { opacity: .12; }
  to { opacity: .4; }
}
@keyframes sc-current {
  0% { transform: translate(0, 0); opacity: 0; }
  20% { opacity: .8; }
  80% { opacity: .6; }
  100% { transform: translate(var(--cx, 0px), var(--cy, 30px)); opacity: 0; }
}

/* ---------- Entrance (home, once per session) ---------- */
.scene.is-entering .sc-rise {
  animation: sc-rise 1.15s var(--ease-out, cubic-bezier(.22, 1, .36, 1)) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}
.scene.is-entering .scene-layer[data-depth="0"] .sc-rise { animation-name: sc-fade; }
@keyframes sc-rise {
  from { opacity: 0; transform: translateY(calc(16px + var(--i, 0) * 7px)); }
  to { opacity: 1; transform: none; }
}
@keyframes sc-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- Pausing ---------- */
/* user pause, off-screen and hidden tab all freeze the ambient loops */
.scene.is-paused *:not(.sc-rise),
.scene.is-offscreen * { animation-play-state: paused !important; }

/* ---------- Reduced motion: a still frame ---------- */
.scene.is-still *,
.scene.is-still *::before,
.scene.is-still *::after { animation: none !important; transition: none !important; }
.scene.is-still .scene-layer { transform: none !important; }
@media (prefers-reduced-motion: reduce) {
  .scene *, .scene *::before, .scene *::after { animation: none !important; transition: none !important; }
  .scene .scene-layer { transform: none !important; }
}
html[data-motion="reduce"] .scene *,
html[data-motion="reduce"] .scene *::before,
html[data-motion="reduce"] .scene *::after { animation: none !important; transition: none !important; }
html[data-motion="reduce"] .scene .scene-layer { transform: none !important; }

/* ---------- High contrast, forced colors, print: no illustrations ---------- */
html[data-contrast="high"] .scene { display: none !important; }
@media (forced-colors: active) {
  .scene { display: none !important; }
}
@media print {
  .scene { display: none !important; }
}
