/* ================================================================
   FONTS
================================================================ */
@font-face {
  font-family: 'Alte Haas Grotesk';
  src: local('Alte Haas Grotesk'),
       local('AlteHaasGroteskRegular'),
       url('./assets/fonts/AlteHaasGroteskRegular.ttf') format('truetype');
  font-weight: 300 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Alte Haas Grotesk';
  src: local('Alte Haas Grotesk Bold'),
       local('AlteHaasGroteskBold'),
       url('./assets/fonts/AlteHaasGroteskBold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ================================================================
   CUSTOM PROPERTIES
================================================================ */
:root {
  --font: 'Alte Haas Grotesk', 'Helvetica Neue', Helvetica, Arial, sans-serif;

  /* Palette — dark warm charcoal, not pure black */
  --bg:          #111010;
  --surface:     #181716;
  --surface-2:   #1e1c1b;
  --text:        #ddd7cf;
  --text-dim:    #9a9390;
  --muted:       #5e5a57;
  --border:      #252220;
  --border-2:    #2e2b28;

  /* Spacing / sizing */
  --nav-h:       56px;
  --ease:        cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.45, 0, 0.15, 1);
  --motion-fast: 180ms;
  --motion-base: 480ms;
  --motion-slow: 900ms;
  --motion-cinematic: 1400ms;
}

/* ================================================================
   RESET & BASE
================================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

/* ================================================================
   FOCUS STYLES — visible but refined
================================================================ */
:focus { outline: none; }

:focus-visible {
  outline: 1.5px solid rgba(200, 190, 178, 0.5);
  outline-offset: 3px;
  border-radius: 1px;
}

/* ================================================================
   LAYOUT UTILITY
================================================================ */
.container {
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
}

/* ================================================================
   VIEW SYSTEM — single-page view switching
================================================================ */
.view {
  display: none;
  min-height: 100vh;
  min-height: 100svh;
}
.view.active {
  display: block;
}

/* ================================================================
   NAVIGATION
================================================================ */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--nav-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  font-family: var(--font);
  padding: 0 28px;
  transition: background 300ms var(--ease),
              border-color 300ms var(--ease);
}

.site-nav.on-hero {
  background: transparent;
  border-bottom: 1px solid transparent;
}

.site-nav.on-hero .nav-logo {
  visibility: hidden;
  pointer-events: none;
}

.site-nav.on-page {
  background: rgba(17, 16, 16, 0.90);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  transition: color 200ms;
}

.site-nav.on-page .nav-logo {
  color: var(--text);
}

.nav-logo:hover {
  color: #fff;
}

.site-nav.on-page .nav-logo:hover {
  color: var(--text);
  opacity: 0.7;
}

/* Centre column — Galerii / CV */
.nav-center {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav-link {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  position: relative;
  padding-bottom: 2px;
  transition: color 200ms;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms var(--ease);
}

.nav-link:hover {
  color: #fff;
}

.nav-link:hover::after {
  transform: scaleX(1);
}

.site-nav.on-page .nav-link {
  color: var(--muted);
}

.site-nav.on-page .nav-link:hover {
  color: var(--text);
}

.nav-link-sep {
  color: rgba(255, 255, 255, 0.2);
  font-size: 12px;
  font-weight: 300;
}

.site-nav.on-page .nav-link-sep {
  color: var(--border-2);
}

.lang-toggle {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 0;
}

.lang-opt {
  color: rgba(255, 255, 255, 0.35);
  transition: color 150ms;
  cursor: pointer;
}

.lang-opt.active {
  color: rgba(255, 255, 255, 0.85);
}

.site-nav.on-page .lang-opt {
  color: var(--muted);
}

.site-nav.on-page .lang-opt.active {
  color: var(--text);
}

.lang-sep {
  color: rgba(255, 255, 255, 0.15);
  font-size: 10px;
}

.site-nav.on-page .lang-sep {
  color: var(--border-2);
}

/* ================================================================
   HOME / HERO
================================================================ */
.view-home {
  position: relative;
}

.home-hero {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.12) 0%,
    rgba(0, 0, 0, 0.00) 30%,
    rgba(0, 0, 0, 0.55) 65%,
    rgba(0, 0, 0, 0.82) 100%
  );
  pointer-events: none;
}

.hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0 5vw 7vh;
}

.hero-name {
  font-family: var(--font);
  font-size: clamp(6rem, 16vw, 18rem);
  font-weight: 700;
  line-height: 0.88;
  letter-spacing: -0.04em;
  color: #fff;
}


/* ================================================================
   SCROLL REVEAL
================================================================ */
.reveal-item {
  opacity: 0;
  transform: translateY(52px);
  transition: opacity 900ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 900ms cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ================================================================
   HOME WORKS — scroll-reveal grid below the hero fold
================================================================ */
.hero-works {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  background: var(--bg);
}

.hero-works-pair {
  display: grid;
  width: 100%;
  gap: 0;
  align-items: stretch;
  grid-template-columns: 45.23% 54.77%;
  overflow: hidden;
}

.hero-works-pair--opening {
  aspect-ratio: 1.25 / 1;
}

.hero-works-pair--secondary {
  aspect-ratio: 1.54803 / 1;
}

.hero-works-item {
  overflow: hidden;
  min-width: 0;
}

.hero-works-item[data-gallery] {
  cursor: zoom-in;
}

.hero-works-item[data-gallery]:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.58);
  outline-offset: -5px;
}

.hero-works-item img {
  width: 100%;
  height: auto;
  display: block;
}

.hero-works-pair .hero-works-item img {
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-works-pair--secondary .hero-works-item img {
  object-fit: contain;
  transform: none;
}

.hero-works-item--wide {
  width: 100%;
}

.hero-works-cta {
  display: flex;
  justify-content: center;
  padding: 56px 0 100px;
}

.hero-works-cta button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-2);
  transition: color 200ms, border-color 200ms;
}

.hero-works-cta button:hover {
  color: var(--text);
  border-color: var(--muted);
}

.hero-cta-arrow {
  transition: transform 220ms var(--ease);
}

.hero-works-cta button:hover .hero-cta-arrow {
  transform: translateX(4px);
}

/* ================================================================
   SHARED INNER-PAGE HEADER
================================================================ */
.inner-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: calc(var(--nav-h) + 36px);
  padding-bottom: 36px;
}

.view-label {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 180ms;
}

.back-link:hover {
  color: var(--text-dim);
}

.back-arrow {
  display: inline-block;
  transition: transform 200ms var(--ease);
}

.back-link:hover .back-arrow {
  transform: translateX(-3px);
}

/* ================================================================
   GALLERY OVERVIEW
================================================================ */
.view-gallery-overview {
  padding-bottom: 120px;
}

.all-works-feature {
  width: fit-content;
  min-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 0 max(24px, calc((100vw - 1200px) / 2)) 36px;
  padding: 14px 18px;
  border: 1px solid var(--border-2);
  color: var(--text);
  text-align: left;
  transition:
    background var(--motion-base) var(--ease),
    color var(--motion-fast) var(--ease),
    border-color var(--motion-fast) var(--ease);
}

.all-works-feature:hover,
.all-works-feature:focus-visible {
  background: var(--surface);
  border-color: var(--muted);
}

.all-works-feature-copy {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.all-works-feature-title {
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.all-works-feature-count {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.all-works-feature-arrow {
  color: var(--text-dim);
  font-size: 15px;
  font-weight: 400;
  line-height: 1;
  transition: transform 300ms var(--ease-out);
}

.all-works-feature:hover .all-works-feature-arrow,
.all-works-feature:focus-visible .all-works-feature-arrow {
  transform: translateX(4px);
}

/* Full-width grid — background color bleeds through 1px gaps
   to create subtle editorial dividers without actual borders */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
}

/* First card leads the grid — editorial double-width feature */
.gallery-card:first-child {
  grid-column: span 2;
}

.gallery-card {
  background: var(--surface);
  cursor: pointer;
  overflow: hidden;
}

.gallery-card:hover .gallery-cover img {
  transform: scale(1.04);
}

.gallery-cover {
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
  overflow: hidden;
  position: relative;
}

.gallery-card:first-child .gallery-cover {
  aspect-ratio: 16 / 9;
}

.gallery-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms var(--ease);
}

.gallery-cover-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.gallery-card-caption {
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.gallery-card-title {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--text);
  line-height: 1.4;
}

.gallery-card-count {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ================================================================
   GALLERY DETAIL
================================================================ */
.view-gallery-detail {
  padding-bottom: 140px;
}

.gallery-detail-header {
  position: relative;
  align-items: flex-start;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 88px;
}

.gallery-detail-meta {
  text-align: right;
}

.gallery-detail-title {
  font-size: clamp(2rem, 4.5vw, 3.6rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--text);
  margin-top: 10px;
}

.gallery-detail-count {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 10px;
}

.gallery-sort {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 18px;
}

.gallery-sort[hidden] {
  display: none;
}

.gallery-sort-label {
  margin-right: 7px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gallery-sort-button {
  min-width: 70px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border-2);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition:
    color var(--motion-fast) var(--ease),
    border-color var(--motion-fast) var(--ease),
    background var(--motion-fast) var(--ease);
}

.gallery-sort-button:hover,
.gallery-sort-button:focus-visible,
.gallery-sort-button.active {
  border-color: var(--muted);
  color: var(--text);
  background: var(--surface);
}

.gallery-sort-direction {
  width: 8px;
  color: var(--text-dim);
}

/* Images — exact-ratio justified rows */
.image-sequence {
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 2.5vw, 34px);
  padding: 0 clamp(12px, 2.5vw, 40px);
}

.image-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: var(--row-gap, 8px);
  width: 100%;
}

.image-item {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  min-width: 0;
}

.image-item-frame {
  width: 100%;
  height: var(--row-height);
  overflow: hidden;
}

.image-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: zoom-in;
  transition: opacity 180ms;
}

.image-item img:hover {
  opacity: 0.88;
}

.image-item-index {
  margin-top: 7px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  align-self: flex-end;
}

.image-fallback-block {
  width: 100%;
  aspect-ratio: 3 / 2;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.empty-state {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-align: center;
  padding: 80px 0;
}

/* ================================================================
   CV
================================================================ */
.view-cv {
  padding-bottom: 140px;
}

.cv-inner {
  /* uses .container for width */
}

.cv-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: calc(var(--nav-h) + 36px);
  padding-bottom: 16px;
}

.cv-title-block {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 42%);
  align-items: end;
  gap: clamp(18px, 3vw, 40px);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.cv-title-copy {
  padding-bottom: 2px;
}

.cv-name {
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin-bottom: 10px;
  color: var(--text);
}

.cv-intro {
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-dim);
  max-width: 620px;
}

.cv-portrait {
  overflow: hidden;
  aspect-ratio: 1.55 / 1;
  background: var(--surface);
}

.cv-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.cv-body {
  /* sections */
}

.cv-section {
  display: grid;
  grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
  gap: 0 clamp(20px, 3vw, 38px);
  padding: clamp(14px, 2vw, 22px) 0;
  border-bottom: 1px solid var(--border);
}

/* Last section has no bottom border */
.cv-section--contact {
  border-bottom: none;
}

.cv-section-label {
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.5;
  padding-top: 3px;
  /* sticky label scrolls with section */
  position: sticky;
  top: calc(var(--nav-h) + 16px);
  height: fit-content;
  align-self: start;
}

.cv-section-content {
  min-width: 0;
}

.cv-year-group {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 0 12px;
  padding: 5px 0;
  border-top: 1px solid rgba(46, 43, 40, 0.65);
}

.cv-year-group:first-child {
  padding-top: 0;
  border-top: 0;
}

.cv-year-group:last-child {
  padding-bottom: 0;
}

.cv-year-entries {
  min-width: 0;
}

.cv-detail {
  font-size: 11px;
  line-height: 1.42;
  color: var(--text);
  max-width: 760px;
  margin-bottom: 2px;
}

.cv-detail:last-child {
  margin-bottom: 0;
}

.cv-year {
  font-size: 10px;
  line-height: 1.55;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-top: 1px;
}

.cv-detail a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border-2);
  transition: color var(--motion-fast) var(--ease),
              border-color var(--motion-fast) var(--ease);
}

.cv-detail a:hover,
.cv-detail a:focus-visible {
  color: #fff;
  border-color: var(--text-dim);
}

/* ================================================================
   LIGHTBOX
================================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  font-family: 'Alte Haas Grotesk', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: rgba(7, 6, 6, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms var(--ease);
}

.lightbox.open {
  opacity: 1;
  pointer-events: all;
}

.lightbox-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 80px;
  max-width: 100vw;
  max-height: 100vh;
}

.lightbox-stage img {
  max-width: calc(100vw - 160px);
  max-height: calc(100vh - 128px);
  width: auto;
  height: auto;
  object-fit: contain;
  /* subtle fade when switching images */
  transition: opacity 150ms;
}

.lightbox.has-metadata .lightbox-stage {
  padding-bottom: 170px;
}

.lightbox.has-metadata .lightbox-stage img {
  max-height: calc(100vh - 220px);
}

.lightbox-meta {
  position: fixed;
  z-index: 11;
  left: 50%;
  bottom: 22px;
  width: min(920px, calc(100vw - 240px));
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(0, 1.3fr);
  gap: 32px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.24);
  color: var(--text);
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
  transition:
    opacity var(--motion-base) var(--ease-out),
    transform var(--motion-base) var(--ease-out);
  pointer-events: none;
}

.lightbox-meta[hidden] {
  display: none;
}

.lightbox.open .lightbox-meta {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.lightbox-meta-title {
  align-self: start;
  font-family: inherit;
  font-size: clamp(1rem, 1.5vw, 1.35rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.lightbox-meta-details {
  display: grid;
  grid-template-columns: max-content max-content minmax(180px, 1fr);
  gap: 12px 30px;
  min-width: 0;
}

.lightbox-meta-details > div {
  min-width: 0;
}

.lightbox-meta-details dt {
  font-family: inherit;
  margin-bottom: 4px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.62rem;
  line-height: 1;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.lightbox-meta-details dd {
  font-family: inherit;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.72rem;
  line-height: 1.45;
}

.lightbox.has-metadata .lightbox-counter {
  right: 24px;
  bottom: 24px;
  left: auto;
  transform: none;
}

.lightbox-stage img.loading {
  opacity: 0;
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 10;
  color: rgba(255, 255, 255, 0.4);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 160ms;
}

.lightbox-close:hover {
  color: rgba(255, 255, 255, 0.85);
}

.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  color: rgba(255, 255, 255, 0.3);
  width: 60px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 160ms;
}

.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

.lightbox-prev:hover,
.lightbox-next:hover {
  color: rgba(255, 255, 255, 0.8);
}

.lightbox-counter {
  position: fixed;
  font-family: inherit;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.25);
  text-transform: uppercase;
  white-space: nowrap;
}

/* ================================================================
   RESPONSIVE
================================================================ */
@media (max-width: 960px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .gallery-card:first-child {
    grid-column: span 2;
  }
  .hero-content {
    padding: 0 28px 44px;
    flex-direction: column;
    align-items: flex-start;
    gap: 28px;
  }
  .cv-section {
    grid-template-columns: 160px 1fr;
    gap: 0 32px;
  }

}

@media (max-width: 640px) {
  :root {
    --nav-h: 52px;
  }

  .container {
    width: calc(100% - 32px);
  }

  .site-nav {
    padding: 0 16px;
  }

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

  .all-works-feature {
    margin: 0 16px 24px;
    padding: 13px 16px;
  }
  .gallery-card:first-child {
    grid-column: span 1;
    /* reset the wide aspect ratio on mobile */
  }
  .gallery-card:first-child .gallery-cover {
    aspect-ratio: 4 / 3;
  }

  .gallery-detail-header {
    flex-direction: column;
    gap: 20px;
  }
  .gallery-detail-meta {
    text-align: left;
  }

  .gallery-sort {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .inner-header {
    padding-top: calc(var(--nav-h) + 24px);
    padding-bottom: 24px;
  }

  .image-sequence {
    gap: 28px;
    padding: 0 16px;
  }

  .image-row {
    width: 100%;
  }

  .image-item {
    max-width: 100%;
    margin: 0 auto;
  }

  .gallery-detail-header {
    margin-bottom: 56px;
  }

  .site-nav {
    grid-template-columns: auto 1fr auto;
    gap: 0 12px;
  }

  .nav-center {
    justify-content: center;
    gap: 14px;
  }

  .hero-content {
    padding: 0 5vw 6vh;
  }

  .hero-works {
    width: 100%;
    padding-top: 8px;
  }

  .cv-section {
    grid-template-columns: 1fr;
    gap: 10px 0;
    padding: 14px 0;
  }
  .cv-section-label {
    position: static;
  }

  .cv-year-group {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 0 10px;
  }

  .cv-title-block {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .cv-portrait {
    order: -1;
    aspect-ratio: 16 / 10;
  }

  .lightbox-stage {
    padding: 52px 16px;
  }
  .lightbox-stage img {
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 104px);
  }
  .lightbox.has-metadata .lightbox-stage {
    padding-bottom: 218px;
  }
  .lightbox.has-metadata .lightbox-stage img {
    max-height: calc(100svh - 258px);
  }
  .lightbox-meta {
    right: 16px;
    bottom: 18px;
    left: 16px;
    width: auto;
    grid-template-columns: 1fr;
    gap: 12px;
    transform: translateY(8px);
  }
  .lightbox.open .lightbox-meta {
    transform: translateY(0);
  }
  .lightbox-meta-details {
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 10px 24px;
  }
  .lightbox-meta-details > div:last-child {
    grid-column: 1 / -1;
  }
  .lightbox.has-metadata .lightbox-counter {
    top: 20px;
    right: 56px;
    bottom: auto;
  }
  .lightbox-prev { left: 4px; }
  .lightbox-next { right: 4px; }

}

/* ================================================================
   REDUCED MOTION
================================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  .reveal-item {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ================================================================
   MOTION SYSTEM
   Restrained publication-like movement with two statement reveals.
================================================================ */
body.lightbox-open {
  overflow: hidden;
}

.view.is-entering .inner-header,
.view.is-entering .cv-top-bar {
  animation: view-header-in 700ms var(--ease-out) both;
}

@keyframes view-header-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Statement 1: first-load photographic curtain and type resolve. */
.home-hero {
  background: #090909;
}

.home-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background: var(--bg);
  transform: scaleY(0);
  transform-origin: bottom;
  pointer-events: none;
}

.hero-content {
  z-index: 3;
}

.hero-image {
  transform-origin: center center;
}

.motion-ready .home-hero::after {
  animation: hero-curtain-in var(--motion-cinematic) var(--ease-in-out) 80ms both;
}

.motion-ready .hero-image {
  animation: hero-image-in 1800ms var(--ease-out) 220ms both;
}

.motion-ready .hero-overlay {
  animation: hero-opacity-in 1000ms var(--ease) 650ms both;
}

.motion-ready .hero-name {
  animation: hero-copy-in 1100ms var(--ease-out) 900ms both;
}

.motion-ready .site-nav.on-hero .nav-center,
.motion-ready .site-nav.on-hero .lang-toggle {
  animation: hero-opacity-in 700ms var(--ease) 1200ms both;
}

@keyframes hero-curtain-in {
  from { transform: scaleY(1); }
  to { transform: scaleY(0); }
}

@keyframes hero-image-in {
  from {
    opacity: 0;
    transform: scale(1.018);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes hero-copy-in {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hero-opacity-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.reveal-item {
  transform: translateY(36px);
  transition: opacity var(--motion-slow) var(--ease-out),
              transform var(--motion-slow) var(--ease-out);
}

.hero-works-item img {
  transform: scale(1.012);
  transition: transform 1200ms var(--ease-out);
}

.hero-works-item.is-visible img {
  transform: scale(1);
}

.nav-link::after,
.hero-cta-arrow,
.back-arrow {
  transition-duration: 320ms;
  transition-timing-function: var(--ease-out);
}

.gallery-card {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 700ms var(--ease-out),
              transform 700ms var(--ease-out),
              background var(--motion-base) var(--ease);
  transition-delay: var(--card-delay, 0ms);
}

.gallery-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.gallery-card:hover,
.gallery-card:focus-visible {
  background: var(--surface-2);
}

.gallery-card:hover .gallery-cover img,
.gallery-card:focus-visible .gallery-cover img {
  transform: scale(1.018) translateY(-0.5%);
  filter: contrast(1.025);
}

.gallery-cover img {
  transition: transform 800ms var(--ease-out),
              filter 500ms var(--ease);
}

/* Statement 2: gallery title resolves before the opening work. */
.view-gallery-detail.is-entering .gallery-detail-header {
  animation: detail-header-in 900ms var(--ease-out) both;
}

.view-gallery-detail.is-entering .gallery-detail-meta > * {
  animation: detail-meta-in 800ms var(--ease-out) both;
}

.view-gallery-detail.is-entering .gallery-detail-meta > :nth-child(2) {
  animation-delay: 90ms;
}

.view-gallery-detail.is-entering .gallery-detail-meta > :nth-child(3) {
  animation-delay: 160ms;
}

@keyframes detail-header-in {
  from {
    opacity: 0;
    transform: translateY(24px);
    border-color: transparent;
  }
  to {
    opacity: 1;
    transform: translateY(0);
    border-color: var(--border);
  }
}

@keyframes detail-meta-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.image-item {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--motion-slow) var(--ease-out),
              transform var(--motion-slow) var(--ease-out);
  transition-delay: var(--image-delay, 0ms);
}

.image-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.view-gallery-detail.is-entering .image-row:first-child .image-item:first-child {
  clip-path: inset(0 0 100% 0);
  animation: first-artwork-in 1200ms var(--ease-in-out) 280ms both;
}

@keyframes first-artwork-in {
  from {
    opacity: 0;
    transform: translateY(18px);
    clip-path: inset(0 0 100% 0);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    clip-path: inset(0 0 0 0);
  }
}

.image-item img {
  transition: opacity var(--motion-base) var(--ease);
}

.cv-title-block,
.cv-section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 700ms var(--ease-out),
              transform 700ms var(--ease-out);
}

.cv-title-block {
  transform: translateY(24px);
  transition-duration: 800ms;
}

.cv-title-block.is-visible,
.cv-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.lightbox {
  visibility: hidden;
  transition: opacity 420ms var(--ease),
              visibility 0s linear 420ms;
}

.lightbox.open {
  visibility: visible;
  transition-delay: 0s;
}

.lightbox-stage img {
  opacity: 0;
  transform: translateY(12px) scale(0.995);
  transition: opacity 520ms var(--ease),
              transform 700ms var(--ease-out);
}

.lightbox.open .lightbox-stage img:not(.loading) {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.lightbox-stage img.loading {
  opacity: 0;
  transform: translateY(8px) scale(0.998);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next,
.lightbox-counter {
  opacity: 0;
  transition: color var(--motion-fast) var(--ease),
              opacity 400ms var(--ease) 180ms;
}

.lightbox.open .lightbox-close,
.lightbox.open .lightbox-prev,
.lightbox.open .lightbox-next,
.lightbox.open .lightbox-counter {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation-delay: 0ms !important;
  }

  .motion-ready .hero-image,
  .motion-ready .hero-overlay,
  .motion-ready .hero-name,
  .motion-ready .site-nav.on-hero .nav-center,
  .motion-ready .site-nav.on-hero .lang-toggle,
  .reveal-item,
  .gallery-card,
  .image-item,
  .cv-title-block,
  .cv-section {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }
}
