/* Portfolio v2 design system: warm-on-dark, bold type, flat surfaces. */
/*
  File guide for beginners:
  - `:root` tokens are global design decisions (type, spacing, color).
  - Boot/intro classes (`.boot-*`, `.intro-*`) support first-load hero animation safety.
  - Component sections below style hero, work list, about, modal, and case-study layouts.
*/

:root {
  /* Typography: shared family with variable axes. */
  --font-sans: "Fraunces", "Iowan Old Style", "Times New Roman", Georgia, serif;
  --font-display: "Archivo", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;

  /* Typography defaults */
  --wdth-normal: 100;
  --wdth-display: 125;
  --wght-regular: 450;
  --wght-black: 900;

  /* Layout scale */
  --max-w: 1400px;
  --pad-x: 96px;

  /* Spacing scale */
  --s-1: 8px;
  --s-2: 12px;
  --s-3: 16px;
  --s-4: 24px;
  --s-5: 32px;
  --s-6: 48px;
  --s-7: 96px;
  --s-8: 140px;
  --case-gap-after-bleed-heading: 64px;
  --case-gap-after-bleed-heading-mobile: 52px;

  /* Color tokens */
  --c-bg: #07070a;
  --c-text: #fffce1;
  --c-muted: rgba(255, 252, 225, 0.78);
  --c-accent: #ffb43b;
  --radius: 16px;
  --boot-failsafe-delay: 3.2s;
}

/* Base: predictable box model */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

/* Base: strong underline links */
a {
  color: var(--c-text);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

/* Cards: remove link underlines in work items */
.work-link,
.work-link * {
  text-decoration: none !important;
}

a:hover {
  color: var(--c-accent);
}

/* Base page */
body {
  margin: 0;
  min-height: 100vh;
  color: var(--c-text);
  background-color: var(--c-bg);

  overflow-x: hidden;
  font-family: var(--font-sans);
  font-variation-settings: "opsz" 36, "wght" var(--wght-regular);
  line-height: 1.45;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 10000;
  padding: 10px 14px;
  background: var(--c-text);
  color: #07070a;
  text-decoration: none;
  border-radius: 8px;
  font-family: var(--font-display);
  font-variation-settings: "wdth" 110, "wght" 700;
  letter-spacing: 0.04em;
}

.skip-link:focus {
  top: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* -------------------------------------------------------------------------- */
/* Boot / intro safety layer                                                   */
/* -------------------------------------------------------------------------- */
body.intro-scroll-lock {
  overflow: hidden;
}

body.booting-intro .nickname,
body.booting-intro .tagline,
body.booting-intro .rule {
  /* Hide hero copy while JS sets deterministic start states for intro animation. */
  opacity: 0 !important;
}

.boot-black {
  position: fixed;
  inset: 0;
  z-index: 5200;
  background: #000;
  pointer-events: none;
  /* Fail-safe: if JS never runs, don't leave users on a permanent black screen. */
  animation: boot-black-failsafe 0s linear var(--boot-failsafe-delay) forwards;
}

.cursor {
  display: none;
}

/* -------------------------------------------------------------------------- */
/* Custom cursor (enhancement only; pointer-fine devices)                      */
/* -------------------------------------------------------------------------- */
@media (pointer: fine) {
  body {
    cursor: none;
  }

  body.cursor-suppressed {
    cursor: auto;
  }

  .cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 180, 59, 0.75);
    border: 2px solid #000;
    mix-blend-mode: screen;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(1);
    transition: transform 140ms ease, background-color 140ms ease, opacity 200ms ease;
    opacity: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    font-family: var(--font-display);
    font-variation-settings: "wdth" var(--wdth-display), "wght" var(--wght-black);
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #07070a;
    display: grid;
  }

  .cursor-text {
    font-family: var(--font-display);
    font-variation-settings: "wdth" 100, "wght" var(--wght-black);
    font-weight: 900;
    letter-spacing: 0.03em;
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 120ms ease;
  }

  .cursor.is-active {
    opacity: 1;
  }

  body.cursor-suppressed .cursor {
    opacity: 0 !important;
    transform: translate(-50%, -50%) scale(0.9) !important;
  }

  .cursor.is-link {
    background: rgba(255, 252, 225, 0.88);
    mix-blend-mode: normal;
    border-color: rgba(7, 7, 10, 0.9);
    transform: translate(-50%, -50%) scale(1.08);
    opacity: 0.95;
  }

  /* GO puck expands only on work-card hover so it reads like a project affordance. */
  .cursor.is-go {
    transform: translate(-50%, -50%) scale(1.5);
  }

  .cursor.is-go .cursor-text {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cursor,
  .cursor * {
    transition: none !important;
  }
}

.page {
  max-width: var(--max-w);
  margin-left: auto;
  margin-right: auto;
  /*
    Non-blocking startup polish:
    Keep the page visible immediately, then apply a short settle animation so first paint
    feels intentional on mobile without delaying content.
  */
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: no-preference) {
  .page:not(.boot-hidden) {
    animation: page-content-ready-fade 460ms cubic-bezier(0.22, 1, 0.36, 1) 40ms both;
  }
}

.page.boot-hidden {
  opacity: 0;
  visibility: hidden;
  /* Fail-safe reveal when runtime scripts fail before clearing boot-hidden. */
  animation: page-boot-failsafe 0s linear var(--boot-failsafe-delay) forwards;
}

@keyframes boot-black-failsafe {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes page-boot-failsafe {
  to {
    opacity: 1;
    visibility: visible;
  }
}

@keyframes page-content-ready-fade {
  from {
    opacity: 0.84;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hero-fallback-rise {
  from {
    transform: translateY(16px);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes hero-fallback-rule {
  from {
    width: 0;
    opacity: 0;
  }
  to {
    width: 72px;
    opacity: 1;
  }
}

body.css-hero-fallback .name-line,
body.css-hero-fallback .nickname,
body.css-hero-fallback .tagline {
  will-change: transform, opacity, filter;
  animation: hero-fallback-rise 0.64s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

body.css-hero-fallback .name-line:nth-of-type(1) {
  animation-delay: 0.06s;
}

body.css-hero-fallback .name-line:nth-of-type(2) {
  animation-delay: 0.16s;
}

body.css-hero-fallback .nickname {
  animation-delay: 0.36s;
}

body.css-hero-fallback .tagline {
  animation-delay: 0.52s;
}

body.css-hero-fallback .rule {
  animation: hero-fallback-rule 0.62s cubic-bezier(0.22, 1, 0.36, 1) 0.68s forwards;
}

@keyframes mobile-hero-rise {
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0px);
  }
}

@keyframes mobile-hero-rule {
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

.container {
  max-width: var(--max-w);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

::selection { background: rgba(255, 184, 72, 0.22); }

a:focus-visible {
  outline: 3px solid var(--c-accent);
  outline-offset: 3px;
}

/* Hero */
.site-header {
  position: relative;
  overflow: hidden;
  margin-bottom: var(--s-8);
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: clamp(64px, 10vh, 140px);
  padding-bottom: clamp(64px, 10vh, 140px);
}

.site-header .container {
  position: relative;
  z-index: 2;
  width: 100%;
}

.rule {
  height: 6px;
  width: 72px;
  background: var(--c-text);
  margin-top: var(--s-3);
}

.name {
  margin: 0 0 clamp(34px, 4.6vh, 56px) 0;
  text-transform: uppercase;
  line-height: 0.9;

  /* Desktop hero keeps perspective on the wrapper so character rolls feel like one object. */
  font-family: var(--font-display);
  font-size: clamp(5.0rem, 13vw, 10.5rem);
  font-weight: 900;
  font-stretch: 125%;
  font-variation-settings: "wdth" 125, "wght" 900;
  letter-spacing: -0.085em;
  perspective: 1200px;
  transform-style: preserve-3d;
}

.name-line {
  display: block;
  position: relative;
  white-space: nowrap;
  transform-style: preserve-3d;
  will-change: transform;
}

.name-char {
  display: inline-block;
  backface-visibility: hidden;
  transform-style: preserve-3d;
  will-change: transform, opacity, filter;
}

.name-char--space {
  min-width: 0.28em;
}

.nickname {
  display: block;
  font-weight: 700;
  font-size: 0.12em;
  letter-spacing: 0.18em;
  margin-top: 0.18em;
  margin-left: 0;
  line-height: 1;
  opacity: 0.9;
  white-space: nowrap;
}

.tagline {
  margin-top: 0;
  max-width: 56ch;
  color: var(--c-muted);
  font-size: 1.25rem;
  line-height: 1.65;
}

.tagline-group {
  /* Inline by default so desktop reads like one sentence; mobile overrides to stacked beats. */
  display: inline;
  will-change: transform, opacity, filter;
}

/* -------------------------------------------------------------------------- */
/* Homepage content sections                                                    */
/* -------------------------------------------------------------------------- */
/* Selected work */
.work-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--s-4);
}

.work-link {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;

  color: var(--c-text);
  border-radius: var(--radius);
  background: transparent;
  overflow: hidden;
  transition: color 180ms ease;
}
.work-copy {
  /* Copy panel should feel slightly more alive on hover without turning into a button. */
  padding: var(--s-4);
  background: rgba(255, 252, 225, 0.18);
  transition: background-color 220ms ease, box-shadow 220ms ease;
}


.work-link:focus-visible {
  outline: 3px solid var(--c-accent);
  outline-offset: 6px;
}

.work-link:hover {
  /* Hover should feel editorial and confident, not like a button pile of effects. */
  color: var(--c-text);
}

.work-link:is(:hover, :focus-visible) .work-copy {
  background: rgba(255, 252, 225, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 252, 225, 0.07);
}

.work-copy h3 {
  margin-bottom: var(--s-3);
  /* Lock the heading color so card hover doesn't inherit the global link accent flash. */
  color: var(--c-text);
  font-family: var(--font-display);
  font-variation-settings: "wdth" 110, "wght" 820;
  font-size: clamp(1.95rem, 2.4vw, 2.35rem);
  line-height: 1.07;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.work-copy p {
  margin: 0;
  font-family: var(--font-sans);
  font-variation-settings: "opsz" 36, "wght" 390;
  color: rgba(255, 252, 225, 0.84);
  max-width: 38ch;
  line-height: 1.5;
  font-size: clamp(1.05rem, 1.2vw, 1.25rem);
  transition: color 220ms ease;
}

.work-link:is(:hover, :focus-visible) .work-copy p {
  color: rgba(255, 252, 225, 0.92);
}

.work-media {
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 0;
  overflow: hidden;
}

.work-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1), filter 300ms ease;
  transform: scale(1);
  filter: saturate(0.98) contrast(0.98);
}

.work-link:is(:hover, :focus-visible) .work-media img {
  transform: scale(1.045);
  filter: saturate(1.04) contrast(1.03);
}

/* Homepage section rhythm only (avoid affecting case-study sections). */
main > section { margin-bottom: var(--s-8); }

main > section:first-child {
  padding-top: clamp(18px, 3vh, 44px);
}

main > section + section {
  padding-top: var(--s-7);
}


h2 {
  font-family: var(--font-display);
  margin: 0 0 var(--s-3) 0;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 900;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
}

h2::after {
  content: "";
  display: inline-block;
  height: 3px;
  width: clamp(120px, 18vw, 220px);
  background: var(--c-text);
  opacity: 0.7;
  transform-origin: left center;
  transform: scaleX(var(--h2-rule-scale, 1));
}


h3 {
  font-family: var(--font-display);
  margin: 0 0 var(--s-3) 0;
  font-size: 1.65rem;
  line-height: 1.15;
  font-weight: 850;
  letter-spacing: -0.01em;
}

h1 {
  font-family: var(--font-display);
}

p { margin: 0 0 var(--s-2) 0; }

/* About */

.about-bleed {
  width: 100vw;
  margin-top: 0;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-bottom: var(--s-6);
  overflow: hidden;
}

.about-layout {
  max-width: 72ch;
  margin-left: 0;
}

.about-layout p {
  margin-top: 0;
}

.about-text-container {
  display: block;
}

.about-photo {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;

  min-height: clamp(420px, 60vh, 760px);
  height: clamp(420px, 60vh, 760px);

  object-fit: cover;
  object-position: center 45%;
  transform: scale(1.04);
  transform-origin: center;

  border: 0;
  border-radius: 0;
}

/* Footer */

.site-footer {
  background: var(--c-text);
  color: #07070a;
  margin-top: var(--s-8);
  overflow: hidden;
}

/* -------------------------------------------------------------------------- */
/* Case modal + injected case-study content                                    */
/* -------------------------------------------------------------------------- */
/* Case modal: fixed viewport shell; panel owns scrolling and focus content. */
.case-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 2000;
}

.case-modal.is-open {
  display: block;
}

.case-modal.is-transitioning {
  pointer-events: none;
}

.case-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 7, 10, 0.45);
}

.case-modal-panel {
  position: relative;
  width: 100%;
  height: 100%;
  max-height: none;
  overflow: auto;
  /* Opaque card tone keeps continuity without background bleed-through. */
  background: #3a3834;
  color: var(--c-text);
  border-radius: 0;
  border: none;
  z-index: 1;
  /* Keep scroll functionality but remove visible scrollbar chrome. */
  scrollbar-width: none;
  -ms-overflow-style: none;
  display: flex;
  flex-direction: column;
  transform-origin: 50% 10%;
}

.case-modal-panel::-webkit-scrollbar {
  width: 0;
  height: 0;
}

@media (min-width: 900px) {
  .case-modal-panel {
    /* Side gutters keep backdrop-click close; top/bottom are flush. */
    width: min(1320px, calc(100% - 48px));
    height: 100%;
    margin: 0 auto;
  }
}

.case-modal-close {
  position: sticky;
  top: clamp(12px, 2vw, 20px);
  align-self: flex-end;
  margin: clamp(12px, 2vw, 20px) clamp(12px, 2vw, 20px) 0 0;
  width: 48px;
  height: 48px;
  padding: 0;
  background: transparent;
  color: rgba(255, 252, 225, 0.72);
  border: 0;
  border-radius: 10px;
  font-size: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 3;
}

.case-modal-close::before {
  content: "×";
  font-size: 48px;
  line-height: 1;
  font-weight: 300;
}

.case-modal-close:hover {
  color: var(--c-text);
}

.case-modal-close:focus-visible {
  outline: 3px solid var(--c-accent);
  outline-offset: 3px;
}

.modal-transition-ghost {
  position: fixed;
  top: 0;
  left: 0;
  margin: 0;
  z-index: 2100;
  pointer-events: none;
  overflow: hidden;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

.modal-transition-ghost--card {
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
}

.modal-transition-ghost--card .work-link {
  width: 100%;
  height: 100%;
  box-shadow: none;
  transform: none;
  transition: none;
}

.modal-transition-ghost--card .work-link * {
  transition: none;
}

.modal-transition-ghost--panel {
  border-radius: 16px;
  background: #3a3834;
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.36);
}

.case-modal-body {
  /* Extra bottom padding keeps last section from feeling cut off. */
  padding: clamp(20px, 3.5vw, 56px) clamp(20px, 3.5vw, 56px) clamp(84px, 10vw, 140px);
  display: grid;
  gap: 24px;
  justify-items: center;
}

.case-flow {
  width: 100%;
  margin: 0;
  display: grid;
  /* Use explicit sibling spacing rules below; grid gap made title/paragraph/media
     spacing stack unpredictably (especially in title-only sections). */
  gap: 0;
  justify-items: center;
}

.case-inline-frame {
  width: min(980px, 100%);
  min-height: 82vh;
  border: 0;
  border-radius: 16px;
  background: #3a3834;
}

.case-text-wrap {
  /* Shared readable column for long-form case copy. */
  width: min(720px, 100%);
  margin: 0 auto;
}

.case-bleed {
  /* Gallery/media column aligns to the same reading grid as text. */
  width: min(720px, 100%);
  margin: 0 auto;
}

.case-lede {
  display: grid;
  gap: var(--s-2);
  max-width: 720px;
}

.case-title {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 850;
  font-variation-settings: "wght" 850;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.case-intro {
  margin: 0;
  color: var(--c-text);
  font-size: 1rem;
  line-height: 1.6;
}

.case-block h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  font-variation-settings: "wght" 700;
}

.case-block--legacy-subtitle h3 {
  text-transform: none;
  letter-spacing: 0;
  text-align: center;
}

.case-block p {
  margin: 0;
  color: rgba(255, 252, 225, 0.9);
  font-size: 0.98rem;
  max-width: 70ch;
  line-height: 1.62;
  font-weight: 360;
  font-variation-settings: "opsz" 18, "wght" 360;
}

.case-block {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
}

.case-text-wrap + .case-text-wrap {
  margin-top: 24px;
}

/* Create clearer section breaks before title rows. */
.case-text-wrap + .case-text-wrap--title {
  margin-top: var(--case-gap-after-bleed-heading);
}

.case-bleed + .case-text-wrap.case-text-wrap--title {
  margin-top: var(--case-gap-after-bleed-heading);
}

/* Title rows use explicit classes (instead of :has) for reliable spacing. */
.case-text-wrap--title + .case-text-wrap,
.case-text-wrap--title + .case-bleed {
  margin-top: 12px;
}

/* Intro block spacing before first body section/media. */
.case-lede + .case-text-wrap,
.case-lede + .case-bleed {
  margin-top: 24px;
}

.case-bleed + .case-text-wrap {
  margin-top: 36px;
}

.case-bleed + .case-text-wrap.case-text-wrap--after-deliverables {
  margin-top: 52px;
}

.case-bleed + .case-text-wrap.case-text-wrap--after-markers {
  margin-top: 52px;
}

.case-bleed + .case-bleed {
  margin-top: 24px;
}

/* Full section headers (h3 + optional body) need stronger separation above.
   Keep this after generic sibling spacing so it wins the cascade. */
.case-text-wrap + .case-text-wrap.case-text-wrap--section {
  margin-top: var(--case-gap-after-bleed-heading);
}

.case-bleed + .case-text-wrap.case-text-wrap--section {
  margin-top: var(--case-gap-after-bleed-heading);
}

.case-text-wrap + .case-bleed {
  margin-top: 24px;
}


.case-media-block {
  margin: 28px 0;
}

.case-block strong.case-lead {
  font-weight: 700 !important;
  font-variation-settings: "wght" 700 !important;
  letter-spacing: 0.02em;
}

.case-deliverables-gallery {
  display: grid;
  row-gap: 8px;
  column-gap: 8px;
}

.case-deliverables-gallery .case-media-block {
  margin: 0;
}

.case-deliverables-gallery .case-gallery-2up {
  gap: 8px;
}

.case-developer-gallery {
  display: grid;
  row-gap: 8px;
}

.case-developer-gallery .case-media-block {
  margin: 0;
}

.case-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.case-list li {
  margin: 0;
  color: rgba(255, 252, 225, 0.9);
  font-size: 0.98rem;
  line-height: 1.62;
  font-weight: 360;
  font-variation-settings: "opsz" 18, "wght" 360;
}

.case-ordered-list {
  margin: 0;
  padding-left: 1.3em;
  color: rgba(255, 252, 225, 0.9);
  font-size: 0.98rem;
  line-height: 1.62;
  font-weight: 360;
  font-variation-settings: "opsz" 18, "wght" 360;
}

.case-media {
  margin: 0;
  background: transparent;
  width: 100%;
}

/* Stacked media in a single block need vertical breathing room. */
.case-bleed > .case-media + .case-media {
  margin-top: 24px;
}

.case-media-frame {
  border-radius: 16px;
  overflow: hidden;
  background: transparent;
}

.case-bleed .case-media {
  border-radius: 16px;
}

.case-media img {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  image-rendering: auto;
  display: block;
  cursor: zoom-in;
}

.case-bleed .case-media img {
  max-height: none;
  object-fit: contain;
}

.case-gallery-2up {
  /* Legacy-style gallery rhythm: 2 columns with fixed 8px gutters. */
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.case-gallery-2up .case-media {
  margin: 0;
  position: relative;
  overflow: hidden;
}

.case-gallery-2up .case-media:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.case-gallery-2up .case-media-frame {
  aspect-ratio: 16 / 9;
  border-radius: 0;
}

.case-gallery-2up .case-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.case-gallery-2up--no-crop .case-media-frame {
  background: transparent;
  aspect-ratio: 4 / 5;
}

.case-gallery-2up--no-crop .case-media img {
  object-fit: contain;
}

.case-gallery-2up--deliverables .case-media-frame {
  aspect-ratio: 10 / 9;
}

.case-gallery-2up--deliverables .case-media img {
  object-fit: contain;
}

.case-gallery-2up--before-after {
  row-gap: 28px;
}

.case-gallery-2up--before-after .case-media-frame {
  aspect-ratio: 10 / 9;
}

.case-gallery-2up--before-after .case-media img {
  object-fit: cover;
  object-position: center top;
}

.case-gallery-2up--before-after .case-gallery-label {
  margin: 6px 0 0;
  color: rgba(255, 252, 225, 0.84);
  font-size: 0.85rem;
  line-height: 1.2;
  text-align: center;
}

.case-hover-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: clamp(8px, 1.2vw, 12px) 12px;
  background: linear-gradient(
    to top,
    rgba(7, 7, 10, 0.95) 0%,
    rgba(7, 7, 10, 0.72) 45%,
    rgba(7, 7, 10, 0) 100%
  );
  color: var(--c-text);
  font-size: clamp(0.82rem, 1vw, 1rem);
  line-height: 1.35;
  text-align: left;
  font-family: var(--font-sans);
  font-variation-settings: "opsz" 18, "wght" 520;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
  z-index: 2;
}

.case-gallery-2up .case-media:hover .case-hover-caption,
.case-gallery-2up .case-media:focus-within .case-hover-caption {
  opacity: 1;
  transform: translateY(0);
}

.case-caption {
  margin: 12px 0 0 0;
  color: var(--c-text);
  font-size: 0.95rem;
  line-height: 1.55;
}

/* When a caption is followed by the next media block, add breathing room. */
.case-caption + .case-media,
.case-caption + .case-media-block {
  margin-top: 24px;
}

.case-caption-label {
  font-weight: 700;
  font-variation-settings: "wght" 700;
  letter-spacing: 0.02em;
  margin-right: 6px;
}

.case-block--title-only {
  margin-bottom: 8px;
}

.case-bleed--after-title .case-media-block {
  margin-top: 16px;
}

body.modal-open {
  /* Prevent background page scroll while modal is open. */
  overflow: hidden;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 3000;
}

.lightbox.is-open {
  display: block;
}

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

.lightbox-panel {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  z-index: 1;
}

.lightbox-figure {
  margin: 0;
  max-width: min(1200px, 92vw);
  max-height: 85vh;
  width: 100%;
  height: auto;
  display: grid;
  place-items: center;
}

.lightbox-figure img {
  width: 100%;
  height: auto;
  max-height: 85vh;
  object-fit: contain;
  display: block;
  border-radius: 18px;
  transform-origin: center center;
  transition: transform 140ms ease;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox-figure img.is-zoomed {
  cursor: grab;
}

.lightbox-figure img.is-dragging {
  cursor: grabbing;
}

.lightbox-caption {
  margin-top: 12px;
  color: var(--c-text);
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: left;
}

.lightbox-close {
  position: fixed;
  top: clamp(16px, 3vw, 32px);
  right: clamp(16px, 3vw, 32px);
  width: 48px;
  height: 48px;
  padding: 0;
  background: transparent;
  color: rgba(255, 252, 225, 0.72);
  border: 0;
  border-radius: 10px;
  font-size: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 3;
}

.lightbox-close::before {
  content: "×";
  font-size: 48px;
  line-height: 1;
  font-weight: 300;
}

.lightbox-close:hover {
  color: var(--c-text);
}

.lightbox-close:focus-visible {
  outline: 3px solid var(--c-accent);
  outline-offset: 3px;
}

.site-footer a {
  color: #07070a;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.site-footer a:hover {
  color: #07070a;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  background-color: rgba(0, 0, 0, 0.08);
  outline: none;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: var(--s-6);
  padding-top: var(--s-6);
  padding-bottom: var(--s-6);
}

.footer-top {
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}

.footer-heading {
  margin: 0;
  font-size: clamp(1.6rem, 4.5vw, 2.6rem);
  font-weight: 900;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  font-family: var(--font-display);
  font-variation-settings: "wdth" var(--wdth-display), "wght" var(--wght-black);
  line-height: 1;
}

.footer-links {
  display: flex;
  gap: var(--s-6);
  flex-wrap: wrap;
}

.footer-bottom {
  margin-top: var(--s-6);
}

.footer-brand {
  font-family: var(--font-display);
  margin: 0;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* -------------------------------------------------------------------------- */
/* Responsive overrides                                                         */
/* -------------------------------------------------------------------------- */
/* Mobile: tighter spacing and stacked work cards */
@media (max-width: 720px) {
  :root { --pad-x: 18px; --s-7: 64px; --s-8: 96px; }

  .site-header {
    margin-bottom: 60px;
    padding-top: 0;
    padding-bottom: 0;
    min-height: 100svh;
    display: flex;
    align-items: center;
  }

  .site-header .container {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  main > section:first-child {
    padding-top: 20px;
  }

  .work-link {
    grid-template-columns: 1fr;
    gap: var(--s-4);
    background: rgba(255, 252, 225, 0.18);
  }


  .work-copy {
    padding: var(--s-4);
    background: transparent;
  }


  .name-line { white-space: normal; }
  .nickname { display: inline-block; margin-left: 0.4em; }

  .name {
    font-size: clamp(3.4rem, 15vw, 5.6rem);
    letter-spacing: -0.055em;
    margin-bottom: var(--s-4);
  }
  .tagline { font-size: 1.05rem; max-width: 60ch; }
  .tagline-group { display: block; }
  .tagline-group + .tagline-group { margin-top: 0.08em; }
  .footer-links { gap: 12px; }

  .case-modal-body {
    padding: var(--s-4) var(--s-4) calc(var(--s-7) + var(--s-2));
  }

  .case-flow {
    gap: 0;
  }

  .case-text-wrap + .case-text-wrap,
  .case-bleed + .case-text-wrap {
    margin-top: 24px;
  }

  .case-text-wrap + .case-text-wrap--title {
    margin-top: var(--case-gap-after-bleed-heading-mobile);
  }

  .case-bleed + .case-text-wrap.case-text-wrap--title {
    margin-top: var(--case-gap-after-bleed-heading-mobile);
  }

  .case-text-wrap--title + .case-text-wrap,
  .case-text-wrap--title + .case-bleed {
    margin-top: 10px;
  }

  .case-bleed + .case-bleed {
    margin-top: 16px;
  }

  .case-text-wrap + .case-text-wrap.case-text-wrap--section {
    margin-top: var(--case-gap-after-bleed-heading-mobile);
  }

  .case-bleed + .case-text-wrap.case-text-wrap--section {
    margin-top: var(--case-gap-after-bleed-heading-mobile);
  }


  .case-gallery-2up {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) and (prefers-reduced-motion: no-preference) {
  /* Phones use CSS-only first paint animation so the hero never depends on JS timing. */
  .site-header .name-line,
  .site-header .nickname,
  .site-header .tagline-group,
  .site-header .rule {
    opacity: 0;
    transform: translateY(16px);
    filter: blur(8px);
    animation: mobile-hero-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .site-header .name-line:nth-of-type(1) {
    animation-delay: 0.06s;
  }

  .site-header .name-line:nth-of-type(2) {
    animation-delay: 0.18s;
  }

  .site-header .nickname {
    animation-delay: 0.32s;
  }

  .site-header .tagline-group:nth-of-type(1) {
    animation-delay: 0.46s;
  }

  .site-header .tagline-group:nth-of-type(2) {
    animation-delay: 0.6s;
  }

  .site-header .tagline-group:nth-of-type(3) {
    animation-delay: 0.74s;
  }

  .site-header .rule {
    /* Divider lands last to finish the sequence after name + tagline copy. */
    filter: none;
    transform: scaleX(0);
    transform-origin: left center;
    animation-name: mobile-hero-rule;
    animation-duration: 0.44s;
    animation-delay: 0.88s;
  }
}
