/* Homepage hero scene: depth layers on top of homepage-sky.css.
   Back to front: sky gradient, horizon glow, moon/sun, far range, near range,
   trees, grass (lw-hill-3), stone. Everything here is decorative (aria-hidden). */

:root .homepage-classic .hero-world {
  --hero-ground-height: 72px;
  --scene-stone: 20px;
  overflow: hidden;
  padding-bottom: 148px;
  border-bottom: 3px solid #26292f;
  background: linear-gradient(180deg, #101d36 0%, #19305a 38%, #2c4a74 70%, #46617e 100%);
}
:root[data-theme="light"] .homepage-classic .hero-world {
  border-bottom-color: #4f545c;
  background: linear-gradient(180deg, #5fb0ec 0%, #8fcbf3 40%, #b9e1f6 72%, #e4ecdc 100%);
}
.homepage-classic .hero-world .lw-in { position: relative; z-index: 2; }

/* The old faint hills and tiny moon give way to the layers below. */
:root .homepage-classic .hero-world :is(.lw-hill-1, .lw-hill-2) { display: none; }
:root .homepage-classic .sky-celestial { display: none; }

.scene { position: absolute; inset: 0; pointer-events: none; }

/* ---- Horizon glow: dusk in dark theme, warm haze in light ---- */
.scene-glow {
  position: absolute; inset: auto 0 0; height: 70%;
  background:
    radial-gradient(ellipse 70% 55% at 68% 100%, rgba(255, 146, 92, .26), transparent 70%),
    radial-gradient(ellipse 60% 45% at 18% 100%, rgba(186, 120, 200, .16), transparent 70%),
    linear-gradient(to top, rgba(120, 92, 150, .22), transparent 60%);
}
:root[data-theme="light"] .scene-glow {
  background:
    radial-gradient(ellipse 70% 55% at 68% 100%, rgba(255, 214, 150, .45), transparent 70%),
    linear-gradient(to top, rgba(255, 240, 210, .5), transparent 55%);
}

/* ---- A proper moon (sun in light theme) framing the server card ---- */
.scene-body {
  position: absolute; top: 112px; left: calc(50% + 452px);
  width: 64px; height: 64px; box-sizing: border-box;
  border: 4px solid #c9d3ea;
  background:
    linear-gradient(#a9b6d6, #a9b6d6) 34px 10px / 12px 12px no-repeat,
    linear-gradient(#b8c4e0, #b8c4e0) 12px 32px / 10px 10px no-repeat,
    linear-gradient(#b8c4e0, #b8c4e0) 38px 38px / 6px 6px no-repeat,
    #e4ebf8;
  box-shadow: 0 0 0 10px rgba(200, 214, 245, .07), 0 0 0 22px rgba(200, 214, 245, .04), 0 0 90px 30px rgba(170, 190, 240, .18);
}
:root[data-theme="light"] .scene-body {
  border-color: #ffd23f;
  background: linear-gradient(#fff3a8, #fff3a8) 10px 10px / 16px 8px no-repeat, #ffe36b;
  box-shadow: 0 0 0 10px rgba(255, 225, 110, .22), 0 0 0 22px rgba(255, 225, 110, .1), 0 0 90px 34px rgba(255, 210, 90, .35);
}

/* ---- Two blocky mountain ranges, tiled ---- */
.scene-range {
  position: absolute; left: 0; right: 0;
  bottom: calc(var(--scene-stone) + var(--hero-ground-height) * .45);
  mask-repeat: repeat-x; mask-position: left bottom;
  -webkit-mask-repeat: repeat-x; -webkit-mask-position: left bottom;
}
.scene-range-far {
  height: 200px; background: linear-gradient(#243b5e, #2c4566);
  mask-image: url("/static/hero-range-far.svg"); mask-size: 873px 200px;
  -webkit-mask-image: url("/static/hero-range-far.svg"); -webkit-mask-size: 873px 200px;
  opacity: .92;
}
.scene-range-caps {
  background: #7f93b9; opacity: .6;
  mask-image: url("/static/hero-range-far-caps.svg");
  -webkit-mask-image: url("/static/hero-range-far-caps.svg");
}
.scene-range-near {
  height: 120px; background: linear-gradient(#20394f, #1c3344 70%);
  mask-image: url("/static/hero-range-near.svg"); mask-size: 720px 120px; mask-position: 37% bottom;
  -webkit-mask-image: url("/static/hero-range-near.svg"); -webkit-mask-size: 720px 120px; -webkit-mask-position: 37% bottom;
}
.scene-range-rim {
  background: #2f5a4a;
  mask-image: url("/static/hero-range-near-rim.svg");
  -webkit-mask-image: url("/static/hero-range-near-rim.svg");
}
/* Low forest just behind the grass ties the hills to the ground. */
.scene-forest {
  bottom: calc(var(--scene-stone) + var(--hero-ground-height) * .5);
  height: 56px; background: #1a3a2c;
  mask-image: url("/static/hero-forest.svg"); mask-size: 560px 56px; mask-position: 12% bottom;
  -webkit-mask-image: url("/static/hero-forest.svg"); -webkit-mask-size: 560px 56px; -webkit-mask-position: 12% bottom;
}
:root[data-theme="light"] .scene-range-far { background: linear-gradient(#9cc4e2, #b3d4e8); opacity: .95; }
:root[data-theme="light"] .scene-range-caps { background: #f4f9ff; opacity: .95; }
:root[data-theme="light"] .scene-range-near { background: linear-gradient(#7cad8b, #8fbd99); }
:root[data-theme="light"] .scene-range-rim { background: #a3d08a; }
:root[data-theme="light"] .scene-forest { background: #4f8a4a; }

/* ---- Ground: grass sits on a stone layer instead of ending abruptly ---- */
:root .homepage-classic .hero-world .lw-hill-3 { bottom: var(--scene-stone); height: var(--hero-ground-height); opacity: 1; z-index: 1; }
.scene::after {
  content: ""; position: absolute; inset: auto 0 0; height: var(--scene-stone); z-index: 1;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='20' shape-rendering='crispEdges'%3E%3Crect width='40' height='20' fill='%23464a52'/%3E%3Crect x='4' y='3' width='8' height='4' fill='%23565b64'/%3E%3Crect x='22' y='2' width='10' height='4' fill='%233b3f46'/%3E%3Crect x='14' y='11' width='8' height='4' fill='%23565b64'/%3E%3Crect x='30' y='12' width='6' height='5' fill='%2352565e'/%3E%3Crect x='0' y='14' width='6' height='4' fill='%233b3f46'/%3E%3C/svg%3E") left top / 40px 20px repeat-x;
}
:root[data-theme="light"] .scene::after { filter: brightness(1.35); }
:root .homepage-classic .hero-world .lw-torch { z-index: 1; }
:root .homepage-classic .lw-t1 { bottom: calc(var(--scene-stone) + var(--hero-ground-height) * 20 / 36 - 2px); }
:root .homepage-classic .lw-t2 { right: auto; left: calc(50% + 566px); bottom: calc(var(--scene-stone) + var(--hero-ground-height) * 24 / 36 - 2px); }

/* ---- Pixel oaks just outside the content column (both on a y=12 grass step) ---- */
.scene-tree {
  position: absolute; z-index: 1; width: 70px; height: 91px;
  bottom: calc(var(--scene-stone) + var(--hero-ground-height) * 24 / 36 - 3px);
}
.scene-tree-a { left: calc(50% - 668px); }
.scene-tree-b { left: calc(50% + 612px); width: 56px; height: 73px; }
:root:not([data-theme="light"]) .scene-tree { filter: brightness(.72) saturate(.85); }

/* ---- Night-only life: fireflies and a rare meteor ---- */
.scene-fireflies, .scene-meteor { display: none; }
@media (prefers-reduced-motion: no-preference) {
  :root:not([data-theme="light"]) .scene-fireflies { display: block; }
  :root:not([data-theme="light"]) .scene-meteor { display: block; }
}
.scene-fireflies i {
  position: absolute; left: var(--x); bottom: var(--y); z-index: 1;
  width: 3px; height: 3px; background: #e9ff8a;
  box-shadow: 0 0 6px 2px rgba(220, 255, 120, .55);
  opacity: 0; animation: scene-firefly 7s ease-in-out var(--d) infinite;
}
@keyframes scene-firefly {
  0%, 100% { opacity: 0; transform: translate(0, 0); }
  20% { opacity: .9; }
  50% { opacity: .25; transform: translate(14px, -18px); }
  70% { opacity: .85; transform: translate(-6px, -30px); }
}
.scene-meteor {
  position: absolute; top: 96px; left: 18%;
  width: 90px; height: 2px; transform: rotate(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .85));
  opacity: 0; animation: scene-meteor 16s linear 4s infinite;
}
@keyframes scene-meteor {
  0%, 93% { opacity: 0; transform: translate(0, 0) rotate(-18deg); }
  94% { opacity: 1; }
  100% { opacity: 0; transform: translate(260px, -84px) rotate(-18deg); }
}

/* ---- Smaller screens ---- */
@media (max-width: 1240px) {
  :root .homepage-classic .lw-t2 { left: auto; right: 5%; }
}
@media (max-width: 1000px) {
  .scene-body { top: 104px; left: auto; right: 6%; width: 44px; height: 44px; border-width: 3px; }
  :root .homepage-classic .hero-world { padding-bottom: 136px; }
}
@media (max-width: 680px) {
  :root .homepage-classic .hero-world { --hero-ground-height: 60px; --scene-stone: 16px; padding-bottom: 104px; }
  .scene-body { top: 96px; right: 8%; width: 36px; height: 36px; border-width: 3px; box-shadow: 0 0 0 6px rgba(200, 214, 245, .06), 0 0 40px 12px rgba(170, 190, 240, .16); }
  :root[data-theme="light"] .scene-body { box-shadow: 0 0 0 6px rgba(255, 225, 110, .2), 0 0 40px 14px rgba(255, 210, 90, .3); }
  .scene-range-far { height: 140px; mask-size: 611px 140px; -webkit-mask-size: 611px 140px; }
  .scene-range-near { height: 84px; mask-size: 504px 84px; -webkit-mask-size: 504px 84px; }
  .scene-forest { height: 40px; mask-size: 400px 40px; -webkit-mask-size: 400px 40px; }
}
