/* =========================================================
   Interactions layer — intro, smooth scroll, menu reel, text & image
   reveals, services spotlight, footer, talk badge.
   Uses the tokens from styles.css (--ink, --gold, --gold-2, --grey …).
   ========================================================= */

/* ---------- Lenis smooth scroll (recommended base) ---------- */
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; }

/* ---------- Intro ---------- */
.intro {
  position: fixed; inset: 0; z-index: 200; background: var(--ink); color: #FFFFFF;
  display: none; flex-direction: column; justify-content: space-between;
  padding: max(22px, env(safe-area-inset-top, 0px)) var(--gutter) 0;
  clip-path: inset(0 0 0 0); transition: clip-path 1s cubic-bezier(.76, 0, .24, 1);
}
.intro-on .intro { display: flex; }
.intro.is-leaving { clip-path: inset(0 0 100% 0); }
.intro-top { display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.6); }
.intro-top b { color: var(--gold-2); font-weight: 600; }
.intro-line {
  font-family: var(--serif); font-size: clamp(26px, 3vw, 40px); line-height: 1.1; color: rgba(255,255,255,.88);
  opacity: 0; transform: translateY(14px); transition: opacity .8s .2s, transform .8s .2s var(--ease);
}
.intro.is-playing .intro-line { opacity: 1; transform: none; }
.intro-name { overflow: hidden; line-height: .8; margin: 0 calc(var(--gutter) * -0.2); }
.intro-name span {
  display: block; font-weight: 800; font-stretch: 78%; text-transform: uppercase; letter-spacing: -.01em;
  font-size: clamp(110px, 31vw, 460px); color: #FFFFFF; transform: translateY(105%);
  transition: transform 1.1s cubic-bezier(.2, .8, .1, 1);
}
.intro.is-playing .intro-name span { transform: translateY(6%); }
.intro-bar { height: 2px; background: rgba(255,255,255,.12); margin: 0 calc(var(--gutter) * -1); }
.intro-bar i { display: block; height: 100%; width: 0; background: var(--gold); transition: width 1.5s cubic-bezier(.6, 0, .2, 1); }
.intro.is-playing .intro-bar i { width: 100%; }
/* hold the hero headline until the intro lifts */
.intro-on .hero-title .line > span { animation-play-state: paused; }

/* ---------- Header: framed menu button once scrolled ---------- */
.menu-btn { border: 1px solid transparent; border-radius: 10px; padding: 8px 12px; margin-left: -12px; transition: border-color .4s, background .4s; }
.header.is-scrolled .menu-btn { border-color: rgba(255,255,255,.35); }
.menu-btn:focus-visible, .reel-card:focus-visible, .talk-badge:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ---------- Menu: the reel ---------- */
.menu {
  background: var(--grey); color: var(--ink); justify-content: flex-start; gap: 0;
  padding: calc(92px + env(safe-area-inset-top, 0px)) 0 max(24px, env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; visibility: hidden;
  transition: clip-path .8s cubic-bezier(.76, 0, .24, 1), visibility 0s .8s;
}
.menu-open .menu { visibility: visible; transition: clip-path .8s cubic-bezier(.76, 0, .24, 1), visibility 0s; }
.menu-open .header, .menu-open .header .logo { color: var(--ink); }
.menu-open .header.is-scrolled { background: transparent; border-bottom-color: transparent; backdrop-filter: none; }
.menu-open .header .menu-btn { border-color: transparent; }
.menu-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline; gap: 16px; padding: 0 var(--gutter) 22px; }
.menu-kicker, .menu-count { font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: rgba(26,36,33,.6); }
.menu-count { justify-self: end; font-variant-numeric: tabular-nums; }
.menu-hint { font-family: var(--serif); font-size: clamp(17px, 1.6vw, 22px); color: var(--ink); opacity: .8; }

.reel {
  display: flex; gap: 18px; overflow-x: auto; overflow-y: hidden; flex: 1; min-height: 0;
  padding: 4px var(--gutter) 12px; scroll-snap-type: x proximity; scrollbar-width: none; cursor: none;
  -webkit-overflow-scrolling: touch;
}
.reel::-webkit-scrollbar { display: none; }
.reel.is-dragging { scroll-snap-type: none; }
.reel.is-dragging .reel-card { pointer-events: none; }
.reel-card {
  flex: 0 0 auto; width: clamp(240px, 24vw, 340px); display: flex; flex-direction: column; gap: 12px;
  scroll-snap-align: start; color: var(--ink);
  opacity: 0; transform: translateX(60px);
  transition: opacity .7s var(--ease), transform .9s var(--ease);
}
.menu-open .reel-card { opacity: 1; transform: none; }
.menu-open .reel-card:nth-child(2) { transition-delay: .05s; }
.menu-open .reel-card:nth-child(3) { transition-delay: .1s; }
.menu-open .reel-card:nth-child(4) { transition-delay: .15s; }
.menu-open .reel-card:nth-child(5) { transition-delay: .2s; }
.menu-open .reel-card:nth-child(6) { transition-delay: .25s; }
.menu-open .reel-card:nth-child(7) { transition-delay: .3s; }
.menu-open .reel-card:nth-child(8) { transition-delay: .35s; }
.reel-img { position: relative; overflow: hidden; border-radius: 6px; aspect-ratio: 4 / 4.6; max-height: min(52vh, 440px); background: #d9d9d9; max-width: 100%; }
.reel-img.dark-img { background: var(--ink); }
.reel-img img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); transition: transform 1.2s var(--ease), filter .6s; filter: grayscale(.25); }
.reel-img.dark-img img { object-fit: contain; object-position: center bottom; filter: grayscale(1); }
.reel-card:hover .reel-img img { transform: scale(1); filter: none; }
.reel-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.reel-meta h3 { font-weight: 800; font-stretch: 78%; text-transform: uppercase; font-size: clamp(32px, 3.4vw, 54px); line-height: .9; transition: color .3s; }
.reel-meta span { font-size: 11px; font-weight: 600; letter-spacing: .12em; color: var(--gold); }
.reel-card p { font-family: var(--serif); font-size: 18px; line-height: 1.25; color: rgba(26,36,33,.72); }
.reel-card:hover h3 { color: var(--gold); }
.menu .menu-foot { padding: 18px var(--gutter) 0; margin-top: 0; border-top: 1px solid rgba(26,36,33,.12); margin-inline: var(--gutter); padding-inline: 0; color: rgba(26,36,33,.7); }
.menu .menu-foot a:hover { color: var(--gold); }
.menu .menu-foot b { color: var(--gold); }

.drag-cursor {
  position: fixed; left: 0; top: 0; z-index: 5; pointer-events: none;
  width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%;
  display: grid; place-items: center; background: var(--gold); color: #FFFFFF;
  font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  transform: scale(0); transition: transform .3s var(--ease);
}
.drag-cursor.is-on { transform: scale(1); }
.drag-cursor.is-down { transform: scale(.82); }
@media (hover: none) { .drag-cursor { display: none; } .reel { cursor: auto; } }
@media (max-width: 640px) {
  .menu-top { grid-template-columns: 1fr auto; }
  .menu-hint { display: none; }
  .reel-card { width: 72vw; }
  .reel-img { aspect-ratio: 4 / 4.2; max-height: 44vh; }
}

/* ---------- Headings: words slide up from a mask ---------- */
.split .w { display: inline-block; overflow: hidden; vertical-align: top; padding: .04em .06em .14em; margin: -.04em -.06em -.14em; }
.split .wi { display: inline-block; transform: translateY(115%); transition: transform 1s cubic-bezier(.2, .8, .1, 1); }
.split.is-in .wi { transform: none; }

/* ---------- Images: zoom out as they come into view ---------- */
.zoomable img { transform: scale(1.22); transition: transform 1.8s cubic-bezier(.2, .8, .1, 1); }
.zoomable.is-in img { transform: scale(1); }
.xcard:hover .zoomable.is-in img { transform: scale(1.05); transition-duration: 1s; }

/* ---------- Buttons: fill sweeps in on hover ---------- */
.btn { position: relative; overflow: hidden; isolation: isolate; }
.btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: currentColor; opacity: .1; transform: translateY(101%); transition: transform .5s var(--ease);
}
.btn:hover::after { transform: none; }

/* ---------- Services: one row on desktop with a spotlight ---------- */
@media (min-width: 1100px) {
  .services .stack { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: 18px; }
  .services .scard, .services .scard:nth-child(2), .services .scard:nth-child(3) { position: relative; top: auto; margin-left: 0; max-width: none; box-shadow: none; transition: opacity .45s, transform .45s var(--ease), border-color .45s; }
  .services .scard .btn-wide { margin-top: auto; }
  .services .stack:hover .scard { opacity: .42; }
  .services .stack:hover .scard:hover { opacity: 1; transform: translateY(-6px); border-color: var(--gold-2); }
}

/* ---------- Marquee: pause on hover ---------- */
.marquee:hover .marquee-track { animation-play-state: paused; }

/* ---------- Footer ---------- */
.footer { padding: clamp(64px, 9vw, 110px) 0 0; overflow: hidden; }
.footer-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.footer-kicker { font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.5); margin-bottom: 16px; }
.footer-links { display: grid; gap: 8px; font-size: 15px; color: rgba(255,255,255,.88); }
.footer-links a { position: relative; transition: color .3s; }
.footer-links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .4s var(--ease); }
.footer-links a:hover { color: #FFFFFF; }
.footer-links a:hover::after { transform: scaleX(1); transform-origin: left; }
.footer-links b { color: var(--gold-2); font-weight: 600; }
.footer-giant { overflow: hidden; margin-top: clamp(40px, 6vw, 80px); line-height: .78; text-align: center; }
.footer-giant span {
  display: block; font-weight: 800; font-stretch: 78%; letter-spacing: -.01em; color: #FFFFFF;
  font-size: clamp(110px, 33vw, 520px); transform: translateY(var(--giant-y, 18%));
}
.footer .footer-row { padding-block: 20px; border-top: 1px solid rgba(255,255,255,.12); margin-top: 0; }
@media (max-width: 820px) { .footer-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 520px) { .footer-cols { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Talk badge (rotating ring + portrait) ---------- */
.talk-badge {
  position: fixed; z-index: 70; width: 104px; height: 104px; border-radius: 50%;
  right: calc(18px + env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  display: grid; place-items: center; background: var(--ink); color: #FFFFFF;
  box-shadow: 0 14px 34px -14px rgba(26,36,33,.6);
  transition: transform .5s var(--ease), opacity .4s, visibility .4s;
}
.talk-badge svg { position: absolute; inset: 0; width: 100%; height: 100%; animation: badgeSpin 14s linear infinite; }
.talk-badge text { font-family: var(--sans); font-size: 10.5px; font-weight: 700; letter-spacing: 2.6px; fill: #FFFFFF; }
.talk-face {
  width: 54px; height: 54px; border-radius: 50%; border: 2px solid var(--gold);
  background: #FFFFFF url("assets/media/portrait/headshot.jpg") 50% 14% / 190% auto no-repeat; filter: grayscale(1);
}
.talk-badge:hover { transform: scale(1.06); }
.talk-badge:hover svg { animation-duration: 5s; }
.talk-badge.is-hidden, .menu-open .talk-badge, .intro-on .talk-badge { opacity: 0; visibility: hidden; transform: scale(.6); }
@keyframes badgeSpin { to { transform: rotate(360deg); } }
@media (max-width: 640px) { .talk-badge { width: 84px; height: 84px; } .talk-face { width: 44px; height: 44px; } .talk-badge text { font-size: 11px; } }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .split .wi, .zoomable img { transform: none !important; }
  .talk-badge svg { animation: none; }
  .intro { display: none !important; }
}

/* keep the side gutter when cards snap */
.reel { scroll-padding-inline: var(--gutter); }
@media (min-width: 1100px) {
  .services .scard .display-sm { font-size: clamp(30px, 2.7vw, 46px); overflow-wrap: anywhere; }
  .services .scard-top { gap: 12px; }
  .services .scard-top em { font-size: 20px; text-align: right; }
  .services .scard { min-width: 0; }
}

/* ---------- LinkedIn icon in the header ---------- */
.header-right { justify-self: end; display: flex; align-items: center; gap: 10px; }
.header-li {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid currentColor; color: inherit; transition: background .3s, color .3s, border-color .3s, transform .3s var(--ease);
}
.header-li svg { width: 17px; height: 17px; fill: currentColor; }
.header-li:hover { background: var(--gold); border-color: var(--gold); color: #FFFFFF; transform: translateY(-2px); }
.header-li:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
@media (max-width: 640px) {
  .header { grid-template-columns: auto 1fr auto; }
  .header .logo { justify-self: center; }
  .header-right { gap: 8px; }
  .header-li { width: 38px; height: 38px; }
}