/* ==========================================================================
   components.css — reusable UI components: brand, nav links, buttons, cards
   Page-layout rules live in layout.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Brand wordmark
   -------------------------------------------------------------------------- */
.brand {
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  font-size: var(--fs-md);
  letter-spacing: 0.02em;
  color: var(--color-text);
}

.brand:hover {
  color: var(--color-text);
}

/* logo-light.png (feather mark + "The Folio Studios" wordmark + tagline),
   used everywhere .brand appears on a light background (header nav, main
   footer, the Get Started page's own minimal footer). Fixed height, auto
   width — the file's own 1774x887 intrinsic size is declared on the <img>
   for correct aspect-ratio reservation, and is large enough that the
   displayed size (well under 200px wide anywhere it's used) stays sharp on
   retina screens without needing a second @2x asset. */
.brand__logo {
  display: block;
  height: 34px;
  width: auto;
}

/* The header's own desktop size (60px) is set in layout.css instead of
   here — components.css loads after layout.css (see header.php's stylesheet
   list), so an unconditional rule here would outrank layout.css's mobile
   media-query step-downs at equal specificity regardless of viewport width. */

.brand__logo--footer {
  height: 40px;
}

/* --------------------------------------------------------------------------
   Nav links
   -------------------------------------------------------------------------- */
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: var(--fs-xs);
}

.nav-links > li {
  display: flex;
  align-items: center;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  color: var(--color-text-secondary);
  padding-block: var(--space-1);
  border-bottom: 1.5px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.nav-links a:hover {
  color: var(--color-text);
}

.nav-links a[aria-current='page'] {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

/* ---- Dropdown wrapper (Services, About) -------------------------------- */
.nav-links__dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

/* ---- Dropdown trigger: real <button>, JS-driven via aria-expanded
   (assets/js/nav-dropdowns.js) — click, touch, and keyboard all go
   through the one aria-expanded flag, so the CSS below and the
   accessibility state can never drift apart. Deliberately not hover-only
   — no :hover-reveal rule exists for either Services or About, only the
   attribute-selector rule further down. */
.nav-links__trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  font: inherit;
  font-size: var(--fs-xs);
  color: var(--color-text-secondary);
  background: none;
  border: none;
  border-bottom: 1.5px solid transparent;
  padding-block: var(--space-1);
  padding-inline: 0;
  margin: 0;
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.nav-links__trigger:hover {
  color: var(--color-text);
}

.nav-links__trigger::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-bottom: 1px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.6;
  transition: transform var(--transition-fast);
}

.nav-links__trigger[aria-expanded="true"]::after {
  transform: rotate(-135deg);
}

/* indicates the current page lives inside this group, without claiming
   the trigger itself IS that page (aria-current stays on the real link) */
.nav-links__trigger--active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.nav-links__submenu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 50;
  min-width: 190px;
  margin-top: var(--space-3);
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: 1px;
  list-style: none;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 14px 34px -14px rgba(20, 20, 25, 0.30);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--transition-fast), transform var(--transition-fast),
    visibility var(--transition-fast);
}

/* Both Services and About are click/keyboard-driven (assets/js/nav-dropdowns.js)
   — neither opens on mere hover. Open/closed state is driven purely by
   aria-expanded, reflected live by this attribute selector, never a
   separately-tracked class that could fall out of sync with what a
   screen reader is told. */
.nav-links__trigger[aria-expanded="true"] + .nav-links__submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-links__submenu a {
  display: block;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  border-bottom: none;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.nav-links__submenu a:hover,
.nav-links__submenu a:focus-visible {
  background: var(--color-panel);
  color: var(--color-text);
}

.nav-links__submenu a[aria-current='page'] {
  color: var(--color-accent);
  font-weight: var(--weight-medium);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: var(--weight-semibold);
  line-height: 1;
  border: 1.5px solid transparent;
  transition: background var(--transition-fast), color var(--transition-fast),
    border-color var(--transition-fast);
}

/* Dark filled — primary CTA */
.btn--dark {
  background: var(--color-surface-dark);
  color: var(--color-text-on-dark);
  border-color: var(--color-surface-dark);
}

.btn--dark:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-text-on-dark);
}

/* Outline — secondary CTA */
.btn--outline {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-surface-dark);
}

.btn--outline:hover {
  background: var(--color-surface-dark);
  color: var(--color-text-on-dark);
}

/* Compact nav variant */
.btn--sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--fs-xs);
}

/* Light filled — for use on dark surfaces */
.btn--light {
  background: var(--color-bg);
  color: var(--color-text);
  border-color: var(--color-bg);
}

.btn--light:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-text-on-dark);
}

/* --------------------------------------------------------------------------
   Card (base — extended per page)
   -------------------------------------------------------------------------- */
.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}

/* --------------------------------------------------------------------------
   Callout / highlight box
   -------------------------------------------------------------------------- */
.callout {
  background: var(--color-highlight-bg);
  border-left: 2px solid var(--color-highlight-border);
  padding: var(--space-3) var(--space-4);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: var(--fs-sm);
  color: #7a6a2a;
}

/* ==========================================================================
   Homepage scroll pipeline — stage rows + laptop mockup
   Visual values mirror the design mockup. Behaviour driven by scroll-stage.js
   (adds .stages-js to <body>, and .is-open / .is-active per active row).
   ========================================================================== */

.stage-row {
  position: relative;
  border-bottom: 1px solid var(--color-border);
  overflow: hidden;
}

.stage-row:last-child {
  border-bottom: none;
}

/* same container system as the header/hero/lower sections: constrains the
   content to --container-max and centers it, so extra viewport width grows
   the outer margins instead of the gap between text and artwork. */
.stage-row__inner {
  /* deliberately not positioned: .stage-row stays the sole positioning
     context for the ::before/::after timeline line+dot (and for
     scroll-stage.js's --dot-top offsetTop math), so the dot keeps
     painting above the grid content exactly as it did before. */
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: var(--space-8);
  min-height: 72vh;
}

/* laptop on the right instead of the left — DOM order is always
   [slot, text], so only the --right rows need reordering. */
.stage-row--right .stage-laptop-slot {
  order: 2;
}

.stage-row--right .stage-text {
  order: 1;
}

/* ---- Timeline connector: 1px dotted line + node dot per row ----------- */
.stage-row::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  border-left: 1px dotted var(--color-border);
  transform: translateX(-50%);
  pointer-events: none;
}

.stage-row::after {
  content: "";
  position: absolute;
  left: 50%;
  /* --dot-top is set by scroll-stage.js to the vertical centre of the
     eyebrow+heading+paragraph block; falls back to the row centre. */
  top: var(--dot-top, 50%);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  transform: translate(-50%, -50%);
  transition: background var(--transition), border-color var(--transition),
    transform var(--transition);
  pointer-events: none;
}

.stage-row.is-active::after {
  background: var(--color-accent);
  border-color: var(--color-accent);
  transform: translate(-50%, -50%) scale(1.5);
}

/* ---- Text side --------------------------------------------------------- */
/* same pattern as .hero__text: a max-width block sitting flush at its grid
   column's start edge, matching the site's shared container conventions. */
.stage-text {
  position: relative;
  max-width: 42ch;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* keep real content above the giant faint numeral */
.stage-text > *:not(.stage-bg-number) {
  position: relative;
  z-index: 1;
}

/* ---- Giant faint numeral treatment (shared: pipeline + trust strip) --- */
.stage-bg-number,
.trust-strip__figure {
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  font-size: 200px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--color-text);
  opacity: 0.04;
  pointer-events: none;
  user-select: none;
}

.stage-bg-number {
  position: absolute;
  top: 50%;
  left: -0.08em;
  transform: translateY(-58%);
  z-index: 0;
  transition: opacity var(--transition);
}

.stage-text.is-active .stage-bg-number {
  opacity: 0.06;
}

/* ---- Eyebrow row: numbered badge + label ---------------------------- */
.stage-eyebrow-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.stage-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1.5px solid var(--color-border);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: var(--weight-medium);
  color: var(--color-text-faint);
  transition: border-color var(--transition), color var(--transition);
}

.stage-text.is-active .stage-badge {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.stage-eyebrow {
  font-family: var(--font-heading);
  font-size: var(--fs-eyebrow);
  font-weight: var(--weight-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  transition: color var(--transition);
}

.stage-heading {
  font-family: var(--font-heading);
  font-weight: var(--weight-semibold);
  font-size: clamp(1.35rem, 1rem + 1.1vw, 1.75rem);
  line-height: 1.25;
  margin: 0;
  color: var(--color-text-faint);
  text-wrap: balance;
  transition: color var(--transition);
}

.stage-para {
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  color: var(--color-text-muted);
  max-width: 46ch;
  margin: 0;
  transition: color var(--transition);
}

.stage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

/* Active row: text comes up to full colour */
.stage-text.is-active .stage-eyebrow { color: var(--color-accent); }
.stage-text.is-active .stage-heading { color: var(--color-text); }
.stage-text.is-active .stage-para    { color: var(--color-text-secondary); }

/* ---- Pipeline laptop slot (scroll open / close) --------------------- */
.stage-laptop-slot {
  justify-self: center; /* balanced within its grid column, whatever its own width */
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 500px;
  padding-block: var(--space-6);
  overflow: hidden;
}

/* Only collapse rows once JS is running; no-JS shows every laptop open.
   Durations are intentionally slow so the reveal reads as deliberate. */
.stages-js .stage-laptop-slot {
  width: 0;
  transition: width 0.95s cubic-bezier(0.4, 0, 0.2, 1);
}

.stages-js .stage-laptop-slot.is-open {
  width: 500px;
}

/* the fold-open flip lives on its own layer so it never fights the tilt */
.laptop-flip {
  transform-origin: 50% 100%;
  transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.65s ease;
}

.stages-js .stage-laptop-slot:not(.is-open) .laptop-flip {
  transform: perspective(1100px) rotateX(84deg);
  opacity: 0;
}

.stages-js .stage-laptop-slot.is-open .laptop-flip {
  transition-delay: 0.25s;
}

/* ==========================================================================
   .laptop — reusable dimensional laptop (hero + every pipeline stage)
   Resting tilt from --rest-x / --rest-y (set inline per instance);
   cursor-follow tilt layered on via --mx / --my (set by laptop-tilt.js).
   ========================================================================== */
.laptop-scene {
  position: relative;
  width: 400px;
  max-width: 100%;
  perspective: 1200px;
}

.laptop {
  position: relative;
  transform-style: preserve-3d;
  transform:
    rotateX(calc(var(--rest-x, 2deg) + var(--mx, 0deg)))
    rotateY(calc(var(--rest-y, -4deg) + var(--my, 0deg)));
  transition: transform 0.15s ease-out;
}

/* deep, soft lift shadow beneath the whole machine */
.laptop__shadow {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: -16px;
  height: 30px;
  background: rgba(16, 17, 21, 0.30);
  filter: blur(28px);
  border-radius: 50%;
  z-index: -1;
}

/* lid: black shell with a thin aluminium rim + a camera dot */
.laptop__bezel {
  position: relative;
  background: #1c1d21;
  border-radius: 11px 11px 6px 6px;
  padding: 13px 9px 9px;
  box-shadow:
    0 0 0 1px rgba(206, 210, 218, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 -2px 6px rgba(0, 0, 0, 0.35);
}

.laptop__camera {
  position: absolute;
  top: 5px;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #303136;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.10);
  transform: translateX(-50%);
}

.laptop__screen {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 4px;
  height: 250px;
  overflow: hidden;
}

/* diagonal glass reflection, upper-left */
.laptop__glass {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    128deg,
    rgba(255, 255, 255, 0.30) 0%,
    rgba(255, 255, 255, 0.08) 16%,
    rgba(255, 255, 255, 0) 38%
  );
}

.laptop__chrome {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  padding: 7px 11px;
  border-bottom: 1px solid var(--color-border-light);
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: #9b9a92;
}

.laptop__dots {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.laptop__dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #dcdad0;
}

.laptop__chrome-title {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.laptop__chrome-meta,
.laptop__wc {
  flex-shrink: 0;
}

.laptop__wc {
  color: #b0afa6;
}

.laptop__progress {
  width: 42px;
  height: 3px;
  flex-shrink: 0;
  border-radius: 2px;
  background: var(--color-border);
  overflow: hidden;
}

.laptop__progress > span {
  display: block;
  height: 100%;
  background: var(--color-accent);
}

.laptop__panel {
  flex: 1;
  min-height: 0;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  color: #2b2c31;
  overflow: hidden;
}

.laptop__hinge {
  height: 9px;
  width: 94%;
  margin: 0 auto;
  background: linear-gradient(#191a1e, #212228);
  border-radius: 0 0 4px 4px;
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.4);
}

/* keyboard deck: perspective-correct trapezoid, wider than the screen */
.laptop__deck {
  position: relative;
  height: 13px;
  width: 118%;
  margin-left: -9%;
  background: linear-gradient(#2c2d32, #202126);
  border-radius: 2px 2px 10px 10px;
  clip-path: polygon(4% 0, 96% 0, 100% 100%, 0 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.laptop__deck::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.07);
}

/* ==========================================================================
   Device illustrations (hero + every pipeline stage except "Write") — always
   the laptop.png frame, scaled down responsively rather than swapped for a
   tablet/phone image. .device__screen is clip-pathed onto its screen, using
   corner coordinates measured pixel-by-pixel from the image.
   ========================================================================== */
.device,
.crt {
  position: relative;
  width: min(460px, 100%);
}

.device__frame,
.crt__frame {
  position: relative;
}

.device__img,
.crt__img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

/* reserve the box so the frame doesn't jump while the PNG loads */
.device__img { aspect-ratio: 1536 / 1024; }

.device__screen,
.crt__screen {
  position: absolute;
  overflow: hidden;
}

.device__view {
  position: absolute;
  inset: 0;
  padding: 7% 9%;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.55;
  color: #2b2c31;
  overflow: hidden;
}

/* laptop.png screen (default / desktop) — head-on view, a clean rectangle */
.device__screen {
  left: 21.6%;
  top: 10.9%;
  width: 56.9%;
  height: 46.2%;
  background: #ffffff;
  clip-path: none;
}

.device__view {
  transform: none;
}

/* entrance — a plain fade, gated like the other stage visuals. (No transform:
   these frames wrap transparent PNGs, and a transform promotes them to a
   compositing layer with no opaque backdrop, which strands the page behind
   them.) */
.stages-js .device,
.stages-js .crt,
.stages-js .desk,
.stages-js .stage-svg {
  opacity: 0;
  transition: opacity 0.7s ease;
}

.stages-js .stage-laptop-slot.is-open .device,
.stages-js .stage-laptop-slot.is-open .crt,
.stages-js .stage-laptop-slot.is-open .desk,
.stages-js .stage-laptop-slot.is-open .stage-svg {
  opacity: 1;
  transition-delay: 0.15s;
}

.hero .device { opacity: 1; }

/* ==========================================================================
   CRT computer (computer.png) — "Edit & Polish" stage. A one-time proofread
   sequence plays on the green screen (crt-proofread.js); panda mascot beside
   the machine.
   ========================================================================== */
.crt__img { aspect-ratio: 1 / 1; }

.crt__screen {
  /* computer.png screen quad, measured pixel-by-pixel and kept a hair inside
     the dark glass so text never reaches the bezel. A near-opaque dark fill
     sits inside that quad so the green text has real contrast — the screen in
     the artwork alone is too pale to read against. */
  left: 38.3%;
  top: 21%;
  width: 32.4%;
  height: 34%;
  clip-path: polygon(0% 23.5%, 100% 0%, 97.8% 79.4%, 0% 100%);
  /* background:
    radial-gradient(130% 130% at 42% 32%,
      rgba(8, 20, 11, 0.78) 0%,
      rgba(2, 7, 4, 0.94) 78%); */
}

.crt__view {
  position: absolute;
  inset: 0;
  /* generous top / left inset: the screen's top-left corner is clipped down
     the perspective (see .crt__screen clip-path), so text must start below it. */
  padding: 19% 7% 5% 10%;
  transform: skewY(-11deg);
  transform-origin: 50% 42%;
}

/* the on-screen document */
.crt__doc {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: var(--weight-medium);
  line-height: 1.5;
  letter-spacing: -0.02em;
  color: #33ff66;                                 /* Matrix digital-rain green */
  /* crisp dark edge for legibility + phosphor glow */
  /* text-shadow: 0 0 1px rgba(0, 0, 0, 0.85), 0 0 6px rgba(0, 255, 65, 0.55); */
}

.crt__l {
  margin: 0 0 1px;
  white-space: normal; /* wrap rather than spill on very small screens */
  color:#30C62C !important;
}

.crt__l--status {
  margin-top: 6px;
  color: #9dffb9;      /* brighter Matrix green so the "done" line pops */
  font-size: 8.5px;
  letter-spacing: 0.02em;
}
.crt__l--status[hidden] { display: none; }
.crt__l--status.is-in { animation: crt-fade-up 0.45s ease both; }

/* a word mid-correction: pale-amber highlight, easing back to green */
.crt__w {
  border-radius: 2px;
  transition: color 0.4s ease, background-color 0.4s ease, box-shadow 0.4s ease;
}
.crt__w--hl {
  color: #f1cf95;
  background-color: rgba(240, 200, 130, 0.22);
  box-shadow: 0 0 4px rgba(240, 200, 130, 0.28);
}

/* the trailing "s" of "words", fading out as it's deleted */
.crt__s {
  transition: opacity 0.16s ease;
}
.crt__s--del { opacity: 0; }

.crt__caret {
  display: inline-block;
  width: 0.5em;
  height: 1em;
  margin-left: 1px;
  vertical-align: -0.14em;
  background: #00ff41;
  box-shadow: 0 0 5px rgba(0, 255, 65, 0.55);
  animation: stage-blink 1.1s steps(1) infinite;
}

@keyframes crt-fade-up {
  from { opacity: 0; transform: translateY(3px); }
  to   { opacity: 1; transform: none; }
}

.crt__panda {
  position: absolute;
  left: 1%;
  bottom: -3%;
  width: 21%;
  height: auto;
  animation: crt-panda-bob 3.4s ease-in-out infinite;
}

@keyframes crt-panda-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
  .crt__panda { animation: none; }
  .crt__caret { animation: none; }
}

/* ==========================================================================
   Write stage — write-pencil-animation.svg, embedded as an <img>. The SVG
   runs its own CSS/SMIL animation (a pencil writing the outline, stroke by
   stroke) in image mode; there is nothing to drive from here. Width matches
   .crt in Step 02 so the two illustrations read at the same size. The SVG's
   own <style> block honours prefers-reduced-motion.
   ========================================================================== */
.desk {
  position: relative;
  width: min(460px, 100%);
}

.desk__img {
  display: block;
  width: 100%;
  height: auto;      /* viewBox 1536x1024 keeps the aspect ratio, no cropping */
  max-width: 100%;
}

/* ==========================================================================
   Steps 03–05 — self-contained animated SVG illustrations
   (design-publish-animation.svg, book-promotion-sales-animation.svg,
   ready-when-you-are-animation.svg). Each ships its own CSS-driven animation
   and its own prefers-reduced-motion handling; embedded as a plain <img>,
   there is nothing to drive from this page. One shared wrapper sized like
   .desk / .crt (min(460px,100%)); a per-illustration modifier sets the
   aspect-ratio to that SVG's own viewBox, since the three source canvases
   aren't all the same shape — this is what keeps each one uncropped and
   undistorted at every width.
   ========================================================================== */
.stage-svg {
  position: relative;
  width: min(460px, 100%);
}

.stage-svg__img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  pointer-events: none; /* illustrative only — never intercepts scroll/clicks */
}

/* design-publish-animation.svg & book-promotion-sales-animation.svg: 1536x1024 */
.stage-svg--design-publish .stage-svg__img,
.stage-svg--book-promotion .stage-svg__img {
  aspect-ratio: 1536 / 1024;
}

/* ready-when-you-are-animation.svg: a smaller, near-square canvas */
.stage-svg--ready-plan .stage-svg__img {
  aspect-ratio: 473 / 394;
}

/* ---- Hero manuscript screen ---------------------------------------- */
.ms {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 8px;
  height: 100%;
}

.ms__side {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 6px;
  border-right: 1px solid var(--color-border-light);
}

.ms__side-h {
  font-size: 6.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #b9b8ae;
}

.ms__ch {
  font-size: 7px;
  line-height: 1.35;
  color: #a6a59c;
}

.ms__ch--on {
  color: var(--color-accent);
}

.ms__page {
  min-width: 0;
}

.ms__h {
  display: block;
  margin-bottom: 5px;
  font-size: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #b9b8ae;
}

.ms__page p {
  max-width: none;
  margin: 0 0 6px;
  font-size: 9px;
  line-height: 1.55;
  color: #3a3b40;
}

/* hero: the whole body is one typed block — keep the \n\n paragraph breaks */
.ms__body--typed {
  white-space: pre-wrap;
}

/* ---- Floating UI pinned to the hero laptop ------------------------ */
.laptop-float {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 14px 34px -14px rgba(20, 20, 25, 0.30);
  font-size: var(--fs-xs);
  font-weight: var(--weight-medium);
  color: var(--color-text);
  white-space: nowrap;
}

.laptop-float--save {
  top: -18px;
  left: -26px;
}

.laptop-float--editor {
  bottom: 8%;
  right: -46px;
}

.laptop-float__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-success-bg);
  color: var(--color-success);
  font-size: 10px;
}

.laptop-float__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  font-family: var(--font-heading);
  font-size: 9px;
  font-weight: var(--weight-bold);
  color: var(--color-text-faint);
}

.laptop-float__label {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-text-muted);
}

.laptop-float__label strong {
  font-weight: var(--weight-semibold);
  color: var(--color-text);
}

/* ==========================================================================
   Hero section
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--color-border);
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: var(--space-8);
  align-items: center;
  min-height: 84vh;
  padding-block: var(--space-9);
}

.hero__text {
  max-width: 42ch;
}

.hero__heading {
  margin-top: var(--space-4);
  font-size: clamp(1.6rem, 1.15rem + 1.55vw, 2.15rem);
  font-weight: var(--weight-semibold);
  line-height: 1.18;
}

.hero__lede {
  margin-top: var(--space-4);
  font-size: var(--fs-md);
  color: var(--color-text-secondary);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.hero__media {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__blob {
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  background: radial-gradient(circle at center, var(--color-accent) 0%, transparent 70%);
  filter: blur(44px);
  pointer-events: none;
}

.hero__blob--a {
  width: 440px;
  height: 440px;
  right: -60px;
  top: -90px;
  opacity: 0.09;
}

.hero__blob--b {
  width: 320px;
  height: 320px;
  right: 22%;
  bottom: -130px;
  opacity: 0.06;
}

/* ---- Screen content bits ------------------------------------------------ */
.stage-screen-faint { color: #c7c6bd; }

.stage-cursor {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  background: var(--color-accent);
  margin-left: 1px;
  vertical-align: -0.18em;
  animation: stage-blink 1s steps(1) infinite;
}

@keyframes stage-blink {
  50% { opacity: 0; }
}

.stage-strike { color: var(--color-error); text-decoration: line-through; }
.stage-insert { color: var(--color-success); }

/* Typewriter: element types its own text content when its stage activates.
   Elements deferred until typing finishes (e.g. the editor comment). */
.js-typewriter [data-tw-after] {
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.js-typewriter [data-tw-after]:not(.is-revealed) {
  opacity: 0;
  transform: translateY(4px);
}

.stage-comment {
  margin-top: 10px;
  padding: 6px 8px;
  background: var(--color-highlight-bg);
  border-left: 2px solid var(--color-highlight-border);
  font-size: 8.5px;
  line-height: 1.45;
  color: #7a6a2a;
}

.stage-kdp-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.stage-cover-thumb {
  width: 44px;
  height: 64px;
  border-radius: 2px;
  background: linear-gradient(160deg, var(--color-accent), var(--color-surface-dark));
  flex-shrink: 0;
}

.stage-kdp-meta {
  font-size: 8.5px;
  color: #5b5c62;
  line-height: 1.7;
}

.stage-status-pill {
  display: inline-flex;
  padding: 1px 6px;
  background: var(--color-success-bg);
  color: var(--color-success);
  border-radius: 8px;
  font-size: 7.5px;
  font-weight: 600;
  margin-top: 3px;
}

/* .stage-social-card / .stage-bars / .stage-cal* — removed along with
   stage_screen_market() and stage_screen_call() in laptop-mockup.php; they
   styled the old Step 04 / Step 05 screen content, now replaced by the
   supplied animated SVGs (see .stage-svg). */

/* ---- Stacked / narrow screens ---------------------------------------- */
@media (max-width: 900px) {
  .stage-row__inner {
    grid-template-columns: 1fr;
    align-items: flex-start;
    min-height: 0;
    padding-block: var(--space-8);
    gap: var(--space-6);
  }

  /* stacked rows always read artwork-then-text, regardless of side */
  .stage-row--right .stage-laptop-slot,
  .stage-row--right .stage-text {
    order: 0;
  }

  /* timeline metaphor doesn't hold when rows stack */
  .stage-row::before,
  .stage-row::after {
    display: none;
  }

  .stage-text {
    width: 100%;
    max-width: none;
  }

  .stage-bg-number {
    left: auto;
    right: 0;
    top: 0;
    transform: translateY(-30%);
    font-size: 120px;
  }

  .stage-laptop-slot,
  .stages-js .stage-laptop-slot,
  .stages-js .stage-laptop-slot.is-open {
    width: 100%;
    padding-block: 0;
    justify-content: flex-start;
  }

  /* keep all copy readable when stacked */
  .stages-js .stage-text .stage-eyebrow { color: var(--color-accent); }
  .stages-js .stage-text .stage-heading { color: var(--color-text); }
  .stages-js .stage-text .stage-para    { color: var(--color-text-secondary); }

  /* hero stacks; device below text. The desktop padding-block (96px top and
     bottom) is what left ~100px above the label and a big gap after the
     laptop once the layout stacked — tighten both ends for small screens. */
  .hero__inner {
    grid-template-columns: 1fr;
    gap: var(--space-6);
    min-height: 0;
    padding-top: var(--space-5);
    padding-bottom: var(--space-6);
  }

  .hero__media { justify-content: flex-start; }

  /* laptop.png carries ~9.6% transparent margin on each side, so a box that
     is already flush with the text still looks centered. Pull the box left by
     exactly that margin (min(460px, 100%) is the device's own rendered width
     here — % in margin resolves against the same containing block as its
     width; the <=480px block below swaps in its 340px cap) so the visible
     laptop lines up with the text edge. A margin, not a transform: these
     frames must not be promoted to a compositing layer (see the
     .stages-js .device note above). */
  .hero .device { margin-left: calc(min(460px, 100%) * -0.096); }

  /* both hero buttons share one row, equal width; text scales down with the
     viewport so they still fit at 360px (see the <340px rule below) */
  .hero__actions {
    flex-wrap: nowrap;
    gap: 8px;
    max-width: 460px;
  }

  .hero__actions .btn {
    flex: 1 1 0;
    min-width: 0;
    white-space: nowrap;
    padding: 12px clamp(8px, 2.6vw, 24px);
    font-size: clamp(0.75rem, 3.4vw, 0.9375rem);
  }

  .laptop-float--save { left: 0; }
  .laptop-float--editor { right: 0; }
}

@media (max-width: 480px) {
  .device,
  .crt,
  .desk,
  .stage-svg {
    width: 100%;
    max-width: 340px;
  }

  .laptop-scene {
    width: 100%;
    max-width: 330px;
  }

  .laptop-float { display: none; }

  .hero .device { margin-left: calc(min(340px, 100%) * -0.096); }

  /* CRT screen is tiny here — drop the context line, tighten the insets and
     ease the type down a little (not "extremely small") so both corrected
     sentences stay on one line each and nothing wraps onto the bezel. */
  .crt__view { padding: 17% 5% 5% 8%; }
  .crt__doc { font-size: 7.5px; line-height: 1.55; letter-spacing: -0.03em; }
  .crt__l--wide { display: none; }
}

/* Under 340px two hero buttons can't share a row legibly — stack them. */
@media (max-width: 339px) {
  .hero__actions { flex-wrap: wrap; }
  .hero__actions .btn { flex: 1 1 100%; }
}

/* ==========================================================================
   Homepage — content sections below the pipeline
   ========================================================================== */

.home-section {
  position: relative;
  overflow: hidden;
  padding-block: var(--space-9);
}

/* alternating tone gives separation without hard borders everywhere */
.home-section--panel {
  background: var(--color-panel);
}

/* lift real content above decorative blobs */
.home-section > .container {
  position: relative;
  z-index: 1;
}

/* large soft accent blob for depth behind a section */
.bg-blob {
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  background: radial-gradient(circle at center, var(--color-accent) 0%, transparent 70%);
  filter: blur(50px);
  opacity: 0.07;
  pointer-events: none;
}

.home-section__head {
  max-width: 46ch;
  margin-bottom: var(--space-7);
}

.home-section__head h2 {
  margin-top: var(--space-3);
  font-weight: var(--weight-semibold);
  font-size: clamp(1.3rem, 1.05rem + 0.95vw, 1.65rem);
}

.home-section__lede {
  font-size: var(--fs-md);
  color: var(--color-text-secondary);
  margin-top: var(--space-3);
}

.home-section__more {
  display: inline-block;
  margin-top: var(--space-5);
  font-size: var(--fs-sm);
  font-weight: var(--weight-semibold);
}

/* ---- Trust strip: stat band ---------------------------------------- */
.trust-strip {
  position: relative;
  overflow: hidden;
  border-block: 1px solid var(--color-border);
  background: var(--color-panel);
}

.trust-strip__figure {
  position: absolute;
  z-index: 0;
  right: var(--space-6);
  top: 50%;
  transform: translateY(-52%);
}

.trust-strip__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
  padding-block: var(--space-7);
}

.stat {
  text-align: left;
}

.stat__num {
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  font-size: clamp(1.6rem, 1.25rem + 1.15vw, 2rem);
  line-height: 1;
  color: var(--color-text);
  letter-spacing: var(--tracking-tight);
}

.stat__label {
  margin-top: var(--space-2);
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

/* ---- Packages preview: two track cards ---------------------------- */
.track-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
}

.track-card {
  position: relative;
  overflow: hidden; /* clip the hover sheen to the card's own rounded corners */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-6);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast),
    background-color 300ms ease, box-shadow 300ms ease, transform 300ms ease;
}

/* real content sits above the decorative sheen layer */
.track-card > * {
  position: relative;
  z-index: 1;
}

/* the glass-shine sweep — a broad diagonal band, off-card and invisible at
   rest. pointer-events: none so it never intercepts clicks/taps. */
.track-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    100deg,
    transparent 32%,
    rgba(255, 255, 255, 0.55) 47%,
    rgba(148, 148, 148, 0.32) 51%,
    transparent 66%
  );
  transform: translateX(-120%);
  opacity: 0;
  transition: opacity 200ms ease;
}

/* the "engaged" look shared by hover and keyboard focus: a faint gray tint,
   a slightly stronger border, a soft shadow. Always available — keyboard
   focus must work regardless of pointer type. */
.track-card:focus-within {
  background: rgba(120, 118, 110, 0.06);
  border-color: rgba(112, 110, 102, 0.45);
  box-shadow: 0 10px 24px -14px rgba(60, 58, 52, 0.35);
}

.track-card:focus-within::before {
  opacity: 1;
  animation: track-card-sheen 800ms ease-out 1;
}

/* the lift + hover trigger are reserved for devices that actually hover with
   a precise pointer, so touch taps never get a stuck "hover" state. */
@media (hover: hover) and (pointer: fine) {
  .track-card:hover {
    background: rgba(120, 118, 110, 0.06);
    border-color: rgba(112, 110, 102, 0.45);
    box-shadow: 0 10px 24px -14px rgba(60, 58, 52, 0.35);
    transform: translateY(-3px);
  }

  .track-card:hover::before {
    opacity: 1;
    animation: track-card-sheen 800ms ease-out 1;
  }

  .track-card:focus-within {
    transform: translateY(-3px);
  }
}

@keyframes track-card-sheen {
  from { transform: translateX(-120%); }
  to   { transform: translateX(120%); }
}

@media (prefers-reduced-motion: reduce) {
  /* keep the gray background/border/shadow emphasis; drop the lift and the
     sweeping sheen entirely */
  .track-card:hover,
  .track-card:focus-within {
    transform: none;
  }

  .track-card:hover::before,
  .track-card:focus-within::before {
    opacity: 0;
    animation: none;
  }
}

.track-card__label {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.track-card h3 {
  font-size: var(--fs-lg);
}

.track-card p {
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
}

.track-card__more {
  margin-top: auto;
  padding-top: var(--space-2);
  font-size: var(--fs-sm);
  font-weight: var(--weight-semibold);
}

/* ---- Authors: split section head (heading left, link upper-right) ---- */
.home-section__head--split {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-6);
  max-width: none;
}

.home-section__head--split > div {
  max-width: 46ch;
}

.home-section__head--split .home-section__more {
  margin-top: var(--space-2);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---- Authors: book showcase row --------------------------------- */
.book-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

/* one visual group: cover + label + testimonial hover/lift together */
.book-showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

.book-showcase__cover {
  width: 100%;
  max-width: 180px;
  aspect-ratio: 1024 / 1536; /* reserves space up front — no layout shift on load */
  transition: transform 300ms ease;
}

.book-showcase__cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain; /* show the full cover, never cropped or stretched */
}

.book-showcase__label {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent);
  text-align: center;
}

/* ---- Testimonial card: warm paper card w/ hover glass-sheen ------ */
.testimonial-card {
  position: relative;
  overflow: hidden; /* clip the hover sheen to the card's own rounded corners */
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  width: 100%;
  margin: 0;
  padding: var(--space-6);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 14px 28px -22px rgba(60, 58, 52, 0.28);
  transition: border-color 300ms ease, box-shadow 300ms ease;
}

/* real content sits above the decorative sheen layer */
.testimonial-card > * {
  position: relative;
  z-index: 1;
}

/* the glass-shine sweep — off-card and invisible at rest, matches the
   Track A / Track B hover treatment used elsewhere on the homepage. */
.testimonial-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    100deg,
    transparent 32%,
    rgba(255, 255, 255, 0.55) 47%,
    rgba(148, 148, 148, 0.32) 51%,
    transparent 66%
  );
  transform: translateX(-120%);
  opacity: 0;
  transition: opacity 200ms ease;
}

/* decorative teal quotation mark */
.testimonial-card__mark {
  position: absolute;
  top: var(--space-2);
  right: var(--space-4);
  z-index: 0;
  font-family: var(--font-heading);
  font-size: 3.4rem;
  line-height: 1;
  color: #2f6f6a;
  opacity: 0.22;
  pointer-events: none;
  user-select: none;
}

.testimonial-card__quote {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: var(--lh-body);
  color: var(--color-text);
}

.testimonial-card__by {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: auto;
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}

.testimonial-card__name {
  font-weight: var(--weight-semibold);
  font-size: var(--fs-sm);
}

.testimonial-card__book cite {
  font-style: italic;
  font-size: var(--fs-xs);
  color: var(--color-text-secondary);
}

.testimonial-card__meta {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  color: var(--color-text-muted);
}

/* the book + its testimonial move together, as one hover group — reserved
   for devices that actually hover with a precise pointer. */
@media (hover: hover) and (pointer: fine) {
  .book-showcase:hover .book-showcase__cover {
    transform: translateY(-4px);
  }

  .book-showcase:hover .testimonial-card {
    border-color: rgba(112, 110, 102, 0.45);
    box-shadow: 0 16px 32px -18px rgba(60, 58, 52, 0.4);
  }

  .book-showcase:hover .testimonial-card::before {
    opacity: 1;
    animation: book-card-sheen 850ms ease-out 1;
  }
}

@keyframes book-card-sheen {
  from { transform: translateX(-120%); }
  to   { transform: translateX(120%); }
}

@media (prefers-reduced-motion: reduce) {
  .book-showcase:hover .book-showcase__cover {
    transform: none;
  }

  .book-showcase:hover .testimonial-card::before {
    opacity: 0;
    animation: none;
  }
}

/* ---- Blog preview -------------------------------------------- */
.post-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color 300ms ease, box-shadow 300ms ease, transform 300ms ease;
}

.post-card__link {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  color: inherit;
}

/* fixed 3:2 image area — the source art is already 1536x1024 (3:2), so
   cover never crops it; it just fills the reserved box exactly. */
.post-card__cover {
  position: relative;
  overflow: hidden; /* clip the hover sheen to the image's own rounded corners */
  aspect-ratio: 3 / 2;
  border-radius: var(--radius-sm);
  background: var(--color-panel);
}

.post-card__cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* the hover sheen — scoped to the image only, off-frame and invisible at
   rest. pointer-events: none so it never intercepts clicks/taps. */
.post-card__cover::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    100deg,
    transparent 32%,
    rgba(255, 255, 255, 0.5) 47%,
    rgba(148, 148, 148, 0.28) 51%,
    transparent 66%
  );
  transform: translateX(-120%);
  opacity: 0;
  transition: opacity 200ms ease;
}

.post-card__cat {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.post-card h3 {
  font-size: var(--fs-base);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
}

.post-card__meta {
  margin-top: auto;
  padding-top: var(--space-1);
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

/* the "engaged" look shared by hover and keyboard focus. Always available —
   keyboard focus must work regardless of pointer type. */
.post-card:focus-within {
  border-color: var(--color-text-faint);
  box-shadow: 0 14px 28px -18px rgba(60, 58, 52, 0.35);
}

.post-card:focus-within .post-card__cover::before {
  opacity: 1;
  animation: post-card-sheen 800ms ease-out 1;
}

/* the lift + hover trigger are reserved for devices that actually hover with
   a precise pointer, so touch taps never get a stuck "hover" state. */
@media (hover: hover) and (pointer: fine) {
  .post-card:hover {
    border-color: var(--color-text-faint);
    box-shadow: 0 14px 28px -18px rgba(60, 58, 52, 0.35);
    transform: translateY(-3px);
  }

  .post-card:hover .post-card__cover::before {
    opacity: 1;
    animation: post-card-sheen 800ms ease-out 1;
  }

  .post-card:focus-within {
    transform: translateY(-3px);
  }
}

@keyframes post-card-sheen {
  from { transform: translateX(-120%); }
  to   { transform: translateX(120%); }
}

@media (prefers-reduced-motion: reduce) {
  .post-card:hover,
  .post-card:focus-within {
    transform: none;
  }

  .post-card:hover .post-card__cover::before,
  .post-card:focus-within .post-card__cover::before {
    opacity: 0;
    animation: none;
  }
}

/* ---- Final CTA banner --------------------------------------- */
.cta-banner {
  position: relative;
  overflow: hidden;
  background: var(--color-surface-dark);
  color: var(--color-text-on-dark);
}

.cta-banner .bg-blob {
  opacity: 0.20;
  filter: blur(64px);
}

.cta-banner__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr; /* single centered column when there's no art */
  align-items: center;
  gap: var(--space-8);
  padding-block: var(--space-9);
}

/* two-column layout only when an .cta-banner__art image is actually present */
.cta-banner--split .cta-banner__grid {
  grid-template-columns: 1.1fr 1fr;
}

.cta-banner__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
}

.cta-banner__eyebrow {
  color: var(--color-highlight-border); /* restrained mustard against charcoal */
}

.cta-banner__heading {
  color: var(--color-text-on-dark);
  font-weight: var(--weight-semibold);
  font-size: clamp(1.3rem, 1.05rem + 0.95vw, 1.65rem);
  max-width: 20ch;
}

.cta-banner__text {
  color: var(--color-text-faint);
  max-width: 52ch;
}

.cta-banner__secondary {
  margin-top: calc(-1 * var(--space-2));
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}

.cta-banner .btn--light {
  margin-top: var(--space-3);
}

/* right-hand artwork — a flattened PNG with its own charcoal backdrop, so
   the section background is tuned to match its edges (see .cta-banner--split
   below); the image itself is never animated or hovered. */
.cta-banner__art {
  width: 100%;
}

.cta-banner__art img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1536 / 1024;
  border-radius: var(--radius-md);
}

/* section background tuned to the manuscript artwork's own charcoal edges
   (sampled ~#15191c) so the rectangle disappears into the section. */
.cta-banner--split {
  background: #15191c;
}

/* ---- Responsive ------------------------------------------- */
@media (max-width: 900px) {
  .trust-strip__grid { grid-template-columns: repeat(2, 1fr); }
  .track-cards       { grid-template-columns: 1fr; }
  .post-cards        { grid-template-columns: 1fr; }

  /* tablet: two balanced columns rather than three-across cramped text */
  .book-row              { grid-template-columns: repeat(2, 1fr); }
  .book-showcase__cover  { max-width: 150px; }

  /* CTA: stack with copy first, artwork below — content order in the
     markup already puts the button before the illustration. */
  .cta-banner--split .cta-banner__grid { grid-template-columns: 1fr; }
  .cta-banner__art  { max-width: 480px; }

  /* cta-manuscript.png is a flattened image with flat charcoal margins
     (~19% left, ~22% right, ~8% top/bottom of its own size) around the
     notebook, so a box that is already flush with the text still reads as
     centered and adds dead space. Pull the box left/up/down by those margins
     so the visible artwork lines up with the text edge. min(480px, 100%) is
     the art's own rendered width (% in margin resolves against the same grid
     area as its width). The overshoot is clipped by .cta-banner's
     overflow: hidden and is the same colour as the section behind it. */
  .cta-banner__art {
    margin-left: calc(min(480px, 100%) * -0.19);
    margin-block: calc(min(480px, 100%) * -0.05);
  }
}

@media (max-width: 640px) {
  /* mobile: link drops below the heading block instead of crowding it */
  .home-section__head--split          { flex-direction: column; }
  .home-section__head--split .home-section__more { margin-top: var(--space-4); }

  /* each book stacks directly above its own testimonial */
  .book-row              { grid-template-columns: 1fr; }
  .book-showcase__cover  { max-width: 200px; }
}

/* Mobile: stats and team stay two-across (they used to collapse to one long
   column at 480px), with tighter section padding. */
@media (max-width: 767px) {
  /* ---- stats band ---- */
  .trust-strip__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 16px;
    padding-block: var(--space-6);
  }

  .stat__num { white-space: nowrap; }

  /* the faint "120" watermark: smaller and tucked toward the corner so it
     stays a quiet texture behind the labels; the strip's overflow: hidden
     already guarantees it can't widen the page */
  .trust-strip__figure {
    font-size: 130px;
    right: var(--space-3);
  }

  /* ---- closing CTA banner ---- */
  .cta-banner__grid {
    gap: var(--space-5);
    padding-block: var(--space-7) var(--space-6);
  }
}

/* ==========================================================================
   Cinematic intro sequence — state classes driven by intro-sequence.js.
   Base .intro layout is inlined in header.php so it covers before CSS loads.
   ========================================================================== */
.intro {
  transition: background 0.7s ease;
}

.intro__stage {
  width: min(400px, 84vw);
  opacity: 0;
  transform: scale(0.86);
  transform-origin: 50% 45%;
  backface-visibility: hidden;
  /* will-change is added by intro-sequence.js only while the zoom runs */
}

/* 1 — laptop settles in */
.intro.is-laptop-in .intro__stage {
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.5s ease, transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

/* screen layers (sit inside .laptop__panel) */
.intro-screen {
  position: relative;
  height: 100%;
}

.intro-logo {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  transition: opacity 0.5s ease;
}

.intro-logo__word {
  display: flex;
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  font-size: 15px;
  letter-spacing: 0.22em;
  color: var(--color-text);
}

.intro-logo__word span {
  opacity: 0;
  transform: translateY(7px);
}

/* 2 — staggered letter reveal */
.intro.is-logo .intro-logo__word span {
  animation: introLetterIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--i) * 45ms);
}

@keyframes introLetterIn {
  to { opacity: 1; transform: none; }
}

.intro-ms {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.55s ease;
}

/* 3 — cross-fade wordmark → manuscript */
.intro.is-manuscript .intro-logo { opacity: 0; }
.intro.is-manuscript .intro-ms { opacity: 1; }

/* 5a — PREP (before any scaling): drop everything that would smear or cost
   layout/paint under a transform. Legible text fades out fast; the frame's
   shadow, glass, chrome, hinge and deck are removed instantly (no transition);
   the screen becomes a soft glow. After this the only thing left to animate
   is a transform on .intro__stage and opacities on two elements. */
.intro.is-zoom-prep .intro-screen {
  opacity: 0;
  transition: opacity 0.18s ease;
}

.intro.is-zoom-prep .laptop {
  transform: none;
  transition: transform 0.2s ease;
}

.intro.is-zoom-prep .laptop__shadow,
.intro.is-zoom-prep .laptop__glass,
.intro.is-zoom-prep .laptop__chrome,
.intro.is-zoom-prep .laptop__camera,
.intro.is-zoom-prep .laptop__hinge,
.intro.is-zoom-prep .laptop__deck {
  opacity: 0;
}

.intro.is-zoom-prep .laptop__bezel {
  box-shadow: none;
}

.intro.is-zoom-prep .laptop__screen {
  background: radial-gradient(ellipse at 50% 45%, #ffffff 0%, var(--color-bg) 78%);
}

/* 5b — ZOOM: transform only, slow ease-in-out so it accelerates then settles */
.intro.is-zoom {
  pointer-events: none;
}

.intro.is-zoom .intro__stage {
  transform: scale(7);
  transition: transform 1.5s cubic-bezier(0.65, 0, 0.35, 1);
}

/* 5c — CROSS-FADE over the last ~40% of the zoom: overlay opacity down while
   the real page opacity comes up. Grounds match (--color-bg) so it blends. */
.intro.is-reveal {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.page-shell {
  transition: opacity 0.6s ease;
}

/* ==========================================================================
   Enquiry section — the reusable "Tell us about your book" dark section
   rendered by includes/components/enquiry-section.php on every public
   page except individual blog articles. Kept in the shared stylesheet
   (rather than a per-page <style> block) since the same PHP function
   renders this identical markup on ~15 different pages.
   ========================================================================== */
.enquiry-section {
  position: relative;
  background-color: var(--color-surface-dark);
  background-image: url("../images/enquiry-section-background.png");
  background-image: image-set(
    url("../images/enquiry-section-background.webp") type("image/webp") 1x,
    url("../images/enquiry-section-background.png") type("image/png") 1x
  );
  background-repeat: no-repeat;
  background-position: left center;
  background-size: cover;
  color: var(--color-text-on-dark);
  padding-block: 48px;
}

.enquiry-section__inner {
  display: grid;
  grid-template-columns: minmax(0, 45fr) minmax(0, 55fr);
  gap: var(--space-8);
  align-items: center;
}

.enquiry-section__eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: rgba(251, 250, 247, 0.75);
}

.enquiry-section__heading {
  margin-top: var(--space-3);
  font-size: clamp(1.8rem, 1.4rem + 1.8vw, 2.5rem);
  color: var(--color-text-on-dark);
}

.enquiry-section__lede {
  margin-top: var(--space-4);
  font-size: var(--fs-md);
  color: rgba(251, 250, 247, 0.72);
  max-width: 40ch;
}

/* ---- Form ---------------------------------------------------------- */
.enquiry-form { margin-top: 0; }

.enquiry-form > * + * {
  margin-top: var(--space-4);
}

.enquiry-field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-4);
}

.enquiry-field-row > * {
  min-width: 0;
  margin-top: 0;
}

.enquiry-field,
.enquiry-phone-field {
  display: flex;
  flex-direction: column;
}

.enquiry-phone-field {
  border: 0;
  padding: 0;
}

.enquiry-field label,
.enquiry-phone-field legend {
  padding: 0;
  font-size: var(--fs-sm);
  font-weight: var(--weight-medium);
  line-height: 1.4;
  color: var(--color-text-on-dark);
}

.enquiry-phone-field legend {
  margin-bottom: var(--space-2);
}

.enquiry-field__required { color: #e6b04a; }

.enquiry-field input,
.enquiry-field select,
.enquiry-field textarea,
.enquiry-phone-field input,
.enquiry-phone-field select {
  margin-top: var(--space-2);
  padding: 12px 16px;
  font: inherit;
  font-size: var(--fs-sm);
  line-height: 1.4;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.enquiry-field input::placeholder,
.enquiry-field textarea::placeholder {
  color: var(--color-text-muted);
}

.enquiry-field input:focus-visible,
.enquiry-field select:focus-visible,
.enquiry-field textarea:focus-visible,
.enquiry-phone-field input:focus-visible,
.enquiry-phone-field select:focus-visible {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(42, 77, 255, 0.25);
}

.enquiry-field textarea {
  resize: vertical;
  min-height: 100px;
}

.enquiry-field--invalid input,
.enquiry-field--invalid select,
.enquiry-field--invalid textarea,
.enquiry-phone-field--invalid input,
.enquiry-phone-field--invalid select {
  border-color: var(--color-error);
}

.enquiry-field__error {
  margin-top: var(--space-2);
  font-size: var(--fs-xs);
  color: #ff9b9b;
}

.enquiry-field--full { grid-column: 1 / -1; }

/* Phone row: country selector + number, side by side, sharing the exact
   input/select rule above for height/padding/border/focus — the selector
   is a normal, non-overlapping flex item next to the input, never an
   absolutely-positioned prefix laid over it, so it cannot cover typed
   digits at any width. */
.enquiry-phone-row {
  display: flex;
  gap: var(--space-3);
}

.enquiry-phone-row__country {
  flex: 0 1 190px;
  min-width: 0;
}

.enquiry-phone-row__number {
  flex: 1 1 auto;
  min-width: 0;
}

.enquiry-phone-row select,
.enquiry-phone-row input {
  width: 100%;
  margin-top: 0;
}

/* honeypot: off-screen for sighted/no-JS users too, not display:none (a
   bot skips fields it can't "see" rendered — this still renders) */
.enquiry-hp {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.enquiry-form__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.enquiry-form__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
}

.enquiry-form__divider {
  width: 1px;
  height: 20px;
  background: rgba(251, 250, 247, 0.3);
}

.enquiry-privacy-link {
  font-size: var(--fs-sm);
  color: var(--color-text-on-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.enquiry-privacy-link:hover,
.enquiry-privacy-link:focus-visible {
  color: rgba(251, 250, 247, 0.75);
}

.enquiry-required-note {
  font-size: var(--fs-xs);
  color: rgba(251, 250, 247, 0.6);
}

/* ---- Status / error summary ------------------------------------------ */
.enquiry-notice {
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
}

.enquiry-notice--success {
  background: rgba(47, 125, 79, 0.2);
  border: 1px solid #6bbf8e;
  color: #bdeccf;
}

.enquiry-notice--unavailable {
  background: rgba(251, 250, 247, 0.08);
  border: 1px solid rgba(251, 250, 247, 0.3);
  color: var(--color-text-on-dark);
}

.enquiry-notice--unavailable .btn { margin-top: var(--space-3); }

.enquiry-notice--error {
  background: rgba(178, 59, 59, 0.2);
  border: 1px solid #e08a8a;
  color: #ffd4d4;
}

.enquiry-summary {
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid #e08a8a;
  border-radius: var(--radius-md);
  background: rgba(178, 59, 59, 0.15);
  font-size: var(--fs-sm);
}

.enquiry-summary p { color: #ffd4d4; font-weight: var(--weight-semibold); }

.enquiry-summary ul {
  margin: var(--space-2) 0 0;
  padding-left: var(--space-5);
  color: #ffd4d4;
}

.enquiry-summary a { color: #ffd4d4; }

/* ---- Responsive ---------------------------------------------------- */
@media (max-width: 860px) {
  .enquiry-section {
    /* keep the charcoal ground, drop the decorative pen so narrow layouts
       stay readable and compact rather than fighting the artwork */
    background-image: none;
    padding-block: 40px;
  }

  .enquiry-section__inner {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .enquiry-section__lede { max-width: none; }

  .enquiry-field-row { grid-template-columns: 1fr; }

  .enquiry-phone-row { flex-direction: column; }
  .enquiry-phone-row__country { flex-basis: auto; }
}

/* ==========================================================================
   Portfolio carousel — the reusable "Explore our work" section rendered
   by includes/components/portfolio-carousel.php on every eligible page
   immediately above the enquiry section. Kept in the shared stylesheet
   since the same PHP function renders this identical markup on many
   different pages.
   ========================================================================== */
.pfc-section {
  position: relative;
  padding-block: var(--space-8);
  border-bottom: 1px solid var(--color-border);
  background-color: var(--color-bg);
  background-image: radial-gradient(circle, rgba(22, 24, 29, 0.09) 0.8px, transparent 0.9px);
  background-size: 24px 24px;
}

.pfc-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.pfc-head__text { max-width: 52ch; }

.pfc-eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-accent);
}

.pfc-heading {
  margin-top: var(--space-2);
  font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem);
}

.pfc-lede {
  margin-top: var(--space-2);
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
}

.pfc-head__controls {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  flex-shrink: 0;
}

.pfc-view-link {
  font-size: var(--fs-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-accent);
  white-space: nowrap;
}

.pfc-nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.pfc-nav[hidden] { display: none; }

.pfc-nav__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast),
    opacity var(--transition-fast);
}

.pfc-nav__btn:hover:not(:disabled) {
  border-color: var(--color-text);
}

.pfc-nav__btn:disabled {
  color: var(--color-text-faint);
  border-color: var(--color-border-light);
  cursor: default;
  opacity: 0.6;
}

/* ---- Track: native horizontal scroll + CSS scroll-snap ------------------ */
.pfc-track {
  display: flex;
  gap: var(--space-5);
  list-style: none;
  margin: 0;
  padding: 0 0 var(--space-2);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 0;
  scrollbar-width: none;
}

.pfc-track::-webkit-scrollbar { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .pfc-track { scroll-behavior: smooth; }
}

.pfc-card {
  flex: 0 0 calc((100% - 3 * var(--space-5)) / 4);
  min-width: 0;
  scroll-snap-align: start;
}

@media (max-width: 1100px) {
  .pfc-card { flex-basis: calc((100% - 2 * var(--space-5)) / 3); }
}

@media (max-width: 860px) {
  .pfc-card { flex-basis: calc((100% - 1 * var(--space-5)) / 2); }
}

@media (max-width: 560px) {
  .pfc-card { flex-basis: 82%; }
}

.pfc-card__frame {
  display: block;
  color: inherit;
}

a.pfc-card__frame:hover .pfc-card__media,
a.pfc-card__frame:focus-visible .pfc-card__media {
  border-color: var(--color-text-faint);
}

.pfc-card__media {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 3 / 4;
  padding: var(--space-4);
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast);
}

.pfc-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pfc-card__body {
  display: block;
  margin-top: var(--space-3);
}

.pfc-card__title {
  display: block;
  font-weight: var(--weight-semibold);
  font-size: var(--fs-sm);
  color: var(--color-text);
}

.pfc-card__credit,
.pfc-card__sample {
  display: block;
  margin-top: 2px;
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 560px) {
  .pfc-head {
    align-items: flex-start;
  }

  .pfc-head__controls {
    width: 100%;
    justify-content: space-between;
  }
}

/* ==========================================================================
   Enquiry popup — the site-wide "Tell us about your book" modal, rendered
   once by includes/components/enquiry-popup.php (see footer.php's single
   call site) and opened only by explicit user action (the "Quick enquiry"
   trigger — see footer.php). Mirrors the native <dialog> pattern already
   established by the Portfolio page's project-detail dialog (.pf-dialog):
   position:fixed + inset:0 + margin:auto for centering, a real ::backdrop,
   and a scrollable inner body so content-driven height never overflows a
   short viewport.
   ========================================================================== */
.enquiry-popup {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(920px, 94vw);
  max-height: 92dvh;
  padding: 0;
  border: none;
  border-radius: var(--radius-lg);
  background: var(--color-bg);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
  color: var(--color-text);
}

.enquiry-popup::backdrop {
  background: rgba(20, 20, 25, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

/* Two-panel split: cover image left, form right. The image column simply
   stretches to whatever height the form panel ends up (capped below), and
   the <img> is absolutely filled into it with object-fit: cover, so it is
   never stretched or distorted at any height. */
.enquiry-popup__layout {
  display: grid;
  grid-template-columns: minmax(0, 42fr) minmax(0, 58fr);
}

.enquiry-popup__media {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: var(--color-panel);
}

.enquiry-popup__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 28% 50%;
}

.enquiry-popup__panel {
  min-width: 0;
  max-height: min(640px, 92dvh);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-7) var(--space-6);
}

/* Lives on the dialog itself (not inside the scrolling panel), so it stays
   pinned to the card corner however far the form is scrolled. */
.enquiry-popup__close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  cursor: pointer;
}

.enquiry-popup__close:hover { border-color: var(--color-text-faint); }

.enquiry-popup__close:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.enquiry-popup__head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding-right: var(--space-7);
}

.enquiry-popup__art {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.enquiry-popup__eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-accent);
}

.enquiry-popup__heading {
  margin-top: var(--space-1);
  font-size: var(--fs-xl);
  color: var(--color-text);
}

.enquiry-popup__lede {
  margin-top: var(--space-1);
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
}

.enquiry-popup__form {
  margin-top: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.enquiry-popup-field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-4);
}

.enquiry-popup-field {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.enquiry-popup-field label,
.enquiry-popup-phone legend {
  font-size: var(--fs-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
}

.enquiry-popup-phone legend { margin-bottom: var(--space-2); }
.enquiry-popup-field__required { color: var(--color-accent); }

.enquiry-popup-field input,
.enquiry-popup-phone input,
.enquiry-popup-phone select {
  margin-top: var(--space-2);
  padding: 12px 14px;
  font: inherit;
  font-size: var(--fs-sm);
  line-height: 1.4;
  min-height: 46px;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.enquiry-popup-field input::placeholder {
  color: var(--color-text-muted);
}

.enquiry-popup-field input:focus-visible,
.enquiry-popup-phone input:focus-visible,
.enquiry-popup-phone select:focus-visible {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(42, 77, 255, 0.15);
}

.enquiry-popup-field--invalid input,
.enquiry-popup-phone--invalid input,
.enquiry-popup-phone--invalid select {
  border-color: var(--color-error);
}

.enquiry-popup-field__error {
  margin-top: var(--space-2);
  font-size: var(--fs-xs);
  color: var(--color-error);
}

.enquiry-popup-phone { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; }

.enquiry-popup-phone__row {
  display: flex;
  gap: var(--space-2);
}

/* Country select shows full "+dial — Name" text (no flags-only shorthand),
   so it needs more room than the number field next to it, but must still
   never clip or overlap it. */
.enquiry-popup-phone__country { flex: 1 1 200px; min-width: 0; }
.enquiry-popup-phone__number { flex: 1 1 160px; min-width: 0; }

.enquiry-popup-phone__row select,
.enquiry-popup-phone__row input {
  width: 100%;
  margin-top: 0;
}

.enquiry-popup-hp {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.enquiry-popup__submit {
  width: 100%;
  min-height: 48px;
}

.enquiry-popup__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.enquiry-popup__required-note {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

.enquiry-popup__privacy {
  font-size: var(--fs-xs);
  color: var(--color-text-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.enquiry-popup__privacy:hover,
.enquiry-popup__privacy:focus-visible {
  color: var(--color-accent);
}

/* ---- Status / error summary ------------------------------------------ */
.enquiry-popup-notice {
  margin-top: var(--space-5);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
}

.enquiry-popup-notice--success {
  border: 1px solid var(--color-success);
  background: var(--color-success-bg);
  color: var(--color-success);
}

.enquiry-popup-notice--unavailable {
  border: 1px solid var(--color-highlight-border);
  background: var(--color-highlight-bg);
  color: var(--color-text);
}

.enquiry-popup-notice--unavailable .btn { margin-top: var(--space-3); }

.enquiry-popup-notice--error {
  border: 1px solid var(--color-error);
  background: #fbeeee;
  color: var(--color-error);
}

.enquiry-popup-summary {
  margin-top: var(--space-5);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-error);
  border-radius: var(--radius-md);
  background: #fbeeee;
  font-size: var(--fs-sm);
}

.enquiry-popup-summary p { color: var(--color-error); font-weight: var(--weight-semibold); }
.enquiry-popup-summary ul { margin: var(--space-2) 0 0; padding-left: var(--space-5); color: var(--color-error); }
.enquiry-popup-summary a { color: var(--color-error); }

/* ---- Quick-enquiry trigger --------------------------------------------- */
.quick-enquiry-btn {
  cursor: pointer;
}

/* ---- Responsive --------------------------------------------------------- */
/* Tablet: keep the split, give the form more of the width. */
@media (max-width: 899px) {
  .enquiry-popup__layout { grid-template-columns: minmax(0, 34fr) minmax(0, 66fr); }
  .enquiry-popup__panel { padding: var(--space-6) var(--space-5); }
  .enquiry-popup-phone__country { flex-basis: 170px; }
}

/* Small tablet / phone: stack — short banner image on top, form below. The
   banner stays fixed and only the form panel scrolls, so the close button
   and image are never scrolled out of view. */
@media (max-width: 719px) {
  .enquiry-popup__layout { grid-template-columns: minmax(0, 1fr); }
  .enquiry-popup__media { height: 160px; }
  .enquiry-popup__media img { object-position: 30% 45%; }
  .enquiry-popup__panel { max-height: calc(92dvh - 160px); padding: 20px; }
  .enquiry-popup__close { top: var(--space-3); right: var(--space-3); width: 44px; height: 44px; }
  .enquiry-popup__art { width: 56px; height: 56px; }
  .enquiry-popup__head { padding-right: 0; }
}

@media (max-width: 540px) {
  .enquiry-popup-field-row { grid-template-columns: 1fr; }
  .enquiry-popup-phone__row { flex-wrap: wrap; }
  .enquiry-popup-phone__country,
  .enquiry-popup-phone__number { flex-basis: 100%; }
}

/* Very short viewports (e.g. a phone on its side): drop the banner so the
   form gets the whole card. */
@media (max-height: 520px) {
  .enquiry-popup__media { display: none; }
  .enquiry-popup__layout { grid-template-columns: minmax(0, 1fr); }
  .enquiry-popup__panel { max-height: 92dvh; }
}

@media (prefers-reduced-motion: reduce) {
  .enquiry-popup { transition: none; }
}

/* ==========================================================================
   Service pages — shared mobile / tablet rules (ghostwriting + services/*).

   Every service page carries its own page-local <style> block (prefixes gw-,
   et-, cd-, pb-, mk-, aw-, pl-) with the same desktop-first structure: a
   96px-padded hero grid, 96px sections, 32-48px card/panel padding, and
   grids that only change columns at 860px. Rather than repeating a fix in
   seven inline blocks, these rules match the shared naming pattern by
   attribute suffix and are scoped with .svc-main (set on <main> by
   includes/header.php for those pages only). The extra class makes each
   selector out-rank the equal-weight page-local rules regardless of source
   order. Everything is inside the 860px query — the pages' own stacking
   breakpoint — so desktop is untouched.
   ========================================================================== */
@media (max-width: 860px) {
  /* one consistent, slimmer page gutter (matches the header's 16px), and a
     safety net so nothing decorative (a rotated card, a negative margin) can
     ever widen the page */
  .svc-main {
    --container-pad: 16px;
    overflow-x: clip;
  }

  /* ---- section rhythm: one consistent vertical gap ---- */
  .svc-main .home-section,
  .svc-main .pfc-section { padding-block: 48px; }

  .svc-main .home-section__head { margin-bottom: 28px; }

  /* ---- hero ----
     The desktop padding-block (96px top and bottom) and 48-64px grid gap were
     still applied after the hero stacked, leaving ~100px above the label. */
  .svc-main [class$="-hero__inner"] {
    gap: 24px;
    padding-top: 24px;
    padding-bottom: 32px;
  }

  /* both hero buttons on one row; text scales with the viewport and the
     buttons share the row (auto-width, growing equally), so even the longest
     label ("Explore website options") fits at 360px. Stacks below 340px. */
  .svc-main [class$="-hero__actions"] {
    flex-wrap: nowrap;
    gap: 8px;
    margin-top: 24px;
    max-width: 460px;
  }

  .svc-main [class$="-hero__actions"] .btn {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    padding: 12px clamp(6px, 2.4vw, 20px);
    font-size: clamp(0.6875rem, 3.2vw, 0.9375rem);
  }

  /* ---- hero artwork: left-align to the text edge ----
     Each PNG carries transparent margin on its left (measured), which makes
     a box that is already flush with the text look centered. Pull each box
     left by that margin and trim the empty top/bottom. min(Npx, 100%) is
     the art's own rendered width (% margins resolve against the same
     container as its width). Margins, never transforms. */
  .svc-main .cd-hero__art {
    margin: calc(min(460px, 100%) * -0.03) 0 calc(min(460px, 100%) * -0.03) calc(min(460px, 100%) * -0.084);
  }

  .svc-main .pb-hero__art {
    margin: calc(min(480px, 100%) * -0.06) 0 calc(min(480px, 100%) * -0.06) calc(min(480px, 100%) * -0.027);
  }

  .svc-main .aw-hero__art {
    margin: calc(min(520px, 100%) * -0.06) 0 calc(min(520px, 100%) * -0.06) calc(min(520px, 100%) * -0.027);
  }

  /* in-page illustrations: same idea, using each image's measured left
     margin (SVG/PNG widths are the pages' own clamp()/min() values, which
     resolve to these at phone/tablet widths) */
  .svc-main .gw-audience-art { margin-left: calc(min(280px, 60vw) * -0.141); }
  .svc-main .et-receive-art  { margin-left: calc(clamp(220px, 22vw, 260px) * -0.175); }
  .svc-main .pl-receive-art  { margin-left: calc(clamp(220px, 22vw, 330px) * -0.092); }
  .svc-main .cd-includes-art { margin-left: calc(min(320px, 100%) * -0.192); }
  .svc-main .pb-handoff-art  { margin-left: calc(clamp(220px, 22vw, 280px) * -0.091); }

  /* the tilted "Chapter one" card: keep the 2.5deg tilt, but size it so its
     rotated corners stay inside the text column (a 4:3 box tilted 2.5deg is
     ~3% wider than its own width) and start at the text's left edge */
  .svc-main .gw-tablet {
    width: calc(100% - 12px);
    margin: 4px 0 4px 6px;
  }

  /* ---- cards and panels: 20px inside instead of 32-48px ---- */
  .svc-main :is(
    [class$="-option-card"],
    [class$="-process-card"],
    [class$="-support-card"],
    [class$="-focus-card"],
    [class$="-audience-card"],
    [class$="-includes-list__panel"]
  ) { padding: 20px; }

  .svc-main [class$="-faq__item"] { padding: 16px 20px; }

  .svc-main .gw-scope-panel,
  .svc-main .pl-note { padding: 20px; }

  .svc-main .pl-receive-list li { padding: 14px 16px; }

  /* "What we agree before writing begins" panel (and similar heading + intro
     + bullet-list cards): heading wraps across the whole card, bullets sit
     close to their text, tighter list rhythm */
  .svc-main .gw-scope-panel h2 { font-size: 1.5rem; }

  .svc-main .gw-scope-list {
    gap: 14px;
    margin-top: 20px;
  }

  .svc-main .gw-scope-list li { padding-left: 18px; }

  .svc-main .gw-scope-panel__lede { max-width: none; line-height: 1.5; }

  .svc-main .gw-scope-list span { line-height: 1.5; }

  /* ---- stacked "image + list" splits: 24px, not the desktop 64px gap ---- */
  .svc-main :is(
    [class$="-receive-grid"],
    [class$="-includes-grid"],
    [class$="-handoff-grid"],
    [class$="-deliver-grid"],
    .gw-audience-head
  ) { gap: 24px; }

  .svc-main :is(
    [class$="-handoff-grid"],
    [class$="-deliver-grid"],
    [class$="-includes-grid"]
  ) { margin-top: 24px; }

  .svc-main .gw-audience-head { margin-bottom: 24px; }

  .svc-main .gw-audience-art,
  .svc-main .et-receive-art,
  .svc-main .pl-receive-art { margin-top: 0; }

  .svc-main .et-receive-list { margin-top: 0; }

  /* The proofreading link now sits mid-sentence, but .et-clarify a is
     inline-block with a top margin, which opens a blank gap in the line it
     lands on when the paragraph wraps. Inline, no margin, on small screens. */
  .svc-main .et-clarify a { display: inline; margin-top: 0; }

  /* the deliverables <ul> never reset the browser's 40px list indent */
  .svc-main .aw-deliverables { margin: 0; padding-left: 0; }
}

/* 4-card process grids fit two-across on tablets */
@media (min-width: 600px) and (max-width: 860px) {
  .svc-main [class$="-process-grid"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Under 340px two hero buttons can't share a row legibly — stack them. */
@media (max-width: 339px) {
  .svc-main [class$="-hero__actions"] { flex-wrap: wrap; }
  .svc-main [class$="-hero__actions"] .btn { flex-basis: 100%; }
}

/* ==========================================================================
   Packages page — mobile / tablet rules (860px and below, the page's own stacking
   breakpoint; nothing at 900px+ changes).
   The page also gets the shared .svc-main rules above (16px gutter, 48px
   section rhythm, hero padding, FAQ item padding). Page-local pk- classes
   are matched by their real names, scoped with .svc-main so each selector
   out-ranks the page's own inline <style>.
   ========================================================================== */
@media (max-width: 860px) {
  /* ---- hero: the artwork PNG has ~1% left margin and ~5-6% top/bottom
     transparent space; align it to the text edge and trim the dead space ---- */
  .svc-main .pk-hero__art {
    margin: calc(min(460px, 100%) * -0.03) 0 calc(min(460px, 100%) * -0.04) calc(min(460px, 100%) * -0.012);
  }

  /* ---- starting-point cards, package cards, Track B panel ---- */
  .svc-main .pk-start-grid,
  .svc-main .pk-cards { gap: 16px; }

  .svc-main .pk-start-card { padding: 20px; gap: 16px; }

  .svc-main .pk-card { padding: 20px; }

  .svc-main .pk-card__price { margin-top: 20px; padding-top: 20px; }

  .svc-main .pk-card .btn,
  .svc-main .pk-pipeline__main .btn { margin-top: 24px; }

  .svc-main .pk-track__head { margin-bottom: 24px; }

  .svc-main .pk-pipeline {
    padding: 20px;
    gap: 24px;
  }

  /* packages-write-for-me.png carries ~18% transparent margin on its left;
     pull the box left by it so the visible art lines up with the text */
  .svc-main .pk-pipeline__art {
    margin: calc(min(200px, 100%) * -0.03) 0 calc(min(200px, 100%) * -0.03) calc(min(200px, 100%) * -0.184);
  }

  .svc-main .pk-strip { padding: 20px; }

  .svc-main .pk-testimonial { padding: 20px; }
  .svc-main .pk-testimonial-grid { gap: 16px; }

  /* ---- feature checklists ----
     The <li> was display:flex, which turns every text fragment and every
     inline link inside it into its own flex item — "Editing, cover design,
     and publishing" split into scattered pieces with commas on their own and
     "add-ons" breaking at its hyphen. Make each item a normal block: the
     checkmark (the existing ::before mask icon) is positioned in the item's
     left padding, and everything else flows as ordinary inline text that
     wraps naturally, with wrapped lines aligned under the first line's text. */
  .svc-main .pk-feature-list,
  .svc-main .pk-pipeline__features { gap: 10px; }

  .svc-main .pk-feature-list li,
  .svc-main .pk-pipeline__features li {
    display: block;
    position: relative;
    padding-left: 26px;
    font-size: var(--fs-sm);
    line-height: 1.5;
    hyphens: manual;
    overflow-wrap: normal;
    word-break: normal;
  }

  .svc-main .pk-feature-list li::before,
  .svc-main .pk-pipeline__features li::before {
    position: absolute;
    left: 0;
    top: 0.2em;
    margin-top: 0;
  }

  .svc-main .pk-feature-list li a,
  .svc-main .pk-pipeline__features li a { display: inline; }

  /* ---- "What runs through every package": two-across ---- */
  .svc-main .pk-stages {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 16px;
    align-items: stretch;
  }

  .svc-main .pk-stage { min-width: 0; }

  .svc-main .pk-stage h3 { margin-top: 12px; font-size: var(--fs-sm); }

  .svc-main .pk-stage__scope {
    font-size: var(--fs-xs);
    line-height: 1.35;
    overflow-wrap: break-word;
    text-wrap: pretty;
  }

  .svc-main .pk-stage p {
    font-size: 0.875rem;
    line-height: 1.5;
  }
}

/* ==========================================================================
   Cookie consent — banner + "Manage" preferences panel
   (includes/components/cookie-consent.php, assets/js/cookie-consent.js).
   Rendered once, from footer.php, on every page. Mirrors the enquiry
   popup's fixed/centered-panel pattern and the site's existing .btn
   variants (dark primary, outline secondary) rather than inventing new
   button styling.
   ========================================================================== */
.cookie-consent__banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 400;
  padding: var(--space-5) var(--container-pad, 24px);
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -14px 34px -18px rgba(20, 20, 25, 0.25);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 280ms ease, transform 280ms ease;
}

.cookie-consent__banner[hidden] { display: none; }

.cookie-consent__banner.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.cookie-consent__banner-inner {
  max-width: var(--container-max);
  margin-inline: auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-5);
}

.cookie-consent__text {
  flex: 1 1 320px;
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
}

.cookie-consent__text a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-consent__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  flex-shrink: 0;
  gap: var(--space-3);
}

/* "Reject non-essential" — deliberately a plain text-style control, not a
   third full button, so Accept All / Manage keep the visual priority. */
.cookie-consent__text-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-consent__text-btn:hover,
.cookie-consent__text-btn:focus-visible {
  color: var(--color-text);
}

/* ---- Backdrop + panel: same fixed/centered pattern as .enquiry-popup --- */
.cookie-consent__scrim {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(20, 20, 25, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 250ms ease, visibility 0s linear 250ms;
}

.cookie-consent__scrim[hidden] { display: none; }

.cookie-consent__scrim.is-open {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

.cookie-consent__panel {
  position: fixed;
  inset: 0;
  margin: auto;
  z-index: 9001;
  width: min(480px, 92vw);
  max-height: min(640px, 88dvh);
  overflow-y: auto;
  padding: var(--space-7) var(--space-6);
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 250ms ease, transform 250ms ease, visibility 0s linear 250ms;
}

.cookie-consent__panel[hidden] { display: none; }

.cookie-consent__panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s;
}

html.cookie-panel-open { overflow: hidden; }

.cookie-consent__close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  cursor: pointer;
}

.cookie-consent__close:hover { border-color: var(--color-text-faint); }

.cookie-consent__close:focus-visible,
.cookie-consent__panel-heading:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.cookie-consent__panel-heading {
  padding-right: var(--space-7);
  font-size: var(--fs-xl);
  outline: none;
}

.cookie-consent__panel-lede {
  margin-top: var(--space-2);
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
}

.cookie-consent__panel-lede a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-consent__category {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
}

.cookie-consent__category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.cookie-consent__category-name {
  font-weight: var(--weight-semibold);
  font-size: var(--fs-base);
  color: var(--color-text);
}

.cookie-consent__always {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.cookie-consent__category-desc {
  margin-top: var(--space-2);
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
}

.cookie-consent__panel-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
}

/* ---- Toggle switch: a real checkbox, visually a track + thumb --------- */
.cookie-consent__switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.cookie-consent__switch input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.cookie-consent__switch-track {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  padding: 2px;
  border-radius: var(--radius-pill);
  background: var(--color-border);
  border: 1px solid var(--color-border);
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.cookie-consent__switch-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 20, 25, 0.3);
  transition: transform var(--transition-fast);
}

.cookie-consent__switch input:checked + .cookie-consent__switch-track {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.cookie-consent__switch input:checked + .cookie-consent__switch-track .cookie-consent__switch-thumb {
  transform: translateX(20px);
}

.cookie-consent__switch input:focus-visible + .cookie-consent__switch-track {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ---- Responsive: stack full width, 44px tap targets -------------------- */
@media (max-width: 640px) {
  .cookie-consent__banner-inner {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-4);
  }

  .cookie-consent__actions {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
  }

  .cookie-consent__actions .btn,
  .cookie-consent__actions .cookie-consent__text-btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  .cookie-consent__panel {
    width: min(480px, 94vw);
    padding: var(--space-6) var(--space-5);
  }

  .cookie-consent__panel-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-consent__panel-actions .btn,
  .cookie-consent__panel-actions .cookie-consent__text-btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-consent__banner,
  .cookie-consent__panel,
  .cookie-consent__scrim,
  .cookie-consent__switch-track,
  .cookie-consent__switch-thumb {
    transition: none;
  }
}

/* ==========================================================================
   Video testimonial carousel — "Here's how it feels to publish with The
   Folio Studios", rendered by
   includes/components/video-testimonial-carousel.php on the Testimonials
   page and the Ghostwriting page, directly above the enquiry section.
   Track/nav pattern mirrors .pfc-* above; cards are portrait (9:16) with an
   overlaid caption pill and play button, and clicking one opens the shared
   .vtc-modal <dialog> player.
   ========================================================================== */
.vtc-section {
  position: relative;
  padding-block: var(--space-8);
  border-bottom: 1px solid var(--color-border);
  background-color: var(--color-bg);
  background-image: radial-gradient(circle, rgba(22, 24, 29, 0.09) 0.8px, transparent 0.9px);
  background-size: 24px 24px;
}

.vtc-head { text-align: center; margin-bottom: var(--space-6); }

.vtc-heading {
  max-width: 34ch;
  margin: 0 auto;
  font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem);
}

/* ---- Carousel shell: arrows either side of the track --------------------- */
.vtc-carousel {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.vtc-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast),
    opacity var(--transition-fast);
}

.vtc-arrow:hover:not(:disabled) { border-color: var(--color-text); }

.vtc-arrow:disabled {
  color: var(--color-text-faint);
  border-color: var(--color-border-light);
  cursor: default;
  opacity: 0.6;
}

/* ---- Track: native horizontal scroll + CSS scroll-snap ------------------- */
.vtc-track {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  gap: var(--space-5);
  list-style: none;
  margin: 0;
  padding: 0 0 var(--space-2);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 0;
  scrollbar-width: none;
}

.vtc-track::-webkit-scrollbar { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .vtc-track { scroll-behavior: smooth; }
}

.vtc-card {
  flex: 0 0 calc((100% - 3 * var(--space-5)) / 4);
  min-width: 0;
  scroll-snap-align: start;
}

@media (max-width: 1100px) {
  .vtc-card { flex-basis: calc((100% - 2 * var(--space-5)) / 3); }
}

@media (max-width: 860px) {
  .vtc-card { flex-basis: calc((100% - 1 * var(--space-5)) / 2); }
}

@media (max-width: 560px) {
  .vtc-card { flex-basis: 78%; }
}

.vtc-card__btn {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.vtc-card__frame {
  position: relative;
  display: block;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-panel);
  transition: border-color var(--transition-fast);
}

.vtc-card__btn:hover .vtc-card__frame,
.vtc-card__btn:focus-visible .vtc-card__frame {
  border-color: var(--color-text-faint);
}

.vtc-card__btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-md);
}

.vtc-card__thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vtc-card__caption {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  right: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: var(--fs-xs);
  font-weight: var(--weight-semibold);
  line-height: 1.35;
  box-shadow: 0 8px 20px -12px rgba(20, 20, 25, 0.35);
}

.vtc-card__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--color-bg);
  color: var(--color-accent);
  box-shadow: 0 10px 24px -10px rgba(20, 20, 25, 0.45);
  transition: transform var(--transition-fast);
}

.vtc-card__play svg { margin-left: 2px; } /* optically center the triangle */

.vtc-card__btn:hover .vtc-card__play,
.vtc-card__btn:focus-visible .vtc-card__play {
  transform: translate(-50%, -50%) scale(1.06);
}

/* ---- CTA below the carousel ----------------------------------------------- */
.vtc-cta {
  display: flex;
  justify-content: center;
  margin-top: var(--space-7);
}

/* ---- Modal player: native <dialog>, mirrors .enquiry-popup's centering --- */
.vtc-modal {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(480px, 92vw);
  max-height: 92dvh;
  padding: 0;
  border: none;
  border-radius: var(--radius-lg);
  background: #000;
  box-shadow: var(--shadow-panel);
  overflow: visible;
}

.vtc-modal::backdrop {
  background: rgba(20, 20, 25, 0.7);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.vtc-modal__close {
  position: absolute;
  top: -44px;
  right: 0;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  cursor: pointer;
}

.vtc-modal__close:hover { border-color: var(--color-text-faint); }

.vtc-modal__close:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.vtc-modal__player {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 92dvh;
  background: #000;
}

.vtc-modal__player iframe,
.vtc-modal__player video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ---- Responsive: small, unobtrusive arrows on mobile ---------------------- */
@media (max-width: 560px) {
  .vtc-carousel { gap: var(--space-2); }

  .vtc-arrow {
    width: 28px;
    height: 28px;
  }

  .vtc-modal__close {
    top: -40px;
    width: 32px;
    height: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vtc-modal__player iframe,
  .vtc-modal__player video { transition: none; }
}
