/* ==========================================================================
   /case-studies/ hub  —  page-scoped layer (2026-09-23)
   Loaded AFTER main.css / v4.css / ui5.css on case-studies/index.html only.

   1. Compact scene hero: the v5 scene as a slim banner so the portfolio grid
      is reached with little scrolling (Dan, 2026-09-23; the glass facts panel
      was removed and the hero cut again 2026-09-25). Same scene and branches,
      copy split into two columns on desktop, title + buttons only on phones.
   2. Slim section header: eyebrow + one-line title + the "tiles play the real
      site" hint, instead of the tall two-line display head + divider.
   3. Three-up portfolio wall on wide screens (two-up on tablets, one-up on
      phones); a short last row splits its width (6-track grid) instead of
      leaving an empty cell.
   4. Every tile carries the client site's REAL hero footage as a muted loop
      that cross-fades in over the still when the tile scrolls into view or is
      hovered (js/cs-hub.js). Opacity only — a playing <video> is never given a
      transform (see memory: never-transform-a-playing-hero-video).
   ========================================================================== */

/* ---------- 1. compact hero ---------- */
/* 2026-09-25 (Dan: "this box sucks … remove it … reduce the size of the hero so
   people can get to the portfolio faster"): the glass facts panel is gone and the
   hero is a slim banner. On desktop the copy splits in two — eyebrow + title on the
   left, lede + buttons on the right — so the whole block is one text-row tall, and
   smaller branches set a smaller top pad. Phones keep title + buttons only. */
.pr-herowrap--cs { --pr-branch-w: clamp(118px, 7.6vw, 150px); }
.pr-hero--compact { min-height: 0; align-items: flex-end; padding-bottom: clamp(20px, 2vw, 30px); }
body.ui5 .pr-hero--compact { padding-top: calc(var(--nav-h) - 40px + var(--pr-branch-w) * 0.78); }
.pr-hero--compact .pr-hero__branch--left { top: calc(var(--nav-h) - 58px); left: calc(-1 * var(--pr-gutter) - 1.2vw); }  /* smaller branch: pull it in so the leaf still shows */
.pr-hero--compact .pr-hero__branch--right { top: calc(var(--nav-h) - 20px); width: clamp(110px, 8vw, 160px); }
.pr-hero--compact .pr-hero__scene { object-position: 50% 62%; }
.pr-hero--compact .pr-hero__inner { grid-template-columns: minmax(0, 1fr); }
.pr-hero--compact .pr-hero__eyebrow { margin-bottom: 10px; }
.pr-hero--compact .pr-hero__title { font-size: clamp(2.1rem, 3.4vw, 3.3rem); max-width: none; margin-bottom: 0; }
.pr-hero--compact .pr-hero__lede { font-size: clamp(0.98rem, 1.02vw, 1.06rem); line-height: 1.55; max-width: 54ch; }
.pr-hero--compact .pr-cta-row { margin-top: 14px; }
@media (min-width: 961px) {
  .pr-hero--compact .pr-hero__text--split { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: clamp(28px, 4vw, 80px); align-items: end; }
}
@media (max-width: 960px) {
  .pr-hero--compact .pr-hero__branch--right { display: none; }
  .pr-hero--compact .pr-hero__title { margin-bottom: 12px; }
}
@media (max-width: 600px) {
  .pr-herowrap--cs { --pr-branch-w: 30vw; }
  body.ui5 .pr-hero--compact { padding-top: calc(var(--nav-h) + 2px + var(--pr-branch-w) * 0.5); padding-bottom: 20px; }
  .pr-hero--compact .pr-hero__branch--left { top: calc(var(--nav-h) - 34px); left: -10vw; }
  .pr-hero--compact .pr-hero__title { font-size: clamp(1.9rem, 7.8vw, 2.4rem); }
  .pr-hero--compact .pr-hero__lede { display: none; }  /* phones: title + buttons, then straight into the work */
  .pr-hero--compact .pr-cta-row { margin-top: 4px; gap: 10px; }
  .pr-hero--compact .pr-cta-row .pr-btn { padding: 13px 16px; letter-spacing: 0.1em; }  /* both buttons on one row */
}

/* ---------- 2. slim section header ---------- */
body.v4 #main-content.cs-hub { padding-top: clamp(28px, 3vw, 44px); padding-bottom: clamp(48px, 5vw, 72px); }
.cs-hub__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 32px; margin-bottom: 0; }
.cs-hub__head .section-eyebrow { margin-bottom: 10px; }
.cs-hub__title { font-family: var(--font-editorial); font-weight: 600; font-size: clamp(1.7rem, 2.5vw, 2.5rem); line-height: 1.08; letter-spacing: -0.01em; color: var(--black); margin: 0; }
.cs-hub__title em { font-style: normal; font-weight: 400; color: var(--burgundy); }
.cs-hub__hint { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 6px; padding: 9px 14px 9px 12px; border: 1px solid rgba(107, 33, 75, 0.16); border-radius: 999px; background: #fff; font-family: var(--font-primary); font-size: 0.8rem; font-weight: 500; letter-spacing: 0.02em; color: rgba(27, 18, 32, 0.78); }
.cs-hub__hint-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--burgundy); box-shadow: 0 0 0 0 rgba(107, 33, 75, 0.45); animation: csPulse 2.4s ease-out infinite; }
@keyframes csPulse { 0% { box-shadow: 0 0 0 0 rgba(107, 33, 75, 0.45); } 70% { box-shadow: 0 0 0 8px rgba(107, 33, 75, 0); } 100% { box-shadow: 0 0 0 0 rgba(107, 33, 75, 0); } }
@media (min-width: 961px) { .cs-hub__hint { margin-right: 64px; } }  /* clear of the floating share button at the fold */
@media (max-width: 600px) { .cs-hub__hint { font-size: 0.74rem; padding: 8px 12px 8px 10px; } }

/* ---------- 3. portfolio wall ---------- */
.cs-hub .cs-grid { margin-top: clamp(18px, 2vw, 26px); }
@media (min-width: 1280px) {
  .cs-hub .cs-grid { grid-template-columns: repeat(3, 1fr); }
  /* 13 tiles = 4 rows of 3 + the closer. The odd-count rule in main.css
     still fires (13 is odd) and already spans it full width at 16:6. */
  .cs-hub .cs-card__box { padding: clamp(44px, 4.4vw, 72px) clamp(18px, 1.5vw, 26px) clamp(16px, 1.3vw, 22px); gap: 6px; }
  .cs-hub .cs-card__title { font-size: clamp(22px, 1.75vw, 31px); }
  .cs-hub .cs-card__result { font-size: 14px; }
  .cs-hub .cs-card__eyebrow { font-size: 10.5px; }
  .cs-hub .cs-card__more { font-size: 10.5px; }
  .cs-hub .cs-grid > .cs-card:last-child:nth-child(odd) .cs-card__box { padding: clamp(22px, 2.2vw, 34px) clamp(56px, 6vw, 96px) clamp(26px, 2.4vw, 38px) clamp(22px, 2.4vw, 36px); gap: 9px; }
  .cs-hub .cs-grid > .cs-card:last-child:nth-child(odd) .cs-card__title { font-size: clamp(27px, 2.9vw, 40px); }
  .cs-hub .cs-grid > .cs-card:last-child:nth-child(odd) .cs-card__result { font-size: clamp(14.5px, 1.05vw, 16.5px); }
}

/* 14 tiles (SP Vacations added 2026-09-25) = 4 rows of 3 + a row of 2. The wall
   runs on 6 tracks at 3-up so a short last row splits its width instead of
   leaving an empty cell: 2 left over -> two 3-track tiles at 2:1 (the same height
   as a 4:3 tile on 2 tracks, give or take the gap); 1 left over -> the 16:6
   full-width closer from main.css (its :nth-child(odd) rule). */
@media (min-width: 1280px) {
  .cs-hub .cs-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .cs-hub .cs-grid > .cs-card { grid-column: span 2; }
  .cs-hub .cs-grid > .cs-card:nth-last-child(2):nth-child(3n+1),
  .cs-hub .cs-grid > .cs-card:last-child:nth-child(3n+2) { grid-column: span 3; aspect-ratio: 2 / 1; }
  .cs-hub .cs-grid > .cs-card:last-child:nth-child(3n+1) { grid-column: 1 / -1; aspect-ratio: 16 / 6; }
}

/* stacking: still (0) < loop (1) < veil (2) < caption scrim (3) < pill (4) */
.cs-hub .cs-card__img { z-index: 0; }
.cs-hub .cs-card__tint { z-index: 2; }
.cs-hub .cs-card__box { z-index: 3; }

/* ---------- 4. the real hero loop on every tile ---------- */
.cs-card__video {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 50%;
  display: block;
  opacity: 0;
  transition: opacity 0.9s ease;
  pointer-events: none;            /* clicks go straight to the tile link */
  background: transparent;
  transform: none !important;      /* never transform a playing video — it shakes */
  animation: none !important;
}
.cs-card.is-playing .cs-card__video { opacity: 1; }
/* the burgundy veil lifts while the site plays, so the footage reads true */
.cs-card.is-playing .cs-card__tint { opacity: 0; }
/* the hover zoom stays on the STILL only */
.cs-card.is-playing .cs-card__img { transition: none; }

/* steady-hero-video (2026-10-11): the tile that holds a playing loop is never
   transformed either. The reveal slide (.reveal / .reveal.visible leave a permanent
   translateY(0)) and the hover lift re-sampled the video every frame. Fade only;
   the shadow and the copper ring still change on hover. */
.cs-card,
.cs-card.reveal,
.cs-card.reveal.visible,
.cs-card:hover,
.cs-card:focus-visible,
.cs-hub .cs-card:hover,
.cs-hub .cs-card:focus-within {
  transform: none !important;
  animation: none !important;
}

/* "Live site · domain" pill (or "Private engagement") */
.cs-card__pill {
  position: absolute; top: 14px; left: 14px; z-index: 4;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px 7px 10px;
  border-radius: 999px;
  background: rgba(8, 5, 10, 0.62);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-family: var(--font-primary); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase; color: #fff;
  pointer-events: none;
  max-width: calc(100% - 28px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cs-card__pill-dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: #d7c9a1; }
.cs-card.is-playing .cs-card__pill-dot { background: #7fe0a0; box-shadow: 0 0 0 3px rgba(127, 224, 160, 0.22); }
.cs-card__pill--private .cs-card__pill-dot { background: rgba(255, 255, 255, 0.55); }
@media (max-width: 600px) { .cs-card__pill { top: 10px; left: 10px; font-size: 9.5px; padding: 6px 10px 6px 9px; } }

/* Reduced motion: keep the site loops (they ARE the showcase and the owner
   asked for them), just drop the fades so nothing eases around. */
@media (prefers-reduced-motion: reduce) {
  .cs-card__video { transition: opacity 0.25s linear; }
  .cs-hub__hint-dot { animation: none; }
}

/* ==========================================================================
   5. PORTFOLIO CARD v2  (2026-09-25 — Dan: "take the UI to the next level …
      when people click on view the site (that part is hard to see)")

   The referral wall is the biggest lead source, so each tile is rebuilt from a
   one-click <a> into a self-contained <article> that shows the client's live
   site in motion AND carries a prominent, always-visible "View live site" CTA
   plus a "Case study" link — no more guessing where to click. Navigation is via
   those two real, named buttons only (no mouse-only whole-card overlay: an
   unnamed <a> trips TrollBuster F4 and strands keyboard/AT users). Everything
   below is page-scoped and loads after main.css / v4.css / ui5.css, so no other
   page is affected.
   ========================================================================== */

/* -- tile shell: softer radius, deeper lift, a copper ring that lights on hover -- */
.cs-hub .cs-card {
  border-radius: 18px;
  background: #0b0910;
  transition: box-shadow 0.45s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.cs-hub .cs-card:hover,
.cs-hub .cs-card:focus-within {
  transform: translateY(-6px);
  box-shadow: 0 54px 104px -34px rgba(16, 10, 30, 0.62);
}
/* hairline that warms to copper on hover/focus — reads as "interactive" */
.cs-hub .cs-card__frame {
  position: absolute; inset: 0; z-index: 6;
  border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.10);
  transition: box-shadow 0.4s ease;
}
.cs-hub .cs-card:hover .cs-card__frame,
.cs-hub .cs-card:focus-within .cs-card__frame {
  box-shadow: inset 0 0 0 1.5px rgba(194, 106, 63, 0.9), 0 0 0 1px rgba(194, 106, 63, 0.22);
}

/* -- layering: img0 < video1 < tint2 < box4 < pill5 < frame6 -- */
.cs-hub .cs-card__box { z-index: 4; }
.cs-hub .cs-card__pill { z-index: 5; }

/* -- caption: give the actions room and a slightly deeper scrim so the copper
      button always sits on a legible base, even over a bright site screenshot -- */
.cs-hub .cs-card__box {
  gap: 7px;
  padding-bottom: clamp(16px, 1.5vw, 22px);
  background: linear-gradient(to top,
    rgba(8, 5, 10, 0.96) 0%,
    rgba(8, 5, 10, 0.93) 34%,
    rgba(8, 5, 10, 0.82) 56%,
    rgba(8, 5, 10, 0.55) 74%,
    rgba(8, 5, 10, 0.18) 89%,
    rgba(8, 5, 10, 0.00) 100%);
}

/* -- the action row: prominent, always visible (touch has no hover) -- */
.cs-card__actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 9px;
  margin-top: 12px;
}
.cs-btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-primary); font-size: 12.5px; font-weight: 600;
  letter-spacing: 0.02em; line-height: 1; white-space: nowrap;
  text-decoration: none; border-radius: 999px;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease,
              transform 0.25s ease, box-shadow 0.25s ease;
}
.cs-btn svg { width: 14px; height: 14px; flex: 0 0 auto; transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1); }
.cs-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* primary — "View live site": the fix. Copper, filled, unmissable. */
.cs-btn--visit {
  padding: 10px 15px;
  background: var(--copper-ink, #A84F2F); color: #fff;
  box-shadow: 0 8px 22px -10px rgba(194, 106, 63, 0.95);
}
.cs-btn--visit:hover, .cs-btn--visit:focus-visible {
  background: #b05a33; transform: translateY(-1px);
  box-shadow: 0 13px 28px -10px rgba(194, 106, 63, 1);
}
.cs-btn--visit:hover svg, .cs-btn--visit:focus-visible svg { transform: translate(2px, -2px); }  /* ↗ lifts */

/* secondary — "Case study": glass, clearly a link, never competes with the CTA */
.cs-btn--study {
  padding: 10px 13px;
  background: rgba(255, 255, 255, 0.12); color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.34);
}
.cs-btn--study:hover, .cs-btn--study:focus-visible {
  background: rgba(255, 255, 255, 0.2); border-color: #fff; transform: translateY(-1px);
}
.cs-btn--study:hover svg, .cs-btn--study:focus-visible svg { transform: translateX(3px); }  /* → slides */

/* -- staggered reveal: a gentle left-to-right cascade as each row scrolls in -- */
.cs-hub .cs-grid > .cs-card.reveal { transition-delay: calc(var(--i, 0) * 80ms); }

/* -- "live" signal: the badge dot breathes while the real site is playing -- */
.cs-hub .cs-card.is-playing .cs-card__pill-dot {
  background: #7fe0a0;
  animation: csDotPulse 2s ease-out infinite;
}
@keyframes csDotPulse {
  0%   { box-shadow: 0 0 0 0 rgba(127, 224, 160, 0.5); }
  70%  { box-shadow: 0 0 0 7px rgba(127, 224, 160, 0); }
  100% { box-shadow: 0 0 0 0 rgba(127, 224, 160, 0); }
}

/* -- the lone 13th tile (full-bleed 16:6 banner): give its buttons breathing room -- */
@media (min-width: 1280px) {
  .cs-hub .cs-grid > .cs-card:last-child:nth-child(odd) .cs-card__actions { margin-top: 14px; }
}

/* -- mobile: fatter tap targets, actions wrap cleanly under the copy -- */
@media (max-width: 600px) {
  .cs-card__actions { gap: 8px; margin-top: 11px; }
  .cs-btn { font-size: 12px; }
  .cs-btn--visit { padding: 11px 15px; }
  .cs-btn--study { padding: 11px 13px; }
}

/* -- respect reduced-motion for the NEW decorative bits (loops + reveal stay) -- */
@media (prefers-reduced-motion: reduce) {
  .cs-hub .cs-card.is-playing .cs-card__pill-dot { animation: none; }
  .cs-btn svg { transition: none; }
  .cs-btn:hover svg, .cs-btn:focus-visible svg { transform: none; }
}
