/* ============================================================
   Arjun Patel — Design Portfolio
   Minimal · editorial · characterful
   ============================================================ */

/* -----  Tiempos Text (self-hosted display serif for headings)  ----- */
@font-face {
  font-family: "Tiempos Text";
  src: url("../assets/editorial/tiempos-regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
/* Only Regular (400) is available — map 500/600/700 to it so any heading weight renders */
@font-face {
  font-family: "Tiempos Text";
  src: url("../assets/editorial/tiempos-regular.woff2") format("woff2");
  font-weight: 500 700; font-style: normal; font-display: swap;
}

/* -----  Theme tokens  ----- */
:root {
  --bg:        #fdfdfc;
  --fg:        #0a0a0a;
  --muted:     #6b6b68;
  --faint:     #9a9a96;
  --line:      rgba(10, 10, 10, 0.10);
  --surface:   #f4f3f0;
  --accent:    #0a0a0a;

  --font-sans: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Tiempos Text", Georgia, "Times New Roman", serif;

  --container: 1600px;
  --gutter: clamp(2rem, 7vw, 6.5rem);
  --radius: 18px;
  /* Shared top offset so the page header (h1) lands at the same height on every tab */
  --page-top: clamp(10rem, 22vw, 18rem);
  /* Reserved height for the header zone (h1 + subtext) so the first card row /
     content starts at the SAME position on every tab, regardless of header length */
  --header-min: clamp(19rem, 25vw, 23rem);
  /* Gap between the header zone and the first card row / content */
  --header-gap: clamp(3.5rem, 7vw, 6rem);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  --bg:      #0a0a0b;
  --fg:      #f3f2ef;
  --muted:   #9b9b97;
  --faint:   #6a6a66;
  --line:    rgba(255, 255, 255, 0.13);
  --surface: #17171a;
  --accent:  #f3f2ef;
}

/* -----  Reset & base  ----- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

/* Permanent horizontal-overflow safety net.
   The recurring "content drags left/right" bug is always the same root cause:
   a flex or grid child refuses to shrink below its content width (min-width
   defaults to `auto`) and pushes the page wider than the screen. Allowing every
   element to shrink stops that at the source. Zero-specificity `:where()` means
   any component that needs an explicit min-width still wins. */
:where(body *) { min-width: 0; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  overflow-x: hidden;   /* fallback for browsers without clip support */
  overflow-x: clip;     /* modern: clips without breaking sticky nav */
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.55;
  font-size: 1rem;
  letter-spacing: -0.01em;
  font-kerning: normal;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
  overflow-x: hidden;   /* fallback for browsers without clip support */
  overflow-x: clip;     /* modern: clips without coercing overflow-y */
  width: 100%;
  max-width: 100%;
}

/* media never forces the page wider than the viewport */
img, video, svg { max-width: 100%; }

a { color: inherit; text-decoration: none; }
em { font-style: normal; }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

::selection { background: var(--fg); color: var(--bg); }

.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  transform: translateY(-120%);
  background: var(--fg);
  color: var(--bg);
  padding: 0.6rem 1rem;
  border-radius: 0 0 10px 0;
  z-index: 100;
  transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* -----  Custom circle cursor (fine pointers only)  ----- */
.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(10, 10, 10, 0.85);   /* dark dot for light mode */
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  will-change: transform;
  transition: width 0.25s var(--ease), height 0.25s var(--ease),
              background 0.25s var(--ease), opacity 0.3s var(--ease);
}
.cursor-dot.is-hover {
  width: 30px;
  height: 30px;
  background: rgba(10, 10, 10, 0.28);
}
/* light dot in dark mode */
[data-theme="dark"] .cursor-dot { background: rgba(255, 255, 255, 0.85); }
[data-theme="dark"] .cursor-dot.is-hover { background: rgba(255, 255, 255, 0.30); }
/* hide the native cursor only when the custom one is active */
@media (hover: hover) and (pointer: fine) {
  body.has-cursor,
  body.has-cursor * { cursor: none; }
}
@media (hover: none), (pointer: coarse) {
  .cursor-dot { display: none; }
}

/* Shared layout width */
.hero,
.section,
.nav,
.footer {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  max-width: 100%;
  padding-block: 1.1rem;
  padding-inline: 0;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease);
}
.nav.is-stuck { border-bottom-color: var(--line); }

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  min-height: 2.4rem;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
  position: relative;
}

/* -----  Light / dark theme toggle  ----- */
.theme-toggle {
  position: absolute;
  left: var(--gutter);
  top: 50%;
  transform: translateY(-50%);
  display: inline-grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.25s var(--ease), background 0.25s var(--ease),
              border-color 0.25s var(--ease);
}
.theme-toggle:hover { color: var(--fg); background: var(--surface); border-color: var(--fg); }
.theme-toggle svg { grid-area: 1 / 1; }
/* show moon in light mode (offer dark), sun in dark mode (offer light) */
.theme-toggle__sun { display: none; }
.theme-toggle__moon { display: block; }
[data-theme="dark"] .theme-toggle__sun { display: block; }
[data-theme="dark"] .theme-toggle__moon { display: none; }

/* -----  ArjunLM nav button (right)  ----- */
.nav__arjunlm {
  position: fixed;
  right: max(var(--gutter), calc((100vw - var(--container)) / 2 + var(--gutter)));
  top: 1.35rem;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.nav__arjunlm:hover { background: var(--surface); border-color: var(--fg); }
/* the sparkle (ArjunLM.svg glyph) replaces the old green status dot on all layouts */
.nav__arjunlm-spark { display: block; flex: none; width: 16px; height: 16px; }
/* the FAB.svg (full circle) is only used as the floating button on mobile */
.nav__arjunlm-fab { display: none; }

/* ============================================================
   ArjunLM — chat panel (pushes the page, not an overlay)
   ============================================================ */
:root { --alm-width: 30vw; }

/* the page shrinks to make room for the panel (desktop only) */
body { transition: padding-right 0.45s var(--ease); }
body.alm-open { padding-right: clamp(340px, 30vw, 420px); }

/* full-viewport clipper: keeps the off-screen (closed) panel from ever
   extending the page width, which caused horizontal drag / pinch-zoom-out
   on mobile (iOS doesn't clip fixed elements via overflow on html/body) */
.alm-clip {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 95;
}
.alm-clip .alm-panel { pointer-events: auto; }

.alm-panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100dvh;
  width: clamp(340px, var(--alm-width), 420px);
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  background: var(--bg);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s var(--ease), visibility 0.4s;
  visibility: hidden;
  z-index: 95;
}
.alm-open .alm-panel { transform: translateX(0); visibility: visible; }

.alm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  min-height: 2.4rem;
  padding: 1.1rem clamp(1rem, 2vw, 1.4rem);
  border-bottom: 1px solid var(--line);
}
.alm-head-actions { display: inline-flex; gap: 0.35rem; }
.alm-reset,
.alm-close {
  border: none;
  background: transparent;
  color: var(--faint);
  display: inline-grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.alm-reset:hover,
.alm-close:hover { color: var(--fg); background: var(--surface); }
.alm-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.95rem;
}
.alm-dot {
  display: inline-flex;
  align-items: center;
  color: var(--fg);
}
.alm-dot svg { display: block; }

.alm-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.2rem clamp(1rem, 2vw, 1.4rem);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  scrollbar-width: thin;
}
.alm-msg { display: flex; width: 100%; }
.alm-msg--user { justify-content: flex-end; }
.alm-bubble {
  max-width: 85%;
  padding: 0.7rem 0.95rem;
  border-radius: 16px;
  font-size: 0.92rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.alm-msg--bot .alm-bubble {
  background: var(--surface);
  color: var(--fg);
  border-bottom-left-radius: 5px;
}
.alm-msg--user .alm-bubble {
  background: var(--fg);
  color: var(--bg);
  border-bottom-right-radius: 5px;
}
.alm-bubble p { margin: 0; }
.alm-bubble p + p, .alm-bubble ul { margin-top: 0.5rem; }
.alm-bubble ul { padding-left: 1.1rem; margin-bottom: 0; }
.alm-bubble li { margin: 0.2rem 0; }
.alm-bubble strong { font-weight: 600; }
.alm-msg--bot .alm-bubble a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* typing dots */
.alm-typing .alm-bubble {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.alm-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--faint);
  animation: almBlink 1.2s infinite ease-in-out both;
}
.alm-typing span:nth-child(2) { animation-delay: 0.15s; }
.alm-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes almBlink {
  0%, 80%, 100% { opacity: 0.25; }
  40% { opacity: 1; }
}

/* welcome state (heading + suggestions), hidden once chat starts */
.alm-welcome {
  padding: 0 clamp(1rem, 2vw, 1.4rem) 0.4rem;
}
.alm-started .alm-welcome { display: none; }
.alm-welcome-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--fg);
  margin: 0 0 0.9rem;
}
.alm-suggest {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.alm-chip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  transition: color 0.2s var(--ease);
}
.alm-chip:hover { color: var(--fg); }
.alm-chip-arrow { color: var(--faint); font-size: 0.95rem; display: inline-flex; align-items: center; }
.alm-chip-arrow svg { display: block; }

.alm-form {
  display: flex;
  gap: 0.5rem;
  flex: none;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  padding: 0.8rem clamp(1rem, 2vw, 1.4rem) 1.1rem;
}
.alm-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.7rem 0.9rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  background: var(--surface);
  color: var(--fg);
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s var(--ease);
}
.alm-input:focus { border-color: var(--line); }
.alm-send {
  flex: none;
  width: 2.6rem;
  height: 2.6rem;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: none;
  background: var(--fg);
  color: var(--bg);
  cursor: pointer;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
.alm-send:hover { transform: scale(1.05); }

@media (max-width: 760px) {
  /* on small screens the panel slides in from the right and covers the full
     screen, header included, so only dismiss closes it */
  .alm-panel {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    top: 0;
    bottom: 0;
    border-left: none;
    border-top: none;
    border-radius: 0;
    transform: translateX(100%);
    z-index: 120;
  }
  .alm-open .alm-panel { transform: translateX(0); visibility: visible; }
  /* full-screen sheet: no page push, lock the background scroll */
  body.alm-open { padding-right: 0; overflow: hidden; }
  /* the log scrolls; head + form stay fixed so typing never hides the header */
  .alm-log { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  /* keep the ArjunLM header clear of the status bar / notch on full-screen sheet */
  .alm-head { padding-top: calc(1rem + env(safe-area-inset-top)); }
  .alm-form { padding-bottom: calc(1.1rem + env(safe-area-inset-bottom)); }
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 500;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
}
.nav__mark {
  display: inline-grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  font-size: 1rem;
  transition: transform 0.6s var(--ease);
}
.nav__brand:hover .nav__mark { transform: rotate(90deg); }

.nav__links {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: center;
}
.nav__links a {
  position: relative;
  padding: 0.4rem 0.85rem;
  color: var(--muted);
  font-size: 0.95rem;
  border-radius: 999px;
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}
.nav__links a:hover { color: var(--fg); background: var(--surface); }
.nav__links a[aria-current="page"] { color: var(--fg); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding-top: var(--page-top);
  padding-bottom: var(--header-gap);
}
.hero__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;   /* headline left, timeline right — no empty side padding */
  align-items: flex-start;   /* top-align header + timeline (matching top margins) */
  gap: clamp(1.5rem, 3vw, 3rem);
  min-height: var(--header-min);   /* reserve header zone so cards start at a consistent Y */
}
.hero__grid .timeline { margin-right: 0; }

.hero__headline {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-kerning: normal;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  font-size: clamp(2rem, 4.6vw, 3.6rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  font-weight: 500;
  max-width: 20ch;
  text-wrap: balance;
}

.hero__bio {
  font-family: var(--font-sans);
  margin-top: clamp(0.9rem, 2vw, 1.3rem);
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: -0.01em;
  color: var(--muted);
  max-width: 52ch;
  text-wrap: pretty;
}
.hero__bio strong { color: var(--fg); font-weight: 400; }

/* -----  Buttons  ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.5rem;
  font-size: 0.98rem;
  font-weight: 500;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease),
              color 0.25s var(--ease), border-color 0.25s var(--ease), opacity 0.25s var(--ease);
}
.btn--primary { background: var(--fg); color: var(--bg); }
.btn--primary:hover { transform: translateY(-2px); opacity: 0.88; }
.btn--ghost { border-color: var(--line); color: var(--fg); }
.btn--ghost:hover { background: var(--surface); transform: translateY(-2px); }

/* ============================================================
   SECTIONS (shared)
   ============================================================ */
.section { padding-block: clamp(4rem, 10vw, 8rem); }

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: clamp(2rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(2.5rem, 6vw, 4rem);
}
.section__title {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 500;
  letter-spacing: -0.015em;
}
.section__meta {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   WORK GRID
   ============================================================ */
/* First grid section sits directly below the hero — the hero's
   padding-bottom (--header-gap) supplies the whole gap, so this
   section's own top padding is removed to avoid double spacing. */
.section.work { padding-top: 0; }

.work__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(2rem, 5vw, 4rem) clamp(1.5rem, 4vw, 3rem);
}

.card { display: block; }

.card__thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 4px;
  overflow: hidden;
  background: var(--surface);
  transition: transform 0.55s var(--ease);
}
/* Distinct, muted gradient artwork per project */
.card__thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  transform: scale(1.02);
  transition: transform 0.7s var(--ease);
  background-blend-mode: overlay;
}
/* subtle dot-grid overlay to feel like a design canvas */
.card__thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.35) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.5;
  mix-blend-mode: soft-light;
}

.card[data-thumb="a"] .card__thumb::before { background: linear-gradient(135deg, #ffd9a8 0%, #f7a072 45%, #e26d5c 100%); }
.card[data-thumb="b"] .card__thumb::before { background: linear-gradient(135deg, #cdd7ff 0%, #a5b4fc 50%, #7c83ff 100%); }
.card[data-thumb="c"] .card__thumb::before { background: linear-gradient(135deg, #c9f2df 0%, #86e3b6 50%, #38b58f 100%); }
.card[data-thumb="d"] .card__thumb::before { background: linear-gradient(135deg, #d7d8dc 0%, #a9abb2 50%, #6d6f78 100%); }
.card[data-thumb="e"] .card__thumb::before { background: linear-gradient(135deg, #ffd6e8 0%, #f7a8c4 50%, #e8749b 100%); }
.card[data-thumb="f"] .card__thumb::before { background: linear-gradient(135deg, #bfe8ff 0%, #7fc8f0 50%, #3f9fd6 100%); }

.card:hover .card__thumb::before { transform: scale(1.08) rotate(1.5deg); }

/* video cards (Fun page): the thumb holds an inline <video> instead of a
   gradient. Hide the gradient/dot-grid layers and let the video fill the frame. */
.card--video { display: block; margin: 0; }
.card__thumb--video { background: #0c0c0d; }
.card__thumb--video::before,
.card__thumb--video::after { content: none; }
.card__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #0c0c0d;
  cursor: pointer;
}
.card__thumb--work-video {
  background: #ffffff;
}
.card__thumb--work-video::before,
.card__thumb--work-video::after {
  content: none;
}
.card__video--work {
  pointer-events: none;
}
.card__video--voice { transform: scale(1.17); }
.card__video--library {
  object-position: center;
  transform: scale(1.08);
}
/* static image inside a video-style thumb (non-video Fun cards) */
.card__thumb--video .card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* real photo thumbnail on a work card — fills the frame and replaces the
   gradient + dot-grid artwork */
.card__thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.02);
  transition: transform 0.7s var(--ease);
}
.card__thumb:has(img)::before,
.card__thumb:has(img)::after { content: none; }
.card:hover .card__thumb img { transform: scale(1.06); }
/* hold the thumbnail perfectly still while hovering the play / listen control */
.card:hover:has(.card__time:hover) .card__thumb img {
  transform: scale(1.06);
  transition: none;
}
.card:hover:has(.card__time:hover) .card__thumb::before {
  transition: none;
}
/* "contain" thumbnail: a full mockup/screenshot filling the frame edge to edge,
   centred, no white padding (e.g. the Create / Library device mockups) */
.card__thumb--contain { background: #ffffff; }
.card__thumb--contain::before,
.card__thumb--contain::after { content: none !important; }
.card__thumb--contain img {
  object-fit: cover;
  object-position: center;
  transform: none;
  padding: 0;
}
.card:hover .card__thumb--contain img,
.card:hover:has(.card__time:hover) .card__thumb--contain img { transform: none; }
/* video/image cards stay put; the media zooms slightly inside the frame */
.card--video .card__video,
.card--video .card__img { transition: transform 0.55s var(--ease); }
.card--video:hover .card__video,
.card--video:hover .card__img { transform: scale(1.05); }

/* non-clickable tag chips under a card */
.card__tags {
  grid-column: 1;
  list-style: none;
  padding: 0;
  margin: 1.1rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.card__tag {
  padding: 0.45rem 0.9rem;
  background: var(--surface);
  border-radius: 999px;
  font-size: 0.8rem;
  line-height: 1.2;
  color: var(--muted);
  white-space: nowrap;
}


.card__body {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  column-gap: 1rem;
  margin-top: 1.15rem;
}
.card__title {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-kerning: normal;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  line-height: 1.22;
  font-weight: 500;
  letter-spacing: -0.005em;
  text-wrap: pretty;
  grid-column: 1 / -1;
}
.card__meta {
  grid-column: 1;
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 0.1rem;
}
.card__time {
  grid-column: 1;
  font-family: var(--font-sans);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.95rem;
  color: var(--faint);
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}
.card__play {
  display: inline-grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  padding-left: 1px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.card__play:hover,
.card:hover .card__play {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}
.card__play svg { grid-area: 1 / 1; }
.card__play .card__pause-icon { display: none; }
/* while this card is being read aloud, show the pause glyph + active styling */
.card.is-speaking .card__play {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}
.card.is-speaking .card__play .card__play-icon { display: none; }
.card.is-speaking .card__play .card__pause-icon { display: block; }

/* ============================================================
   DESIGNING FOR AI
   ============================================================ */
.ai__lede {
  font-size: clamp(1.5rem, 3.2vw, 2.6rem);
  line-height: 1.22;
  letter-spacing: -0.03em;
  font-weight: 500;
  max-width: 24ch;
  margin-bottom: clamp(3rem, 7vw, 5rem);
}
.ai__lede em { color: var(--muted); font-weight: 400; }

.ai__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(2.5rem, 5vw, 4rem) clamp(2.5rem, 6vw, 5rem);
}
.pillar { max-width: 46ch; }
.pillar__num {
  display: block;
  font-size: 0.85rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.pillar__title {
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  margin-bottom: 0.7rem;
}
.pillar__desc {
  color: var(--muted);
  font-size: clamp(0.98rem, 1.3vw, 1.08rem);
  line-height: 1.55;
}
.pillar__desc strong { color: var(--fg); font-weight: 500; }

.ai__stack {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: clamp(3rem, 6vw, 4.5rem);
}
.ai__stack li {
  padding: 0.5rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.92rem;
  color: var(--muted);
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.ai__stack li:hover {
  color: var(--fg);
  border-color: var(--fg);
  background: var(--surface);
}

/* ============================================================
   ABOUT
   ============================================================ */
.about__grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}
.about__statement {
  font-size: clamp(1.9rem, 4vw, 3.1rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 500;
}
.about__statement em { color: var(--fg); }

.about__col p {
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.12rem);
  margin-bottom: 1.2rem;
  max-width: 52ch;
}
.about__col strong { color: var(--fg); font-weight: 500; }

.about__list {
  list-style: none;
  margin-top: 2rem;
  border-top: 1px solid var(--line);
}
.about__list li {
  display: flex;
  gap: 1.5rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 1rem;
}
.about__list span {
  min-width: 5.5rem;
  color: var(--faint);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-top: 0.15rem;
}

/* ============================================================
   EXPERIENCE  (year · company · role timeline, in hero)
   ============================================================ */
.timeline {
  list-style: none;
  display: grid;
  grid-template-columns: 3rem minmax(0, max-content) minmax(0, max-content);
  align-items: baseline;
  column-gap: clamp(1.5rem, 3vw, 2.6rem);
  max-width: 100%;
}
.timeline__row {
  display: contents;
}
.timeline__year,
.timeline__company,
.timeline__role {
  padding: clamp(0.15rem, 0.4vw, 0.3rem) 0;
  font-size: 1.1rem;
}

.timeline__year {
  font-family: var(--font-mono);
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.timeline__company {
  color: var(--fg);
  letter-spacing: -0.02em;
}
.timeline__role {
  color: var(--muted);
}

/* ============================================================
   RECOGNITION
   ============================================================ */
.awards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.8rem, 4vw, 3rem) clamp(1.5rem, 4vw, 3rem);
}
.award__name {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  font-weight: 500;
  letter-spacing: -0.02em;
}
.award__meta {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 0.4rem;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   BEYOND WORK  (centered topics + scattered photo wall)
   ============================================================ */
.section__head--center {
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-bottom: none;
  gap: 0.6rem;
  padding-bottom: 0;
  margin-bottom: clamp(3.5rem, 8vw, 6rem);
}

.topics {
  display: flex;
  flex-direction: column;
  gap: clamp(4.5rem, 11vw, 9rem);
}
.topic { text-align: center; }
.topic__lead {
  font-size: clamp(1.7rem, 3.6vw, 2.7rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.08;
}
.topic__desc {
  margin: clamp(0.8rem, 2vw, 1.2rem) auto 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  line-height: 1.55;
}
.topic__desc strong { color: var(--fg); font-weight: 500; }
.topic__desc a {
  color: var(--fg);
  background-image: linear-gradient(var(--faint), var(--faint));
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.3s var(--ease);
}
.topic__desc a:hover { background-size: 0% 1px; }

/* ---- the photo wall: centered, overlapping, slightly rotated tiles ---- */
.wall {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-block: clamp(1.5rem, 4vw, 3rem);
}
.wall__tile {
  position: relative;
  flex: 0 0 auto;
  width: clamp(9rem, 15vw, 15rem);
  aspect-ratio: 3 / 4;
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background-color: var(--surface);
  box-shadow: 0 26px 50px -28px rgba(0, 0, 0, 0.5);
  transition: transform 0.55s var(--ease), box-shadow 0.55s var(--ease);
  will-change: transform;
}
.wall__tile::before {
  content: "";
  position: absolute;
  inset: 0;
}
.wall__tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.wall__tile:not(:first-child) { margin-left: clamp(-4rem, -4.5vw, -2.2rem); }

/* scattered arrangement — varied size, rotation, and vertical offset */
.wall__tile:nth-child(1) { transform: rotate(-6deg) translateY(14px); z-index: 1; }
.wall__tile:nth-child(2) { transform: rotate(4deg)  translateY(-20px); z-index: 2; width: clamp(8rem, 13vw, 13rem); aspect-ratio: 1 / 1; }
.wall__tile:nth-child(3) { transform: rotate(-2deg) translateY(2px);  z-index: 3; width: clamp(10rem, 17vw, 17rem); }
.wall__tile:nth-child(4) { transform: rotate(5deg)  translateY(-14px); z-index: 2; aspect-ratio: 4 / 5; }
.wall__tile:nth-child(5) { transform: rotate(-5deg) translateY(16px); z-index: 1; }

.wall__tile:hover {
  transform: rotate(0deg) translateY(-8px) scale(1.05);
  z-index: 10;
  box-shadow: 0 36px 64px -26px rgba(0, 0, 0, 0.55);
}

/* gradient placeholders (swap for real <img>) */
.wall__tile[data-tone="a"]::before { background: linear-gradient(150deg, #a5c8ff 0%, #6d9fe6 50%, #3f6fb0 100%); }
.wall__tile[data-tone="b"]::before { background: linear-gradient(150deg, #ffd7a8 0%, #f2a25c 50%, #d9713a 100%); }
.wall__tile[data-tone="c"]::before { background: linear-gradient(150deg, #cfe6ff 0%, #9fc4ee 50%, #6f9fd6 100%); }
.wall__tile[data-tone="d"]::before { background: linear-gradient(150deg, #d9c9ff 0%, #b09ae6 50%, #7d63c4 100%); }
.wall__tile[data-tone="e"]::before { background: linear-gradient(150deg, #3a3a40 0%, #222226 55%, #121214 100%); }
.wall__tile[data-tone="f"]::before { background: linear-gradient(150deg, #ffc9d6 0%, #f0919f 50%, #d96b7f 100%); }
.wall__tile[data-tone="g"]::before { background: linear-gradient(150deg, #5b5b62 0%, #3a3a40 55%, #1c1c20 100%); }

/* ============================================================
   CONTACT
   ============================================================ */
.contact { text-align: center; padding-block: clamp(5rem, 13vw, 10rem); }
.contact__eyebrow {
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.3rem);
  margin-bottom: clamp(1.2rem, 3vw, 2rem);
}
.contact__email {
  display: inline-block;
  font-size: clamp(2.2rem, 8vw, 5.5rem);
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 500;
  padding-bottom: 0.15em;
  background-image: linear-gradient(var(--fg), var(--fg));
  background-size: 0% 1.5px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.5s var(--ease), opacity 0.3s var(--ease);
}
.contact__email:hover { background-size: 100% 1.5px; }

.contact__socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem 2rem;
  margin-top: clamp(2rem, 5vw, 3.5rem);
}
.contact__socials a {
  color: var(--muted);
  font-size: 1rem;
  position: relative;
  transition: color 0.25s var(--ease);
}
.contact__socials a:hover { color: var(--fg); }
.contact__socials a::after {
  content: "↗";
  font-size: 0.75em;
  margin-left: 0.25rem;
  opacity: 0.5;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 0.9rem;
}
.footer__top { color: var(--muted); transition: color 0.25s var(--ease); }
.footer__top:hover { color: var(--fg); }
.footer__socials {
  display: flex;
  gap: 1.25rem;
}
.footer__socials a { color: var(--muted); transition: color 0.25s var(--ease); }
.footer__socials a:hover { color: var(--fg); }

/* ============================================================
   CASE STUDY  +  "Listen to article" meta bar
   ============================================================ */
.case {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-top: clamp(3rem, 8vw, 6rem);
  padding-bottom: clamp(4rem, 10vw, 8rem);
}

/* two-column case layout: sticky section rail + centered reading column */
.case__layout {
  display: grid;
  grid-template-columns: 1fr minmax(0, 48rem) 1fr;
  column-gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}
.case__main { min-width: 0; }

.case__rail {
  justify-self: start;
  width: 13rem;
  position: sticky;
  top: clamp(5.5rem, 9vw, 7rem);
  align-self: start;
  max-height: calc(100vh - 8rem);
  overflow-y: auto;
  scrollbar-width: none;
}
.case__rail::-webkit-scrollbar { display: none; }

/* on-this-page table of contents */
.case__toc {
  margin-top: clamp(1.6rem, 3vw, 2.2rem);
  display: flex;
  flex-direction: column;
}
.case__toc a {
  padding: 0.42rem 0;
  font-size: 0.9rem;
  line-height: 1.3;
  color: var(--faint);
  transition: color 0.2s var(--ease);
}
.case__toc a:hover { color: var(--muted); }
.case__toc a.is-active {
  color: var(--fg);
  font-weight: 500;
}

/* offset section anchors so they clear the sticky top nav on scroll */
.case__body h2 { scroll-margin-top: clamp(5.5rem, 9vw, 7.5rem); }

/* collapse the rail into a normal-flow block on smaller screens */
@media (max-width: 960px) {
  .case__layout { display: block; }
  .case__main { max-width: 46rem; margin-inline: auto; }
  .case__rail { position: static; max-height: none; overflow: visible; }
  .case__toc { display: none; }
}

/* back link */
.case__back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
  transition: color 0.25s var(--ease), gap 0.25s var(--ease);
}
.case__back:hover { color: var(--fg); gap: 0.7rem; }
.case__rail .case__back { margin-bottom: 0; }

.case__eyebrow {
  color: var(--faint);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.1rem;
}
.case__title {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-kerning: normal;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  line-height: 1.12;
  letter-spacing: -0.005em;
  font-weight: 500;
  max-width: 20ch;
  text-wrap: balance;
}
.case__lede {
  margin-top: clamp(1.2rem, 3vw, 1.8rem);
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  line-height: 1.45;
  letter-spacing: -0.02em;
  color: var(--muted);
  max-width: 44ch;
}

/* -----  at-a-glance facts (role / timeline / team / skills)  ----- */
.case__facts {
  margin-top: clamp(2rem, 4vw, 3rem);
  max-width: 68ch;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(clamp(7rem, 18vw, 9.5rem), 1fr));
  gap: clamp(1.6rem, 3vw, 2.4rem) clamp(1.5rem, 4vw, 2.5rem);
}

/* confidentiality / NDA notice below the header */
.case__notice {
  margin-top: clamp(2rem, 4vw, 3rem);
  padding-top: clamp(1.6rem, 3vw, 2.2rem);
  border-top: 1px solid var(--line);
  max-width: 70ch;
}
.case__notice-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  font-weight: 500;
  color: var(--fg);
  margin-bottom: 0.7rem;
}
.case__notice-title svg { color: #e0a53b; flex: none; }
.case__notice p {
  color: var(--muted);
  font-size: clamp(0.95rem, 1.3vw, 1.05rem);
  line-height: 1.6;
  margin: 0;
}
.case__notice p strong { color: var(--fg); font-weight: 500; }
.case__fact { margin: 0; }
.case__fact--wide { grid-column: 1 / -1; }
.case__fact dt {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--faint);
  margin-bottom: 0.55rem;
}
.case__fact dd {
  margin: 0;
  color: var(--fg);
  font-size: clamp(0.98rem, 1.3vw, 1.1rem);
  line-height: 1.5;
}

/* -----  pull quote inside a case study  ----- */
.case__body blockquote {
  margin: clamp(2.4rem, 5vw, 3.4rem) 0;
  padding-left: clamp(1.1rem, 2.5vw, 1.6rem);
  border-left: 2px solid var(--fg);
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-weight: 400;
  color: var(--fg);
}

/* -----  stat highlight row  ----- */
.case__stats {
  margin: clamp(2.5rem, 5vw, 3.5rem) 0;
  padding: clamp(1.8rem, 4vw, 2.4rem) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(clamp(7rem, 20vw, 9rem), 1fr));
  gap: clamp(1.6rem, 3vw, 2.5rem);
}
.case__stat { margin: 0; }
.case__stat dt {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
/* Legacy no-op: symbols were once wrapped in .g-sym to dodge the demo-font
   watermark. Headings are now Fraunces (a complete font), so .g-sym renders
   identically to its parent — kept only so existing spans stay valid. New
   markup does NOT need it. */
.g-sym { font-family: inherit; }
/* inline number highlight inside case-study prose (body is muted Inter, so
   numbers get the foreground colour + medium weight to stand out) */
.case__body .stat {
  color: var(--fg);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.case__stat dd {
  margin: 0.6rem 0 0;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--muted);
}

/* -----  hero metrics band (full-width, near the top)  ----- */
.case__metrics {
  margin-top: clamp(2.5rem, 6vw, 4rem);
  padding: clamp(1.8rem, 4vw, 2.6rem) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.case__metrics-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--faint);
  margin-bottom: clamp(1.4rem, 3vw, 2rem);
}
.case__metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(clamp(7.5rem, 15vw, 10rem), 1fr));
  gap: clamp(1.8rem, 3vw, 2.5rem) clamp(1.5rem, 3vw, 2rem);
}

/* -----  article meta bar (listen + read time)  ----- */
.article-meta {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 1.5rem);
  flex-wrap: wrap;
  margin-top: clamp(2rem, 5vw, 3rem);
  padding-top: clamp(1.6rem, 4vw, 2.2rem);
  border-top: 1px solid var(--line);
}
.listen-group {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
}
.article-meta__sep {
  width: 1px;
  align-self: stretch;
  min-height: 1.4rem;
  background: var(--line);
}

/* play / pause button with progress ring */
.listen {
  --progress: 0;
  position: relative;
  flex-shrink: 0;
  width: 2.85rem;
  height: 2.85rem;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  color: var(--bg);
  background: var(--fg);
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}
.listen:hover { transform: scale(1.05); }
.listen:active { transform: scale(0.96); }

/* progress ring drawn with a conic gradient mask */
.listen__ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(var(--fg) calc(var(--progress) * 360deg), transparent 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.article-meta[data-listen-state="playing"] .listen__ring,
.article-meta[data-listen-state="paused"] .listen__ring { opacity: 1; }

.listen__play,
.listen__pause { grid-area: 1 / 1; }
.listen__play { margin-left: 2px; } /* optical centering of the triangle */
.listen__pause { display: none; }
.article-meta[data-listen-state="playing"] .listen__play { display: none; }
.article-meta[data-listen-state="playing"] .listen__pause { display: block; }

.listen__label {
  font-size: 1.02rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.listen__time,
.read-time {
  color: var(--muted);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

/* -----  article body  ----- */
.case__body {
  margin-top: clamp(3rem, 7vw, 5rem);
  max-width: 68ch;
}
.case__body > * + * { margin-top: 1.4rem; }
.case__body > p + p { margin-top: 1.6rem; }
.case__body h2 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  letter-spacing: -0.015em;
  font-weight: 500;
  margin-top: clamp(2.6rem, 6vw, 4rem);
}
.case__body h3 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: clamp(1.2rem, 2vw, 1.4rem);
  letter-spacing: -0.015em;
  font-weight: 500;
  margin-top: 2rem;
}
.case__body p,
.case__body li {
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  line-height: 1.65;
  color: var(--muted);
}
.case__body strong { color: var(--fg); font-weight: 500; }
.case__body ul { list-style: none; padding-left: 0; }
.case__body li {
  position: relative;
  margin-top: 0.6rem;
  padding-left: 1.4rem;
}
.case__body li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--faint);
}

/* full-bleed-ish media block placeholder inside a case study */
.case__figure {
  margin-top: clamp(2.5rem, 6vw, 4rem);
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  position: relative;
}
.case__figure::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #cdd7ff 0%, #a5b4fc 50%, #7c83ff 100%);
  opacity: 0.9;
}
/* real cover photo replaces the gradient placeholder */
.case__figure:has(img)::before { content: none; }
.case__figure img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* inline images inside a case-study article (e.g. per-section screenshots) */
.case__inline-figure {
  margin: clamp(2.2rem, 5vw, 3.4rem) 0 clamp(2.6rem, 6vw, 4rem);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
}
.case__inline-figure img {
  display: block;
  width: 100%;
  height: auto;
}

/* next / prev case study nav */
.case__more {
  margin-top: clamp(4rem, 9vw, 7rem);
  padding-top: clamp(2rem, 4vw, 2.6rem);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 1rem;
}
.case__more a { color: var(--muted); transition: color 0.25s var(--ease); }
.case__more a:hover { color: var(--fg); }

/* small "More about me" button under the home glance */
.about__more-btn { margin-top: clamp(2rem, 4vw, 2.6rem); }

/* ============================================================
   ABOUT ME  (dedicated story page)
   ============================================================ */
.about-page {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-top: var(--page-top);
  padding-bottom: clamp(4rem, 10vw, 8rem);
}

.about-hero {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-kerning: normal;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  font-size: clamp(2rem, 4.6vw, 3.6rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  font-weight: 500;
  max-width: 20ch;
  text-wrap: balance;
  margin-top: 0;
  margin-bottom: var(--header-gap);
}
.about-hero em { color: inherit; font-weight: inherit; }
/* Reserve the header zone on the About page so its first story starts at the
   same position as the card rows on Work / Fun (does not affect Fun's inner h1) */
.about-page > .about-hero { min-height: var(--header-min); }

/* Fun / side-quests intro (header + subtext grouped) */
.fun-intro {
  margin-top: 0;
  margin-bottom: var(--header-gap);
  min-height: var(--header-min);   /* reserve header zone — aligns Fun cards with Work */
}
.fun-intro .about-hero {
  max-width: 20ch;
  margin: 0 0 clamp(1.1rem, 2.5vw, 1.6rem);
}
.fun-lede {
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: -0.01em;
  color: var(--muted);
  max-width: 58ch;
  text-wrap: pretty;
}

/* ============================================================
   ABOUT — editorial lede + image galleries
   ============================================================ */
/* headline + intro grouped; no forced header-min reservation here */
.about-lede { margin-bottom: clamp(3.5rem, 8vw, 6rem); }
.about-lede .about-hero {
  min-height: 0;
  max-width: 24ch;
  margin: 0 0 clamp(1.6rem, 3.5vw, 2.4rem);
}
.about-intro {
  max-width: 60ch;
  font-size: clamp(1rem, 1.35vw, 1.2rem);
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: -0.01em;
  color: var(--muted);
  text-wrap: pretty;
}
.about-intro p + p { margin-top: 1.1rem; }
.about-intro strong { color: var(--fg); font-weight: 500; }
.about-intro a {
  color: var(--fg);
  font-weight: 400;
  background-image: linear-gradient(var(--faint), var(--faint));
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.3s var(--ease);
}
.about-intro a:hover { background-size: 0% 1px; }
.about-list {
  list-style: none;
  padding: 0;
  margin: 1.1rem 0;
  display: grid;
  gap: 0.5rem;
}
.about-list li {
  position: relative;
  padding-left: 1.3rem;
}
.about-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--faint);
}

/* numbered category galleries — each category stacks vertically, one row of
   image tiles per category filling the full content width */
.about-gallery {
  display: flex;
  flex-direction: column;
  gap: clamp(3rem, 6vw, 5rem);
}
.gallery-group {
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2vw, 1.5rem);
}
.gallery-group__num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}
.gallery-group__row {
  display: flex;
  gap: clamp(0.75rem, 1.5vw, 1.25rem);
  height: clamp(14rem, 26vw, 22rem);
}
.gallery-tile {
  flex: 1 1 0;
  height: 100%;
  margin: 0;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.gallery-tile--wide { flex-grow: 1.6; }
.gallery-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.85;
}
.gallery-tile:has(img)::before,
.gallery-tile:has(video)::before { content: none; }
.gallery-tile img,
.gallery-tile video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* anchor the crop to the left edge instead of centre */
.gallery-tile img.is-left { object-position: left center; }
.gallery-tile video { cursor: pointer; background: #0c0c0d; }
.gallery-tile[data-tone="a"]::before { background: linear-gradient(150deg, #a5c8ff 0%, #6d9fe6 50%, #3f6fb0 100%); }
.gallery-tile[data-tone="b"]::before { background: linear-gradient(150deg, #ffd7a8 0%, #f2a25c 50%, #d9713a 100%); }
.gallery-tile[data-tone="c"]::before { background: linear-gradient(150deg, #c9f2df 0%, #86e3b6 50%, #38b58f 100%); }
.gallery-tile[data-tone="d"]::before { background: linear-gradient(150deg, #d9c9ff 0%, #b09ae6 50%, #7d63c4 100%); }
.gallery-tile[data-tone="e"]::before { background: linear-gradient(150deg, #ffd6e8 0%, #f7a8c4 50%, #e8749b 100%); }
.gallery-tile[data-tone="f"]::before { background: linear-gradient(150deg, #bfe8ff 0%, #7fc8f0 50%, #3f9fd6 100%); }

/* story rows: text on one side, captioned photo on the other */
.story {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  padding-block: clamp(3rem, 7vw, 5.5rem);
  border-top: 1px solid var(--line);
}
.story--reverse .story__text { order: 2; }
.story--reverse .story__figure { order: 1; }
/* First story sits directly under the About header — no divider line, and no
   extra top padding so it lines up with the card rows on Work / Fun */
.about-hero + .story { border-top: none; padding-top: 0; }

.story__title {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  margin-bottom: clamp(1rem, 2vw, 1.4rem);
}
.story__text p {
  color: var(--muted);
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  line-height: 1.6;
  max-width: 46ch;
}
.story__text p + p { margin-top: 1.1rem; }
.story__text strong { color: var(--fg); font-weight: 500; }
.story__text em { color: var(--fg); }
.story__text a {
  color: var(--fg);
  background-image: linear-gradient(var(--faint), var(--faint));
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.3s var(--ease);
}
.story__text a:hover { background-size: 0% 1px; }

.story__figure { margin: 0; }
.story__media {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}
.story__media::before {
  content: "";
  display: block;
  aspect-ratio: 4 / 3;
}
.story__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.story__figure figcaption {
  margin-top: 0.85rem;
  color: var(--faint);
  font-size: 0.9rem;
  font-style: italic;
}
/* colored placeholder tints (swap for real <img>) */
.story__media[data-tone="a"]::before { background: linear-gradient(150deg, #a5c8ff 0%, #6d9fe6 50%, #3f6fb0 100%); }
.story__media[data-tone="b"]::before { background: linear-gradient(150deg, #ffd7a8 0%, #f2a25c 50%, #d9713a 100%); }
.story__media[data-tone="c"]::before { background: linear-gradient(150deg, #cfe6ff 0%, #9fc4ee 50%, #6f9fd6 100%); }
.story__media[data-tone="d"]::before { background: linear-gradient(150deg, #d9c9ff 0%, #b09ae6 50%, #7d63c4 100%); }
.story__media[data-tone="e"]::before { background: linear-gradient(150deg, #3a3a40 0%, #222226 55%, #121214 100%); }

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal {
  opacity: 1;
  transform: none;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 820px) {
  .hero__grid { flex-direction: column; align-items: flex-start; gap: clamp(2rem, 8vw, 3rem); }
  .work__grid { grid-template-columns: 1fr; }
  .ai__grid { grid-template-columns: 1fr; }
  .about__grid { grid-template-columns: 1fr; }
  .awards { grid-template-columns: repeat(2, 1fr); }
  .story { grid-template-columns: 1fr; gap: 1.6rem; }
  .story--reverse .story__text { order: 1; }
  .story--reverse .story__figure { order: 2; }
}

/* Mobile nav: theme toggle left, links, ArjunLM right — all in flow */
@media (max-width: 640px) {
  .hero__bio { font-size: 1.05rem; }
  .nav__inner { justify-content: space-between; gap: 0.6rem; }
  .nav__links { justify-content: flex-start; flex: 1; order: 0; min-width: 0; }
  .theme-toggle {
    position: static;
    transform: none;
    flex: none;
    order: 1;
    border: none;
    background: transparent;
    width: auto;
    height: auto;
  }
  .theme-toggle:hover { background: transparent; border: none; }
  /* ArjunLM detaches from the header and floats as a bottom-right FAB so the
     header stays clear and the assistant is always reachable. Uses theme tokens
     so it inverts correctly in light and dark mode. */
  .nav__arjunlm {
    position: fixed;
    right: clamp(1rem, 5vw, 1.5rem);
    bottom: clamp(1rem, 5vw, 1.5rem);
    left: auto;
    top: auto;
    width: 3.5rem;
    height: 3.5rem;
    padding: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    gap: 0;
    background: var(--fg);
    color: var(--bg);
    border: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
    z-index: 96;
  }
  .nav__arjunlm:hover { background: var(--fg); }
  .nav__arjunlm-label { display: none; }           /* hide text label in FAB mode */
  .nav__arjunlm-fab { display: none; }             /* skip the baked-color SVG image */
  .nav__arjunlm-spark { display: block; width: 26px; height: 26px; color: var(--bg); }
  /* hide the FAB when the chat panel is open so it doesn't collide */
  body.alm-open .nav__arjunlm { opacity: 0; pointer-events: none; }
}

/* About galleries: fixed-height flex rows become thin slivers on phones,
   so switch to a 2-up grid with natural aspect ratios */
@media (max-width: 600px) {
  .gallery-group__row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    height: auto;
  }
  .gallery-tile,
  .gallery-tile--wide {
    flex: none;
    height: auto;
    aspect-ratio: 4 / 5;
  }
}

/* Experience timeline → year left, company + role stacked on small screens */
@media (max-width: 640px) {
  .timeline { display: flex; flex-direction: column; gap: 1.6rem; }
  .timeline__row {
    display: grid;
    grid-template-columns: 2.6rem 1fr;
    column-gap: 1rem;
    row-gap: 0.2rem;
    align-items: baseline;
  }
  .timeline__year { grid-row: span 2; padding: 0; }
  .timeline__company,
  .timeline__role { padding: 0; }
}

/* Photo wall → horizontal scroll strip on small screens */
@media (max-width: 720px) {
  .wall {
    justify-content: flex-start;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-inline: var(--gutter);
    margin-inline: calc(-1 * var(--gutter));
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .wall::-webkit-scrollbar { display: none; }
  .wall__tile,
  .wall__tile:nth-child(1),
  .wall__tile:nth-child(2),
  .wall__tile:nth-child(3),
  .wall__tile:nth-child(4),
  .wall__tile:nth-child(5) {
    transform: none;
    width: clamp(9rem, 46vw, 13rem);
    aspect-ratio: 3 / 4;
    scroll-snap-align: center;
  }
  .wall__tile:not(:first-child) { margin-left: 0.8rem; }
}

@media (max-width: 520px) {
  .footer {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.6rem;
  }
  .awards { grid-template-columns: 1fr; gap: 1.4rem; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
