/* Scenic intros, subject tonal grading, ambient light, and organic motion layers. */

.hero {
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at 74% 50%, #385840, var(--ink) 61%);
}
.landscape {
  position: absolute;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
  pointer-events: none;
}
.scene-backdrop {
  position: absolute;
  z-index: 0;
  inset: -48px -18px;
  width: calc(100% + 36px);
  height: calc(100% + 96px);
  max-width: none;
  object-fit: cover;
  object-position: 65% 48%;
}
.archive-intro .scene-backdrop { object-position: center 56%; }
.scene-desk .scene-backdrop { object-position: 70% 78%; }

/* Foreground subjects: graded into each scene's cool deep-green atmosphere. */
.scene-subject {
  position: absolute;
  z-index: 2;
  right: max(var(--gutter), calc((100vw - 83rem) / 2));
  bottom: 3%;
  width: min(44vw, 48rem);
  height: 70%;
  object-fit: contain;
  object-position: center bottom;
}

/* Overhanging canopy branch (Archive & Contact): tucked into upper-right corner,
   toned down and softly defocused so it reads as solid backlit foreground foliage. */
.scene-canopy {
  top: -10%;
  right: -7vw;
  bottom: auto;
  width: min(35vw, 36rem);
  height: 62%;
  object-position: right top;
  transform-origin: 94% 6%;
  opacity: .96;
  filter: brightness(.46) contrast(.92) saturate(.50) hue-rotate(20deg) blur(.7px);
  -webkit-mask-image: radial-gradient(ellipse 118% 114% at 92% 14%, #000 78%, rgb(0 0 0 / .90) 92%, transparent 100%);
  mask-image: radial-gradient(ellipse 118% 114% at 92% 14%, #000 78%, rgb(0 0 0 / .90) 92%, transparent 100%);
}
.river-intro .scene-canopy {
  top: -14%;
  right: -8vw;
  width: min(33vw, 34rem);
  height: 56%;
  opacity: .95;
  filter: brightness(.42) contrast(.94) saturate(.46) hue-rotate(18deg) blur(.75px);
}

/* Forest understory fern (Profile): nestled into lower-right shade. */
.scene-botanical {
  right: -6vw;
  bottom: -14%;
  width: min(44vw, 47rem);
  height: 92%;
  transform-origin: 88% 88%;
  opacity: .92;
  filter: brightness(.56) contrast(.94) saturate(.62) hue-rotate(15deg) blur(.45px);
  -webkit-mask-image: radial-gradient(ellipse 94% 92% at 82% 76%, #000 68%, rgb(0 0 0 / .82) 86%, transparent 100%);
  mask-image: radial-gradient(ellipse 94% 92% at 82% 76%, #000 68%, rgb(0 0 0 / .82) 86%, transparent 100%);
}

/* Grounded bench objects (Work, Writing, Internship): cooled into window light. */
.scene-desk .scene-subject {
  opacity: .94;
  filter: brightness(.80) contrast(.96) saturate(.74) hue-rotate(8deg);
}
.scene-glassware {
  height: 70%;
  opacity: .93;
  filter: brightness(.74) contrast(.95) saturate(.58) hue-rotate(14deg);
}
.scene-notebook, .scene-manuscript {
  scale: 1 .66;
  transform-origin: center bottom;
}
.fern-img {
  filter: brightness(.92) contrast(.98) saturate(.88);
}

/* Soft canopy backlight and text-side readability veil. */
.landscape::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: -4% 0;
  pointer-events: none;
  background: radial-gradient(ellipse 40% 54% at 82% 14%, rgb(246 238 194 / .20), rgb(208 226 170 / .09) 46%, transparent 90%);
}
.landscape::after {
  z-index: 4;
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, #172a20 2%, rgb(23 42 32 / .94) 22%, rgb(23 42 32 / .78) 45%, rgb(23 42 32 / .14) 76%),
    linear-gradient(0deg, rgb(23 42 32 / .60), transparent 34%);
}
.scene-desk .landscape::after {
  background:
    linear-gradient(90deg, #172a20 2%, rgb(23 42 32 / .94) 22%, rgb(23 42 32 / .78) 45%, rgb(23 42 32 / .10) 76%),
    linear-gradient(0deg, rgb(18 34 26 / .68) 0%, rgb(23 42 32 / .28) 14%, transparent 34%);
}

.scenic-intro { position: relative; overflow: hidden; }
.scenic-intro .page-inner { position: relative; z-index: 1; padding-block: clamp(2.1rem, 4.4vw, 4rem) clamp(3.8rem, 7vw, 7.5rem); }
.scenic-intro .page-lead { max-width: min(46ch, 50%); color: var(--white); }

/* Ambient atmospheric light: volumetric shafts, warm-green glow, mist, and motes. */
.scene-light {
  position: absolute;
  z-index: 3;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.light-shaft {
  position: absolute;
  top: -32%;
  height: 165%;
  transform-origin: top center;
  mix-blend-mode: screen;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 14%, rgb(0 0 0 / .78) 58%, transparent 96%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 14%, rgb(0 0 0 / .78) 58%, transparent 96%);
}
.light-shaft-a {
  right: 8%;
  width: 38%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgb(214 234 182 / .06) 14%,
    rgb(240 248 210 / .19) 34%,
    rgb(208 226 170 / .07) 52%,
    rgb(234 244 198 / .15) 70%,
    rgb(202 224 168 / .04) 86%,
    transparent 100%
  );
  transform: rotate(-25deg);
  animation: shaft-breathe-a 16s ease-in-out infinite alternate;
}
.light-shaft-b {
  right: 28%;
  width: 24%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgb(204 226 174 / .045) 20%,
    rgb(234 244 200 / .14) 50%,
    rgb(196 220 168 / .04) 80%,
    transparent 100%
  );
  transform: rotate(-21deg);
  animation: shaft-breathe-b 21s ease-in-out infinite alternate;
}
.scene-desk .light-shaft-a {
  right: 6%;
  width: 36%;
  transform: rotate(-32deg);
  animation-name: shaft-desk-a;
}
.scene-desk .light-shaft-b {
  right: 24%;
  width: 22%;
  transform: rotate(-28deg);
  animation-name: shaft-desk-b;
}

.light-glow {
  --glow-size: clamp(26rem, 48vw, 46rem);
  position: absolute;
  top: 24%;
  left: 74%;
  width: var(--glow-size);
  height: var(--glow-size);
  margin-top: calc(var(--glow-size) / -2);
  margin-left: calc(var(--glow-size) / -2);
  border-radius: 50%;
  mix-blend-mode: screen;
  background: radial-gradient(circle, rgb(236 246 202 / .24) 0%, rgb(188 218 164 / .115) 38%, rgb(146 188 142 / .038) 62%, transparent 74%);
}
.light-haze {
  position: absolute;
  inset: 20% -10% -8% 18%;
  background: radial-gradient(ellipse 68% 58% at 64% 66%, rgb(202 224 186 / .135), rgb(164 198 158 / .055) 54%, transparent 78%);
  animation: haze-drift 26s ease-in-out infinite alternate;
}

.light-motes { position: absolute; inset: 0; }
.light-motes i {
  position: absolute;
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(248 252 226 / .92) 0%, rgb(214 232 178 / .36) 44%, transparent 74%);
  opacity: 0;
  animation: mote-float 16s ease-in-out infinite;
}
.light-motes i:nth-child(1) { left: 52%; top: 68%; width: 4px; height: 4px; animation-duration: 15s; animation-delay: -2s; }
.light-motes i:nth-child(2) { left: 61%; top: 44%; width: 6px; height: 6px; animation-duration: 19s; animation-delay: -7s; }
.light-motes i:nth-child(3) { left: 70%; top: 72%; width: 4px; height: 4px; animation-duration: 14s; animation-delay: -11s; }
.light-motes i:nth-child(4) { left: 76%; top: 34%; width: 5px; height: 5px; animation-duration: 21s; animation-delay: -4s; }
.light-motes i:nth-child(5) { left: 83%; top: 58%; width: 6px; height: 6px; animation-duration: 17s; animation-delay: -13s; }
.light-motes i:nth-child(6) { left: 57%; top: 26%; width: 4px; height: 4px; animation-duration: 22s; animation-delay: -9s; }
.light-motes i:nth-child(7) { left: 88%; top: 40%; width: 4px; height: 4px; animation-duration: 16s; animation-delay: -5s; }
.light-motes i:nth-child(8) { left: 66%; top: 56%; width: 5px; height: 5px; animation-duration: 20s; animation-delay: -15s; }

/* Hint compositor promotion only while motion is live. */
html:not([data-still]) .scene-backdrop,
html:not([data-still]) .scene-subject,
html:not([data-still]) .fern-img,
html:not([data-still]) .light-glow {
  will-change: transform;
}

@keyframes shaft-breathe-a {
  0% { transform: translate3d(-1.5%, 0, 0) rotate(-26deg); opacity: .72; }
  100% { transform: translate3d(2%, 1%, 0) rotate(-23.5deg); opacity: 1; }
}
@keyframes shaft-breathe-b {
  0% { transform: translate3d(1.5%, 0, 0) rotate(-20deg); opacity: .55; }
  100% { transform: translate3d(-2%, 1.5%, 0) rotate(-22.5deg); opacity: .92; }
}
@keyframes shaft-desk-a {
  0% { transform: translate3d(-1%, 0, 0) rotate(-33deg); opacity: .68; }
  100% { transform: translate3d(1.5%, .5%, 0) rotate(-31deg); opacity: .96; }
}
@keyframes shaft-desk-b {
  0% { transform: translate3d(1%, 0, 0) rotate(-27.5deg); opacity: .52; }
  100% { transform: translate3d(-1.5%, 1%, 0) rotate(-29.5deg); opacity: .88; }
}
@keyframes haze-drift {
  0% { transform: translate3d(-3%, 1%, 0) scale(1); opacity: .72; }
  100% { transform: translate3d(3.5%, -1.5%, 0) scale(1.04); opacity: 1; }
}
@keyframes mote-float {
  0% { transform: translate3d(0, 14px, 0); opacity: 0; }
  22% { opacity: .68; }
  55% { transform: translate3d(14px, -18px, 0); opacity: .82; }
  82% { opacity: .45; }
  100% { transform: translate3d(24px, -46px, 0); opacity: 0; }
}

[data-still] .scene-light * {
  animation: none !important;
}
[data-still] .light-motes i {
  opacity: .32;
}
[data-still] .scene-backdrop,
[data-still] .scene-subject,
[data-still] .fern-img,
[data-still] .light-glow {
  will-change: auto;
}

@media (max-width: 700px) {
  .scenic-intro .page-lead { max-width: min(43ch, 100%); }
  .scenic-intro .page-inner { padding-top: clamp(7rem, 25vw, 11rem); }
  .scenic-intro .landscape::after {
    background: linear-gradient(0deg, #172a20 2%, rgb(23 42 32 / .94) 42%, rgb(23 42 32 / .20) 86%);
  }
  .scene-subject {
    inset: -.2rem 0 auto auto;
    width: min(75vw, 27rem);
    height: clamp(9rem, 32vw, 16rem);
  }
  .scene-canopy {
    inset: -5% -11% auto auto;
    width: min(48vw, 15rem);
    height: 33%;
    opacity: .94;
  }
  .river-intro .scene-canopy {
    top: -6%;
    right: -11%;
    width: min(46vw, 14.5rem);
    height: 31%;
  }
  .scene-botanical {
    inset: -4% -10% auto auto;
    width: min(54vw, 17.5rem);
    height: 43%;
    opacity: .88;
  }
  .scene-desk .landscape { bottom: auto; height: clamp(11rem, 37vw, 18rem); }
  .scenic-intro.scene-desk .landscape::after {
    background: linear-gradient(0deg, var(--ink), transparent 32%), linear-gradient(90deg, rgb(32 55 44 / .7), transparent 75%);
  }
  .scene-desk .page-inner { padding-top: clamp(8.5rem, 29vw, 13rem); }
  .hero .landscape::after {
    background: linear-gradient(0deg, #172a20 3%, rgb(23 42 32 / .95) 51%, rgb(23 42 32 / .8) 68%, rgb(23 42 32 / .17) 95%);
  }
  .light-shaft-a { width: 52%; right: 4%; }
  .light-shaft-b { width: 32%; right: 24%; }
  .light-glow { left: 72%; top: 18%; }
  .light-motes i:nth-child(n+5) { display: none; }
}

@media (hover: none), (pointer: coarse) {
  .light-motes i { animation-duration: 24s; opacity: .28; }
}

@media (prefers-reduced-motion: reduce) {
  .scene-light * { animation: none !important; }
  .light-motes i { opacity: .26; }
  .scene-backdrop, .scene-subject, .fern-img, .light-glow { will-change: auto; }
}
