/* ============================================================
   Devin Blackburn — Creative Portfolio
   Design language: "late-afternoon olive grove" — warm & earthy
   Fonts: Young Serif (display) + Hanken Grotesk (body)
   Color: OKLCH · deep-olive primary · terracotta accent · warm ink
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  color-scheme: light;

  /* Fonts */
  --font-display: "Prata", Georgia, "Times New Roman", serif;
  --font-sans: "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Surfaces & ink (warm, earthy) */
  --bg:          oklch(0.955 0.011 92);   /* warm oat off-white (primary surface) */
  --bg-sunk:     oklch(0.928 0.015 86);   /* deeper warm section band */
  --surface:     oklch(0.988 0.006 92);   /* raised near-white warm */
  --ink:         oklch(0.255 0.018 62);   /* deep warm brown-black (body text) */
  --ink-soft:    oklch(0.415 0.020 60);   /* secondary text */
  --muted:       oklch(0.475 0.018 58);   /* tertiary / meta labels — WCAG AA on bg & bg-sunk */

  /* Brand */
  --primary:       oklch(0.44 0.10 128);  /* deep olive — links, buttons, text-safe */
  --primary-hover: oklch(0.37 0.095 128);
  --primary-deep:  oklch(0.50 0.060 132);  /* drenched section background — sage green */
  --sage:          oklch(0.74 0.070 128); /* light decorative sage (large only) */
  --accent:        oklch(0.585 0.135 45); /* terracotta — small warm accents */
  --accent-deep:   oklch(0.485 0.130 42);

  /* On dark / drenched */
  --on-dark:       oklch(0.960 0.030 92);  /* cream */
  --on-dark-soft:  oklch(0.870 0.035 90);  /* soft cream */
  --footer-bg:     oklch(0.215 0.017 58);

  /* Lines */
  --border:        oklch(0.885 0.012 88);
  --border-strong: oklch(0.815 0.014 84);
  --border-on-dark: oklch(0.98 0.01 92 / 0.18);

  /* Fluid type scale (~1.25 ratio) */
  --step--1: clamp(0.833rem, 0.80rem + 0.16vw, 0.925rem);
  --step-0:  clamp(1.0rem, 0.955rem + 0.22vw, 1.125rem);
  --step-1:  clamp(1.20rem, 1.12rem + 0.40vw, 1.45rem);
  --step-2:  clamp(1.45rem, 1.31rem + 0.68vw, 1.95rem);
  --step-3:  clamp(1.80rem, 1.55rem + 1.20vw, 2.75rem);
  --step-4:  clamp(2.20rem, 1.75rem + 2.10vw, 3.60rem);
  --hero:    clamp(2.85rem, 1.90rem + 4.6vw, 5.40rem);

  /* Spacing */
  --space-1: 0.25rem;  --space-2: 0.5rem;   --space-3: 0.75rem;
  --space-4: 1rem;     --space-5: 1.5rem;    --space-6: 2rem;
  --space-7: 3rem;     --space-8: 4rem;      --space-9: 6rem;
  --section-pad: clamp(4rem, 3rem + 6vw, 8rem);
  --gutter: clamp(1.15rem, 0.7rem + 2.2vw, 2.75rem);
  --measure: 66ch;

  /* Radius (cards ≤16px) */
  --radius-sm: 6px; --radius: 10px; --radius-md: 14px; --radius-lg: 16px;
  --radius-pill: 999px;

  /* Shadows (warm, soft — never paired with borders) */
  --shadow-sm: 0 1px 2px oklch(0.30 0.02 60 / 0.06), 0 3px 8px oklch(0.30 0.02 60 / 0.06);
  --shadow-md: 0 8px 24px oklch(0.28 0.03 60 / 0.12);
  --shadow-lg: 0 18px 48px oklch(0.25 0.03 55 / 0.20);

  /* Motion */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.30, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.50, 1);
  --dur-fast: 180ms; --dur: 320ms; --dur-slow: 640ms;

  /* z-index scale */
  --z-nav: 100; --z-dropdown: 200; --z-backdrop: 300; --z-modal: 400; --z-toast: 500;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
/* Lists with a class are laid out as components (nav, footer, tags) — the
   browser's 40px bullet indent only pushes them off-centre. Unclassed lists
   are prose (blog post markdown) and keep it. */
:where(ul, ol)[class] { padding-inline-start: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.005em;
  text-wrap: balance;
  color: var(--ink);
}
p { text-wrap: pretty; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

:focus-visible {
  outline: 2.5px solid var(--primary);
  outline-offset: 3px;
  border-radius: 3px;
}

::selection { background: oklch(0.74 0.07 128 / 0.45); color: var(--ink); }

/* ---------- Layout helpers ---------- */
.container { width: min(100% - (var(--gutter) * 2), 1200px); margin-inline: auto; }
.container--wide { width: min(100% - (var(--gutter) * 2), 1440px); margin-inline: auto; }
.section { padding-block: var(--section-pad); }
.section--sunk { background: var(--bg-sunk); }

.section__head { max-width: 60ch; margin-bottom: clamp(2rem, 4vw, 3.5rem); }
.section__kicker {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: var(--step--1); font-weight: 600; letter-spacing: 0.02em;
  color: var(--primary); margin-bottom: 0.9rem;
}
.section__kicker::before {
  content: ""; width: 1.6rem; height: 2px; background: var(--accent); border-radius: 2px;
}
.section__title { font-size: var(--step-3); }
.section__lead { margin-top: 1rem; font-size: var(--step-1); color: var(--ink-soft); max-width: 52ch; }

.skip-link {
  position: absolute; left: 1rem; top: -100%; z-index: var(--z-toast);
  background: var(--ink); color: var(--on-dark); padding: 0.7rem 1.1rem;
  border-radius: var(--radius); transition: top var(--dur) var(--ease-out-expo);
}
.skip-link:focus { top: 1rem; color: var(--on-dark); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  padding: 0.85rem 1.5rem; min-height: 48px;
  font-weight: 600; font-size: var(--step-0); line-height: 1;
  border-radius: var(--radius-pill); text-align: center;
  transition: transform var(--dur-fast) var(--ease-out-quart),
              background-color var(--dur-fast) ease, color var(--dur-fast) ease,
              box-shadow var(--dur-fast) ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--primary); color: var(--on-dark); }
.btn--primary:hover { background: var(--primary-hover); color: var(--on-dark); box-shadow: var(--shadow-md); }
.btn--ghost { border: 1.5px solid var(--border-strong); color: var(--ink); }
.btn--ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn--on-dark { background: var(--on-dark); color: var(--primary-deep); }
.btn--on-dark:hover { background: var(--sage); color: var(--ink); }
.btn--ghost-dark { border: 1.5px solid var(--border-on-dark); color: var(--on-dark); }
.btn--ghost-dark:hover { border-color: var(--on-dark); background: oklch(1 0 0 / 0.08); }
.btn .icon { width: 1.15em; height: 1.15em; }

/* ---------- Scroll reveal (enhances an already-visible default) ---------- */
.reveal { opacity: 1; }
.has-js .reveal {
  opacity: 0; transform: translateY(22px);
  transition: opacity var(--dur-slow) var(--ease-out-expo),
              transform var(--dur-slow) var(--ease-out-expo);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.has-js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .has-js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: var(--z-nav);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: clamp(0.7rem, 1.5vw, 1.1rem) var(--gutter);
  transition: background-color var(--dur) ease, box-shadow var(--dur) ease,
              padding var(--dur) ease, border-color var(--dur) ease;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled, .nav--solid {
  background: var(--surface);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom-color: var(--border);
}
/* At the very top, over the dark hero photo, nav text is light */
.nav:not(.is-scrolled):not(.nav--solid) { color: var(--on-dark); }
.nav:not(.is-scrolled):not(.nav--solid) .nav__link { color: var(--on-dark); }
.nav:not(.is-scrolled):not(.nav--solid) .nav__wordmark { color: var(--on-dark); }
.nav:not(.is-scrolled):not(.nav--solid) .nav__social { color: var(--on-dark); }
.nav:not(.is-scrolled):not(.nav--solid) .nav__toggle-bar { background: var(--on-dark); }

.nav__wordmark {
  font-family: var(--font-display); font-size: 1.35rem; letter-spacing: -0.01em;
  color: var(--ink); white-space: nowrap;
}
.nav__wordmark span { color: var(--primary); }
.nav:not(.is-scrolled):not(.nav--solid) .nav__wordmark span { color: var(--sage); }

.nav__menu { display: flex; align-items: center; gap: clamp(1rem, 2vw, 2rem); }
.nav__links { display: flex; align-items: center; gap: clamp(1rem, 2vw, 1.9rem); list-style: none; }
.nav__link {
  position: relative; color: var(--ink); font-weight: 500; font-size: var(--step-0);
  padding-block: 0.3rem; transition: color var(--dur-fast) ease;
}
.nav__link::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0;
  background: currentColor; transition: width var(--dur) var(--ease-out-expo);
}
.nav__link:hover { color: var(--primary); }
.nav:not(.is-scrolled):not(.nav--solid) .nav__link:hover { color: var(--sage); }
.nav__link:hover::after { width: 100%; }

.nav__socials { display: flex; align-items: center; gap: 0.75rem; padding-left: 0.5rem;
  border-left: 1px solid var(--border); }
.nav:not(.is-scrolled):not(.nav--solid) .nav__socials { border-left-color: var(--border-on-dark); }
.nav__social { color: var(--ink-soft); transition: color var(--dur-fast) ease, transform var(--dur-fast) ease; }
.nav__social:hover { color: var(--primary); transform: translateY(-2px); }
.nav:not(.is-scrolled):not(.nav--solid) .nav__social { color: var(--on-dark-soft); }
.nav:not(.is-scrolled):not(.nav--solid) .nav__social:hover { color: var(--on-dark); }
.nav__social .icon { width: 20px; height: 20px; }

/* Hamburger */
.nav__toggle {
  display: none; width: 48px; height: 48px; position: relative;
  border-radius: var(--radius); z-index: calc(var(--z-modal) + 1);
}
.nav__toggle-bar, .nav__toggle-bar::before, .nav__toggle-bar::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 24px; height: 2px;
  background: var(--ink); border-radius: 2px; transition: transform var(--dur) var(--ease-out-expo),
    opacity var(--dur-fast) ease; translate: -50% -50%;
}
.nav__toggle-bar::before { translate: -50% -8px; }
.nav__toggle-bar::after  { translate: -50% 6px; }
.nav.is-open .nav__toggle-bar { background: transparent; }
.nav.is-open .nav__toggle-bar::before { translate: -50% -50%; transform: rotate(45deg); }
.nav.is-open .nav__toggle-bar::after  { translate: -50% -50%; transform: rotate(-45deg); }

@media (max-width: 860px) {
  .nav__toggle { display: block; }
  .nav__menu {
    position: fixed; inset: 0; height: 100dvh; z-index: var(--z-modal);
    flex-direction: column; justify-content: center; gap: 2.25rem;
    background: var(--primary-deep); color: var(--on-dark);
    padding: 5rem var(--gutter) 3rem;
    clip-path: inset(0 0 100% 0);
    transition: clip-path var(--dur-slow) var(--ease-out-expo);
    pointer-events: none; touch-action: none; overflow-y: auto;
  }
  .nav.is-open .nav__menu { clip-path: inset(0 0 0 0); pointer-events: auto; }
  .nav__links { flex-direction: column; gap: 1.5rem; text-align: center; }
  .nav__menu .nav__link { color: var(--on-dark); font-family: var(--font-display); font-size: var(--step-2); }
  .nav__menu .nav__link::after { background: var(--sage); left: 50%; transform: translateX(-50%); }
  .nav__socials { border-left: none; border-top: 1px solid var(--border-on-dark);
    padding: 1.5rem 0 0; gap: 1.5rem; }
  .nav__menu .nav__social { color: var(--on-dark); }
  .nav__menu .nav__social .icon { width: 26px; height: 26px; }
  /* keep hamburger dark bars visible when open over the panel */
  .nav.is-open .nav__toggle-bar::before,
  .nav.is-open .nav__toggle-bar::after { background: var(--on-dark); }
}

body.nav-locked { overflow: hidden; position: fixed; width: 100%; }

/* ============================================================
   HERO — editorial portrait, with a seamless handoff to olive
   ============================================================ */
.hero {
  position: relative; min-height: 100svh; min-height: 100dvh;
  display: grid; align-items: center;
  padding: clamp(7rem, 13vh, 9rem) var(--gutter) clamp(6rem, 13vh, 8rem);
  isolation: isolate; overflow: hidden; background: var(--primary-deep);
}
.hero__media { position: absolute; inset: 0; z-index: -2; background: var(--primary-deep); }
.hero__media img {
  --hero-media-top: clamp(4.75rem, 5.5vw, 5.75rem);
  --hero-media-bottom: clamp(4.5rem, 8vh, 5.5rem);
  position: absolute; inset: var(--hero-media-top) 1.5rem var(--hero-media-bottom) auto;
  width: min(53vw, 1160px); height: calc(100% - var(--hero-media-top) - var(--hero-media-bottom)); object-fit: cover;
  object-position: 50% 28%; border-radius: clamp(14px, 1.4vw, 24px);
  box-shadow: 0 22px 48px oklch(0.10 0.025 70 / 0.38);
}
.hero__scrim { position: absolute; inset: 0; z-index: -1; background: transparent; }
.hero__inner {
  width: min(44vw, 42rem); color: var(--on-dark);
  position: relative; z-index: 1;
}
.hero__eyebrow {
  font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase;
  font-size: var(--step--1); color: var(--sage); margin-bottom: 1.2rem;
  text-shadow: 0 1px 14px oklch(0.15 0.02 55 / 0.7);
}
.hero__title {
  font-size: var(--hero); color: var(--on-dark); letter-spacing: -0.005em;
  line-height: 1.02; text-shadow: 0 2px 30px oklch(0.15 0.02 55 / 0.4);
}
.hero__bio {
  margin-top: 1.4rem; max-width: 42ch; font-size: var(--step-1);
  color: var(--on-dark-soft); line-height: 1.55; text-wrap: pretty;
  text-shadow: 0 1px 18px oklch(0.15 0.02 55 / 0.6);
}
.hero__actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.9rem; }
.hero__field-notes {
  display: none; margin-top: clamp(2rem, 4.5vh, 3rem);
  width: min(100%, 36rem); padding-top: 0.85rem;
  border-top: 1px solid var(--border-on-dark);
}
.hero__field-label {
  color: var(--sage); font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
}
.hero__threads {
  list-style: none; display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(0.8rem, 2vw, 1.5rem); margin-top: 0.8rem;
}
.hero__threads li { display: grid; gap: 0.1rem; }
.hero__threads strong {
  color: var(--on-dark); font-size: 0.84rem; font-weight: 600;
  letter-spacing: 0.015em; line-height: 1.35;
}
.hero__threads small { color: var(--on-dark-soft); font-size: 0.72rem; line-height: 1.35; }

.hero__scroll {
  position: absolute; left: var(--gutter); bottom: 1.4rem; z-index: 2;
  display: inline-flex; align-items: center; gap: 0.75rem;
  color: var(--on-dark-soft); font-size: var(--step--1); font-weight: 600;
  letter-spacing: 0.04em;
  transition: color var(--dur-fast) ease, gap var(--dur-fast) var(--ease-out-quart);
}
.hero__scroll:hover { color: var(--on-dark); gap: 1rem; }
.hero__scroll-icon { width: 1.1rem; height: 1.1rem; transform: rotate(90deg); }
@media (max-width: 1099px) {
  .hero { align-items: end; padding-bottom: clamp(2.5rem, 5vh, 3.25rem); }
  .hero__media img {
    inset: 4.5rem 0 0; width: 100%; height: calc(100% - 4.5rem); object-position: 50% 12%;
    border-radius: 0; box-shadow: none;
  }
  .hero__scrim {
    background: linear-gradient(to bottom,
      oklch(0.20 0.03 70 / 0.06) 0%,
      oklch(0.20 0.03 70 / 0.10) 42%,
      oklch(0.20 0.03 70 / 0.52) 68%,
      oklch(0.20 0.03 70 / 0.72) 100%);
  }
  .hero__inner { width: 100%; max-width: 42rem; }
  .hero__scroll { left: 50%; translate: -50% 0; bottom: 0.5rem; }
}
/* Short phones: tighten the stack so the title still clears the face */
@media (max-width: 1099px) and (max-height: 720px) {
  .hero { padding-bottom: 2.25rem; }
  .hero__bio { margin-top: 1rem; }
  .hero__actions { margin-top: 1.4rem; }
}

/* ============================================================
   ABOUT — committed deep-olive drenched section
   ============================================================ */
.about {
  background: var(--primary-deep); color: var(--on-dark);
  position: relative; overflow: hidden; padding-bottom: 0;
}
.about__grid {
  display: grid; gap: clamp(2rem, 5vw, 4.5rem); align-items: center;
  grid-template-columns: 1.05fr 0.95fr;
}
.about__body .section__kicker { color: var(--sage); }
.about__body .section__kicker::before { background: var(--accent); }
.about__title { color: var(--on-dark); font-size: var(--step-3); }
.about__text { margin-top: 1.3rem; display: flex; flex-direction: column; gap: 1rem;
  color: var(--on-dark-soft); font-size: var(--step-1); max-width: 54ch; line-height: 1.7; }
.about__stats { margin-top: 2.2rem; display: flex; flex-wrap: wrap; gap: clamp(1.4rem, 4vw, 3rem); }
.about__stat .num { font-family: var(--font-display); font-size: var(--step-3); color: var(--sage); display: block; line-height: 1; }
.about__stat .label { font-size: var(--step--1); color: var(--on-dark-soft); letter-spacing: 0.04em; margin-top: 0.4rem; }
.about__actions { margin-top: 2.2rem; display: flex; flex-wrap: wrap; gap: 0.9rem; }

.about__media { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto;
  gap: clamp(0.6rem, 1.4vw, 1rem); }
.about__media figure { overflow: hidden; border-radius: var(--radius-md); }
.about__media img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 5; }
.about__media .wide { grid-column: 1 / -1; }
.about__media .wide img { aspect-ratio: 16 / 10; }

.about__story {
  max-width: 74ch; margin: clamp(3rem, 6vw, 5rem) auto 0;
  color: var(--on-dark-soft);
  font-size: var(--step-0); line-height: 1.75;
}
.about__story p + p { margin-top: 1.15rem; }
.about__story strong { color: var(--on-dark); font-weight: 600; }
.about__closer {
  min-height: clamp(12rem, 24vh, 18rem);
  margin: 0; display: grid; place-items: center; text-align: center;
  font-family: var(--font-display); font-size: var(--step-2);
  color: var(--sage); letter-spacing: -0.005em;
}

@media (max-width: 1100px) {
  .about__grid { grid-template-columns: 1fr; }
  .about__body { max-width: 760px; margin-inline: auto; }
  .about__media {
    width: min(100%, 900px); max-width: none; margin-inline: auto;
    grid-template-columns: repeat(3, 1fr); grid-template-rows: 1fr;
  }
  .about__media .wide { grid-column: auto; }
  .about__media .wide img { aspect-ratio: 4 / 5; }
}
@media (max-width: 600px) {
  .about__media { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; }
  .about__media .wide { grid-column: 1 / -1; }
  .about__media .wide img { aspect-ratio: 16 / 10; }
}

/* ============================================================
   GALLERY — masonry (CSS columns) + lightbox
   ============================================================ */
.gallery__masonry {
  columns: 3 260px; column-gap: clamp(0.7rem, 1.4vw, 1.1rem);
  max-width: 1280px; margin-inline: auto;
}
.gallery__item {
  break-inside: avoid; margin-bottom: clamp(0.7rem, 1.4vw, 1.1rem);
  width: 100%; padding: 0; border-radius: var(--radius-md); overflow: hidden;
  position: relative; display: block; background: var(--bg-sunk);
}
.gallery__item img { width: 100%; height: auto; }
.gallery__item::after {
  content: ""; position: absolute; inset: 0; background: oklch(0.30 0.05 128 / 0);
  transition: background var(--dur) ease;
}
.gallery__item:hover::after { background: oklch(0.30 0.05 128 / 0.18); }
.gallery__zoom {
  position: absolute; right: 0.7rem; bottom: 0.7rem; width: 40px; height: 40px;
  display: grid; place-items: center; border-radius: var(--radius-pill);
  background: oklch(0.98 0.01 92 / 0.85); color: var(--ink);
  opacity: 0; translate: 0 6px; transition: opacity var(--dur) ease, translate var(--dur) var(--ease-out-expo);
  z-index: 3;
}
.gallery__item:hover .gallery__zoom, .gallery__item:focus-visible .gallery__zoom { opacity: 1; translate: 0 0; }
.gallery__zoom .icon { width: 20px; height: 20px; }
.gallery__more { margin-top: clamp(2rem, 4vw, 3rem); text-align: center; }
.portfolio-page main { background: var(--bg-sunk); }
.portfolio-page .portfolio-stage { padding-bottom: var(--section-pad); }
.portfolio-page .portfolio-hero {
  position: relative; min-height: 100svh; overflow: hidden;
  display: grid; place-items: center; isolation: isolate;
  padding: clamp(7rem, 10vh, 8rem) var(--gutter) clamp(6rem, 10vh, 8rem);
}
.portfolio-mosaic {
  --mosaic-line: 6px; --mosaic-border: 3px;
  position: absolute; z-index: -2; inset: 0;
  display: grid; grid-template-columns: repeat(16, minmax(0, 1fr));
  grid-template-rows: repeat(8, minmax(0, 1fr));
  gap: 0; background: white;
  pointer-events: none;
}
.portfolio-mosaic__tile {
  min-width: 0; min-height: 0; overflow: hidden;
  border: var(--mosaic-border) solid white;
  box-sizing: border-box;
}
.portfolio-mosaic__tile img {
  width: 100%; height: 100%; object-fit: cover;
  filter: brightness(0.58) saturate(0.88);
  transform: scale(var(--crop-zoom, 1));
  transform-origin: var(--crop-x, 50%) var(--crop-y, 50%);
}
.portfolio-mosaic[data-layout="custom"] { display: block; }
.portfolio-mosaic[data-layout="custom"] .portfolio-mosaic__tile { position: absolute; }
.portfolio-mosaic[data-layout="focus"] {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: repeat(8, minmax(0, 1fr));
}
.portfolio-mosaic[data-layout="focus"] .portfolio-mosaic__tile:nth-child(1) { grid-column: 4 / 10; grid-row: 2 / 7; }
.portfolio-mosaic[data-layout="focus"] .portfolio-mosaic__tile:nth-child(2) { grid-column: 1 / 4; grid-row: 1 / 2; }
.portfolio-mosaic[data-layout="focus"] .portfolio-mosaic__tile:nth-child(3) { grid-column: 4 / 7; grid-row: 1 / 2; }
.portfolio-mosaic[data-layout="focus"] .portfolio-mosaic__tile:nth-child(4) { grid-column: 7 / 10; grid-row: 1 / 2; }
.portfolio-mosaic[data-layout="focus"] .portfolio-mosaic__tile:nth-child(5) { grid-column: 10 / 13; grid-row: 1 / 2; }
.portfolio-mosaic[data-layout="focus"] .portfolio-mosaic__tile:nth-child(6) { grid-column: 1 / 4; grid-row: 2 / 4; }
.portfolio-mosaic[data-layout="focus"] .portfolio-mosaic__tile:nth-child(7) { grid-column: 1 / 4; grid-row: 4 / 7; }
.portfolio-mosaic[data-layout="focus"] .portfolio-mosaic__tile:nth-child(8) { grid-column: 10 / 13; grid-row: 2 / 4; }
.portfolio-mosaic[data-layout="focus"] .portfolio-mosaic__tile:nth-child(9) { grid-column: 10 / 13; grid-row: 4 / 7; }
.portfolio-mosaic[data-layout="focus"] .portfolio-mosaic__tile:nth-child(10) { grid-column: 1 / 5; grid-row: 7 / 9; }
.portfolio-mosaic[data-layout="focus"] .portfolio-mosaic__tile:nth-child(11) { grid-column: 5 / 9; grid-row: 7 / 9; }
.portfolio-mosaic[data-layout="focus"] .portfolio-mosaic__tile:nth-child(12) { grid-column: 9 / 13; grid-row: 7 / 9; }
.portfolio-mosaic[data-layout="balanced"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
}
.portfolio-mosaic[data-layout="balanced"] .portfolio-mosaic__tile {
  grid-column: auto; grid-row: auto;
}
.portfolio-mosaic[data-layout="editorial"] .portfolio-mosaic__tile:nth-child(1) { grid-column: 1 / 5; grid-row: 1 / 5; }
.portfolio-mosaic[data-layout="editorial"] .portfolio-mosaic__tile:nth-child(2) { grid-column: 5 / 9; grid-row: 1 / 3; }
.portfolio-mosaic[data-layout="editorial"] .portfolio-mosaic__tile:nth-child(3) { grid-column: 5 / 7; grid-row: 3 / 6; }
.portfolio-mosaic[data-layout="editorial"] .portfolio-mosaic__tile:nth-child(4) { grid-column: 7 / 9; grid-row: 3 / 6; }
.portfolio-mosaic[data-layout="editorial"] .portfolio-mosaic__tile:nth-child(5) { grid-column: 9 / 13; grid-row: 1 / 5; }
.portfolio-mosaic[data-layout="editorial"] .portfolio-mosaic__tile:nth-child(6) { grid-column: 13 / 17; grid-row: 1 / 4; }
.portfolio-mosaic[data-layout="editorial"] .portfolio-mosaic__tile:nth-child(7) { grid-column: 1 / 3; grid-row: 5 / 9; }
.portfolio-mosaic[data-layout="editorial"] .portfolio-mosaic__tile:nth-child(8) { grid-column: 3 / 5; grid-row: 5 / 9; }
.portfolio-mosaic[data-layout="editorial"] .portfolio-mosaic__tile:nth-child(9) { grid-column: 5 / 9; grid-row: 6 / 9; }
.portfolio-mosaic[data-layout="editorial"] .portfolio-mosaic__tile:nth-child(10) { grid-column: 9 / 11; grid-row: 5 / 9; }
.portfolio-mosaic[data-layout="editorial"] .portfolio-mosaic__tile:nth-child(11) { grid-column: 11 / 13; grid-row: 5 / 9; }
.portfolio-mosaic[data-layout="editorial"] .portfolio-mosaic__tile:nth-child(12) { grid-column: 13 / 17; grid-row: 4 / 9; }
.portfolio-page .page-head {
  position: relative; z-index: 1; width: min(780px, 80vw); padding: 0;
  text-align: center; color: var(--on-dark);
  background: transparent; border: 0; border-radius: 0; box-shadow: none;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  text-shadow:
    0 3px 4px rgb(8 10 6 / var(--hero-shadow-strength, 0.9)),
    0 14px 34px rgb(8 10 6 / var(--hero-shadow-strength, 0.9));
}
.portfolio-page .page-head::before {
  content: ""; position: absolute; z-index: -1; inset: -3rem -4rem;
  background: radial-gradient(ellipse at center,
    rgb(7 14 6 / var(--hero-shadow-strength, 0.9)) 0%,
    rgb(7 14 6 / var(--hero-shadow-strength, 0.9)) 46%,
    rgb(7 14 6 / 0.2) 68%,
    transparent 82%);
  filter: blur(12px); pointer-events: none;
}
.portfolio-page .page-head .container { max-width: 860px; }
.portfolio-page .page-head .section__kicker { justify-content: center; color: var(--on-dark); }
.portfolio-page .page-head .section__kicker::before { display: none; }
.portfolio-page .page-head .section__title { color: var(--on-dark); }
.portfolio-page .page-head .section__lead { margin-inline: auto; color: var(--on-dark); }
.portfolio__stamp {
  display: flex; justify-content: center; gap: 0.8rem; margin-top: 1.4rem;
  color: var(--on-dark-soft); font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.portfolio__stamp span + span::before { content: "•"; margin-right: 0.8rem; color: var(--accent); }
.portfolio-hero__cta {
  position: absolute; z-index: 1; left: 50%; bottom: 1.5rem; translate: -50% 0;
  display: inline-flex; align-items: center; gap: 0.65rem;
  padding: 0.78rem 1.2rem; border-radius: var(--radius-pill);
  background: var(--on-dark); color: var(--primary-deep); box-shadow: var(--shadow-md);
  font-size: var(--step--1); font-weight: 700; letter-spacing: 0.02em;
  transition: translate var(--dur-fast) var(--ease-out-quart), background var(--dur-fast) ease;
}
.portfolio-hero__cta:hover { translate: -50% 3px; background: white; }
.portfolio-gallery { padding-top: clamp(3rem, 6vw, 6rem); }
.portfolio-gallery { scroll-margin-top: 5rem; }
.portfolio-page .gallery__masonry {
  display: block; columns: 3; column-gap: clamp(0.9rem, 1.8vw, 1.5rem);
  max-width: 1500px; margin: 0 auto;
}
.portfolio-page .gallery__item {
  display: block; width: 100%; margin: 0 0 clamp(0.9rem, 1.8vw, 1.5rem);
  break-inside: avoid; aspect-ratio: auto;
  box-shadow: 0 14px 35px oklch(0.22 0.025 62 / 0.12);
}
.portfolio-page .gallery__item img { width: 100%; height: auto; object-fit: contain; }
@media (max-width: 1100px) {
  .portfolio-page .portfolio-hero { min-height: 52rem; }
  .portfolio-page .page-head { width: min(680px, 82vw); }
}
@media (max-width: 860px) {
  .portfolio-page .gallery__masonry { columns: 2; margin-top: 0; }
}
@media (max-width: 600px) {
  .portfolio-page .portfolio-hero { min-height: 44rem; padding-inline: 1rem; }
  .portfolio-page .page-head { width: calc(100% - 1.5rem); }
  .portfolio-page .page-head .section__title { font-size: clamp(2.2rem, 10vw, 2.8rem) !important; }
  .portfolio__stamp { align-items: center; flex-direction: column; gap: 0.15rem; }
  .portfolio__stamp span + span::before { display: none; }
  .portfolio-page .gallery__masonry { columns: 1; margin-top: 0; }
  .portfolio-hero__cta { bottom: 1rem; }
}

/* Lightbox (native <dialog>) */
.lightbox { border: none; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh;
  width: 100%; height: 100%; margin: 0; color: var(--on-dark); }
.lightbox::backdrop { background: oklch(0.15 0.015 55 / 0.92); backdrop-filter: blur(6px); }
.lightbox[open] { display: block; }
.lightbox__stage {
  display: grid; grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto auto; place-items: center;
  gap: 0.65rem; padding: 1rem clamp(4rem, 8vw, 7rem) 0.75rem;
  width: 100%; height: 100%; overflow: hidden;
}
.lightbox__img {
  min-height: 0; max-width: min(92vw, 1200px); max-height: calc(100dvh - 10rem);
  width: auto; height: auto;
  border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.lightbox__meta {
  width: min(100%, 920px); min-height: 1.8rem;
  display: flex; align-items: baseline; justify-content: center; gap: 1rem;
}
.lightbox__caption { text-align: center; color: var(--on-dark-soft); font-size: var(--step--1); }
.lightbox__position {
  flex: none; color: oklch(0.72 0.015 90); font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
}
.lightbox__filmstrip {
  display: flex; gap: 0.45rem; align-items: center; justify-content: safe center; width: min(100%, 760px);
  min-height: 66px; padding: 0.4rem; overflow-x: auto; overscroll-behavior-inline: contain;
  scrollbar-width: none; scroll-snap-type: x proximity;
  -webkit-mask-image: linear-gradient(90deg, transparent, black 1rem, black calc(100% - 1rem), transparent);
  mask-image: linear-gradient(90deg, transparent, black 1rem, black calc(100% - 1rem), transparent);
}
.lightbox__filmstrip::-webkit-scrollbar { display: none; }
.lightbox__thumb {
  flex: 0 0 54px; width: 54px; height: 54px; padding: 0;
  border-radius: 7px; overflow: hidden; opacity: 0.52;
  scroll-snap-align: center;
  transition: opacity var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.lightbox__thumb img { width: 100%; height: 100%; object-fit: cover; }
.lightbox__thumb:hover { opacity: 0.82; }
.lightbox__thumb.is-active {
  opacity: 1;
  box-shadow: 0 0 0 2px var(--on-dark), 0 4px 14px oklch(0.05 0 0 / 0.45);
}
.lightbox__btn {
  position: fixed; top: 50%; translate: 0 -50%; width: 54px; height: 54px;
  display: grid; place-items: center; border-radius: var(--radius-pill);
  background: oklch(1 0 0 / 0.12); color: var(--on-dark);
  transition: background var(--dur-fast) ease, transform var(--dur-fast) ease;
}
.lightbox__btn:hover { background: oklch(1 0 0 / 0.24); }
.lightbox__btn .icon { width: 26px; height: 26px; }
.lightbox__prev { left: clamp(0.6rem, 2vw, 1.5rem); }
.lightbox__next { right: clamp(0.6rem, 2vw, 1.5rem); }
.lightbox__close { position: fixed; top: clamp(0.8rem, 2vw, 1.4rem); right: clamp(0.8rem, 2vw, 1.4rem);
  translate: 0 0; width: 48px; height: 48px; }
@media (max-width: 600px) {
  .lightbox__stage { padding: 3.5rem 0.65rem 0.55rem; gap: 0.45rem; }
  .lightbox__img { max-width: 100%; max-height: calc(100dvh - 8.5rem); }
  .lightbox__btn { width: 44px; height: 44px; background: oklch(0.08 0.01 55 / 0.42); }
  .lightbox__prev { left: 0.4rem; }
  .lightbox__next { right: 0.4rem; }
  .lightbox__meta { padding-inline: 0.5rem; }
  .lightbox__caption { max-width: 70vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .lightbox__filmstrip { min-height: 58px; }
  .lightbox__thumb { flex-basis: 48px; width: 48px; height: 48px; }
}

/* ============================================================
   PODCAST
   ============================================================ */
.podcast__grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.podcast__art {
  position: relative; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 1;
  max-width: 420px; box-shadow: var(--shadow-lg);
}
.podcast__art img { width: 100%; height: 100%; object-fit: cover; }
.podcast__art .badge {
  position: absolute; left: 1rem; top: 1rem; display: inline-flex; align-items: center; gap: 0.45rem;
  background: oklch(0.18 0.02 55 / 0.6); color: var(--on-dark); padding: 0.4rem 0.8rem;
  border-radius: var(--radius-pill); font-size: var(--step--1); font-weight: 600; backdrop-filter: blur(6px);
}
.podcast__player { border: 0; width: 100%; border-radius: var(--radius-md); }
.podcast__subs { margin-top: 1.6rem; display: flex; flex-wrap: wrap; gap: 0.7rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1.05rem;
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-pill);
  font-weight: 600; font-size: var(--step--1); color: var(--ink);
  transition: border-color var(--dur-fast) ease, color var(--dur-fast) ease, background var(--dur-fast) ease;
}
.chip:hover { border-color: var(--primary); color: var(--primary); background: oklch(0.74 0.07 128 / 0.12); }
.chip .icon { width: 18px; height: 18px; }
@media (max-width: 780px) { .podcast__grid { grid-template-columns: 1fr; } .podcast__art { max-width: 340px; } }

/* ============================================================
   CONTACT + FOOTER
   ============================================================ */
.contact { text-align: center; }
.contact__inner { max-width: min(58rem, 100%); margin-inline: auto; }
.contact__title { font-size: var(--step-4); }
.contact__lead { margin-top: 1rem; color: var(--ink-soft); font-size: var(--step-1); }
.contact__email {
  display: block; width: max-content; margin: 1.8rem auto 0; font-family: var(--font-display);
  font-size: clamp(1rem, 4.4vw, var(--step-2)); color: var(--primary); border-bottom: 2px solid var(--sage);
  padding-bottom: 0.2rem; transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease;
  max-width: 100%; white-space: nowrap;
}
.contact__email:hover { color: var(--primary-hover); border-color: var(--accent); }
.contact__socials { margin-top: 2rem; display: flex; justify-content: center; gap: 1rem; }
.contact__socials a {
  width: 50px; height: 50px; display: grid; place-items: center; border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-strong); color: var(--ink-soft);
  transition: all var(--dur-fast) var(--ease-out-quart);
}
.contact__socials a:hover { color: var(--on-dark); background: var(--primary); border-color: var(--primary); transform: translateY(-3px); }
.contact__socials .icon { width: 22px; height: 22px; }

.footer { background: var(--footer-bg); color: var(--on-dark-soft); padding-block: clamp(2.5rem, 5vw, 3.5rem); }
.footer__inner { display: flex; flex-wrap: wrap; gap: 1.5rem 2rem; align-items: center; justify-content: space-between; }
.footer__wordmark { font-family: var(--font-display); font-size: 1.4rem; color: var(--on-dark); }
.footer__wordmark span { color: var(--sage); }
.footer__nav { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; list-style: none; }
.footer__nav a { color: var(--on-dark-soft); font-size: var(--step-0); }
.footer__nav a:hover { color: var(--on-dark); }
.footer__meta { width: 100%; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border-on-dark);
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: space-between;
  font-size: var(--step--1); color: var(--on-dark-soft); }
.footer__meta a { color: var(--on-dark-soft); text-decoration: underline; text-underline-offset: 3px; }

/* ============================================================
   BLOG
   ============================================================ */
.page-head { padding-top: clamp(7rem, 12vh, 10rem); padding-bottom: clamp(2rem, 5vw, 3.5rem); background: var(--bg-sunk); }
.blog__list { display: grid; gap: clamp(1.2rem, 2.5vw, 2rem); grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.post-card { display: flex; flex-direction: column; border-radius: var(--radius-lg); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); transition: box-shadow var(--dur) ease; }
.post-card:hover { box-shadow: var(--shadow-md); }
.post-card__media { aspect-ratio: 16 / 10; overflow: hidden; }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; }
.post-card__body { padding: 1.3rem 1.4rem 1.5rem; display: flex; flex-direction: column; gap: 0.6rem; flex: 1; }
.post-card__meta { font-size: var(--step--1); color: var(--muted); letter-spacing: 0.02em; text-transform: uppercase; }
.post-card__title { font-size: var(--step-2); }
.post-card__excerpt { color: var(--ink-soft); }
.post-card__link { position: absolute; inset: 0; }
.post-card { position: relative; }
.post-card__more { margin-top: auto; padding-top: 0.5rem; font-weight: 600; color: var(--primary); display: inline-flex; align-items: center; gap: 0.4rem; }

.article { padding-top: clamp(6.5rem, 11vh, 9rem); }
.article__header { max-width: 60ch; margin-inline: auto; text-align: center; margin-bottom: clamp(2rem, 5vw, 3rem); }
.article__meta { color: var(--muted); font-size: var(--step--1); letter-spacing: 0.03em; text-transform: uppercase; margin-bottom: 1rem; }
.article__title { font-size: var(--step-4); }
.article__hero { max-width: 1000px; margin: 0 auto clamp(2rem, 5vw, 3.5rem); border-radius: var(--radius-lg); overflow: hidden; }
.article__hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.prose { max-width: var(--measure); margin-inline: auto; font-size: var(--step-1); line-height: 1.75; color: var(--ink); }
.prose > * + * { margin-top: 1.4rem; }
.prose h2 { font-size: var(--step-2); margin-top: 2.6rem; }
.prose h3 { font-size: var(--step-1); margin-top: 2rem; }
.prose blockquote { border-left: 3px solid var(--sage); padding-left: 1.2rem; font-family: var(--font-display);
  font-size: var(--step-2); color: var(--primary-deep); line-height: 1.3; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose img { border-radius: var(--radius-md); margin-block: 2rem; }
.article__back { display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 3rem; font-weight: 600; }

/* ---------- Reduced motion global ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
