/* ============================================================
   JONAS RODRIGUES · AI Creative Director / VFX Lead
   Cinematic Dark — ZIGVERSE identity
   Display: Syne · Body: Hanken Grotesk
   Accent: neon pink #ff2bd6 · secondary cyan #1fd6dd
   v3 · professional senior pass
   ============================================================ */

:root {
  --bg:        #0a0a0a;
  --bg-soft:   #111111;
  --bg-card:   #141414;
  --bg-line:   #222222;
  --fg:        #f0f0f0;
  --fg-muted:  #b0b0b0;   /* was #9a9a9a — improved WCAG contrast */
  --fg-dim:    #606060;
  --accent:    #ff2bd6;
  --accent-2:  #1fd6dd;

  --font-display: 'Inter', system-ui, -apple-system, sans-serif;
  --font-sans:    'Hanken Grotesk', system-ui, -apple-system, sans-serif;
  --font-graffiti: 'Permanent Marker', cursive;

  /* fluid type scale */
  --text-xs:   clamp(0.7rem,  0.66rem + 0.18vw, 0.8rem);
  --text-sm:   clamp(0.85rem, 0.8rem  + 0.22vw, 0.95rem);
  --text-base: clamp(0.97rem, 0.93rem + 0.22vw, 1.08rem);
  --text-lg:   clamp(1.1rem,  1rem    + 0.5vw,  1.35rem);
  --text-xl:   clamp(1.25rem, 1.1rem  + 0.75vw, 1.65rem);
  --text-2xl:  clamp(1.5rem,  1.2rem  + 1.5vw,  2.4rem);
  --text-3xl:  clamp(2rem,    1.5rem  + 2.2vw,  3.2rem);
  --display:   clamp(2.4rem,  1rem  + 6vw,  5.5rem);

  /* spacing tokens */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-14: 3.5rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* section rhythm — tight & punchy */
  --section:   clamp(2rem, 4vw, 3rem);
  --stack-gap: clamp(1.25rem, 2.5vw, 2rem);

  --max-width: 1340px;
  --gutter:    clamp(1.25rem, 4.5vw, 3.5rem);

  --ease:       cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out:   cubic-bezier(0.22, 1, 0.36, 1);
  --hairline:   1px solid var(--bg-line);
  --radius-sm:  8px;
  --radius:     14px;
  --radius-lg:  20px;
  --radius-xl:  28px;

  --shadow-glow-pink: 0 0 70px -15px var(--accent);
  --shadow-glow-cyan: 0 0 70px -15px var(--accent-2);
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; background: none; border: 0; color: inherit; cursor: pointer; }
a, button, [data-lightbox] { touch-action: manipulation; }
h1, h2, h3, h4 { overflow-wrap: break-word; }
/* Removed container overflow-x rules to allow full-width background bands */
::selection { background: var(--accent); color: #0a0a0a; }

/* ============================================================
   FILM GRAIN OVERLAY
   ============================================================ */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: 0.035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* ============================================================
   GLOBAL UTILITIES
   ============================================================ */
.kicker {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-muted);
  line-height: 1.5;
}
.kicker--accent { color: var(--accent); }
.cyan { color: var(--accent-2); }

/* ============================================================
   WEBGL CANVAS
   ============================================================ */
#webgl { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
body:has(#webgl[style*="display: none"]) {
  background:
    radial-gradient(ellipse at 22% 20%, color-mix(in srgb, var(--accent) 11%, transparent), transparent 52%),
    radial-gradient(ellipse at 80% 78%, color-mix(in srgb, var(--accent-2) 9%, transparent),  transparent 52%),
    var(--bg);
  background-attachment: fixed;
}
.nav, main, .footer-expand { position: relative; z-index: 2; }

/* preloader removed — site loads instantly */

/* Utility: line breaks visible only on mobile */
.mobile-br { display: none; }
@media (max-width: 680px) { .mobile-br { display: inline; } }


/* ============================================================
   SCROLL PROGRESS
   ============================================================ */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0); transform-origin: 0 50%; will-change: transform;
}

/* ============================================================
   DOODLES (Basquiat-style SVGs)
   ============================================================ */
.doodle {
  position: absolute;
  pointer-events: none;
  z-index: 5;
  overflow: visible;
}
.doodle path {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  transition: stroke-dashoffset 2.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.is-visible .doodle path,
.reveal.is-visible .doodle path {
  stroke-dashoffset: 0;
}
.doodle--crown {
  width: 100px;
  height: 80px;
  top: -45px;
  left: -20px;
  transform: rotate(-12deg);
}
.doodle--underline {
  width: 100%;
  height: 20px;
  bottom: -5px;
  left: 0;
  transform: rotate(-2deg);
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-5) var(--gutter);
  mix-blend-mode: difference;
  transition: transform 0.5s var(--ease), background 0.4s ease,
              padding 0.4s ease, backdrop-filter 0.4s ease;
}
.nav__brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: opacity 0.3s;
}
.nav__brand:hover { opacity: 0.65; }
.lang-switcher {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.lang-option {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding: 0.4em 0.9em;
  border-radius: 999px;
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
}
.lang-option:hover:not(.is-active) {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.05);
}
.lang-option.is-active {
  background: var(--accent);
  color: #000;
  box-shadow: 0 0 12px -4px var(--accent);
  pointer-events: none;
}

.nav.is-scrolled {
  mix-blend-mode: normal;
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: var(--hairline);
  padding-block: var(--space-3);
}
.nav.is-hidden { transform: translateY(-110%); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: calc(var(--section) + 4rem) var(--gutter) var(--section);
  max-width: var(--max-width);
  margin-inline: auto;
}

.hero__label { margin-bottom: var(--space-6); }

.hero__title {
  font-family: var(--font-graffiti);
  font-weight: 400;
  font-size: var(--display);
  line-height: 0.95;
  text-align: center;
}
.hero__title .split-wrap:first-child {
  font-size: 1.8em; /* Scales JONAS to match or exceed RODRIGUES width */
}
.hero__title .split-wrap:nth-child(3) {
  font-size: 1em; /* Baseline for RODRIGUES */
}
.hero__title .accent { color: var(--accent); }

.hero__sub {
  font-size: var(--text-xl);
  max-width: 50ch;
  color: var(--fg-muted);
  font-weight: 400;
  margin-bottom: var(--space-6);
  line-height: 1.5;
  margin-inline: auto;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: var(--space-3) 0;
  border-bottom: 1px solid rgba(240,240,240,0.4);
  align-self: center;
  transition: gap 0.5s var(--ease), color 0.3s, border-color 0.3s;
}
.hero__cta:hover { gap: var(--space-8); color: var(--accent); border-color: var(--accent); }
.hero__cta-arrow { display: inline-block; animation: cta-bob 2s var(--ease) infinite; }
@keyframes cta-bob {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(5px); }
}

/* hero line reveal */
.hero__title .split-wrap { display: inline-block; overflow: hidden; padding-bottom: 0.08em; }
.reveal-line {
  display: inline-block;
  transform: translateY(115%); opacity: 0;
  transition: transform 1s var(--ease), opacity 1s var(--ease);
}
.is-loaded .reveal-line { transform: translateY(0); opacity: 1; }

.spray-reveal {
  position: relative;
  display: inline-block;
  -webkit-mask-image: linear-gradient(to right, black 45%, transparent 55%);
  -webkit-mask-size: 250% 100%;
  -webkit-mask-position: 100% 0;
  opacity: 0;
}
.is-loaded .spray-reveal {
  animation: sprayMaskWipe 1.2s steps(25) forwards;
}
/* Glowing nozzle effect */
.spray-reveal::before {
  content: '';
  position: absolute;
  top: 10%; bottom: 10%; left: 0; width: 30px;
  background: radial-gradient(circle, var(--accent) 20%, transparent 70%);
  filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}
.is-loaded .spray-reveal::before {
  animation: sprayNozzle 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
/* Droplet puff */
.spray-reveal::after {
  content: '';
  position: absolute;
  top: -20%; left: -5%; right: -5%; bottom: -20%;
  background-image: 
    radial-gradient(circle, var(--accent) 2px, transparent 2.5px),
    radial-gradient(circle, var(--accent-2) 1.5px, transparent 2px),
    radial-gradient(circle, #fff 1.5px, transparent 2px),
    radial-gradient(circle, var(--accent) 1px, transparent 1.5px),
    radial-gradient(circle, #fff 2px, transparent 2.5px);
  background-size: 100% 100%;
  background-position: 10% 20%, 30% 80%, 70% 30%, 90% 70%, 50% 10%;
  background-repeat: no-repeat;
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}
.is-loaded .spray-reveal::after {
  animation: sprayPuff 1.2s ease-out forwards;
}

.hero__title .split-wrap:nth-of-type(1) .spray-reveal,
.hero__title .split-wrap:nth-of-type(1) .spray-reveal::before,
.hero__title .split-wrap:nth-of-type(1) .spray-reveal::after { animation-delay: 0.15s; }

.hero__title .split-wrap:nth-of-type(2) .spray-reveal,
.hero__title .split-wrap:nth-of-type(2) .spray-reveal::before,
.hero__title .split-wrap:nth-of-type(2) .spray-reveal::after { animation-delay: 0.75s; }

@keyframes sprayMaskWipe {
  0% { -webkit-mask-position: 100% 0; opacity: 0.5; filter: blur(3px) drop-shadow(0 0 10px var(--accent)); transform: scale(0.98); }
  20% { opacity: 1; filter: blur(1px); transform: scale(1.02); }
  100% { -webkit-mask-position: 0% 0; opacity: 1; filter: blur(0px) drop-shadow(0 0 0px transparent); transform: scale(1); }
}
@keyframes sprayNozzle {
  0% { transform: translateX(-20px); opacity: 0; }
  10% { opacity: 0.8; }
  80% { opacity: 0.5; }
  100% { transform: translateX(100%); opacity: 0; }
}
@keyframes sprayPuff {
  0% { opacity: 0; transform: scale(0.9) translateX(-10%); filter: blur(2px); }
  20% { opacity: 0.9; filter: blur(0px); }
  100% { opacity: 0; transform: scale(1.1) translateX(10%); filter: blur(5px); }
}

/* split char (label + tagline) */
.split-wrap { display: inline-block; overflow: hidden; }
.split-char {
  display: inline-block;
  transform: translateY(110%); opacity: 0;
  transition: transform 0.9s var(--ease), opacity 0.9s var(--ease);
}
.is-loaded .split-char { transform: translateY(0); opacity: 1; }

/* hero parallax inner */
.hero__inner { display: flex; flex-direction: column; will-change: transform, opacity; }

/* ============================================================
   INTRO STATS BAND
   ============================================================ */
.intro {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-8) var(--gutter);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--stack-gap);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(16px);
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 10 L30 40 M80 20 L70 60 M40 80 L60 90 M20 70 L15 85' stroke='rgba(255,255,255,0.05)' stroke-width='0.5' fill='none'/%3E%3C/svg%3E");
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}
.intro__stat { 
  padding-inline: var(--space-4);
  transition: transform 0.4s var(--ease);
}
.intro__stat:hover {
  transform: translateY(-3px);
}
.intro__stat:not(:last-child) {
  border-right: var(--hairline);
  padding-right: var(--stack-gap);
}
.intro__stat .num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-2xl);
  letter-spacing: -0.025em;
  line-height: 1;
  transition: text-shadow 0.4s var(--ease);
}
.intro__stat:hover .num {
  text-shadow: var(--shadow-glow-cyan);
}
.intro__stat .num em { font-style: normal; color: var(--accent); }
.intro__stat:hover .num em { text-shadow: var(--shadow-glow-pink); }

.intro__stat p {
  color: var(--fg-muted);
  font-size: var(--text-sm);
  margin-top: var(--space-3);
  max-width: 28ch;
  line-height: 1.55;
  transition: color 0.4s var(--ease);
}
.intro__stat:hover p {
  color: var(--fg);
}

/* ============================================================
   SECTION HEADER
   ============================================================ */
.section-head {
  max-width: var(--max-width);
  margin: 0 auto var(--space-12); /* Increased from space-5 to space-12 for massive breathing room */
  padding: var(--space-2) var(--gutter) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-3xl);
  line-height: 0.95;
  letter-spacing: -0.025em;
}

/* ============================================================
   WORK / CHAPTERS
   ============================================================ */
.work { padding-block: var(--section) var(--space-6); }

.chapter {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--section) var(--gutter) var(--section);
}
.chapter:first-of-type { border-top: 0; }
.chapter:not(:first-of-type) {
  position: relative;
  border-top: 1px solid var(--border);
}

/* Glassmorphism + Scratches for alternating chapters */
.chapter:nth-of-type(even)::before {
  content: '';
  display: block;
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.015); /* Very transparent to let particles show */
  backdrop-filter: blur(12px); /* Glass effect */
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 10 L30 40 M80 20 L70 60 M40 80 L60 90 M20 70 L15 85' stroke='rgba(255,255,255,0.03)' stroke-width='0.5' fill='none'/%3E%3C/svg%3E");
  background-size: 150px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  z-index: -2;
}

/* Artistic doodles restricted to the final project page (#ch-04 Pinocchio) */
#ch-04::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background-image: url('images/basquiat-bg.svg');
  background-size: 1000px;
  background-position: center top;
  opacity: 0.25; /* Striking but balanced */
  mix-blend-mode: color-dodge; 
  z-index: -1;
  pointer-events: none;
}

.chapter__head {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}
.chapter__index {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xs);
  color: var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.chapter__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: calc(var(--text-2xl) * 1.39); /* +10% from previous 1.265 */
  line-height: 0.95;
  letter-spacing: -0.025em;
}
.chapter__title::first-letter {
  color: var(--accent);
}
.chapter__tagline {
  color: var(--fg-muted);
  font-size: calc(var(--text-lg) * 1.1); /* +10% */
  max-width: 58ch;
  line-height: 1.5;
  margin-top: 0;
  white-space: nowrap;
}

.chapter__split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4.5vw, 4.5rem);
  align-items: center;
  margin-bottom: var(--space-10); /* Increase spacing before sub-images */
}

/* Push text column down very slightly for rhythm */
.chapter__split > :last-child {
  padding-top: 0;
}

/* portrait-video chapters: text aligned to top */
.chapter__split:has(.media--portrait) {
  grid-template-columns: 0.42fr 0.58fr; /* Text 42%, Video 58% (Video increased by 15-20%) */
  align-items: stretch; /* Title starts at the top, no empty gap above */
  gap: clamp(2rem, 5vw, 5rem);
}

/* Specific properties for the video in normal portrait layout */
.chapter__split:has(.media--portrait):not(.is-reverse) > :last-child {
  justify-self: end;
  width: 100%;
  max-width: 440px;
  height: 100%;
  aspect-ratio: auto;
  padding-top: 0;
}

/* Small top padding just for visual breathing room */
.chapter__split:has(.media--portrait) > :last-child,
.chapter__split.is-reverse:has(.media--portrait) > :last-child {
  padding-top: clamp(0.5rem, 2vh, 2rem);
}

/* reversed layout (text left, video right) */
.chapter__split.is-reverse {
  grid-template-columns: 0.45fr 0.55fr;
}
.chapter__split.is-reverse:has(.media--portrait) {
  grid-template-columns: 0.45fr 0.55fr; /* Text 45% (more words per line), Video 55% */
  align-items: center; /* Center vertically instead of stretching */
}
.chapter__split.is-reverse:has(.media--portrait) > :first-child {
  justify-self: end;
  width: 100%;
  max-width: 440px; /* Prevents it from getting absurdly wide */
  margin-right: -1.5rem; /* Pushed slightly to the right */
  margin-top: 0; /* Aligned exactly at the top */
}

/* Specific size and position for TR1 (Chapter 01) on desktop (EN vs PT-BR) */
@media (min-width: 1025px) {
  html[lang^="pt"] #ch01-main-video {
    max-width: 510px !important;
    margin-right: -4rem !important;
  }
  html[lang="en"] #ch01-main-video {
    max-width: 380px !important;
    margin-right: -1.5rem !important;
  }
}

/* Specific 20% increase for the Talk on AI GIF on desktop */
@media (min-width: 681px) {
  #ch06-main-video {
    max-width: 528px !important;
  }
}

/* Specific size increase for Pinocchio on desktop */
@media (min-width: 1025px) {
  #ch-04 .chapter__split {
    grid-template-columns: 0.3fr 0.7fr; /* Text 30%, Video 70% */
  }
  #ch04-main-video {
    max-width: none !important; /* Override the default max-width: 440px */
    width: 110%;
    margin-right: -10%;
  }
}
.chapter__split.is-reverse > :first-child {
  order: 2;
}
.chapter__split.is-reverse > :last-child {
  order: 1;
}

/* ============================================================
   DUO MEDIA (Two videos side-by-side)
   ============================================================ */
.media-duo {
  display: flex;
  gap: var(--space-4);
  width: 100%;
  height: auto !important;
  align-self: center !important; /* Center vertically instead of stretching */
  max-width: none !important; /* Allow two videos to fully expand */
  justify-self: stretch !important; /* Fill the grid column */
  margin: 0 !important;
}
.media-duo > .media {
  flex: 1;
  width: 100%;
  height: auto !important; /* Do not force height */
  aspect-ratio: 9/16 !important; /* Force exact 9:16 proportions */
}

/* util: push body below cine hero (Muiraquitã chapter) */
.chapter__body-offset { margin-top: var(--space-8); }

.chapter__body p { color: var(--fg-muted); max-width: 52ch; line-height: 1.7; }
.chapter__split:has(.media--portrait) .chapter__body p {
  max-width: none;
  font-size: clamp(1rem, 1rem + 0.25vw, 1.15rem);
}
.chapter__body p strong { color: var(--fg); font-weight: 600; }
.chapter__body > p + p {
  margin-top: var(--space-3);
}

/* Indent text body below the title in portrait layouts for better typographic hierarchy */
.chapter__split:has(.media--portrait) .chapter__body > :not(.chapter__head) {
  margin-left: clamp(1rem, 2.5vw, 2.5rem);
}

/* ============================================================
   META + BADGE
   ============================================================ */
.meta { display: flex; flex-direction: column; gap: var(--space-3); margin: var(--space-5) 0 0; }
.meta__row { display: flex; gap: var(--space-6); flex-wrap: wrap; }
.meta__item { display: flex; flex-direction: column; gap: 3px; }
.meta__item .k {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.meta__item .v { font-weight: 600; font-size: var(--text-sm); }
.meta__item .v.cyan { color: var(--accent-2); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.45em 0.9em;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 999px;
  width: fit-content;
  box-shadow: 0 0 18px -6px var(--accent);
}
.badge::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.badge--cyan { border-color: var(--accent-2); color: var(--accent-2); box-shadow: 0 0 18px -6px var(--accent-2); }
.badge--cyan::before { background: var(--accent-2); }

/* Green "Delivered" badge */
.badge--green { border-color: #22c55e; color: #22c55e; box-shadow: 0 0 18px -6px #22c55e; }
.badge--green::before { background: #22c55e; }

/* ============================================================
   MEDIA CARDS
   ============================================================ */
.media {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--bg-card);
  border: var(--hairline);
  border-radius: var(--radius);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.4s ease;
}
.media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease), filter 0.6s var(--ease);
  transform: translateY(var(--py, 0px)) scale(var(--sc, 1));
}
a.media:hover img { transform: translateY(var(--py, 0px)) scale(var(--sc, 1)); }
a.media:hover { 
  border-color: var(--accent-2); 
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}
a.media:hover { --sc: 1.05; }

/* Swiper navigation custom styles */
.proj-swiper { padding-bottom: 3rem; }
.swiper-button-next, .swiper-button-prev { color: var(--accent-2) !important; transform: scale(0.6); }
.swiper-pagination-bullet { background: rgba(255,255,255,0.4) !important; }
.swiper-pagination-bullet-active { background: var(--accent-2) !important; }

/* aspect ratios */
.media--cine     { aspect-ratio: 2.35 / 1; border-radius: var(--radius-lg); }
.media--wide     { aspect-ratio: 16 / 9; }
.media--portrait {
  aspect-ratio: 9 / 16;
  border-radius: var(--radius-lg);
  max-height: 140vh; /* Allow video to become very tall to fill the space */
  max-width: 100%; /* Prevent horizontal blowout of the grid */
  height: auto;
  margin: 0 auto;
}
.media--tall     { aspect-ratio: 3 / 4; }
.media--square   { aspect-ratio: 1 / 1; }
.media--thumb    { aspect-ratio: 4 / 3; }

/* play button */
.media--video::before {
  content: "";
  position: absolute; inset: 0; margin: auto;
  width: 72px; height: 72px;
  border-radius: 50%;
  border: 1.5px solid rgba(240,240,240,0.85);
  background: rgba(10,10,10,0.25);
  backdrop-filter: blur(4px);
  z-index: 3;
  transition: all 0.4s var(--ease);
}
.media--video::after {
  content: "";
  position: absolute; inset: 0; margin: auto;
  width: 0; height: 0;
  transform: translateX(3px);
  border-left: 18px solid #f0f0f0;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  z-index: 4;
  transition: all 0.4s var(--ease);
}
.media--video:hover::before {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.1);
  box-shadow: var(--shadow-glow-pink);
}
.media--video:hover::after { border-left-color: #0a0a0a; }
.media--video.is-cyan:hover::before {
  background: var(--accent-2);
  border-color: var(--accent-2);
  box-shadow: var(--shadow-glow-cyan);
}
.media--baked::before, .media--baked::after { display: none; }

/* caption badge */
.media__cap {
  position: absolute; left: var(--space-3); bottom: var(--space-3); z-index: 5;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg);
  background: rgba(10,10,10,0.6);
  backdrop-filter: blur(6px);
  padding: 0.34em 0.7em;
  border-radius: 999px;
}

/* overlay gradient on image media hover */
a.media[data-lightbox="image"]::before {
  content: '';
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 6%, transparent) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.5s var(--ease);
  border-radius: inherit;
}
a.media[data-lightbox="image"]:hover::before { opacity: 1; }

/* "view" arrow on image media */
a.media[data-lightbox="image"]::after {
  content: "\2197";
  position: absolute; top: var(--space-3); right: var(--space-3); z-index: 5;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(10,10,10,0.45);
  backdrop-filter: blur(4px);
  color: var(--fg);
  border: 1px solid rgba(240,240,240,0.35);
  font-size: 0.95rem; font-weight: 600;
  opacity: 0; transform: scale(0.8);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease),
              background 0.3s, border-color 0.3s, color 0.3s;
}
a.media[data-lightbox="image"]:hover::after {
  opacity: 1; transform: scale(1);
  background: var(--accent); border-color: var(--accent); color: #0a0a0a;
}

/* feature media: subtle initial zoom that settles */
@property --sc { syntax: "<number>"; inherits: false; initial-value: 1; }
.media.is-feature { --sc: 1.08; }
.media.is-feature.is-in { --sc: 1; }
a.media.is-feature:hover { --sc: 1.03; }
.media img { transition: --sc 0.9s var(--ease), filter 0.6s var(--ease); }
.media.is-feature img { will-change: transform; }

/* ============================================================
   STRIP (thumbnail row)
   ============================================================ */
.strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 items default */
  gap: var(--space-4);
  margin-top: var(--space-6);
  max-width: 61%; /* Reduced ~15% from 72% */
}

/* For 1, 2, or 4 items, use 2 columns so they are large */
.strip:has(> .media:only-of-type),
.strip:has(> .media:nth-of-type(2):last-of-type),
.strip:has(> .media:nth-of-type(4):last-of-type) {
  grid-template-columns: repeat(2, 1fr);
}

/* Specific size reduction for 4-item grids (like VanDutch) */
.strip:has(> .media:nth-of-type(4):last-of-type):not(.strip--4col) {
  max-width: 52%; /* Reduced by ~20% from the previous 65% baseline */
}

/* Force 4 columns side by side */
.strip.strip--4col {
  grid-template-columns: repeat(4, 1fr) !important;
  max-width: 80%;
}
.strip__label {
  grid-column: 1 / -1;
  margin-bottom: calc(var(--space-2) * -1);
}

/* ============================================================
   MELLA GIF GRID
   ============================================================ */
.gif-block { margin-top: var(--space-6); }
.gif-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-4);
  max-width: 68%; /* Reduced ~15% from 80% */
}
.gif-grid .media { aspect-ratio: 2 / 3; border-radius: var(--radius); }
.gif-grid .media img { filter: saturate(1.05); }

/* ============================================================
   ABOUT
   ============================================================ */
.about {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--section) var(--gutter);
  border-top: var(--hairline);
}

.about__top {
  display: grid;
  grid-template-columns: 1fr 1.5fr;     /* was 0.8/1.2 — portrait gets more weight */
  gap: var(--stack-gap);
  align-items: start;
}

.about__portrait .media {
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-xl);
}
.about__portrait .media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* animated halo behind portrait */
.about__portrait {
  position: relative;
}
.about__portrait::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: calc(var(--radius-xl) + 2px);
  background: conic-gradient(from 0deg, var(--accent), var(--accent-2), var(--fg-dim), var(--accent));
  z-index: -1;
  opacity: 0.3;
  filter: blur(8px);
  animation: portrait-halo 6s linear infinite;
}
@keyframes portrait-halo {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .about__portrait::before { animation: none; }
}

.about__lead {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xl);
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin-bottom: var(--space-4);
}
.about__body p { color: var(--fg-muted); max-width: 56ch; line-height: 1.7; }
.about__body p strong { color: var(--fg); font-weight: 600; }
.about__body p + p { margin-top: var(--space-3); }

/* ============================================================
   SKILL STACKS
   ============================================================ */
.stacks {
  margin-top: var(--space-12);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--stack-gap);
}
.stack {
  padding: var(--space-5);
  background: var(--bg-soft);
  border: var(--hairline);
  border-radius: var(--radius);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s var(--ease);
}
.stack:hover {
  border-color: color-mix(in srgb, var(--accent-2) 50%, transparent);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px -10px rgba(0,0,0,0.6);
}
.stack__head {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-sm);
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-3);
  border-bottom: var(--hairline);
  letter-spacing: 0.01em;
}
.stack__head span { color: var(--accent-2); }
.stack li {
  color: var(--fg-muted);
  font-size: var(--text-sm);
  padding: 0.3em 0;
  line-height: 1.4;
}

/* Stacks carousel wrapper */
.stacks-carousel { position: relative; }
.stacks-arrow {
  display: none; /* Hidden on desktop */
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--fg);
  font-size: 1.8rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
  line-height: 1;
}
.stacks-arrow:hover {
  background: rgba(255,255,255,0.2);
}
.stacks-arrow--prev { left: -4px; }
.stacks-arrow--next { right: -4px; }
/* Stacks Carousel Pagination */
.stacks-pagination {
  display: none; /* hidden on desktop */
  justify-content: center;
  gap: 8px;
  margin-top: var(--space-6);
}
.stacks-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
}
.stacks-dot.active {
  background: var(--accent);
  transform: scale(1.2);
}

/* ============================================================
   EXPERIENCE & EDUCATION COLUMNS
   ============================================================ */
.cols2 {
  margin-top: var(--space-12);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--stack-gap);
}
.tl__item {
  padding: var(--space-3) 0;
  border-bottom: var(--hairline);
  display: flex;
  justify-content: space-between;
  gap: var(--space-6);
  align-items: flex-start;
}
.tl__item h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-sm);
  line-height: 1.3;
}
.tl__item p { color: var(--fg-muted); font-size: var(--text-sm); margin-top: 2px; }
.tl__item .yr {
  color: var(--fg-dim);
  font-size: var(--text-xs);
  white-space: nowrap;
  padding-top: 2px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* ============================================================
   CLIENTS
   ============================================================ */
.clients { margin-top: var(--space-10); }
.clients__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-8);
  margin-top: var(--space-4);
}
.clients__list li {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1rem, 0.9rem + 0.7vw, 1.45rem);   /* was too large at 1.7rem */
  color: var(--fg-dim);
  transition: color 0.3s;
  letter-spacing: -0.01em;
  cursor: default;
  word-break: break-word;
}
.clients__list li:hover { color: var(--fg); }

/* ============================================================
   MONTAGE
   ============================================================ */
.montage { margin-top: var(--space-8); }
.montage .media { aspect-ratio: 16 / 10; border-radius: var(--radius-lg); }

/* ============================================================
   EXPANDING FOOTER / CONTACT
   ============================================================ */
.footer-expand {
  position: relative;
  background: var(--bg);
  border-top: var(--hairline);
  overflow: hidden;
}
.footer-expand__strip {
  max-width: var(--max-width);
  margin-inline: auto;
  padding: var(--space-5) var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: opacity 0.4s var(--ease);
  gap: var(--space-4);
  flex-wrap: wrap;
}
.footer-expand__body {
  position: relative;
  max-width: 100%;
  margin-inline: auto;
  height: 0;
  overflow: hidden;
  padding-inline: calc(var(--gutter) + 5vw);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-6);
  transition: height 1.1s var(--ease);
  background-color: var(--bg);
  background-image: url('images/basquiat-bg.svg');
  background-size: 800px 800px;
  background-position: center;
}
.footer-expand.is-expanded .footer-expand__body { height: 100svh; }
.footer-expand.is-expanded .footer-expand__strip { opacity: 0; pointer-events: none; }
.footer-expand__pre { margin-bottom: var(--space-2); }
.footer-expand__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 8vw, 9rem);
  line-height: 1.05; /* Increased from 0.88 to prevent text clipping at the bottom */
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--fg) 30%, color-mix(in srgb, var(--fg) 70%, transparent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  padding-bottom: 0.15em; /* Added padding to ensure descenders/hand-drawn fonts are not clipped */
}
.footer-expand__title .accent {
  color: var(--accent);
  font-family: var(--font-graffiti);
  font-weight: 400; /* Spray fonts are usually normal weight */
  font-size: 1.1em; /* Adjust to match the visual weight of the bold font */
  letter-spacing: 0;
  text-transform: uppercase; /* Changed from lowercase to fix missing accented characters like 'Ó' in Permanent Marker */
}
.footer-expand__email {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.1rem, 3.5vw, 2.6rem);
  letter-spacing: -0.01em;
  display: inline-block;
  border-bottom: 1px solid rgba(240,240,240,0.3);
  width: fit-content;
  transition: color 0.4s, border-color 0.4s;
  word-break: break-word;
}
.footer-expand__email:hover { color: var(--accent); border-color: var(--accent); }
.footer-expand__socials {
  display: flex;
  gap: var(--space-8);
  flex-wrap: wrap;
  margin-top: var(--space-2);
}
.footer-expand__socials a {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-bottom: 1px solid transparent;
  padding-bottom: 3px;
  transition: color 0.3s, border-color 0.3s;
}
.footer-expand__socials a:hover { color: var(--accent-2); border-bottom-color: var(--accent-2); }
.footer-expand__meta {
  margin-top: auto;
  padding-bottom: var(--space-6);
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin: 0 auto;
}

/* ============================================================
   SWIPER CAROUSEL OVERRIDES
   ============================================================ */
.proj-swiper {
  padding-bottom: var(--space-8) !important;
  cursor: grab;
}
.proj-swiper:active {
  cursor: grabbing;
}
.proj-swiper .swiper-pagination-bullet {
  background: var(--fg-muted);
  opacity: 0.3;
  transition: all 0.3s ease;
  width: 8px;
  height: 8px;
}
.proj-swiper .swiper-pagination-bullet-active {
  background: var(--accent);
  opacity: 1;
  width: 24px;
  border-radius: 4px;
}
.proj-swiper .media {
  margin: 0;
  /* Allow natural aspect-ratio height from images */
}

/* ============================================================
   LIGHTBOX OVERRIDES
   ============================================================ */
.lightbox {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(6,6,6,0.97);
  backdrop-filter: blur(24px);
  display: grid; place-items: center;
  padding: var(--gutter);
  opacity: 0; pointer-events: none;
  transition: opacity 0.5s var(--ease);
}
.lightbox.is-open { opacity: 1; pointer-events: auto; }
.lightbox__close {
  position: absolute; top: var(--space-5); right: var(--space-5);
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border: var(--hairline); color: var(--fg);
  border-radius: 50%;
  transition: color 0.3s, border-color 0.3s, transform 0.4s var(--ease);
}
.lightbox__close:hover { color: var(--accent); border-color: var(--accent); transform: rotate(90deg); }
.lightbox__content {
  width: 100%; max-width: 1100px;
  display: flex; flex-direction: column;
  gap: var(--space-5);
  transform: translateY(28px);
  transition: transform 0.6s var(--ease);
}
.lightbox.is-open .lightbox__content { transform: translateY(0); }
.lightbox__player {
  aspect-ratio: 16 / 9;
  background: var(--bg-soft);
  position: relative;
  border: var(--hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.lightbox__player iframe, .lightbox__player video {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}
.lightbox__player--portrait {
  aspect-ratio: 9 / 16;
  max-height: 70vh;
  max-width: 40vw;
  width: 100%;
  margin-inline: auto;
}
@media (max-width: 680px) {
  .lightbox__player--portrait {
    max-width: 85vw;
    max-height: 75vh;
  }
}
.lightbox__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-xl);
  line-height: 1.05;
}
.lightbox__desc { color: var(--fg-muted); max-width: 70ch; font-size: var(--text-sm); line-height: 1.6; }
.lightbox__image {
  width: 100%; height: auto;
  max-height: 82svh; object-fit: contain;
  border-radius: var(--radius-lg);
}
.lightbox__placeholder {
  position: absolute; inset: 0;
  display: grid; place-content: center;
  text-align: center;
  gap: var(--space-4);
  padding: var(--space-8);
  background: radial-gradient(ellipse at 50% 40%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%), var(--bg-soft);
  border-radius: var(--radius-lg);
}
.lightbox__placeholder .ico { font-size: 2.2rem; }
.lightbox__placeholder h4 { font-family: var(--font-display); font-weight: 800; font-size: var(--text-lg); }
.lightbox__placeholder code {
  font-family: ui-monospace, monospace;
  color: var(--accent-2);
  background: rgba(255,255,255,0.07);
  padding: 0.15em 0.5em;
  border-radius: 4px;
}
.lightbox__placeholder p { color: var(--fg-muted); font-size: var(--text-sm); max-width: 46ch; margin-inline: auto; }

/* ============================================================
   SCROLL REVEALS
   ============================================================ */
.reveal {
  opacity: 0; transform: translateY(36px);
  transition: opacity 0.85s var(--ease), transform 0.85s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

.reveal-stagger > *:not(.no-stagger) {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal-stagger.is-visible > *:not(.no-stagger) { opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 0.12s; }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 0.19s; }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 0.26s; }
.reveal-stagger.is-visible > *:nth-child(5) { transition-delay: 0.33s; }
.reveal-stagger.is-visible > *:nth-child(6) { transition-delay: 0.40s; }

/* word reveal (section titles) */
.word-wrap { display: inline-block; overflow: hidden; padding-bottom: 0.08em; }
.word {
  display: inline-block;
  transform: translateY(115%); opacity: 0;
  transition: transform 0.9s var(--ease), opacity 0.9s var(--ease);
}
.is-words-in .word { transform: translateY(0); opacity: 1; }

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  .reveal, .reveal-stagger > *, .split-char, .reveal-line, .word {
    transform: none !important; opacity: 1 !important;
  }
  a.media:hover img { transform: none; }
  .media.is-feature, .media.is-feature.is-in { --sc: 1 !important; }
  .media img { transition: opacity 0.3s ease; }
  .hero__inner { transform: none !important; opacity: 1 !important; }
  .hero__cta-arrow { animation: none; }
  .scroll-progress { display: none; }
}

/* ============================================================
   RESPONSIVE — iPad LANDSCAPE 1025–1100px
   ============================================================ */
@media (max-width: 1100px) and (min-width: 1025px) {
  .chapter__split { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   RESPONSIVE — TABLET 1024px
   ============================================================ */
@media (max-width: 1024px) {
  .chapter__split {
    grid-template-columns: 1fr;
    gap: var(--space-8);
    align-items: start;
  }
  .chapter__split.is-reverse:has(.media--portrait) > :first-child {
    justify-self: center !important;
    max-width: 320px !important;
    height: auto !important;
    margin-inline: auto !important;
  }
  .chapter__split, .chapter__split.is-reverse { grid-template-columns: 1fr !important; }
  .chapter__split:has(.media--portrait) .chapter__body > :not(.chapter__head) {
    margin-left: 0;
  }
  .chapter__split.is-reverse > :first-child,
  .chapter__split.is-reverse > :last-child {
    order: unset;
  }
  .media--portrait {
    max-height: 50vh;
    max-width: 320px;
    margin-inline: auto;
  }
  .about__top { grid-template-columns: 1fr; gap: var(--space-10); }
  .about__portrait { max-width: 380px; margin-inline: auto; }
  .stacks { grid-template-columns: repeat(2, 1fr); gap: var(--space-8); }
  .cols2 { grid-template-columns: 1fr; gap: var(--space-8); }
}

/* ============================================================
   RESPONSIVE — MOBILE 680px
   ============================================================ */
@media (max-width: 680px) {
  /* nav */
  .nav { padding: var(--space-4) var(--gutter); justify-content: center !important; text-align: center !important; }
  .nav__brand { display: block; width: 100%; text-align: center !important; }
  .nav__links { display: none; }

  /* hero - Center everything */
  .hero { 
    padding-top: calc(var(--section) + 3.5rem); 
    text-align: center !important;
    display: flex;
    flex-direction: column;
    align-items: center !important;
  }
  .hero__title { text-align: center !important; }
    .hero__sub { 
    font-size: var(--text-lg); 
    max-width: 100%; 
    margin-inline: auto; 
    text-align: center !important; /* FIXED ALIGNMENT */
  }  .hero__title {
    font-size: clamp(2.5rem, 13vw, 4rem) !important; /* Scaled up per request */
    line-height: 1.05;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    max-width: 100vw;
  }
  .hero__cta { margin-inline: auto; min-height: 44px; }
  
  /* fix crown overlapping text on mobile */
  .doodle--crown {
    width: 52px !important;
    height: 42px !important;
    top: -22px !important;
    left: -8px !important;
    transform: rotate(-12deg) !important;
  }
/* intro stats */
  .intro {
    grid-template-columns: 1fr;
    gap: 0;
    padding-block: var(--space-8);
    border-radius: var(--radius);
    text-align: center !important;
  }
  .intro__stat {
    padding: var(--space-6) var(--space-4);
    border-right: none !important;
    text-align: center !important;
    display: flex;
    flex-direction: column;
    align-items: center !important;
  }
  .intro__stat:not(:last-child) {
    border-bottom: var(--hairline);
  }

  /* chapter - fully centered */
  .chapter__head { 
    padding-top: var(--space-2); 
    margin-bottom: var(--space-8); 
    text-align: center !important; 
    display: flex;
    flex-direction: column;
    align-items: center !important;
  }
  .chapter__index, .chapter__title, .chapter__tagline { 
    text-align: center !important; 
    max-width: 100% !important;
    overflow-wrap: break-word !important;
    word-wrap: break-word !important;
    padding-inline: var(--space-2);
    box-sizing: border-box;
  }
  .chapter__title {
    font-size: 2.5rem !important;
  }
  .chapter__title--display {
    font-size: clamp(2.5rem, 12vw, 3.5rem) !important;
  }
  .chapter__tagline { 
    font-size: var(--text-base); 
    margin-inline: auto; 
    max-width: 100% !important;
    white-space: normal !important;
    text-align: center !important; /* Always centered, never justified */
  }
  .chapter__tagline br {
    display: none;
  }
  p.chapter__tagline {
    text-align: center !important; /* Extra specificity override */
  }
  
  .chapter__body { 
    text-align: center !important; 
    display: flex; 
    flex-direction: column; 
    align-items: center !important; 
  }
  .chapter__body p:not(.chapter__tagline) { 
    max-width: 100%; 
    margin-inline: auto; 
    text-align: justify !important;
  }
  .chapter__body-offset { margin-top: var(--space-8) !important; }
  
  /* meta and badges */
  .meta { align-items: center !important; text-align: center !important; width: 100%; }
  .meta__row { flex-direction: column; gap: var(--space-3); align-items: center !important; justify-content: center !important; width: 100%; }
  .meta__item { align-items: center !important; text-align: center !important; }
  .badge { margin-inline: auto !important; }

  /* strip & gif */
  .strip { grid-template-columns: repeat(2, 1fr); gap: var(--space-3); max-width: 100% !important; text-align: center !important; }
  .strip__label, .kicker { text-align: center !important; width: 100%; }
  .gif-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-3); max-width: 100% !important; }
  .gif-grid > :nth-child(n+5) { display: none !important; }

  /* about - centered on mobile */
  .about { text-align: center !important; display: flex; flex-direction: column; align-items: center !important; }
  .about__portrait { max-width: 260px; margin-inline: auto; }
  .about__lead { font-size: var(--text-lg); margin-inline: auto; text-align: center !important; }
  .about__body p { 
    max-width: 100%; 
    margin-inline: auto; 
    text-align: justify !important; /* TEXT JUSTIFIED */
  }
  
   /* section titles */
  .section-title { text-align: center !important; margin-inline: auto; display: block; }
  .doodle--underline { margin-inline: auto; }

  /* intro stats - bigger numbers */
  .intro__stat .num { font-size: clamp(2.5rem, 10vw, 3.5rem); }

  /* stacks */
  /* stacks → horizontal carousel */
  .stacks { 
    display: flex !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: var(--space-4);
    margin-top: var(--space-12);
    padding-bottom: var(--space-4);
    scrollbar-width: none; /* Firefox */
  }
  .stacks::-webkit-scrollbar { display: none; } /* Chrome/Safari */
  .stack { 
    flex: 0 0 75%; /* Each card takes 75% of viewport width */
    scroll-snap-align: center;
    display: flex; 
    flex-direction: column; 
    align-items: center !important; 
    text-align: center !important;
  }
  .stack__desc { text-align: center !important; }
  
  /* Show carousel arrows on mobile */
  .stacks-carousel { padding-inline: var(--space-8); }
  .stacks-arrow { display: flex !important; align-items: center; justify-content: center; }
  
  /* footer */
  .footer-expand__socials { justify-content: center !important; flex-wrap: wrap; }
  .footer-expand__socials a { min-height: 44px; display: flex; align-items: center; justify-content: center !important; }
  .footer-expand__meta { display: flex !important; flex-direction: column !important; align-items: center !important; justify-content: center !important; text-align: center !important; gap: var(--space-2); }
  .stacks-pagination { display: flex !important; }
  .footer-expand__body { text-align: center !important; display: flex; flex-direction: column; align-items: center !important; }
  .footer-expand.is-expanded .footer-expand__body { 
    height: auto !important; 
    padding-top: var(--space-12) !important; 
    padding-bottom: var(--space-12) !important; 
  }
  .footer-expand__body p { text-align: justify !important; }
  
  /* clients - centered on mobile */
  .clients { text-align: center !important; }
  .clients__list { 
    justify-content: center !important; 
    text-align: center !important;
    gap: var(--space-2) var(--space-6);
  }
  .clients__list li { text-align: center !important; }
  
}

/* TABLET FIXES (Applies 1024px and below) */
@media (max-width: 1024px) {
  .chapter__split.is-reverse:has(.media-duo) {
    grid-template-columns: 1fr !important;
  }
  .media-duo {
    width: 100% !important;
    margin-right: 0 !important;
  }
}

/* MOBILE FIXES (Applies 680px and below) */
@media (max-width: 680px) {
  .media-duo {
    flex-direction: column;
    max-width: 320px !important;
    margin-right: auto !important;
    margin-left: auto !important;
  }

  /* Reorder chapter layout: Title -> Video -> Body Text */
  .chapter__split {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 0 !important;
  }
  .chapter__body {
    display: contents !important;
  }
  .chapter__head {
    order: 1 !important;
    margin-bottom: var(--space-6) !important;
    width: 100%;
  }
  .chapter__split > :not(.chapter__body) {
    order: 2 !important;
    margin-bottom: var(--space-12) !important;
    width: 100%;
    display: flex;
    justify-content: center;
  }
  .chapter__body > :not(.chapter__head) {
    order: 3 !important;
    width: 100%;
  }
}/* Give media-duo maximum possible space */
@media (min-width: 1025px) {
  .chapter__split.is-reverse:has(.media-duo) {
    grid-template-columns: 0.3fr 0.7fr !important; /* Text 30%, Videos 70% */
    gap: clamp(1rem, 2vw, 2rem) !important;
  }
  .media-duo {
    width: 130% !important;
    margin-right: -30% !important;
  }
}












