/* ==========================================================================
   custom.css — your own styles live here.
   tailwind.css is the compiled output from the original build; leave it alone
   and put any new rules or overrides in this file instead.
   ========================================================================== */

html { scroll-behavior: smooth; }

/* Scroll-in animation (replaces the old framer-motion fade/slide) */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  transition-delay: var(--reveal-delay, 0s);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* Nav: becomes a frosted bar once you scroll (toggled by js/main.js) */
.nav-scrolled {
  background: oklch(0.13 0.008 264) !important;
  border-bottom: 0;
  box-shadow: none;
}
.site-nav__menu { border-bottom: 0 !important; background: oklch(0.13 0.008 264) !important; backdrop-filter: none !important; }

/* Mobile menu */
.js-mobile-menu[hidden], .js-icon-close[hidden], .js-icon-open[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}


/* ==========================================================================
   RESPONSIVE SYSTEM
   --------------------------------------------------------------------------
   Three tiers:  phone  < 640px   |   tablet  640–1023px   |   desktop  ≥ 1024px
   Rule of thumb: two-column layouts only happen on desktop. Everything below
   that stacks into one comfortable column, so headings and text never get
   squeezed into a narrow strip. Class names (.hero__layout, .bio-grid, ...)
   are hooks added to the HTML so these rules stay readable.
   ========================================================================== */

/* ---- 1. Fluid headings: scale smoothly with the screen instead of in steps ---- */
#hero h1 { font-size: clamp(1.75rem, 1.15rem + 2.3vw, 2.6rem); line-height: 1.18; }
#about h2, #work h2, #expertise h2, #publications h2, #contact h2 {
  font-size: clamp(1.625rem, 1.1rem + 1.9vw, 2.4rem); line-height: 1.2;
}
.work-card__title { font-size: clamp(1.375rem, 1rem + 1.5vw, 2rem); line-height: 1.25; }
.case-page h1 { font-size: clamp(1.75rem, 1.1rem + 3.2vw, 3.75rem); line-height: 1.12; }
.case-page h2 { font-size: clamp(1.5rem, 1.1rem + 1.5vw, 1.875rem); line-height: 1.2; }

/* Never let a long word or URL push the page wider than the screen */
#root p, #root li, #root h1, #root h2, #root h3, #root h4, #root a, #root span {
  overflow-wrap: break-word;
}

/* ---- 2. Navigation: hamburger below 1024px so the logo and links can't collide ---- */
.site-nav__menu[hidden] { display: none; }
@media (max-width: 1023.98px) {
  .site-nav__links { display: none; }
  .site-nav__toggle {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 0.5rem; min-width: 44px; min-height: 44px; margin-right: -0.75rem; padding: 0 0.75rem;   /* comfortable tap target */
  }
  .site-nav__toggle-label { font-family: var(--font-body, inherit); font-size: 0.9375rem; font-weight: 500; letter-spacing: 0.02em; }
  .site-nav__menu { display: block; max-height: calc(100vh - 4rem); overflow-y: auto; }
  .site-nav__menu .nav-link { display: block; font-size: 1rem; padding: 0.75rem 0; }
}

/* ---- 3. Hero ---- */
@media (max-width: 1023.98px) {
  .hero__layout { flex-direction: column; gap: 2.5rem; }
  .hero__scroll { display: none; }              /* was overlapping the headshot */
}

/* ---- 4. Stats row: centered, wraps cleanly, no orphaned tile ---- */
.stats-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem 1rem; }
.stats-grid > * { flex: 0 0 calc(50% - 0.5rem); }
@media (min-width: 640px)  { .stats-grid > * { flex-basis: calc(33.333% - 0.75rem); } }
@media (min-width: 1024px) { .stats-grid > * { flex: 1 1 0; } }

/* ---- 5. Two-column sections become single column below 1024px ---- */
@media (max-width: 1023.98px) {
  .bio-grid   { grid-template-columns: minmax(0, 1fr); gap: 3rem; }
  .quote-grid { grid-template-columns: minmax(0, 1fr); }
  .pubs-grid  { grid-template-columns: minmax(0, 1fr); gap: 3rem; }
  .pubs-grid > * { grid-column: 1 / -1; }
  .work-card__body { grid-template-columns: minmax(0, 1fr); }
  .work-card__body > * { grid-column: 1 / -1; }
  .work-card__body img { max-width: 36rem; margin-inline: auto; }
}
@media (max-width: 1279.98px) {
  .expertise-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 639.98px) {
  .expertise-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---- 6. Featured-work card header: company · years never splits mid-range ---- */
.work-card__meta { flex-wrap: wrap; column-gap: 0.75rem; row-gap: 0.125rem; }
.work-card__meta > span:last-child { white-space: nowrap; }
@media (max-width: 639.98px) {
  .work-card__meta > span:nth-child(2) { display: none; }    /* the "·" separator */
}
.text-\[10px\] { font-size: 11px; }

/* ---- Case-page stat tiles with longer labels (AI page): scale the heading so words never split ---- */
.case-tile__head { font-size: clamp(1.125rem, 0.6rem + 2.4vw, 1.5rem); overflow-wrap: normal; word-break: normal; }

/* iOS Chrome/WebKit: avoid compositing artifacts from stacked blur filters near the fixed nav */
/* Glow on "noisy data": the original 120px/60px shadow layers render as stray magenta lines on iPhone Chrome, so keep it tighter. */
.purple-glow { filter: none !important; text-shadow: 0 0 8px oklch(60% .22 295 / .8), 0 0 22px oklch(60% .22 295 / .55) !important; }
.site-nav, .site-nav__menu { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
