/* ============================================================
   Project snapshots: lessons that scroll while the image swaps.
   Lessons on the left, one sticky image frame on the right; the
   frame crossfades to whichever lesson is active (project-lessons.js).
   On phones the frame pins above the lessons with story-style bars.
   ============================================================ */
/* position: sticky (the image frame) doesn't work while html/body are scroll
   containers, which overflow-x: hidden makes them. clip hides sideways overflow
   the same way without that. The header was never actually sticking for the
   same reason, so it's pinned to its current behavior (it scrolls away). */
html, body { overflow-x: hidden; overflow-x: clip; }

.pl-section { color: #111110; padding: 40px 0 0; }
.pl-wrap { max-width: 1280px; margin: 0 auto; padding: 0 64px; box-sizing: border-box; }

/* Section label + mood subtitle (same label style as the other sections) */
.pl-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 8px; }
.pl-title { margin: 0; font-family: Manrope, system-ui, sans-serif; font-size: 15px; font-weight: 500; color: var(--accent-text); } /* follows the mood, like the other section labels */
.pl-sub { margin: 0; font-size: 13px; font-style: italic; color: #555; }

.pl-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 64px; align-items: start; }

/* ---------- Lessons ---------- */
.pl-block {
  min-height: 700px; display: flex; flex-direction: column; justify-content: center; padding-right: 16px;
  transform: translateY(16px);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.pl-block.is-active { transform: none; }
/* Inactive lessons fade by colour (not opacity) so the text stays readable: headline 3.3:1 (large text),
   everything else 5.1:1. */
.pl-block h3, .pl-block .pl-body, .pl-block .pl-label, .pl-block .pl-metric { transition: color 0.4s; }
.pl-block:not(.is-active) h3 { color: #8a8a8a; }
.pl-block:not(.is-active) .pl-body, .pl-block:not(.is-active) .pl-label, .pl-block:not(.is-active) .pl-metric,
.pl-block:not(.is-active) .pl-metric a, .pl-block:not(.is-active) .pl-metric .v2-card-link { color: #6b6b6b; }
.pl-label { font-family: Manrope, system-ui, sans-serif; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #6b6b6b; }
.pl-block h3 {
  margin: 12px 0 0; max-width: 520px;
  font-family: 'Helvetica Neue', Helvetica, 'Inter Tight', Arial, sans-serif;
  font-weight: 700; font-size: 38px; line-height: 1.05; letter-spacing: -0.03em;
}
.pl-body { margin: 16px 0 0; max-width: 460px; font-family: Manrope, system-ui, sans-serif; font-size: 15px; line-height: 1.6; color: #555; }
.pl-metric { margin: 20px 0 0; font-family: Manrope, system-ui, sans-serif; font-size: 13px; font-weight: 600; line-height: 1.4; }
/* "dive deeper" (and the password line the gate swaps in) in the page's ink */
.pl-metric a { color: #111110; text-decoration: none; }
.pl-metric a:hover { color: #555; }
.pl-metric .v2-card-link, .pl-metric form.v2-card-link.is-gate {
  display: inline-flex; color: #111110; font-size: 13px; font-weight: 600; opacity: 1; vertical-align: baseline;
}
html:not(.dive-unlocked) .pl-metric a.v2-card-link[data-gated],
html.dive-unlocked .pl-metric form.v2-card-link.is-gate { display: none; }
.pl-metric .v2-card-link:hover { transform: none; color: #555; }
/* The diving mask / padlock sits before the words. */
.pl-metric a.v2-card-link { align-items: center; gap: 6px; }
/* Centre the icon and words on the metric text's line (inline-flex sat about 3px high). */
.pl-metric a.v2-card-link, .pl-metric form.v2-card-link.is-gate { position: relative; top: 3px; }
.pl-metric a.v2-card-link { top: 4.4px; } /* the unlocked link's own box sits a touch higher than the gate form's */
/* 24px-tall tap targets (WCAG 2.5.8): padding added, cancelled by the negative margin so nothing moves. */
.pl-metric a.v2-card-link, .pl-metric form.v2-card-link.is-gate { padding: 6px 0; margin: -6px 0; }
.pl-metric .is-gate .gate-icon { order: -1; margin-right: 6px; }
.pl-metric .is-gate .gate-label { margin-right: 0; }

/* ---------- Image frame ---------- */
.pl-panel {
  position: sticky; top: max(calc(50vh - 240px), calc(var(--hdr-h, 66px) + 16px)); width: 640px; height: 480px; max-width: 100%; justify-self: end;
  border-radius: 10px; border: 1px solid #e4e3de; overflow: hidden;
  --pl-fade: 0.3s;
}
body[data-mood="zen"] .pl-panel { --pl-fade: 0.8s; }
.pl-layer { position: absolute; inset: 0; opacity: 0; transition: opacity var(--pl-fade) ease-in-out; }
.pl-layer.is-active { opacity: 1; }
.pl-layer img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Layered covers: the flat cover by default; the moving-light stack only where
   a mouse can hover (see project-lessons.js). Hard shadows, never blurred. */
.pl-full, .pl-stack .pl-bg, .pl-stack .pl-back, .pl-stack .pl-front, .pl-sh, .pl-sh img, .pl-floor {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
}
.pl-full, .pl-stack img { object-fit: cover; user-select: none; -webkit-user-drag: none; }
.pl-stack { display: none; position: absolute; inset: 0; overflow: hidden; }
.pl-stack .pl-bg { transform: scale(1.04); }
.pl-sh { -webkit-mask-size: 100% 100%; mask-size: 100% 100%; }
.pl-sh img { opacity: 0.2; }
.pl-stack .pl-back, .pl-stack .pl-front, .pl-sh { will-change: transform; }
@media (prefers-reduced-motion: no-preference) {
  .pl-stack { display: block; }
  .pl-full { display: none; }
}
.pl-ph {
  position: absolute; inset: 24px; border: 1px dashed rgba(255, 255, 255, 0.4); border-radius: 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  text-align: center; color: #fff;
}
.pl-ph span:nth-child(1) { font-family: Manrope, system-ui, sans-serif; font-size: 12px; letter-spacing: 0.06em; opacity: 0.85; }
.pl-ph span:nth-child(2) { font-size: 15px; font-weight: 600; }
.pl-ph span:nth-child(3) { font-size: 12px; opacity: 0.85; }
.pl-bars { display: none; }

/* ---------- Phones: frame pinned above the lessons ---------- */
@media (max-width: 900px) {
  .pl-wrap { padding: 0 20px; }
  .pl-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .pl-panel {
    order: -1; position: sticky; top: 0; width: 100%; height: auto; aspect-ratio: 4 / 3; justify-self: stretch;
    border-radius: 0 0 12px 12px; z-index: 2; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  }
  .pl-block { min-height: 72vh; }
  .pl-block h3 { font-size: 30px; }
  /* 44px more background above the cover; the phones keep their distance from the bottom edge.
     (content-box, so the 4:3 ratio is the art's box and the padding is the extra at the top.) */
  .pl-panel { box-sizing: content-box; padding-top: 44px; }
  .pl-stack .pl-back, .pl-stack .pl-front, .pl-stack .pl-floor, .pl-stack .pl-sh { top: auto; bottom: 0; height: auto; aspect-ratio: 4 / 3; }
  .pl-stack .pl-bg, .pl-full { object-position: bottom; }
  /* The story bars are hidden on phones. */
  .pl-bars { display: none; position: absolute; left: 12px; right: 12px; top: 12px; gap: 6px; z-index: 3; }
  .pl-bar { flex: 1; height: 3px; border-radius: 2px; background: rgba(17, 17, 16, 0.18); transition: background 0.3s; }
  .pl-bar.is-on { background: #111110; }
}

@media (prefers-reduced-motion: reduce) {
  .pl-block, .pl-layer, .pl-bar { transition: none; transform: none; }
}

/* Phones: 16px stops iOS zooming the page when the password field is focused, and a
   wider line is easier to see and tap. */
@media (max-width: 900px) {
  .pl-metric .is-gate .gate-line { font-size: 16px; }
  .pl-metric .is-gate.is-asking .gate-line { width: 150px; }
}
