/* portfolio.css — shared base + premium animation system for all portfolio pages.
   One stylesheet → identical motion language on every page. */

:root {
  /* luxury easing — slow, decisive settle (ease-out-expo) */
  --ease-lux: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-silk: cubic-bezier(0.33, 1, 0.68, 1);
}

/* Custom cursor */
@media (pointer: fine) {
  * { cursor: none !important; }
  .cursor-dot {
    position: fixed; top: 0; left: 0; z-index: 99999; pointer-events: none;
    width: 7px; height: 7px; border-radius: 50%; background: #01b1c9;
    transform: translate(-50%,-50%); opacity: 0;
    transition: opacity 0.3s, width 0.2s, height 0.2s;
    will-change: transform;
  }
  .cursor-ring {
    position: fixed; top: 0; left: 0; z-index: 99998; pointer-events: none;
    width: 36px; height: 36px; border-radius: 50%;
    border: 1.5px solid rgba(1,177,201,0.45); background: transparent;
    transform: translate(-50%,-50%); opacity: 0;
    transition: opacity 0.3s, width 0.35s cubic-bezier(0.22,1,0.36,1),
                height 0.35s cubic-bezier(0.22,1,0.36,1),
                border-color 0.3s, background 0.3s;
    will-change: transform;
  }
}

/* Portal cube transition */
.portal-cube-wrap { transform-origin: center center; }
.portal-cube-wrap .cube { animation: cubeSpin 20s linear infinite; }
@media (prefers-reduced-motion: reduce) { .pin-bg { transform: none !important; } } — cards enter with subtle scale + rise */
.proj-card.reveal:not(.in),
.pf-split.reveal:not(.in) {
  transform: scale(0.94) translateY(28px);
  opacity: 0;
}
.proj-card.reveal.in,
.pf-split.reveal.in {
  transform: scale(1) translateY(0);
  opacity: 1;
  transition: transform 700ms cubic-bezier(0.22,1,0.36,1),
              opacity 600ms cubic-bezier(0.22,1,0.36,1);
}
.hero-eyebrow-nodot > span:first-child { font-size: 6px; opacity: 0; }
/* Hero eyebrow: fade the label text (direct edit) */
.hero-eyebrow-nodot > .__om-t { opacity: 0; }

/* Paired hero CTAs — CSS-only swap (robust against runtime DOM mutation) */
.hero-ctas { position: relative; display: flex; gap: 14px; margin-top: 36px; flex-wrap: wrap; }
.hero-ctas .cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  font-family: var(--font-display); font-weight: 600; font-size: 1.0625rem; letter-spacing: var(--ls-button); line-height: 1;
  padding: 1.05rem 2rem; border-radius: var(--radius-pill); cursor: pointer; text-decoration: none; white-space: nowrap;
  border: 1.5px solid transparent;
  transition: background 300ms var(--ease-out), color 300ms var(--ease-out), border-color 300ms var(--ease-out), box-shadow 300ms var(--ease-out);
}
/* default: View my work = strong primary; LinkedIn = clearly secondary */
.hero-ctas .cta-work {
  background: var(--accent); color: var(--text-on-accent); border-color: transparent;
  box-shadow: var(--shadow-accent), 0 0 32px rgba(1,177,201,0.28);
  font-size: 1.125rem; padding: 18px 36px;
}
.hero-ctas .cta-li {
  background: transparent; color: var(--text-muted); border-color: var(--border);
  box-shadow: none; font-size: 0.9375rem; padding: 14px 24px; opacity: 0.78;
}
.hero-ctas .cta-li .li-icon { display: inline-flex; color: var(--cyan-400); transition: color 300ms var(--ease-out); }
/* hover LinkedIn → swap states */
.hero-ctas:has(.cta-li:hover) .cta-work { background: transparent; color: var(--text-primary); border-color: var(--border-strong); box-shadow: none; }
.hero-ctas:has(.cta-li:hover) .cta-li { background: var(--accent); color: var(--text-on-accent); border-color: transparent; box-shadow: var(--shadow-accent); }
.hero-ctas:has(.cta-li:hover) .cta-li .li-icon { color: var(--text-on-accent); }
/* LinkedIn subtly lifts while hovered */
.hero-ctas .cta-li { position: relative; transform: translateY(0); }
.hero-ctas:has(.cta-li:hover) .cta-li { transform: translateY(-2px); }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
/* Lenis smooth-scroll */
/* Lock horizontal overflow on ALL browsers/devices — body alone is not enough on iOS Safari */
html { overflow-x: clip; } /* clip prevents h-scroll without breaking position:sticky */

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
body { margin: 0; font-family: var(--font-body); background: var(--navy-900); color: var(--text-primary); -webkit-font-smoothing: antialiased; overflow-x: clip; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); }
p { margin: 0; }
img { max-width: 100%; }
::selection { background: var(--cyan-500); color: var(--navy-950); }
[data-lucide] { display: inline-flex; }

/* ============================================================
   SCROLL-REVEAL VOCABULARY
   Each variant is visually distinct; all share one easing so
   the whole site feels choreographed rather than random.
   opacity is paired with motion; a JS safety net + the
   reduced-motion block below guarantee content is never stuck.
   ============================================================ */

/* legacy alias — behaves like rise */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .9s var(--ease-lux), transform 1s var(--ease-lux); }
.reveal.in { opacity: 1; transform: none; }

/* rise — body blocks */
[data-anim="rise"] { opacity: 0; transform: translateY(24px); transition: opacity 1s var(--ease-lux), transform 1.1s var(--ease-lux); }
[data-anim="rise"].in { opacity: 1; transform: none; }

/* fade — quiet elements (eyebrows, captions) */
[data-anim="fade"] { opacity: 0; transition: opacity 1.2s var(--ease-lux); }
[data-anim="fade"].in { opacity: 1; }

/* blur — premium soft-focus settle (intros) */
[data-anim="blur"] { opacity: 0; filter: blur(9px); transform: translateY(10px); transition: opacity 1s var(--ease-lux), filter 1.1s var(--ease-lux), transform 1.1s var(--ease-lux); }
[data-anim="blur"].in { opacity: 1; filter: blur(0); transform: none; }

/* zoom — media eases down to rest */
[data-anim="zoom"] { opacity: 0; transform: scale(1.06); transition: opacity 1.1s var(--ease-lux), transform 1.5s var(--ease-lux); }
[data-anim="zoom"].in { opacity: 1; transform: none; }

/* rise-right / rise-left — directional entrance for split layouts */
[data-anim="from-left"] { opacity: 0; transform: translateX(-30px); transition: opacity 1s var(--ease-lux), transform 1.1s var(--ease-lux); }
[data-anim="from-left"].in { opacity: 1; transform: none; }
[data-anim="from-right"] { opacity: 0; transform: translateX(30px); transition: opacity 1s var(--ease-lux), transform 1.1s var(--ease-lux); }
[data-anim="from-right"].in { opacity: 1; transform: none; }

/* clip — luxury curtain wipe (image insides, rectangular) */
[data-anim="clip"] { clip-path: inset(0 0 100% 0); transition: clip-path 1.25s var(--ease-lux); }
[data-anim="clip"].in { clip-path: inset(0 0 0 0); }

/* ---- 3D entrances (refined / subtle) ---- */
[data-anim="tilt3d"] { opacity: 0; transform: perspective(1300px) rotateX(16deg) translateY(40px); }
[data-anim="flip-left"] { opacity: 0; transform: perspective(1400px) rotateY(-20deg) translateX(-28px); }
[data-anim="flip-right"] { opacity: 0; transform: perspective(1400px) rotateY(20deg) translateX(28px); }
[data-anim="pop3d"] { opacity: 0; transform: perspective(1200px) translateZ(-150px) rotateX(8deg); }

/* perspective container helper — set on grids whose children fly in 3D */
.scene-3d { perspective: 1400px; perspective-origin: 50% 40%; }

/* ============================================================
   LUXURY WORD-MASK HEADING
   Words rise from behind an invisible mask, one after another.
   Built by RevealText in shared.jsx.
   ============================================================ */
.lux { display: block; }
.lux-line { display: block; overflow: hidden; padding: 0.04em 0; margin: -0.04em 0; }
.lux-line-in { display: inline-block; transform: translateY(105%); opacity: 0; will-change: transform, opacity; }
.lux.in .lux-line-in { transform: none; opacity: 1; }
/* legacy word-mask fallback */
.lux-word { display: inline-block; overflow: hidden; vertical-align: top; padding: 0.06em 0 0; margin: -0.06em 0 0; }
.lux-word > span { display: inline-block; transform: translateY(115%); opacity: 0; transition: transform 1s var(--ease-lux), opacity 1s var(--ease-lux); }
.lux.in .lux-word > span { transform: none; opacity: 1; }

/* shimmering accent words — restrained cyan sheen */
.lux-accent {
  background: linear-gradient(100deg, var(--cyan-500) 18%, var(--cyan-300) 38%, #eafaff 50%, var(--cyan-300) 62%, var(--cyan-500) 82%);
  background-size: 220% auto;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: luxShimmer 6s linear infinite;
}
@keyframes luxShimmer { to { background-position: -220% center; } }

/* ============================================================
   CHROME
   ============================================================ */
.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; transform: scaleX(0); transform-origin: 0 50%; background: linear-gradient(90deg, var(--cyan-500), var(--lapis-400)); box-shadow: 0 0 12px rgba(1,177,201,0.6); z-index: 200; pointer-events: none; }
.cursor-glow { display: none; }
.pf-burger { display: none; }

/* contextual cursor label — follows pointer over [data-cursor] elements */
.cursor-label { position: fixed; top: 0; left: 0; z-index: 140; pointer-events: none; padding: 9px 16px; border-radius: 999px; background: var(--cyan-500); color: var(--navy-950); font-family: var(--font-display); font-weight: 600; font-size: 13px; letter-spacing: 0.02em; white-space: nowrap; opacity: 0; transform: translate(-50%, -50%) scale(0.5); transition: opacity .25s var(--ease-out), transform .3s var(--ease-lux); box-shadow: 0 6px 20px rgba(1,177,201,0.35); }
.cursor-label.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* kinetic marquee ribbon */
@keyframes marqueeScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.marquee-track { display: flex; width: max-content; animation: marqueeScroll 32s linear infinite; }
.marquee-mask:hover .marquee-track { animation-play-state: paused; }

/* clients desktop / mobile toggle */
.clients-desktop { display: flex; }
.clients-mobile  { display: none; overflow: hidden; }

/* light mode: invert white logos to dark ink on cream */
[data-theme="light"] .pf-client-logo,
[data-theme="light"] .clients-mobile img,
[data-theme="light"] .clients-marquee-item img,
[data-theme="light"] .clients-desktop img {
  filter: brightness(0) opacity(0.45) !important;
}
[data-theme="light"] .pf-client-logo:hover,
[data-theme="light"] .clients-desktop a:hover img {
  filter: brightness(0) opacity(0.7) !important;
}
.clients-marquee-track {
  display: flex;
  flex-direction: row;
  width: max-content;
  align-items: center;
  gap: 48px;
  animation: marqueeScroll 28s linear infinite;
}
.clients-mobile:hover .clients-marquee-track { animation-play-state: paused; }
.clients-marquee-item { display: flex; align-items: center; flex-shrink: 0; }

@media (max-width: 768px) {
  .clients-desktop { display: none !important; }
  .clients-mobile  { display: block !important; }
}

/* "A" mark outline trace — a single luminous segment travels the outline, seamless loop */
@keyframes markTrace { to { stroke-dashoffset: -160; } }
.mark-a-trace { stroke-dasharray: 28 132; stroke-dashoffset: 0; opacity: 0.55; filter: drop-shadow(0 0 5px rgba(1,177,201,0.55)); animation: markTrace 8s linear infinite; }

/* luxury hover reveal — cursor uncovers a second (cyan) image through a soft circular mask,
   clipped inside the [data-reveal] frame; fades out when the cursor leaves */
.reveal-layer {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  transition: opacity .55s var(--ease-out);
  -webkit-mask-image: radial-gradient(circle var(--reveal-r, 150px) at var(--rx, 50%) var(--ry, 50%), #000 0%, #000 46%, transparent 78%);
  mask-image: radial-gradient(circle var(--reveal-r, 150px) at var(--rx, 50%) var(--ry, 50%), #000 0%, #000 46%, transparent 78%);
}
[data-reveal].lit .reveal-layer { opacity: 1; }

/* ============================================================
   CINEMATIC PRELOADER  — branded A-trace with ambient glow
   ============================================================ */
.preloader { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; background: var(--navy-950); overflow: hidden; transition: transform 1.1s var(--ease-lux) .15s; will-change: transform; }
.preloader[data-done="1"] { transform: translateY(-101%); }
/* ambient glow layer — cyan radial that grows with progress */
.preloader__bg-glow { position: absolute; inset: 0; background: radial-gradient(55% 55% at 50% 50%, rgba(1,177,201,0.13) 0%, transparent 70%); pointer-events: none; transition: opacity 0.4s ease; }
.preloader__inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 24px; transition: opacity .55s var(--ease-out), transform .65s var(--ease-lux); }
.preloader[data-done="1"] .preloader__inner { opacity: 0; transform: translateY(-22px); }
/* A mark SVG — responsive, centered */
.preloader__svg { display: block; width: min(56vmin, 260px); height: min(56vmin, 260px); overflow: visible; }
.preloader__count { font-family: var(--font-display); font-weight: 200; letter-spacing: -0.05em; color: var(--text-primary); font-size: clamp(2.4rem, 1.8rem + 3vw, 4.2rem); line-height: 1; font-variant-numeric: tabular-nums; }
.preloader__num { color: #fff; }
.preloader__pct { color: var(--cyan-400); font-size: 0.48em; font-weight: 300; letter-spacing: 0; margin-left: 0.06em; vertical-align: 0.12em; }
.preloader__bar { width: min(180px, 48vw); height: 1px; background: rgba(255,255,255,0.08); border-radius: 1px; overflow: hidden; }
.preloader__bar > i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--cyan-500), rgba(38,97,156,0.6)); box-shadow: 0 0 8px rgba(1,177,201,0.9); transition: width 0.08s linear; }
.preloader__label { font-family: var(--font-display); font-size: 10px; letter-spacing: 0.34em; text-transform: uppercase; color: rgba(255,255,255,0.22); }

/* ============================================================
   FLOATING 3D CUBES + WIRE "A"  (depth motif)
   ============================================================ */
.float3d { position: absolute; inset: 0; pointer-events: none; overflow: hidden; transform-style: preserve-3d; z-index: 0; }
.float3d--fore { z-index: 5; }
.float-item { position: absolute; transform-style: preserve-3d; will-change: transform; }
.cube { position: relative; transform-style: preserve-3d; animation: cubeSpin var(--spin, 22s) linear infinite; }
.cube__f { position: absolute; inset: 0; border: 1.5px solid rgba(53,198,218,0.92); background: linear-gradient(135deg, rgba(1,177,201,0.2), rgba(38,97,156,0.09)); box-shadow: inset 0 0 34px rgba(1,177,201,0.22); }
.cube__f::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 30% 25%, rgba(150,240,250,0.18), transparent 60%); }
/* holographic logo suspended inside the glass volume — rides the cube's 3D rotation */
.cube__core { position: absolute; inset: 0; pointer-events: none; }
.cube__plane {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
/* front layer — full brightness, crisp, with a soft cyan glow */
.cube__logo--front {
  filter: brightness(0) invert(1) drop-shadow(0 0 8px rgba(1,177,201,0.8)) drop-shadow(0 0 24px rgba(1,177,201,0.35));
  opacity: 0.95;
  mix-blend-mode: screen;
  width: auto; height: auto; object-fit: contain;
}
/* mid extrusion layer — slightly diffused, tinted cyan */
.cube__logo--mid {
  filter: brightness(0) invert(0.8) sepia(1) saturate(4) hue-rotate(165deg) drop-shadow(0 0 6px rgba(1,177,201,0.5));
  opacity: 0.38;
  mix-blend-mode: screen;
  width: auto; height: auto; object-fit: contain;
}
/* deep extrusion layer — most diffused, pure cyan glow core */
.cube__logo--deep {
  filter: brightness(0) invert(0.6) sepia(1) saturate(6) hue-rotate(165deg) blur(1.5px) drop-shadow(0 0 14px rgba(1,177,201,0.6));
  opacity: 0.18;
  mix-blend-mode: screen;
  width: auto; height: auto; object-fit: contain;
}
@keyframes cubeSpin { from { transform: rotateX(0) rotateY(0); } to { transform: rotateX(360deg) rotateY(360deg); } }
.wireA { position: absolute; will-change: transform; }
.wireA svg { overflow: hidden; }
@keyframes floatBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-22px); } }

/* ============================================================
   ITALIC-ACCENT KINETIC STORYTELLING
   ============================================================ */
.story-line { font-family: var(--font-display); font-weight: 300; letter-spacing: -0.02em; line-height: 1.04; color: var(--text-muted); transition: color .6s var(--ease-out); }
.story-line .em { font-style: italic; font-weight: 500; color: var(--cyan-400); }
.story-line.in { color: var(--text-primary); }

/* Typewriter story: fixed "From / to / to" + rotating cyan accent words */
.tw-story { font-family: var(--font-display); font-weight: 300; letter-spacing: -0.02em; line-height: 1.06; color: var(--text-primary); }
.tw-line { display: flex; align-items: baseline; gap: 0.32em; min-height: 1.12em; }
.tw-line + .tw-line { margin-top: 6px; }
.tw-fixed { color: var(--text-muted); font-weight: 300; }
.tw-acc { font-style: italic; font-weight: 500; color: var(--cyan-400); white-space: pre; }
.tw-cursor { display: inline-block; width: 0.055em; align-self: center; height: 0.92em; background: var(--cyan-400); border-radius: 1px; opacity: 0; transform: translateY(0.06em); }
.tw-line.active .tw-cursor { animation: tw-blink 0.9s steps(1, start) infinite; }
@keyframes tw-blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }
.kicker-italic { font-style: italic; color: var(--cyan-400); }

/* big parallax watermark "A" behind sections */
.watermark-a { position: absolute; pointer-events: none; z-index: 0; opacity: 0.05; will-change: transform; }

/* ============================================================
   BRAND "A" LOGO PATTERN — tiled mark used as a section texture
   ============================================================ */
.logo-pattern {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 448 448'%3E%3Cpath d='M64 392 L224 64 L384 392' fill='none' stroke='%2335c6da' stroke-width='26' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 112px 112px;
  background-repeat: repeat;
  opacity: 0.05;
  -webkit-mask-image: radial-gradient(120% 90% at 50% 40%, #000 12%, transparent 78%);
  mask-image: radial-gradient(120% 90% at 50% 40%, #000 12%, transparent 78%);
  will-change: transform;
}
.logo-pattern--dense { background-size: 88px 88px; opacity: 0.045; }

/* ============================================================
   CLIENT LOGO ON PROJECT CARDS — large, partially cropped, light sweep
   ============================================================ */
.card-logo-float { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; overflow: hidden; }
.card-logo-float > span { display: inline-flex; align-items: center; justify-content: center; width: 100%; height: 100%; animation: cardLogoFloat 8s var(--ease-silk) infinite; will-change: transform; }
@keyframes cardLogoFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
/* large, intentionally bleeding off the lower edge; reads as a brand graphic, not an icon */
.card-logo { height: clamp(85px, 13vw, 128px); width: auto; max-width: 80%; object-fit: contain; opacity: 0.9;
  filter: drop-shadow(0 6px 22px rgba(0,0,0,0.4)); transform: translateY(10%); transition: transform .7s var(--ease-lux), opacity .5s var(--ease-lux), filter .5s var(--ease-lux); }
.proj-card:hover .card-logo { transform: translateY(5%) scale(1.05); opacity: 1; filter: drop-shadow(0 0 26px rgba(53,198,218,0.55)); }
/* continuous, very soft light sweep across the header; intensifies on hover */
.card-sweep { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.card-sweep::after { content: ''; position: absolute; top: -25%; left: -75%; width: 50%; height: 150%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,0.16), transparent); transform: skewX(-18deg);
  animation: logoSweep 7s var(--ease-lux) infinite; }
.proj-card:hover .card-sweep::after { animation: logoSweep 1.15s var(--ease-lux); }
@keyframes logoSweep { 0% { left: -75%; opacity: 0; } 12% { opacity: 1; } 36% { left: 130%; opacity: 0; } 100% { left: 130%; opacity: 0; } }

/* slow ambient drift for hero glows (additive to JS parallax via nested element) */
@keyframes luxDrift { 0%,100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(0,-24px,0) scale(1.06); } }

@media (max-width: 880px) {
  .pf-nav-links { display: none !important; }
  .pf-nav-cta   { display: none !important; }
  /* LinkedIn in nav hidden on mobile — available in burger menu */
  .pf-nav-actions > a[href*="linkedin"] { display: none !important; }
  .pf-burger { display: flex !important; }
  .pf-hero-grid { grid-template-columns: 1fr !important; }
  .pf-hero-portrait { max-width: 360px; margin: 8px auto 0; }
  .pf-about-grid { grid-template-columns: 1fr !important; }
  .pf-split { grid-template-columns: 1fr !important; }
  .pf-form-row { grid-template-columns: 1fr !important; }
}

/* ── Mobile hero: center CTAs ── */
@media (max-width: 767px) {
  .hero-ctas {
    justify-content: center !important;
    align-items: center !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  .hero-ctas .cta {
    width: auto !important;
    min-width: 220px !important;
    justify-content: center !important;
  }
}

/* ── Mobile footer: compact 2-column layout ─────────────────────── */
@media (max-width: 768px) {
  footer { padding: 32px 18px 20px !important; }

  /* Main footer grid: 2 columns */
  footer > div > div:first-child {
    grid-template-columns: 1fr 1fr !important;
    gap: 28px 20px !important;
    padding-bottom: 24px !important;
  }

  /* Logo/intro: full width */
  footer > div > div:first-child > div:first-child {
    grid-column: 1 / -1 !important;
    max-width: 100% !important;
  }
  footer > div > div:first-child > div:first-child p {
    margin-top: 10px !important;
    font-size: 13px !important;
  }
  footer > div > div:first-child > div:first-child > div {
    margin-top: 14px !important;
  }

  /* Navigate + Expertise: each takes 1 of 2 columns */
  footer > div > div:first-child > div:nth-child(2),
  footer > div > div:first-child > div:nth-child(3) {
    min-width: 0 !important;
  }

  /* Contact: full width */
  footer > div > div:first-child > div:nth-child(4) {
    grid-column: 1 / -1 !important;
  }

  /* Footer bottom bar: stack cleanly */
  footer > div > div:last-child {
    flex-direction: column !important;
    gap: 8px !important;
    padding-top: 18px !important;
    text-align: center !important;
  }
  footer > div > div:last-child > div {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 8px !important;
  }

  /* Footer section headings: less spacing */
  footer h4, footer [style*="marginBottom: 16"] {
    margin-bottom: 10px !important;
  }
}

/* ── Approach section: clear gap before "What I Do" on mobile ──── */
@media (max-width: 767px) {
  /* Allow A-mark and caption to extend below viewport without side clipping */
  .pin-inner {
    overflow: visible !important;
    clip-path: inset(0 0 -200px 0) !important;
    padding-bottom: 0 !important;
  }
  /* Scroll-tunnel height — enough for animation to complete */
  .pin-wrap { height: 340vh !important; }
  /* Spacer so next section clears the overflowing A + caption */
  .pin-wrap + section { margin-top: 80px !important; }
  /* Tighter approach-grid on mobile: less top padding, smaller gap */
  .approach-grid {
    padding-top: 20px !important;
    gap: 10px !important;
  }
  /* Sculpt fills remaining viewport after compact text section */
  .approach-sculpt {
    height: calc(100vh - 220px) !important;
    min-height: 420px !important;
    width: 100% !important;
  }
  /* Single column: text above, journey SVG below */
  .approach-grid {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto !important;
    align-items: start !important;
    height: auto !important;
    padding-top: 80px !important;
    padding-bottom: 24px !important;
    gap: 20px !important;
    overflow: visible !important;
  }
  /* Taller sculpt so full A + caption fit — significantly larger on mobile */
  .approach-sculpt { height: 78vh !important; min-height: 460px !important; width: 100% !important; }
  /* More scroll runway so animation completes at readable size */
  .pin-wrap { height: 340vh !important; }

  /* ── StoryTypewriter: prevent overflow / clip on mobile ────────────────
     white-space:pre on .tw-acc blocks wrapping; remove it on mobile.
     Scale font down so lines fit within one column width. */
  .tw-story {
    font-size: clamp(1.5rem, 1rem + 5vw, 2.4rem) !important;
    overflow: visible !important;
  }
  .tw-line {
    flex-wrap: wrap;
    min-height: unset;
    gap: 0.22em;
  }
  .tw-acc {
    white-space: normal !important;
    overflow-wrap: break-word;
  }
}
@media (max-width: 600px) {
  /* Narrower header padding */
  header nav { padding: 0 14px !important; }

  /* Logo: 15% smaller */
  header nav > a img { height: 20px !important; }

  /* Nav actions: tighten gap */
  .pf-nav-actions { gap: 8px !important; }

  /* LinkedIn button: reduce horizontal padding */
  .pf-nav-actions > a[href*="linkedin"] {
    padding: 7px 10px !important;
    font-size: 13px !important;
    gap: 5px !important;
  }

  /* Lang switcher pill group: slightly smaller */
  .lang-bar-inline { gap: 2px !important; padding: 3px !important; }
  .lang-btn { padding: 4px 7px !important; font-size: 11px !important; }

  /* Burger: keep compact */
  .pf-burger { width: 38px !important; height: 38px !important; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal, [data-anim] { opacity: 1 !important; transform: none !important; filter: none !important; clip-path: none !important; transition: none !important; }
  .lux-word > span { opacity: 1 !important; transform: none !important; }
  .lux-line-in { opacity: 1 !important; transform: none !important; }
  .lux-accent { animation: none; }
  .cursor-glow, .cursor-label { display: none; }
  .marquee-track { animation: none; }
  .card-logo-float > span { animation: none; }
  .card-sweep::after { display: none; }
  .mark-a-trace { animation: none; opacity: 0; }
  .cube { animation: none; }
  .float3d { display: none; }
  .story-line { color: var(--text-primary); }
  .preloader { display: none; }
}
@media (hover: none) { .cursor-label { display: none; } }

/* ── Mobile: hard-lock horizontal overflow ───────────────────────────────
   translateX entrance animations (from-left / from-right / flip-left /
   flip-right) can momentarily widen the page before they fire.  Clipping
   sections prevents them reaching the viewport edge.
   touch-action: pan-y stops iOS rubber-band horizontal drag. */
@media (max-width: 767px) {
  html, body {
    touch-action: pan-y;
    overscroll-behavior-x: none;
  }
  section:not(.pin-inner), footer, header, main, nav {
    overflow-x: clip;
    max-width: 100vw;
  }
  /* pin-wrap must never be clipped — kills sticky */
  .pin-wrap { max-width: none !important; } /* pin-wrap must never be width-capped */
  /* Entrance animations: strip horizontal translate on mobile so they
     never push layout outside the viewport */
  [data-anim="from-left"]  { transform: translateY(16px); }
  [data-anim="from-right"] { transform: translateY(16px); }
  [data-anim="flip-left"]  { transform: perspective(1400px) rotateX(8deg) translateY(16px); }
  [data-anim="flip-right"] { transform: perspective(1400px) rotateX(8deg) translateY(16px); }
  /* Float decorations: clip to parent bounds */
  .float3d { overflow: hidden !important; }
}
