/* ============================================================
   MARK BARILLA PORTFOLIO
   style.css — all tokens, layout, components, themes
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Special+Gothic&display=swap');

/* ── Design Tokens ────────────────────────────────────────── */
:root {
  --bg:           #fafafa;
  --bg-alt:       #f2f2f2;
  --bg-overlay:   rgba(250,250,250,0.92);
  --text:         rgba(0, 0, 0, 0.62);
  --heading:      rgb(1, 18, 48);
  --accent:       rgb(213, 46, 46);
  --border:       rgba(0, 0, 0, 0.10);
  --nav-link:     rgba(0, 0, 0, 0.62);  /* 5.5:1 on #fafafa — passes AA */
  --nav-active:   rgb(213, 46, 46);
  --shadow:       0 2px 24px rgba(0,0,0,0.07);

  --font-serif:   'DM Serif Display', Georgia, serif;
  --font-sans:    'Special Gothic', 'Helvetica Neue', Arial, sans-serif;

  --max-w:        1200px;
  --gutter:       clamp(24px, 5vw, 72px);
  --section-gap:  clamp(80px, 12vw, 160px);

  --transition:   0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-fast: 0.2s ease;

  /* ── Type scale — Minor Third (1.200×), base 16px = 1rem ─ */
  /* Rhythm unit R = 16px × 1.5 = 24px                        */
  --text-micro:  0.75rem;    /* 12px — hard floor for micro/metadata */
  --text-caption: 0.875rem;  /* 14px — labels, captions              */
  --text-base:   1rem;       /* 16px — base                          */
  --text-body:   1.125rem;   /* 18px — body copy  (16 × 1.200¹)     */
  --text-h4:     1.5rem;     /* 24px — H4/subhead (16 × 1.200² ≈ 23→24, 8px-grid) */
  --text-h3:     2rem;       /* 32px — H3         (16 × 1.200³ ≈ 28→32, 8px-grid) */
  --text-h2:     3rem;       /* 48px — H2         (16 × 1.200⁵ ≈ 40→48, 8px-grid) */
  --text-h1:     4rem;       /* 64px — H1 desktop (16 × 1.200⁷ ≈ 57→64, 8px-grid) */

  /* ── Spacing scale — 8px grid, marked at 24px rhythm units ─ */
  /* R = rhythm unit (24px). Mark multiples: 1R=24, 2R=48, 4R=96 */
  --sp-1:  0.25rem;  /*  4px */
  --sp-2:  0.5rem;   /*  8px */
  --sp-3:  0.75rem;  /* 12px */
  --sp-4:  1rem;     /* 16px */
  --sp-5:  1.5rem;   /* 24px — 1R ← rhythm unit */
  --sp-6:  2rem;     /* 32px */
  --sp-7:  2.5rem;   /* 40px */
  --sp-8:  3rem;     /* 48px — 2R */
  --sp-9:  4rem;     /* 64px */
  --sp-10: 6rem;     /* 96px — 4R */
}

[data-theme="dark"] {
  --bg:           #0d0d0d;
  --bg-alt:       #161616;
  --bg-overlay:   rgba(13,13,13,0.92);
  --text:         rgba(255, 255, 255, 0.75);
  --heading:      rgba(255, 255, 255, 0.93);
  --accent:       rgb(255, 100, 100);
  --border:       rgba(255, 255, 255, 0.10);
  --nav-link:     rgba(255, 255, 255, 0.45);
  --nav-active:   rgb(255, 100, 100);
  --shadow:       0 2px 24px rgba(0,0,0,0.4);
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a   { color: inherit; text-decoration: none; }

/* ── Typography ───────────────────────────────────────────── */
/*
 * Minor Third (1.200×) modular scale — base 16px
 * Rhythm unit R = 16 × 1.5 = 24px
 * Leading formula: ⌈size ÷ 24⌉ × 24 ÷ size
 *
 *  H1  64px  → 3R = 72px  → leading 1.125  (capped at 1.1 for display)
 *  H2  48px  → 2R = 48px  → leading 1.000  (relaxed to 1.15 for multi-line)
 *  H3  32px  → 2R = 48px  → leading 1.500  (trimmed to 1.25 for subheads)
 *  H4  24px  → 1R = 24px  → leading 1.000  (relaxed to 1.333 = 32px = 1⅓R)
 *  Body 18px → 2R = 48px  → leading 1.333  (opened to 1.6 for readability)
 */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--heading);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.25rem, 5.5vw, 4rem);    line-height: 1.1;   } /* 36–64px */
h2 { font-size: clamp(1.75rem, 3.8vw, 3rem);    line-height: 1.15;  } /* 28–48px */
h3 { font-size: clamp(1.375rem, 2.5vw, 2rem);   line-height: 1.25;  } /* 22–32px */
h4 { font-size: clamp(1.125rem, 1.8vw, 1.5rem); line-height: 1.333; } /* 18–24px */

p {
  font-family: var(--font-sans);
  font-size: clamp(1.0625rem, 1.4vw, 1.125rem); /* 17–18px */
  line-height: 1.6;                               /* 18 × 1.6 = 28.8px ≈ 1.2R */
  color: var(--text);
  max-width: 62ch;
}

/* ── Layout Utilities ─────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  clip: rect(0,0,0,0); overflow: hidden;
}

/* ── Navigation ───────────────────────────────────────────── */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 24px var(--gutter);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background: var(--bg-overlay);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), background var(--transition);
}

.site-nav.scrolled {
  border-bottom-color: var(--border);
}

.nav-brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

/* Signature logo mark — v2, left-aligned with tagline */
.nav-logo {
  height: 38px;   /* 32px × 1.2 */
  width: auto;
  display: block;
  flex-shrink: 0;
  transition: opacity var(--transition-fast);
}

/* Light mode: logo is black; dark mode: invert to white */
[data-theme="dark"] .nav-logo {
  filter: invert(1);
}

/* Vertical separator between logo and tagline */
.nav-brand-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
  flex-shrink: 0;
}

.nav-brand .title {
  font-family: var(--font-sans);
  font-size: var(--text-caption); /* 14px — caption, above micro floor */
  color: var(--text);
  letter-spacing: 0.01em;
  line-height: 1.4;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
  padding-top: 2px;
}

.nav-links a {
  font-family: var(--font-sans);
  font-size: var(--text-base); /* 16px */
  color: var(--nav-link);
  transition: color var(--transition-fast);
  position: relative;
}

/* Underline animation — top-level nav links only, not dropdown */
.nav-links > li > a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform var(--transition-fast);
}

.nav-links > li > a:hover,
.nav-links > li > a.active {
  color: var(--heading);
}

.nav-links > li > a.active::after,
.nav-links > li > a:hover::after {
  transform: scaleX(1);
}

/* ── Projects dropdown under Work ─────────────────────────── */
.nav-has-dropdown {
  position: relative;
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 14px);
  left: -24px;
  list-style: none;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 0;
  min-width: 272px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.22s ease, visibility 0.22s, transform 0.22s ease;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
  z-index: 200;
}

.nav-has-dropdown:hover .nav-dropdown,
.nav-has-dropdown:focus-within .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown li a {
  display: block;
  padding: 9px 24px;
  font-family: var(--font-serif);
  font-size: var(--text-body); /* 18px — H4 min, on-scale */
  letter-spacing: -0.02em;
  line-height: 1.333;          /* 18 × 1.333 = 24px = 1R */
  color: var(--heading);
  transition: color 0.15s ease, padding-left 0.18s ease;
}
/* suppress the underline ::after from parent rule */
.nav-dropdown li a::after { display: none; }

.nav-dropdown li a:hover {
  color: var(--accent);
  padding-left: 30px;
}

.nav-dropdown li a.current {
  color: var(--accent);
}

/* Subtle divider between dropdown items */
.nav-dropdown li + li {
  border-top: 1px solid var(--border);
}

/* Theme toggle — inline text link in footer copyright line */
.footer-theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 2px;
  transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}
.footer-theme-toggle:hover {
  color: var(--heading);
  text-decoration-color: currentColor;
}
.footer-copy-sep {
  margin: 0 6px;
  opacity: 0.4;
}

/* Mobile nav */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
  align-self: center; /* center against brand height, not flex-start */
}
.nav-hamburger span {
  display: block;
  width: 22px; height: 1.5px;
  background: var(--heading);
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}
.nav-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(4.5px, 4.5px); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(4.5px, -4.5px); }

.nav-mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--bg);
  padding: 100px var(--gutter) 40px;
  flex-direction: column;
  gap: 32px;
}
.nav-mobile-menu.open { display: flex; }
.nav-mobile-menu a {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 6vw, 2rem); /* 24–32px — H3 scale */
  line-height: 1.25;
  color: var(--heading);
  letter-spacing: -0.02em;
}

/* Project sub-links in mobile menu — smaller, indented */
.nav-mobile-menu .mobile-project-link {
  font-size: clamp(1.125rem, 4vw, 1.5rem); /* 18–24px — H4 scale */
  color: var(--text);
  padding-left: 20px;
  margin-top: -20px;  /* tighten from the 32px gap */
}
.nav-mobile-menu .mobile-project-link:last-of-type {
  margin-bottom: 12px;
}
.nav-mobile-menu .mobile-project-link:hover {
  color: var(--accent);
}

/* ── Page wrapper ─────────────────────────────────────────── */
.page {
  padding-top: 100px;
}

/* ── Scroll Animations ────────────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s var(--transition), transform 0.7s var(--transition);
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children */
.stagger-children > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--transition), transform 0.6s var(--transition);
}
.stagger-children.visible > *:nth-child(1) { opacity:1; transform:none; transition-delay: 0s; }
.stagger-children.visible > *:nth-child(2) { opacity:1; transform:none; transition-delay: 0.08s; }
.stagger-children.visible > *:nth-child(3) { opacity:1; transform:none; transition-delay: 0.16s; }
.stagger-children.visible > *:nth-child(4) { opacity:1; transform:none; transition-delay: 0.24s; }
.stagger-children.visible > *:nth-child(5) { opacity:1; transform:none; transition-delay: 0.32s; }
.stagger-children.visible > *:nth-child(6) { opacity:1; transform:none; transition-delay: 0.40s; }
.stagger-children.visible > *:nth-child(n+7) { opacity:1; transform:none; transition-delay: 0.48s; }

/* ── Homepage: Hero ───────────────────────────────────────── */
.hero {
  padding: clamp(60px, 10vw, 140px) var(--gutter) clamp(80px, 14vw, 180px);
  max-width: var(--max-w);
  margin: 0 auto;
}

.hero-title {
  margin-bottom: clamp(24px, 3vw, 40px);
}

.hero-body {
  max-width: 680px;
  font-size: clamp(17px, 1.5vw, 21px);
  line-height: 1.75;
  color: var(--text);
}

.hero-body a {
  color: var(--accent);
  position: relative;
}

.hero-body a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: var(--accent);
  opacity: 0.4;
}

/* ── Homepage: Project Gallery ────────────────────────────── */
.gallery {
  padding: 0 0 var(--section-gap);
}

.gallery-item {
  display: block;
  position: relative;
  cursor: pointer;
  margin-bottom: clamp(8px, 1.5vw, 20px);
}

.gallery-item-inner {
  position: relative;
  overflow: hidden;
  background: var(--bg-alt);
  aspect-ratio: 5 / 4;
}

.gallery-item-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform-origin: center center;
}

.gallery-item:hover .gallery-item-image {
  transform: scale(1.08);
}

/* Gradient scrim — deeper to support tagline text */
.gallery-item-inner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 20%, rgba(0,0,0,0.72) 100%);
  pointer-events: none;
}

.gallery-item-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: clamp(24px, 3vw, 52px) clamp(20px, 4vw, 64px);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  z-index: 1;
}

/* Text column — tagline collapsed by default so title sits flush at bottom */
.gallery-item-text {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.gallery-item-tagline {
  font-family: var(--font-sans);
  font-size: clamp(15px, 1.2vw, 18px);
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.55;
  max-width: 480px;
  /* Collapsed: takes no vertical space, invisible */
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin-top: 0;
  transition:
    max-height 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    opacity    0.3s  cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.05s,
    margin-top 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-item:hover .gallery-item-tagline {
  max-height: 120px;
  opacity: 1;
  margin-top: 10px;
}

.gallery-item-title {
  font-family: var(--font-serif);
  font-size: clamp(28px, 3.8vw, 60px);
  font-weight: 400;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.gallery-item-arrow {
  font-family: var(--font-sans);
  font-size: 24px;
  color: rgba(255, 255, 255, 0.7);
  transition:
    transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    color     0.3s  cubic-bezier(0.25, 0.46, 0.45, 0.94);
  flex-shrink: 0;
  margin-left: 24px;
  /* Align arrow baseline with title text */
  align-self: flex-end;
  line-height: 1.05;
}

.gallery-item:hover .gallery-item-arrow {
  transform: translateX(8px);
  color: #fff;
}

/* ── Case Study Page ──────────────────────────────────────── */
.case-study {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 80px) var(--gutter) var(--section-gap);
}

/* Sans-serif for all section headings inside a case study */
.case-study h2,
.case-study h3,
.case-study h4 {
  font-family: var(--font-sans);
  letter-spacing: -0.01em;
}

/* ── Case Study Grid Indentation ──────────────────────────── */
/* Desktop (12-col): content spans cols 3–9                   */
.case-study-header,
.project-glance,
.project-slide-heading,
.project-slide-body,
.project-slide-caption,
.key-stats,
.credits {
  margin-left: calc(2 / 12 * 100%);
  max-width: calc(7 / 12 * 100%);
}

/* Tablet (6-col): content spans cols 2–4                     */
@media (max-width: 1023px) {
  .case-study-header,
  .project-glance,
  .project-slide-heading,
  .project-slide-body,
  .project-slide-caption,
  .key-stats,
  .credits {
    margin-left: calc(1 / 6 * 100%);
    max-width: calc(3 / 6 * 100%);
  }
}

/* Mobile (4-col): full width, no indent                      */
@media (max-width: 767px) {
  .case-study-header,
  .project-glance,
  .project-slide-heading,
  .project-slide-body,
  .project-slide-caption,
  .key-stats,
  .credits {
    margin-left: 0;
    max-width: 100%;
  }

  /* ── Mobile spacing: more air, larger outer padding ──────── */
  :root {
    --gutter:      28px;
    --section-gap: clamp(64px, 14vw, 100px);
  }

  .page                  { padding-top: 116px; }
  .hero                  { padding-top: 116px; }

  /* Case study header */
  .case-study-header     { margin-bottom: clamp(40px, 10vw, 64px); }
  .case-study-title      { margin-bottom: 20px; }
  .case-study-tagline    { font-size: clamp(18px, 4.5vw, 22px); }

  /* Glance block */
  .project-glance        { padding-top: 24px; padding-bottom: 28px; margin-bottom: clamp(56px, 12vw, 80px); }

  /* Slide spacing */
  .project-slide         { margin-bottom: clamp(64px, 14vw, 100px); }

  /* Slide heading / body breathing room */
  .project-slide-heading { margin-bottom: clamp(20px, 5vw, 32px); }
  .project-slide-body    { margin-top: clamp(16px, 4vw, 24px); }

  /* Section blocks */
  .key-stats,
  .credits               { margin-top: clamp(48px, 10vw, 72px); }
}

.case-study-header {
  margin-bottom: clamp(40px, 6vw, 80px);
}

.case-study-title {
  margin-bottom: clamp(16px, 2vw, 28px);
}

.case-study-tagline {
  font-size: clamp(17px, 1.8vw, 22px);
  line-height: 1.65;
  color: var(--text);
}

.case-study-tagline a,
.case-study-tagline strong {
  color: var(--accent);
}

/* ── Project at a Glance ─────────────────────────────────── */
.project-glance {
  /* margin-bottom only — margin-left inherited from column group */
  margin-bottom: clamp(48px, 7vw, 96px);
  padding: 20px 0 clamp(28px, 4vw, 40px);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* Desktop: 3-col top row (year | role | link), outcome spans all below */
.project-glance-list {
  display: grid;
  grid-template-columns: 72px 1fr 1fr;
  grid-template-rows: auto auto;
  column-gap: 40px;
  row-gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.glance-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.glance-year  { grid-column: 1; grid-row: 1; }
.glance-role  { grid-column: 2; grid-row: 1; }
.glance-link  { grid-column: 3; grid-row: 1; }
.glance-outcome { grid-column: 1 / -1; grid-row: 2; }

.glance-item dt {
  font-family: var(--font-sans);
  font-size: 12px;  /* --text-micro floor */
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--heading);
  opacity: 0.72;  /* 6.5:1 on #fafafa — passes AA for small text */
}

.glance-item dd {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  color: var(--heading);
  margin: 0;
  line-height: 1.4;
}

.glance-item dd a {
  color: var(--heading);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 2px;
  transition: text-decoration-color var(--transition-fast);
}
.glance-item dd a::after {
  content: ' →';
  font-style: normal;
}
.glance-item dd a:hover { text-decoration-color: var(--accent); color: var(--accent); }

/* Stacked second link spacer */
.glance-link-sep {
  display: block;
  height: 5px;
}

/* Caveat note below stacked links */
.glance-caveat {
  display: block;
  margin-top: 10px;
  font-size: 13px;
  font-style: normal;
  font-weight: 400;
  color: var(--heading);
  opacity: 0.60;  /* 4.8:1 on #fafafa — passes AA at 13px */
  line-height: 1.5;
}

/* Mobile: year(1fr) role(3fr) | link(full) | outcome(full) */
@media (max-width: 767px) {
  .project-glance-list {
    grid-template-columns: 1fr 3fr;
    grid-template-rows: auto auto auto;
    row-gap: 20px;
  }
  .glance-year    { grid-column: 1; grid-row: 1; }
  .glance-role    { grid-column: 2; grid-row: 1; }
  .glance-link    { grid-column: 1 / -1; grid-row: 2; }
  .glance-outcome { grid-column: 1 / -1; grid-row: 3; }
}

/* ── Lightbox ─────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              visibility 0.28s;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.96);
}

.lightbox-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
  will-change: transform;
  transform-origin: center center;
  cursor: zoom-in;
  transform: scale(0.92);
  transition: transform 0.32s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.lightbox.is-open .lightbox-img {
  transform: scale(1);
}

.lightbox-img.lb-zoomed  { cursor: grab; }
.lightbox-img.lb-dragging { cursor: grabbing; }

/* Close pill — top-right, frosted glass, no border */
.lightbox-close {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: none;
  border-radius: 100px;
  color: rgba(255, 255, 255, 0.92);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  z-index: 9001;
  transition: background 0.2s ease, transform 0.15s ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.04);
}

.lightbox-close-icon {
  font-size: 15px;
  line-height: 1;
  opacity: 0.85;
}

/* Tap-to-zoom cursor on slide images */
.project-slide-image-wrap img {
  cursor: zoom-in;
}

/* ── Project Slide ────────────────────────────────────────── */
.project-slide {
  margin-bottom: clamp(60px, 10vw, 140px);
}

.project-slide-heading {
  margin-bottom: clamp(24px, 3vw, 40px);
}

.project-slide-heading .divider {
  width: 32px;
  height: 3px;
  background: var(--accent);
  margin-top: 24px;
}

.project-slide-heading h3,
.project-slide-caption h3 {
  font-size: clamp(1.5rem, 2.8vw, 2.5rem); /* 24–40px — one scale step above h3 */
  margin-bottom: 0;
}

/* Full-width image breakout — no forced crop, natural dimensions */
.project-slide-image-wrap {
  position: relative;
  left: 50%;
  width: 100vw;
  margin-left: -50vw;
  box-sizing: border-box;
  background: var(--bg-alt);
  overflow: hidden;
  margin-bottom: 0;
}

.project-slide-image-wrap img {
  width: 100%;
  height: auto;
  display: block;
  display: block;
}

.project-slide-body {
  padding: clamp(24px, 3vw, 40px) 0 0;
}

.project-slide-body p {
  color: var(--text);
}
.project-slide-body p + p {
  margin-top: 16px;
}

/* Legacy caption selector (keeps hand-written index.html pages working) */
.project-slide-caption {
  padding: clamp(28px, 4vw, 56px) 0 0;
}

.project-slide-caption .divider {
  width: 32px;
  height: 3px;
  background: var(--accent);
  margin-bottom: 20px;
}

.project-slide-caption h3 {
  margin-bottom: 16px;
}

.project-slide-caption p {
  color: var(--text);
}
.project-slide-caption p + p {
  margin-top: 16px;
}

/* ── Key Stats ────────────────────────────────────────────── */
.key-stats {
  margin: clamp(48px, 7vw, 96px) 0;
  padding: clamp(32px, 4vw, 56px);
  background: var(--bg-alt);
  border-radius: 8px;
}

.key-stats-label {
  font-family: var(--font-sans);
  font-size: var(--text-micro); /* 12px — micro floor */
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 24px;
}

.key-stats-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.key-stats-list li {
  font-family: var(--font-sans);
  font-size: clamp(15px, 1.3vw, 17px);
  line-height: 1.5;
  color: var(--heading);
}

/* ── Credits ──────────────────────────────────────────────── */
.credits {
  margin-top: clamp(40px, 5vw, 64px);
  padding-top: clamp(32px, 4vw, 48px);
  border-top: 1px solid var(--border);
}

.credits-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.credits-list li {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text);
}

.credits-list li strong {
  color: var(--heading);
  font-weight: 400;
}

.case-study-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
  transition: opacity var(--transition-fast);
}
.case-study-link:hover { opacity: 0.7; }

/* ── Project Navigation (bottom of case study) ────────────── */
.project-nav {
  margin-top: clamp(60px, 8vw, 100px);
  padding-top: clamp(32px, 4vw, 48px);
  border-top: 1px solid var(--border);
}

.project-nav-label {
  font-family: var(--font-sans);
  font-size: var(--text-micro); /* 12px — micro floor */
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 20px;
}

.project-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  list-style: none;
}

.project-nav-links a {
  font-family: var(--font-serif);
  font-size: clamp(15px, 1.4vw, 18px);
  color: var(--text);
  letter-spacing: -0.01em;
  transition: color var(--transition-fast);
  position: relative;
}
.project-nav-links a.current {
  color: var(--accent);
}
.project-nav-links a:not(.current):hover {
  color: var(--heading);
}

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  padding: clamp(32px, 5vw, 64px) var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  border-top: 1px solid var(--border);
}

.footer-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-divider {
  width: 24px;
  height: 2px;
  background: var(--border);
}

.footer-copy {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text);
}

.footer-social {
  display: flex;
  gap: 20px;
  list-style: none;
}

.footer-social a {
  color: var(--text);
  transition: color var(--transition-fast);
}
.footer-social a:hover { color: var(--heading); }
.footer-social svg { width: 20px; height: 20px; }

/* ── Resume Page ──────────────────────────────────────────── */
/*
 * Typographic system: 8px baseline grid
 * Base: 16px / 1.5 line-height = 24px rhythm unit
 * Spacing scale: 8 | 16 | 24 | 32 | 40 | 48 | 56 | 64px
 * All margins/padding snap to 8px increments.
 */

.resume-page {
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(40px, 6vw, 80px) var(--gutter) var(--section-gap);
}

.resume-download-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: clamp(32px, 4vw, 56px);
  flex-wrap: wrap;
  gap: 16px;
}

.resume-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: opacity var(--transition-fast), border-color var(--transition-fast);
  white-space: nowrap;
}
.resume-download-btn:hover { opacity: 0.7; border-color: var(--text); }

.resume-section {
  margin-bottom: clamp(40px, 4vw, 56px);   /* 8px grid */
  padding-bottom: clamp(32px, 3vw, 48px);  /* 8px grid */
  border-bottom: 1px solid var(--border);
}

.resume-section:last-child { border-bottom: none; }

/* Section label — "Summary", "Experience", etc. */
.resume-section-label {
  font-family: var(--font-sans);
  font-size: var(--text-caption); /* 14px */
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;          /* 1 rhythm unit */
}

/* Summary section bullets — square, inset, on grid */
.resume-section > ul {
  list-style: square;
  padding-left: 24px;
  margin: 16px 0 0;
}
.resume-section > ul li {
  font-size: 15px;
  line-height: 1.6;             /* 15 × 1.6 = 24px, on grid */
  color: var(--text);
  padding-left: 4px;
  margin-bottom: 8px;
}
.resume-section > ul li:last-child { margin-bottom: 0; }

.resume-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 24px;                /* 8px grid */
  margin-bottom: 32px;          /* 8px grid */
}
.resume-entry:last-child { margin-bottom: 0; }

/* Company-level heading: "Google — Cambridge, MA", "CNN Digital — Atlanta, GA" */
.resume-entry-company-name {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 2.8vw, 2.25rem); /* 28–36px — H2 min → H3 max */
  line-height: 1.15;
  color: var(--heading);
  letter-spacing: -0.02em;
  grid-column: 1;
  grid-row: 1;
}

/* Role title: "Creative Director", "UX Design Lead" */
.resume-entry-role {
  font-family: var(--font-sans);
  font-size: clamp(1.125rem, 1.8vw, 1.375rem); /* 18–22px — body → H4 */
  line-height: 1.4;
  color: var(--heading);
  letter-spacing: -0.01em;
  grid-column: 1;
  grid-row: 1;
}

.resume-entry-date {
  font-family: var(--font-sans);
  font-size: var(--text-caption); /* 14px */
  color: var(--text);
  white-space: nowrap;
  grid-column: 2;
  grid-row: 1;
  text-align: right;
  padding-top: 4px;
}

.resume-entry-company {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text);
  grid-column: 1 / -1;
  grid-row: 2;
  margin-bottom: 8px;           /* 8px grid */
}

.resume-entry-desc {
  grid-column: 1 / -1;
  grid-row: 3;
}

.resume-entry-desc p,
.resume-entry-desc li {
  font-size: 15px;              /* up from 14px */
  line-height: 1.6;             /* 15 × 1.6 = 24px, on grid */
  color: var(--text);
  max-width: 100%;
  margin-bottom: 8px;
}
.resume-entry-desc li:last-child { margin-bottom: 0; }

.resume-entry-desc ul {
  list-style: square;
  padding-left: 24px;
}

.resume-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.resume-skill-tag {
  padding: 5px 14px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text);
  background: transparent;
  border-radius: 999px;
  border: 1px solid var(--border);
}

/* ── Contact snippet ──────────────────────────────────────── */
.contact-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.contact-links a {
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition-fast);
  padding-bottom: 1px;
}
.contact-links a:hover { border-bottom-color: var(--accent); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .nav-hamburger {
    display: flex;
  }
  .nav-brand {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .nav-brand-divider {
    display: none;
  }
  .nav-brand .title {
    font-size: 11px;
    white-space: normal;
    line-height: 1.3;
  }

  .resume-entry {
    grid-template-columns: 1fr;
  }
  .resume-entry-date {
    grid-column: 1;
    grid-row: 2;
    text-align: left;
  }
  .resume-entry-company { grid-row: 3; }
  .resume-entry-desc    { grid-row: 4; }

  .project-nav-links {
    flex-direction: column;
    gap: 12px;
  }

  /* ── Mobile typography floors (8px baseline grid) ── */
  /* Paragraphs & bullets: hold at 15px — do not reduce */
  .resume-entry-desc p,
  .resume-entry-desc li,
  .resume-section > ul li,
  .resume-entry-company {
    font-size: 15px;
    line-height: 1.6;
  }

  /* Role titles: min 17px */
  .resume-entry-role {
    font-size: 17px;
    line-height: 1.4;
  }

  /* Company name: min 24px */
  .resume-entry-company-name {
    font-size: 24px;
  }

  /* Section labels: min 13px */
  .resume-section-label {
    font-size: 13px;
    letter-spacing: 0.16em;
  }

  /* Dates: min 12px — micro floor, acceptable for compact date range */
  .resume-entry-date {
    font-size: 12px;
  }

  /* Skill tags: min 12px */
  .resume-skill-tag {
    font-size: 12px;
  }

  /* Contact links: min 14px */
  .contact-links a {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .gallery-item-caption {
    flex-direction: row;
    align-items: flex-end;
    padding: 16px 20px;
  }
  .gallery-item-arrow { display: none; }
}
