/*
 * Darja Rihla — Build Log 001 · Mirror / Depth / Layers refresh
 * Additive visual layer for the existing Startup Lab / Build Log page.
 * Does not replace dr-startup-lab.css, its colours, tokens or layout —
 * it reuses --gold / --gold2 / --cyan / --panel / --line from that file
 * and applies the same fixed-depth-field + glass-plane + water-reflection
 * technique already proven on the homepage World Engine and the blog
 * (dr-home-scroll-journey.css, dr-blog.css).
 */

.dr-log__world-environment,
.dr-log__world-horizon,
.dr-log__foreground-glass {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.dr-log__world-environment {
  background:
    radial-gradient(ellipse 58% 38% at 72% 18%, rgba(209, 165, 85, .10), transparent 68%),
    radial-gradient(ellipse 46% 30% at 18% 82%, rgba(110, 215, 232, .07), transparent 70%),
    linear-gradient(155deg, rgba(2, 8, 13, .0), rgba(4, 10, 16, .35));
  mix-blend-mode: screen;
  opacity: .85;
}

.dr-log__world-horizon {
  top: 24vh;
  bottom: auto;
  height: 1px;
  background: linear-gradient(90deg, transparent 6%, rgba(209, 165, 85, .16) 26%, rgba(240, 200, 120, .55) 52%, rgba(110, 215, 232, .2) 78%, transparent 96%);
  box-shadow: 0 0 22px rgba(209, 165, 85, .28), 0 -30px 90px rgba(209, 165, 85, .06);
  opacity: .55;
}

.dr-log__foreground-glass {
  z-index: 3;
  overflow: hidden;
}

.dr-log__glass-plane {
  position: absolute;
  border: 1px solid rgba(240, 200, 120, .14);
  background: linear-gradient(125deg, rgba(240, 200, 120, .07), rgba(110, 215, 232, .025) 46%, transparent 78%);
  box-shadow: inset 0 1px rgba(255, 255, 255, .08), 0 22px 70px rgba(0, 0, 0, .22);
  backdrop-filter: blur(2px) saturate(114%);
  -webkit-backdrop-filter: blur(2px) saturate(114%);
  opacity: .5;
  will-change: transform;
}

.dr-log__glass-plane:nth-child(1) {
  width: min(20vw, 300px); height: 56vh; right: -8vw; top: 6vh;
  transform: translate3d(0, calc(var(--dr-lab-scroll, 0px) * -.2), 0) rotate(-6deg);
}
.dr-log__glass-plane:nth-child(2) {
  width: min(14vw, 210px); height: 42vh; left: -7vw; top: 52vh;
  transform: translate3d(0, calc(var(--dr-lab-scroll, 0px) * -.28), 0) rotate(8deg);
}

/* Article body sits above the depth field and glass planes. */
.dr-log__hero,
.dr-log__body { position: relative; z-index: 4; }

/* Richer water reflection under the release stage — layers on top of the
   base .dr-release-stage__reflection rule already in dr-startup-lab.css,
   same element, same markup, no HTML change required for this part.
   Note: dr-startup-lab.css is linked from inside the post body itself
   (not enqueued), so it actually parses AFTER this enqueued stylesheet.
   The extra .dr-log ancestor selector raises specificity so this override
   wins regardless of that load order, instead of relying on source order. */
.dr-log .dr-release-stage__reflection {
  opacity: .16;
  animation: drLabWaterReflection 7s ease-in-out infinite alternate;
}

/* Mirror reflections under the two acceptance-gallery screenshots. */
.dr-log__gallery figure { position: relative; overflow: visible; }
.dr-log__gallery figure::after {
  content: "";
  position: absolute;
  left: 8%; right: 8%; top: 100%; height: 34px;
  opacity: .18;
  filter: blur(6px);
  background: inherit;
  transform: scaleY(-1) perspective(200px) rotateX(20deg);
  transform-origin: top;
  mask-image: linear-gradient(to bottom, #000, transparent 82%);
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 82%);
  pointer-events: none;
  animation: drLabWaterReflection 7s ease-in-out infinite alternate;
}

/* Scroll-reveal for article sections (progressive enhancement — sections
   are fully visible without JS; see dr-startup-lab.js). */
.dr-log__content section.dr-log-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 700ms ease, transform 700ms ease;
}
.dr-log__content section.dr-log-reveal.is-visible {
  opacity: 1;
  transform: none;
}

@keyframes drLabWaterReflection {
  from { transform: scaleY(-1) perspective(200px) rotateX(20deg) translateX(-2px); }
  to   { transform: scaleY(-.92) perspective(200px) rotateX(20deg) translateX(3px); }
}

@media (max-width: 850px) {
  .dr-log__glass-plane:nth-child(2) { display: none; }
  .dr-log__glass-plane:nth-child(1) { width: 30vw; right: -16vw; opacity: .32; }
  .dr-release-stage__reflection,
  .dr-log__gallery figure::after { opacity: .1; }
}

@media (prefers-reduced-motion: reduce) {
  .dr-release-stage__reflection,
  .dr-log__gallery figure::after { animation: none; }
  .dr-log__glass-plane { transform: none !important; }
  .dr-log__content section.dr-log-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
