/* ==========================================================================
   Elan Afzali — portfolio
   One stylesheet for every page. Generated pages live in /site; edit content in
   build/content.mjs and layout markup in build/pages.mjs.
   ========================================================================== */

/* ---- Typeface: Neue Haas Display (self-hosted WOFF2) ------------------- */
@font-face { font-family: "Neue Haas Display"; src: url("../fonts/neue-haas-display-300.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Neue Haas Display"; src: url("../fonts/neue-haas-display-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Neue Haas Display"; src: url("../fonts/neue-haas-display-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Neue Haas Display"; src: url("../fonts/neue-haas-display-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

/* ---- Tokens ------------------------------------------------------------- */
:root {
  color-scheme: dark;

  --bg: #0b0b0c;
  --bg-raise: #131315;
  --bg-raise-2: #1b1b1e;
  --text: #f3f0ea;
  --text-2: #b9b5ae;          /* 9.6:1 on --bg */
  --text-3: #8d8a85;          /* 5.7:1 on --bg */
  --line: rgba(243, 240, 234, 0.12);
  --line-strong: rgba(243, 240, 234, 0.26);
  --accent: #e9d3b0;

  --font: "Neue Haas Display", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;

  /* fluid type scale */
  --t-label: clamp(0.72rem, 0.7rem + 0.1vw, 0.8rem);
  --t-small: clamp(0.86rem, 0.83rem + 0.12vw, 0.94rem);
  --t-body: clamp(1rem, 0.96rem + 0.16vw, 1.1rem);
  --t-lead: clamp(1.12rem, 1.02rem + 0.4vw, 1.42rem);
  --t-card: clamp(1.05rem, 0.98rem + 0.32vw, 1.32rem);
  --t-h3: clamp(1.45rem, 1.15rem + 1.1vw, 2.2rem);
  --t-h2: clamp(1.9rem, 1.1rem + 2.4vw, 3.4rem);
  --t-h1: clamp(2.5rem, 1.2rem + 4vw, 5.5rem);
  --t-hero: clamp(2.5rem, 1.15rem + 4.25vw, 6rem);

  --gutter: clamp(20px, 3.4vw, 56px);
  --container: 1680px;
  --gap: clamp(10px, 1vw, 16px);
  --section: clamp(88px, 11vw, 176px);
  --header-h: 72px;

  --r-media: 10px;
  --r-card: 14px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- Base --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--t-body);
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0.002em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga";
  overflow-x: clip;
}
img, video, picture, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
p { margin: 0; text-wrap: pretty; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; text-wrap: balance; }
ul, ol { margin: 0; padding: 0; list-style: none; }
dl, dd { margin: 0; }
::selection { background: var(--accent); color: #111; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 999px;
  background: var(--text); color: var(--bg); font-weight: 500; transition: top 200ms var(--ease);
}
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }

.icon { width: 1em; height: 1em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* Labels & small type */
.label {
  font-size: var(--t-label);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.label--light { color: var(--text-2); }
.lead { font-size: var(--t-lead); line-height: 1.5; color: var(--text-2); max-width: 46ch; }
.prose { color: var(--text-2); max-width: 62ch; }
.prose p + p { margin-top: 1em; }
.prose h3 { font-size: var(--t-body); font-weight: 500; color: var(--text); margin: 1.8em 0 0.5em; letter-spacing: 0.01em; }
.prose h3:first-child { margin-top: 0; }

/* Text links with an arrow */
.link-arrow {
  display: inline-flex; align-items: center; gap: 0.55em;
  font-size: var(--t-small); font-weight: 500; letter-spacing: 0.01em;
  padding-bottom: 3px;
  background: linear-gradient(currentColor, currentColor) left bottom / 0% 1px no-repeat;
  transition: background-size 400ms var(--ease-out), color 200ms;
}
.link-arrow .icon { transition: transform 300ms var(--ease-out); }
.link-arrow:hover, .link-arrow:focus-visible { background-size: 100% 1px; }
.link-arrow:hover .icon, .link-arrow:focus-visible .icon { transform: translateX(3px); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
  min-height: 44px; padding: 0.7em 1.25em;
  border: 1px solid var(--line-strong); border-radius: 999px;
  font-size: var(--t-small); font-weight: 500; letter-spacing: 0.01em; white-space: nowrap;
  transition: background-color 220ms var(--ease), color 220ms var(--ease), border-color 220ms var(--ease), transform 220ms var(--ease);
}
.btn:hover, .btn:focus-visible { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn--solid { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn--solid:hover, .btn--solid:focus-visible { background: transparent; color: var(--text); }
.btn--ghost { border-color: transparent; }
.btn--glass { background: rgba(11, 11, 12, 0.45); border-color: rgba(243, 240, 234, 0.3); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.icon-btn {
  display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid var(--line-strong); font-size: 1.1rem;
  transition: background-color 200ms var(--ease), color 200ms var(--ease), border-color 200ms var(--ease);
}
.icon-btn:hover, .icon-btn:focus-visible { background: var(--text); color: var(--bg); border-color: var(--text); }
.icon-btn:disabled { opacity: 0.35; pointer-events: none; }

/* ---- Header ------------------------------------------------------------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h);
  transition: background-color 300ms var(--ease), border-color 300ms var(--ease), transform 400ms var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header::before {
  content: ""; position: absolute; inset: 0 0 -40px 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, rgba(11, 11, 12, 0.72), rgba(11, 11, 12, 0.32) 55%, rgba(11, 11, 12, 0));
  transition: opacity 300ms var(--ease);
}
.site-header:not(.is-scrolled) .nav a { color: var(--text); text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5); }
.site-header:not(.is-scrolled) .nav a:not([aria-current]):not(:hover) { color: rgba(243, 240, 234, 0.86); }
.site-header.is-scrolled { background: rgba(11, 11, 12, 0.78); border-bottom-color: var(--line); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); }
.site-header.is-scrolled::before { opacity: 0; }
.site-header.is-hidden { transform: translateY(-100%); }
.site-header__inner { height: 100%; display: flex; align-items: center; gap: clamp(16px, 3vw, 48px); }
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 500; font-size: 1rem; letter-spacing: 0.01em; margin-right: auto; }
.brand img { height: 34px; width: auto; }
.nav { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 40px); }
.nav a { position: relative; font-size: var(--t-small); color: var(--text-2); padding: 6px 0; transition: color 200ms; }
.nav a:hover, .nav a:focus-visible, .nav a[aria-current] { color: var(--text); }
.nav a[aria-current]::before {
  content: ""; position: absolute; left: -12px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: var(--accent);
}
.nav-cta { min-height: 40px; padding: 0.55em 1.15em; }
.nav-cta[aria-current="page"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.menu-btn { display: none; width: 44px; height: 44px; margin-right: -10px; border-radius: 50%; position: relative; }
.menu-btn span { position: absolute; left: 12px; right: 12px; height: 1.5px; background: currentColor; transition: transform 300ms var(--ease), top 300ms var(--ease); }
.menu-btn span:nth-child(1) { top: 18px; }
.menu-btn span:nth-child(2) { top: 25px; }
.menu-open .menu-btn span:nth-child(1) { top: 21.5px; transform: rotate(45deg); }
.menu-open .menu-btn span:nth-child(2) { top: 21.5px; transform: rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 45; padding: calc(var(--header-h) + 24px) var(--gutter) 32px;
  background: var(--bg); display: flex; flex-direction: column; justify-content: space-between;
  opacity: 0; visibility: hidden; transition: opacity 300ms var(--ease), visibility 0s linear 300ms;
}
.menu-open .mobile-menu { opacity: 1; visibility: visible; transition: opacity 300ms var(--ease); }
.mobile-menu nav a { display: flex; align-items: baseline; gap: 14px; padding: 10px 0; font-size: clamp(2rem, 9vw, 3rem); line-height: 1.1; font-weight: 500; letter-spacing: -0.02em; border-bottom: 1px solid var(--line); }
.mobile-menu nav a .label { font-size: 0.8rem; }
.mobile-menu nav a[aria-current="page"] { color: var(--accent); }
.mobile-menu__foot { display: grid; gap: 12px; color: var(--text-2); font-size: var(--t-small); }
.menu-open { overflow: hidden; }

@media (max-width: 860px) {
  .nav, .nav-cta { display: none; }
  .menu-btn { display: inline-block; }
}

/* ---- Media primitives ------------------------------------------------- */
.media {
  position: relative; overflow: hidden; border-radius: var(--r-media);
  background: var(--tint, var(--bg-raise));
  isolation: isolate;
}
.media > picture, .media > picture img, .media > video, .media > iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.media > picture img { transition: opacity 500ms var(--ease); }
.media > video { opacity: 0; transition: opacity 600ms var(--ease); }
.media.is-playing > video, .media > video.is-ready { opacity: 1; }
.media > iframe { border: 0; background: #000; }
.media--contain > picture img, .media--contain > video { object-fit: contain; }

/* Tiles: media + caption row; the hover zoom lives on the media only */
.tile { display: block; position: relative; }
.tile .media > picture img, .tile .media > video { transition: transform 900ms var(--ease-out), opacity 600ms var(--ease); }
@media (hover: hover) {
  .tile:hover .media > picture img, .tile:hover .media > video { transform: scale(1.035); }
}
.tile__row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-top: 14px; }
.tile__title { font-size: var(--t-card); font-weight: 500; letter-spacing: -0.005em; line-height: 1.25; }
.tile__arrow { color: var(--text-3); transition: color 200ms, transform 300ms var(--ease-out); flex: none; }
.tile:hover .tile__arrow, .tile:focus-visible .tile__arrow { color: var(--text); transform: translate(2px, -2px); }
.tile:focus-visible { outline-offset: 6px; border-radius: var(--r-media); }
.tile--zoom { cursor: zoom-in; }
.tile__badge {
  position: absolute; top: 10px; right: 10px; z-index: 2; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 500; letter-spacing: 0.04em;
  background: rgba(11, 11, 12, 0.55); color: var(--text); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  pointer-events: none;
}

/* ---- Masonry ------------------------------------------------------------ */
/* JS packs items into balanced columns (order preserved left→right). Without
   JS the items fall back to a simple responsive grid. */
.masonry { --cols: 3; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.masonry.is-packed { display: flex; align-items: flex-start; gap: var(--gap); }
.masonry__col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--gap); }
.masonry--titled { row-gap: clamp(28px, 3vw, 44px); }
.masonry--titled.is-packed .masonry__col { gap: clamp(28px, 3vw, 44px); }
.masonry--photos { --cols: 4; }
@media (max-width: 1099px) { .masonry { --cols: 2; } .masonry--photos { --cols: 3; } }
@media (max-width: 799px) { .masonry--photos { --cols: 2; } }
@media (max-width: 599px) { .masonry { --cols: 1; } .masonry--photos { --cols: 2; } }

figure { margin: 0; }

/* A one-line index of links (homepage "Selected motion studies") */
.index-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 14px clamp(24px, 4vw, 64px); padding-top: 22px; border-top: 1px solid var(--line); }
.index-row ul { display: flex; flex-wrap: wrap; gap: 10px clamp(20px, 3vw, 44px); }
.index-row .link-arrow { font-size: var(--t-card); font-weight: 500; }

/* ---- Reveal on scroll --------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 900ms var(--ease-out), transform 900ms var(--ease-out); transition-delay: calc(var(--i, 0) * 70ms); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
}

/* ---- Home: hero --------------------------------------------------------- */
.hero { position: relative; min-height: 100svh; min-height: max(620px, 100svh); display: flex; align-items: flex-end; overflow: hidden; background: #000; }
.hero__media { position: absolute; inset: 0; }
.hero__media picture, .hero__media img, .hero__media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 24%; }
.hero__media video { opacity: 0; transition: opacity 1200ms var(--ease); }
.hero__media video.is-ready { opacity: 1; }
.hero__shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, rgba(11, 11, 12, 1) 0%, rgba(11, 11, 12, 0.78) 22%, rgba(11, 11, 12, 0.18) 55%, rgba(11, 11, 12, 0.35) 100%),
    linear-gradient(to right, rgba(11, 11, 12, 0.55) 0%, rgba(11, 11, 12, 0) 60%);
}
.hero__inner { position: relative; width: 100%; padding-bottom: clamp(36px, 6vw, 88px); padding-top: calc(var(--header-h) + 40px); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px clamp(32px, 6vw, 120px); align-items: end; }
.hero__copy { max-width: 17.5em; font-size: var(--t-hero); }
.hero__copy .label { font-size: var(--t-label); margin-bottom: 22px; color: var(--text-2); }
.hero__title { font-size: 1em; line-height: 1; letter-spacing: -0.028em; font-weight: 500; }
.hero__aside { display: grid; gap: 22px; justify-items: start; min-width: min(300px, 100%); }
.discipline-list { width: 100%; border-top: 1px solid var(--line-strong); }
.discipline-list a { display: flex; align-items: center; gap: 16px; padding: 13px 2px; border-bottom: 1px solid var(--line-strong); font-size: var(--t-card); font-weight: 500; transition: padding 300ms var(--ease-out), color 200ms; }
.discipline-list a .label { min-width: 2.2em; }
.discipline-list a .icon { margin-left: auto; color: var(--text-3); transition: transform 300ms var(--ease-out), color 200ms; }
.discipline-list a:hover, .discipline-list a:focus-visible { padding-left: 10px; }
.discipline-list a:hover .icon, .discipline-list a:focus-visible .icon { color: var(--text); transform: translateX(3px); }
.hero__scroll { position: absolute; left: 50%; bottom: 18px; width: 1px; height: 44px; overflow: hidden; background: var(--line); transform: translateX(-50%); }
.hero__scroll::after { content: ""; position: absolute; inset: 0; background: var(--text); transform: translateY(-100%); animation: scrollcue 2.4s var(--ease) infinite; }
@keyframes scrollcue { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) { .hero__scroll::after { animation: none; } }
@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__aside { min-width: 0; width: 100%; }
  .hero__scroll { display: none; }
}

/* ---- Home: toolkit ------------------------------------------------------ */
.toolkit { padding-block: clamp(40px, 5vw, 72px); border-bottom: 1px solid var(--line); }
.toolkit__inner { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(0, 3fr); gap: 24px 48px; align-items: center; }
.toolkit__list { display: flex; flex-wrap: wrap; gap: clamp(14px, 2.2vw, 30px) clamp(18px, 2.6vw, 38px); justify-content: flex-end; }
.toolkit__item { position: relative; display: grid; place-items: center; width: clamp(26px, 2.2vw, 32px); aspect-ratio: 1; }
.toolkit__item img { width: 100%; height: 100%; object-fit: contain; opacity: 0.86; transition: opacity 200ms, transform 300ms var(--ease-out); }
.toolkit__item:hover img, .toolkit__item:focus-visible img { opacity: 1; transform: translateY(-2px); }
.toolkit__item .tip {
  position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translate(-50%, 4px); white-space: nowrap;
  padding: 5px 9px; border-radius: 6px; background: var(--text); color: var(--bg); font-size: 0.75rem; font-weight: 500;
  opacity: 0; pointer-events: none; transition: opacity 180ms, transform 180ms var(--ease);
}
.toolkit__item:hover .tip, .toolkit__item:focus-visible .tip { opacity: 1; transform: translate(-50%, 0); }
.toolkit { overflow-x: clip; }
.toolkit__item:last-child .tip, .toolkit__item:nth-last-child(2) .tip { left: auto; right: 0; transform: translate(0, 4px); }
.toolkit__item:last-child:hover .tip, .toolkit__item:nth-last-child(2):hover .tip { transform: none; }
.toolkit__item:first-child .tip { left: 0; transform: translate(0, 4px); }
.toolkit__item:first-child:hover .tip { transform: none; }
@media (max-width: 760px) { .toolkit__inner { grid-template-columns: 1fr; } .toolkit__list { justify-content: flex-start; } }

/* ---- Chapters (homepage sections) & page heads with artwork --------------- */
.chapter { padding-bottom: var(--section); }
.art-band { position: relative; overflow: hidden; isolation: isolate; }
.art-band__img { position: absolute; inset: -2px; z-index: -2; }
.art-band__img img { width: 100%; height: 100%; object-fit: cover; }
.art-band::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to bottom, rgba(11, 11, 12, 0.55) 0%, rgba(11, 11, 12, 0.25) 38%, rgba(11, 11, 12, 0.7) 76%, var(--bg) 100%);
}
@media (prefers-reduced-motion: no-preference) {
  .js .art-band__img { transform: scale(1.08); filter: blur(14px); transition: transform 1800ms var(--ease-out), filter 1400ms var(--ease-out); }
  .js .art-band.is-in .art-band__img { transform: scale(1); filter: blur(0); }
}
.chapter-head { min-height: clamp(360px, 58vh, 620px); display: flex; align-items: flex-end; margin-bottom: clamp(36px, 4vw, 64px); }
.chapter-head__inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px 48px; padding-bottom: clamp(28px, 3vw, 44px); }
.chapter-head .label { color: var(--text-2); margin-bottom: 16px; }
.chapter-title { font-size: var(--t-h2); line-height: 1.04; letter-spacing: -0.025em; max-width: 18em; }
@media (max-width: 760px) { .chapter-head__inner { grid-template-columns: 1fr; } }

.page-head { padding-top: calc(var(--header-h) + clamp(48px, 9vw, 140px)); padding-bottom: clamp(40px, 5vw, 72px); }
.page-head--art { min-height: clamp(440px, 64vh, 720px); display: flex; align-items: flex-end; margin-bottom: clamp(24px, 3vw, 48px); }
.page-head__inner { display: grid; gap: 20px; }
.page-head .label { color: var(--text-2); }
.page-title { font-size: var(--t-h1); line-height: 1; letter-spacing: -0.028em; max-width: 14em; }
.page-head__lead { max-width: 40ch; }

.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.breadcrumb a { color: var(--text-2); transition: color 200ms; }
.breadcrumb a:hover, .breadcrumb a:focus-visible { color: var(--text); }
.breadcrumb .sep { color: var(--text-3); }

/* ---- Home: featured 3D ---------------------------------------------------- */
.studies { padding: clamp(22px, 2.4vw, 32px); border-radius: var(--r-card); background: var(--bg-raise); border: 1px solid var(--line); }
.studies h3 { font-size: var(--t-card); margin-bottom: 18px; }
.studies a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); color: var(--text-2); transition: color 200ms, padding 300ms var(--ease-out); }
.studies a:hover, .studies a:focus-visible { color: var(--text); padding-left: 6px; }

/* ---- Project index (3D collection) -------------------------------------- */
.collection { padding-bottom: var(--section); }
.collection-note { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-bottom: 20px; margin-bottom: clamp(20px, 2.4vw, 36px); border-bottom: 1px solid var(--line); }

/* ---- Project pages ---------------------------------------------------------- */
.project-head { padding-top: calc(var(--header-h) + clamp(40px, 7vw, 112px)); padding-bottom: clamp(32px, 4vw, 64px); }
.project-head__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 28px clamp(32px, 5vw, 96px); align-items: end; margin-top: 28px; }
.project-head__grid--solo { grid-template-columns: 1fr; }
.project-head__aside { display: grid; gap: 22px; }
.meta-list { display: flex; flex-wrap: wrap; gap: 12px 32px; padding-top: 18px; border-top: 1px solid var(--line); }
.meta-list div { display: grid; gap: 4px; }
.meta-list dd { font-size: var(--t-small); color: var(--text); }
@media (max-width: 860px) { .project-head__grid { grid-template-columns: 1fr; } }

.project-body { padding-bottom: var(--section); }
/* Feature media fits the viewport height whatever its shape (square and portrait work stays on screen). */
.feature-media { margin-inline: auto; width: min(100%, calc((100svh - var(--header-h) - 112px) * var(--ar, 1.7778))); }
.feature-media .media { width: 100%; }

.player-facade { position: absolute; inset: 0; display: grid; place-items: center; z-index: 2; cursor: pointer; }
.player-facade__btn {
  display: inline-flex; align-items: center; gap: 12px; padding: 14px 22px 14px 16px; border-radius: 999px;
  background: rgba(11, 11, 12, 0.5); border: 1px solid rgba(243, 240, 234, 0.35); color: var(--text);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); font-weight: 500; font-size: var(--t-small);
  transition: background-color 250ms var(--ease), color 250ms var(--ease), transform 300ms var(--ease-out);
}
.player-facade__btn .play { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--text); color: var(--bg); }
.player-facade:hover .player-facade__btn, .player-facade:focus-visible .player-facade__btn { background: var(--text); color: var(--bg); transform: scale(1.03); }
.player-facade:hover .player-facade__btn .play, .player-facade:focus-visible .player-facade__btn .play { background: var(--bg); color: var(--text); }
.player-facade::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at center, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0) 60%); }

.media-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-top: 16px; }
.media-actions .label { color: var(--text-3); }

/* Pager */
.pager { border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; }
.pager a { display: grid; gap: 10px; padding: clamp(28px, 4vw, 56px) 0; transition: color 200ms; }
.pager a + a { text-align: right; justify-items: end; border-left: 1px solid var(--line); padding-left: 24px; }
.pager a:first-child { padding-right: 24px; }
.pager__title { font-size: var(--t-h3); font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; display: inline-flex; align-items: center; gap: 0.4em; }
.pager__title .icon { transition: transform 300ms var(--ease-out); color: var(--text-3); }
.pager a:hover .pager__title .icon, .pager a:focus-visible .pager__title .icon { transform: translateX(4px); color: var(--text); }
.pager a:first-child:hover .pager__title .icon, .pager a:first-child:focus-visible .pager__title .icon { transform: translateX(-4px); }

/* ---- Scrub player (graphic heroes) --------------------------------------- */
.scrub { position: relative; }
.scrub__stage { width: 100%; }
.scrub__bar { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.scrub__progress { flex: 1; height: 2px; margin-inline: 10px; background: var(--line); border-radius: 2px; overflow: hidden; }
.scrub__progress span { display: block; height: 100%; width: 100%; background: var(--text); transform-origin: left; transform: scaleX(0); }
.scrub__hint { font-size: var(--t-label); color: var(--text-3); letter-spacing: 0.04em; }
.pdf-link { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0.55em 1.05em 0.55em 0.75em; }
.pdf-link img { height: 22px; width: auto; }
.sound-toggle { position: absolute; right: 14px; bottom: 14px; z-index: 3; }
@media (max-width: 600px) { .scrub__hint { display: none; } }

/* ---- Showcase (home + graphic design) --------------------------------------- */
.showcase { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr); gap: clamp(24px, 3.4vw, 56px); align-items: start; }
.showcase__panel { display: grid; gap: 28px; position: sticky; top: calc(var(--header-h) + 24px); }
.showcase__tabs { display: grid; border-top: 1px solid var(--line); }
.showcase__tab {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px 2px;
  border-bottom: 1px solid var(--line); font-size: var(--t-card); font-weight: 500; color: var(--text-3);
  transition: color 200ms, padding 300ms var(--ease-out);
}
.showcase__tab .label { min-width: 2.2em; }
.showcase__tab:hover, .showcase__tab:focus-visible { color: var(--text-2); }
.showcase__tab[aria-selected="true"] { color: var(--text); padding-left: 10px; }
.showcase__tab[aria-selected="true"] .label { color: var(--accent); }
.showcase__copy { display: grid; gap: 14px; }
.showcase__copy h3 { font-size: var(--t-h3); letter-spacing: -0.02em; line-height: 1.08; }
.showcase__copy p.desc { color: var(--text-2); }
@media (max-width: 1000px) { .showcase { grid-template-columns: 1fr; } .showcase__panel { position: static; } }

/* ---- IKEA split + asset grids ---------------------------------------------- */
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 96px); align-items: start; }
.split__aside { position: sticky; top: calc(var(--header-h) + 32px); }
@media (max-width: 960px) { .split { grid-template-columns: 1fr; } .split__aside { position: static; } }
.grid-rows { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
@media (max-width: 1100px) { .grid-rows { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.section-gap { margin-top: clamp(56px, 7vw, 112px); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 18px; margin-bottom: clamp(20px, 2.4vw, 32px); border-bottom: 1px solid var(--line); }
.section-title h2 { font-size: var(--t-h3); letter-spacing: -0.02em; }

/* ---- Contact ---------------------------------------------------------------- */
.contact { padding-top: calc(var(--header-h) + clamp(40px, 8vw, 120px)); padding-bottom: var(--section); }
.contact__grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(36px, 6vw, 112px); align-items: center; }
.contact__copy { display: grid; gap: 28px; }
.contact__visual .media { aspect-ratio: 1; }
.email-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.email-big { font-size: var(--t-h3); font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; background: linear-gradient(currentColor, currentColor) left bottom / 100% 1px no-repeat; padding-bottom: 6px; transition: background-size 400ms var(--ease-out), color 200ms; word-break: break-word; }
.email-big:hover, .email-big:focus-visible { color: var(--accent); }
.social-list { display: grid; border-top: 1px solid var(--line); }
.social-list a { display: flex; align-items: center; gap: 16px; padding: 16px 2px; border-bottom: 1px solid var(--line); font-weight: 500; transition: padding 300ms var(--ease-out), color 200ms; }
.social-list a .ico { display: grid; place-items: center; width: 26px; flex: none; }
.social-list a img { width: 26px; height: 24px; object-fit: contain; }
.social-list a .icon { margin-left: auto; color: var(--text-3); transition: transform 300ms var(--ease-out), color 200ms; }
.social-list a:hover, .social-list a:focus-visible { padding-left: 10px; }
.social-list a:hover .icon, .social-list a:focus-visible .icon { color: var(--text); transform: translate(2px, -2px); }
@media (max-width: 900px) { .contact__grid { grid-template-columns: 1fr; } .contact__visual { order: -1; max-width: 520px; } }

/* ---- Footer ------------------------------------------------------------------ */
.site-footer { border-top: 1px solid var(--line); }
.footer-cta { padding-block: clamp(72px, 9vw, 144px); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px 64px; align-items: end; }
.footer-cta .label { color: var(--text-2); margin-bottom: 18px; }
.footer-title { font-size: var(--t-h1); line-height: 1; letter-spacing: -0.028em; max-width: 12em; }
.footer-cta__actions { display: grid; gap: 14px; justify-items: start; }
.footer-bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; padding-block: 36px; border-top: 1px solid var(--line); font-size: var(--t-small); }
.footer-bar h2 { font-size: var(--t-label); font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); margin-bottom: 14px; }
.footer-bar li + li { margin-top: 8px; }
.footer-bar a { color: var(--text-2); transition: color 200ms; display: inline-flex; align-items: center; gap: 10px; }
.footer-bar a:hover, .footer-bar a:focus-visible { color: var(--text); }
.footer-bar a img { width: 20px; height: 18px; object-fit: contain; opacity: 0.8; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-block: 22px 32px; color: var(--text-3); font-size: var(--t-label); letter-spacing: 0.04em; }
@media (max-width: 860px) { .footer-cta { grid-template-columns: 1fr; } .footer-bar { grid-template-columns: 1fr 1fr; } }

/* ---- Lightbox ------------------------------------------------------------------ */
.lb {
  position: fixed; inset: 0; z-index: 80; display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  background: rgba(8, 8, 9, 0.96); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden; transition: opacity 260ms var(--ease), visibility 0s linear 260ms;
}
.lb.is-open { opacity: 1; visibility: visible; transition: opacity 260ms var(--ease); }
.lb__top, .lb__bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px var(--gutter); min-height: 68px; }
.lb__caption { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.lb__caption strong { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb__stage { position: relative; display: grid; place-items: center; padding: 0 var(--gutter); min-height: 0; touch-action: pan-y; }
.lb__frame { position: relative; max-width: 100%; max-height: 100%; border-radius: 6px; overflow: hidden; background: var(--tint, #111); }
.lb__frame picture, .lb__frame img, .lb__frame video { display: block; width: 100%; height: 100%; object-fit: contain; }
.lb__frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.lb__frame img { opacity: 0; transition: opacity 300ms var(--ease); }
.lb__frame img.is-loaded { opacity: 1; }
.lb__frame.is-zoomable img { cursor: zoom-in; }
.lb__frame.is-zoomed { overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.lb__frame.is-zoomed picture { max-width: none; }
.lb__frame.is-zoomed img { cursor: zoom-out; max-width: none; }
.lb__nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; background: rgba(11, 11, 12, 0.5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.lb__nav--prev { left: calc(var(--gutter) * 0.5); }
.lb__nav--next { right: calc(var(--gutter) * 0.5); }
.lb__count { font-variant-numeric: tabular-nums; }
.lb-open { overflow: hidden; }
@media (max-width: 700px) { .lb__nav { top: auto; bottom: -58px; transform: none; } .lb__stage { padding: 0 12px; } }

/* ---- 404 ----------------------------------------------------------------------- */
.notfound { min-height: 80vh; display: grid; align-content: center; gap: 28px; padding-top: var(--header-h); }

/* ---- Print ---------------------------------------------------------------------- */
@media print {
  .site-header, .mobile-menu, .hero__scroll, .lb { display: none !important; }
  body { background: #fff; color: #000; }
}
