/* Selected work as a flight up a river valley (js/peaks.js). Only applies once the scene is on. */

/* Night valley on dark, misty morning on light. Everything stays in the site's blue family. */
:root, [data-theme="dark"] {
  /* Night valley: moonlit navy ridges, mist pooling on the floor, a glowing turquoise river */
  --pk-horizon: #1b2250; --pk-mist: #20285a; --pk-mist-k: 0.55;
  --pk-floor-s: #0e1229; --pk-floor-l: #262e5c;
  --pk-rock-s: #0d1028; --pk-rock-l: #4a5596;
  --pk-snow-s: #2a3164; --pk-snow-l: #b4bdf0;
  --pk-pine: #0a0d24; --pk-water: #2fd6c6; --pk-halo: #1aa89c; --pk-tip: #c9fff8;
  --pk-veil: rgba(8, 8, 10, 0.12);
}
[data-theme="light"] {
  /* Misty morning, kept pale so the cards lead */
  --pk-horizon: #e6e9f6; --pk-mist: #f2f3f8; --pk-mist-k: 0.7;
  --pk-floor-s: #c4cae6; --pk-floor-l: #eceef7;
  --pk-rock-s: #a3acd6; --pk-rock-l: #f1f2f9;
  --pk-snow-s: #cfd5f0; --pk-snow-l: #ffffff;
  --pk-pine: #6f7bb8; --pk-water: #19bdb1; --pk-halo: #19bdb1; --pk-tip: #ffffff;
  --pk-veil: rgba(247, 247, 245, 0.3);
}

#work.pk-on { padding: 0; }
.pk-track { position: relative; }
.pk-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; isolation: isolate; }
.pk-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; }
.pk-stage::after { /* soft fade into the page at top and bottom */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  /* the valley stays a backdrop: a soft veil, edges fading into the page */
  background:
    linear-gradient(to bottom, var(--bg) 0, transparent 24%, transparent 84%, var(--bg) 100%),
    radial-gradient(ellipse 75% 70% at 50% 55%, transparent 40%, var(--bg) 120%),
    var(--pk-veil);
}

.pk-hud { position: absolute; left: 0; right: 0; top: 0; padding-top: calc(64px + clamp(20px, 4vh, 40px)); z-index: 5; pointer-events: none; }
.pk-hud .section-head { margin-bottom: 0; }
.pk-hud .mono { font-variant-numeric: tabular-nums; }

.pk-cards { position: absolute; inset: 0; z-index: 3; }
.pk-card { position: absolute; left: 0; top: 0; opacity: 0; transform-origin: 50% 50%; will-change: transform, opacity; }
.pk-card:not(.is-up) { pointer-events: none; }
.case.pk-case {
  display: grid; grid-template-columns: 1fr; gap: 0;
  background: var(--bg-card); border-radius: 16px; overflow: hidden;
  box-shadow: 0 50px 110px -30px rgba(0, 0, 0, 0.8), 0 18px 40px -20px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--line-strong);
  opacity: 1; transform: none; transition: none;
}
.pk-case .shot-wrap { order: -1; }
.pk-case .shot-wrap::before { display: none; }
.pk-case .shot { border-radius: 0; box-shadow: none; }
.pk-case .shot.stage { padding: 20px 0 0 20px; }
.pk-case .case-text { padding: 20px 24px 22px; gap: 10px; }
.pk-case .case-meta { font-size: 12px; }
.pk-case .case-meta::after { content: "\2192"; margin-left: auto; color: var(--ink); transition: transform 0.3s var(--ease); }
.pk-case:hover .case-meta::after { transform: translateX(4px); }
.pk-case h3 { font-size: 28px; }
.pk-case h3 .h-sub { margin-top: 4px; font-size: 16px; }
.pk-case p, .pk-case .case-link { display: none; }
.pk-case .case-stat { gap: 24px; padding-top: 12px; }
.pk-case .case-stat b { font-size: 19px; }
.pk-case .case-stat span { font-size: 12px; }
.pk-compact .pk-case .case-stat { display: none; }
.pk-case:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* Wide screens: image beside the text, so the card reads wide and short */
@media (min-width: 1100px) {
  .case.pk-case { grid-template-columns: 1.15fr 1fr; align-items: stretch; }
  .pk-case .shot { height: 100%; aspect-ratio: auto; min-height: 260px; }
  .pk-case .case-text { justify-content: center; padding: 26px 28px; }
}
