/* =================================================================
   Peter Alexandrov — portfolio
   Monochrome editorial grid, one signal colour (REC red),
   grotesk + italic serif + mono for technical labels.
   ================================================================= */

/* ---------- Fonts (self-hosted, OFL) ---------- */
@font-face { font-family: "Geist"; src: url(../fonts/geist.woff2) format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url(../fonts/geist-mono.woff2) format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url(../fonts/instrument-serif.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url(../fonts/instrument-serif-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  --bg: #000;
  --fg: #fdfacd;
  --mute: rgba(253, 250, 205, .52);
  --line: rgba(253, 250, 205, .16);
  --accent: #ff3d00;
  --img-bg: #111;

  --sans: "Geist", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Instrument Serif", "Times New Roman", serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --gutter: clamp(16px, 2.6vw, 40px);
  --header-h: 56px;
  --timeline-h: 40px;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-cine: cubic-bezier(.77, 0, .18, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--sans); font-size: 16px; line-height: 1.45; letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ol, ul, figure { margin: 0; padding: 0; font-weight: inherit; }
ol, ul { list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: 0; }
sup { font-size: .7em; vertical-align: super; line-height: 0; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }

.wrap { padding-left: var(--gutter); padding-right: var(--gutter); }
.mono { font-family: var(--mono); font-size: 11px; line-height: 1.4; letter-spacing: .02em; text-transform: uppercase; font-weight: 400; }
.label { color: var(--mute); }
.mask { display: inline-block; overflow: hidden; vertical-align: top; }
.mask > * { display: inline-block; }

.skip { position: fixed; left: var(--gutter); top: -60px; z-index: 300; padding: 8px 12px; background: var(--accent); color: #fff; }
.skip:focus { top: 8px; }

/* ---------- Rolling text on hover ---------- */
.roll { position: relative; display: inline-block; overflow: hidden; vertical-align: top; }
.roll > span, .roll::after { display: block; transition: transform .55s var(--ease-out); }
.roll::after { content: attr(data-text); position: absolute; left: 0; top: 100%; white-space: nowrap; }
a:hover .roll > span, a:hover .roll::after,
button:hover .roll > span, button:hover .roll::after { transform: translateY(-100%); }

/* REC dot */
.rec { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: rec 1.6s steps(2, jump-none) infinite; }
@keyframes rec { 50% { opacity: .15; } }

/* =================================================================
   Loader
   ================================================================= */
.loader {
  position: fixed; inset: 0; z-index: 200; background: #000; color: #fdfacd;
  display: flex; align-items: center; justify-content: space-between; padding: 0 var(--gutter);
  font-family: var(--serif); font-size: 15px;
}
.loader__name { font-style: italic; }
.loader__count { font-family: var(--mono); font-size: 11px; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.loader__frame {
  position: absolute; left: 50%; top: 50%; width: clamp(150px, 16vw, 260px); height: clamp(100px, 10.7vw, 174px);
  transform: translate(-50%, -50%); overflow: hidden; background: #111;
  transition: width 1.3s var(--ease-cine), height 1.3s var(--ease-cine);
}
.loader__frame img { width: 100%; height: 100%; object-fit: cover; }
.loader__frame img.is-hero { filter: grayscale(1) contrast(1.08) brightness(.82); }
.loader.is-opening .loader__frame { width: 100vw; height: 100vh; }
.loader.is-opening .loader__name, .loader.is-opening .loader__count { opacity: 0; transition: opacity .4s; }
.loader.is-done { opacity: 0; visibility: hidden; transition: opacity .6s ease .1s, visibility 0s .7s; }
.no-js .loader { display: none; }

/* =================================================================
   Header
   ================================================================= */
.header {
  position: fixed; left: 0; right: 0; top: 0; z-index: 50; height: var(--header-h);
  display: grid; grid-template-columns: repeat(12, 1fr); align-items: center; column-gap: 12px;
  padding: 0 var(--gutter); color: #fdfacd; mix-blend-mode: difference;
  font-size: 13px; letter-spacing: -.005em;
}
/* Intro: the header stays hidden until the hero animation is over */
.intro .header { opacity: 0; transform: translateY(-16px); pointer-events: none; }
.intro .header__logo, .intro .header__nav a { opacity: 0; transform: translateY(-10px); }
.intro.header-in .header { opacity: 1; transform: none; pointer-events: auto; transition: opacity .8s ease, transform 1.1s var(--ease-out); }
.intro.header-in .header__logo, .intro.header-in .header__nav a { transform: none; transition: opacity .7s ease, transform 1s var(--ease-out); }
.intro.header-in .header__logo { opacity: 1; }
.intro.header-in .header__nav a { opacity: .78; }
.intro.header-in .header__nav a:hover, .intro.header-in .header__nav a.is-active { opacity: 1; }
.intro.header-in .header__nav a:nth-child(1) { transition-delay: .08s; }
.intro.header-in .header__nav a:nth-child(2) { transition-delay: .14s; }
.intro.header-in .header__nav a:nth-child(3) { transition-delay: .2s; }
.intro.header-in .header__nav a:nth-child(4) { transition-delay: .26s; }
.intro.header-in .header__nav a:nth-child(5) { transition-delay: .32s; }
.intro.header-in .header__nav a:nth-child(6) { transition-delay: .38s; }
.header__logo { position: relative; z-index: 2; grid-column: 1 / span 3; display: inline-flex; align-items: center; gap: 10px; font-weight: 500; justify-self: start; }
.header__logo .rec { width: 7px; height: 7px; }
.header__nav { grid-column: 5 / -1; display: grid; grid-template-columns: repeat(6, 1fr); column-gap: 12px; }
.header__nav a { position: relative; padding-left: 10px; opacity: .78; transition: opacity .3s; justify-self: start; }
.header__nav a::before { content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; width: 1px; background: currentColor; opacity: .5; }
.header__nav a:hover, .header__nav a.is-active { opacity: 1; }
.header__nav a.is-active::before { opacity: 1; width: 2px; }
.header__menu { display: none; }
.header__progress { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 0; height: 1px; background: rgba(253,250,205,.2); }
.header__progress span { display: block; height: 100%; background: #fdfacd; transform-origin: left; transform: scaleX(0); }

/* =================================================================
   Timeline (bottom)
   ================================================================= */
.timeline {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; height: var(--timeline-h);
  display: grid; grid-template-columns: minmax(150px, 1fr) 6fr minmax(190px, 1fr); align-items: center; column-gap: 24px;
  padding: 0 var(--gutter); color: #fdfacd; mix-blend-mode: difference; pointer-events: none;
}
.timeline__chapter { white-space: nowrap; }
.timeline__chapter b { font-weight: 500; margin-right: 6px; }
.timeline__ruler {
  position: relative; height: 9px;
  background:
    linear-gradient(rgba(253,250,205,.55), rgba(253,250,205,.55)) left bottom / 100% 1px no-repeat,
    repeating-linear-gradient(90deg, rgba(253,250,205,.4) 0 1px, transparent 1px 16px) left bottom / 100% 5px no-repeat;
}
.timeline__mark { position: absolute; bottom: 0; width: 1px; height: 9px; background: #fdfacd; }
.timeline__head { position: absolute; bottom: -3px; left: 0; width: 7px; height: 7px; margin-left: -3px; border-radius: 50%; background: #fdfacd; box-shadow: 0 0 0 3px rgba(253,250,205,.18); }
.timeline__tc { justify-self: end; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* =================================================================
   Hero
   ================================================================= */
.hero {
  position: relative; height: 100vh; height: 100svh; min-height: 560px; overflow: hidden; color: #fdfacd;
  display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: calc(var(--timeline-h) + 18px);
}
.hero__media { position: absolute; inset: 0; background: #000; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.08) brightness(.82); will-change: transform; }
.hero__shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,.05) 55%, rgba(0,0,0,.62) 100%); }
.hero__name { position: relative; padding: 0 var(--gutter); font-weight: 600; letter-spacing: -.065em; line-height: .8; will-change: transform, opacity; }
.hero__line { display: block; white-space: nowrap; }
.hero__line .mask { overflow: visible; }
.hero__word { display: inline-block; font-size: 21vw; }
/* Entrance: each letter pulls focus — out of a soft blur, from wide to tight, centre first */
.hero__word .c {
  display: inline-block; opacity: 0; filter: blur(.12em);
  transform: translate3d(calc(var(--off, 0) * .16em), 0, 0) scale(1.28);
  transition: opacity .9s ease, filter 1.5s var(--ease-out), transform 1.7s var(--ease-out);
  transition-delay: calc(var(--wd, 0s) + var(--k, 0) * 60ms);
}
.hero__word .c { position: relative; }
.is-ready .hero__word .c { opacity: 1; filter: blur(0); transform: none; }
/* After the intro: letters turn red under the cursor and lean/stretch towards it (driven by JS), anchored at the baseline */
.name-live .hero__word .c { transform-origin: 50% 100%; transition: color .25s ease; transition-delay: 0s; will-change: transform; cursor: default; }
.name-live .hero__word .c:hover { color: var(--accent); }
.hero__row { position: relative; display: flex; justify-content: space-between; align-items: baseline; margin: 14px var(--gutter) 0; padding-top: 16px; border-top: 1px solid rgba(253,250,205,.4); }
.hero__role { font-size: clamp(20px, 2.2vw, 34px); line-height: 1.1; }
.hero__role .mask > span, .hero__scroll .mask > span { transform: translateY(110%); transition: transform 1.1s var(--ease-out); }
.hero__scroll { color: rgba(253,250,205,.7); }
.is-ready .hero__role .mask > span, .is-ready .hero__scroll .mask > span { transform: none; }
.is-ready .hero__role .mask > span { transition-delay: 2.2s; }
.is-ready .hero__scroll .mask > span { transition-delay: 2.45s; }

/* =================================================================
   Sections — shared
   ================================================================= */
.section { position: relative; padding-top: clamp(96px, 16vh, 180px); }
.section__head { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 12px; align-items: center; margin-bottom: clamp(40px, 7vh, 80px); }
.section__head > .label:first-child { grid-column: 1 / span 1; }
.section__head h2 { grid-column: 2 / span 3; }
.wave { grid-column: 5 / -1; width: 100%; height: 12px; overflow: visible; }
.wave path { fill: none; stroke: var(--fg); stroke-width: 1; vector-effect: non-scaling-stroke; opacity: .35; }
.js-wave .wave path { stroke-dasharray: var(--len, 2000); stroke-dashoffset: var(--len, 2000); transition: stroke-dashoffset 2.2s var(--ease-cine); }
.js-wave .section__head.is-in .wave path { stroke-dashoffset: 0; }

/* text reveal */
[data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity 1s ease, transform 1.2s var(--ease-out); transition-delay: var(--rd, 0s); }
[data-reveal].is-in { opacity: 1; transform: none; }

/* =================================================================
   About
   ================================================================= */
.about__lead { display: block; font-size: clamp(40px, 7.6vw, 136px); line-height: .94; font-weight: 500; letter-spacing: -.055em; margin-bottom: clamp(60px, 12vh, 140px); }
.about__l { display: block; }
.about__l2 { padding-left: 24%; }
.about__l3 { padding-left: 8%; }
.about__l3 em { letter-spacing: -.02em; }
.about__lead .w { display: inline-block; opacity: .12; transition: opacity .35s linear; }
.about__lead .w.on { opacity: 1; }
.about__frame { position: relative; overflow: hidden; height: clamp(520px, 105vh, 1100px); }
.about__img { position: absolute; left: 0; right: 0; top: -12%; height: 124%; will-change: transform; }
.about__img img { width: 100%; height: 100%; object-fit: cover; }
.about__notes { position: absolute; left: 0; right: 0; bottom: 9%; display: flex; justify-content: space-between; gap: 30%; color: #fdfacd; }
.about__note { max-width: 330px; font-size: clamp(14px, 1.15vw, 18px); line-height: 1.4; }
.about__note .mono { color: rgba(253,250,205,.6); margin-right: 6px; }
.about__note--right { --rd: .15s; }

/* =================================================================
   Education
   ================================================================= */
[data-dark] { --lit: 0; }
.index { border-top: 1px solid var(--line); }
.index__row { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 12px; align-items: center; padding: 26px 0; border-bottom: 1px solid var(--line); opacity: calc(.06 + var(--lit) * .94); }
.index__num { grid-column: 1; color: var(--mute); }
.index__title { grid-column: 2 / span 8; font-size: clamp(22px, 2.9vw, 46px); line-height: 1.05; letter-spacing: -.04em; font-weight: 500; }
.index__logo { grid-column: 11 / -1; justify-self: end; height: 64px; display: flex; align-items: center; }
.index__logo img { max-height: 64px; width: auto; filter: grayscale(1); }
.education__photos { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 12px; row-gap: 12px; margin-top: clamp(60px, 10vh, 120px); align-items: start; }
.education__photo { overflow: hidden; background: var(--img-bg); }
.education__photo img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) brightness(var(--lit)); opacity: calc(.2 + var(--lit) * .8); }
.education__photo--a { grid-column: 1 / span 7; aspect-ratio: 16 / 9; }
.education__photo--b { grid-column: 9 / span 4; aspect-ratio: 1; margin-top: 18%; }
.education__photo--c { grid-column: 3 / span 6; aspect-ratio: 16 / 9; }

/* =================================================================
   Works
   ================================================================= */
.worklist { border-top: 1px solid var(--line); }
.worklist li {
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 12px; align-items: baseline;
  padding: 14px 0 12px; border-bottom: 1px solid var(--line);
  opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform 1s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 45ms);
}
.worklist.is-in li { opacity: 1; transform: none; }
.worklist li > .mono:first-child { grid-column: 1; color: var(--mute); transition: color .3s; }
.worklist__t { grid-column: 2 / span 9; font-size: clamp(20px, 2.5vw, 40px); line-height: 1.08; letter-spacing: -.04em; font-weight: 500; transition: transform .6s var(--ease-out); }
.worklist__y { grid-column: 12; justify-self: end; color: var(--mute); }
@media (hover: hover) {
  .worklist li:hover .worklist__t { transform: translateX(18px); }
  .worklist li:hover > .mono:first-child { color: var(--accent); }
}

.stills { margin-top: clamp(80px, 14vh, 160px); }
.stills__head { display: flex; justify-content: space-between; margin-bottom: 14px; }
.stills__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.still { position: relative; display: block; width: 100%; aspect-ratio: 4 / 5; overflow: hidden; background: var(--img-bg); clip-path: inset(100% 0 0 0); transition: clip-path 1.5s var(--ease-cine); transition-delay: var(--sd, 0s); }
.still img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) brightness(.6); transition: filter 1.6s ease; transition-delay: var(--sd, 0s); }
.still__n { position: absolute; left: 10px; top: 10px; color: #fdfacd; mix-blend-mode: difference; }
[data-anim="stills"].is-in .still { clip-path: inset(0 0 0 0); }
[data-anim="stills"].is-in .still img { filter: none; }
@media (hover: hover) and (pointer: fine) { .has-cursor .still { cursor: none; } }

.cursor-label {
  position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none;
  padding: 7px 11px 6px; border-radius: 99px; background: var(--accent); color: #fff;
  transform: translate(-50%, -50%) scale(0); transition: transform .35s var(--ease-out);
}
.cursor-label.is-on { transform: translate(-50%, -50%) scale(1); }

/* =================================================================
   Showreel — viewfinder
   ================================================================= */
.viewfinder { position: relative; }
.viewfinder__box { position: relative; aspect-ratio: 16 / 9; background: #000; clip-path: inset(12% 16%); transition: clip-path 1.8s var(--ease-cine); }
.viewfinder__box.is-in { clip-path: inset(0 0); }
.viewfinder__box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.reel { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #000; color: #fdfacd; cursor: pointer; }
.reel__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: transform 1.4s var(--ease-out), filter .8s ease; filter: brightness(.72); }
.reel:hover .reel__poster { transform: scale(1.025); filter: brightness(.9); }
.reel__play { position: relative; display: inline-flex; align-items: center; gap: 14px; padding: 12px 20px 12px 12px; border-radius: 99px; background: rgba(0,0,0,.45); border: 1px solid rgba(253,250,205,.35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: border-color .3s, background .3s; }
.reel:hover .reel__play { border-color: var(--accent); background: rgba(0,0,0,.6); }
.reel__icon { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); position: relative; }
.reel__icon::after { content: ""; position: absolute; left: 15px; top: 12px; border-style: solid; border-width: 7px 0 7px 11px; border-color: transparent transparent transparent #fff; }
.reel__dur { color: rgba(253,250,205,.6); }
.viewfinder__c { position: absolute; width: 26px; height: 26px; border: 0 solid #fdfacd; mix-blend-mode: difference; pointer-events: none; }
.viewfinder__c--tl { left: 14px; top: 14px; border-left-width: 1px; border-top-width: 1px; }
.viewfinder__c--tr { right: 14px; top: 14px; border-right-width: 1px; border-top-width: 1px; }
.viewfinder__c--bl { left: 14px; bottom: 14px; border-left-width: 1px; border-bottom-width: 1px; }
.viewfinder__c--br { right: 14px; bottom: 14px; border-right-width: 1px; border-bottom-width: 1px; }
.viewfinder__meta { display: flex; justify-content: space-between; margin-top: 12px; color: var(--mute); font-variant-numeric: tabular-nums; }
.viewfinder__meta .rec { width: 6px; height: 6px; margin-right: 4px; vertical-align: 1px; }

/* =================================================================
   Side projects — slideshow
   ================================================================= */
.side__intro { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 12px; align-items: end; margin-bottom: clamp(36px, 6vh, 64px); }
.side__subtitle { grid-column: 1 / span 9; font-size: clamp(36px, 6.2vw, 112px); line-height: .95; }
.side__subtitle em { letter-spacing: -.02em; }
.side__note { grid-column: 10 / -1; justify-self: end; color: var(--mute); --rd: .15s; }

.slider { position: relative; }
.slider:focus-visible { outline-offset: 6px; }
.slider__viewport { position: relative; aspect-ratio: 3 / 2; width: 100%; max-width: calc((100vh - 170px) * 1.5); margin: 0 auto; overflow: hidden; background: var(--img-bg); touch-action: pan-y; cursor: grab; }
.slider__viewport:active { cursor: grabbing; }
.slider__track { position: absolute; inset: 0; }
.slider__slide { position: absolute; inset: 0; visibility: hidden; overflow: hidden; }
.slider__slide img { width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.slider__slide.is-active { visibility: visible; z-index: 2; animation: wipeFromRight 1.2s var(--ease-cine) both; }
.slider.is-back .slider__slide.is-active { animation-name: wipeFromLeft; }
.slider__slide.is-leaving { visibility: visible; z-index: 1; }
.slider__slide.is-leaving img { animation: dimOut 1.2s var(--ease-cine) both; }
.slider.no-anim .slider__slide.is-active { animation: none; }
.slider__bar { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; column-gap: 24px; margin: 14px auto 0; max-width: calc((100vh - 170px) * 1.5); }
.slider__btn:hover { color: var(--accent); }
.slider__counter { font-variant-numeric: tabular-nums; overflow: hidden; }
.slider__current { display: inline-block; color: var(--fg); }
.slider__current.is-rolling { animation: digitRoll .6s var(--ease-out) both; }
.slider__total { color: var(--mute); }
.slider__progress { height: 1px; background: var(--line); overflow: hidden; }
.slider__progress span { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }
.slider__progress span.is-running { animation: progress var(--autoplay, 6s) linear forwards; }
.slider.is-paused .slider__progress span { animation-play-state: paused; }
.slider__dots { display: flex; gap: 6px; margin: 16px auto 0; max-width: calc((100vh - 170px) * 1.5); }
.slider__dot { width: 18px; height: 2px; background: var(--line); transition: background .3s, width .4s var(--ease-out); }
.slider__dot::before { content: ""; display: block; height: 14px; margin-top: -6px; }
.slider__dot[aria-selected="true"] { background: var(--fg); width: 36px; }

@keyframes wipeFromRight { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }
@keyframes wipeFromLeft { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes dimOut { from { filter: brightness(1); } to { filter: brightness(.3); } }
@keyframes progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes digitRoll { from { transform: translateY(100%); opacity: 0; } to { transform: none; opacity: 1; } }

/* =================================================================
   Exhibitions
   ================================================================= */
.exlist { border-top: 1px solid var(--line); }
.exlist__item { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 12px; align-items: baseline; padding: 30px 0 28px; border-bottom: 1px solid var(--line); }
.exlist__item + .exlist__item { --rd: .12s; }
.exlist__num { grid-column: 1; color: var(--mute); }
.exlist__name { grid-column: 2 / span 7; font-size: clamp(30px, 4.4vw, 76px); line-height: 1; }
.exlist__place { grid-column: 9 / -1; justify-self: end; text-align: right; color: var(--mute); }

/* =================================================================
   Contacts + footer playground
   ================================================================= */
.contacts { padding-bottom: calc(var(--timeline-h) + 8px); overflow: hidden; }
.contacts__main { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 12px; row-gap: 6px; }
.contacts__big { grid-column: 1 / -1; justify-self: start; font-size: clamp(28px, 5.6vw, 104px); line-height: 1.02; font-weight: 500; letter-spacing: -.055em; transition: color .3s, opacity 1s ease, transform 1.2s var(--ease-out); }
.contacts__big + .contacts__big { --rd: .1s; }
.contacts__big:hover { color: var(--accent); }
.contacts__social { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px 36px; margin-top: 34px; --rd: .2s; }
.contacts__social a { transition: color .3s; }
.contacts__social a:hover { color: var(--accent); }
.playground {
  position: relative; display: flex; justify-content: space-between; margin-top: clamp(80px, 14vh, 160px); padding: 0 var(--gutter);
  font-size: 15.6vw; line-height: .8; font-weight: 600; letter-spacing: -.06em; user-select: none; -webkit-user-select: none; touch-action: none;
}
.playground span { display: inline-block; cursor: grab; will-change: transform; transition: transform .9s cubic-bezier(.34, 1.56, .64, 1), color .3s; }
.playground span.is-drag { cursor: grabbing; transition: color .3s; color: var(--accent); position: relative; z-index: 2; }
.playground__hint { display: flex; justify-content: space-between; color: var(--mute); padding-top: 14px; padding-bottom: 6px; }

/* =================================================================
   Lightbox
   ================================================================= */
.lightbox { position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center; background: rgba(5,5,5,.96); color: #fdfacd; opacity: 0; transition: opacity .5s ease; }
.lightbox[hidden] { display: none; }
.lightbox.is-open { opacity: 1; }
.lightbox__img { max-width: min(86vw, 1100px); max-height: 82vh; width: auto; height: auto; object-fit: contain; clip-path: inset(50% 0 50% 0); transition: clip-path .9s var(--ease-cine), opacity .3s ease; }
.lightbox.is-open .lightbox__img { clip-path: inset(0 0 0 0); }
.lightbox__img.is-swapping { opacity: 0; }
.lightbox__close { position: absolute; top: 18px; right: var(--gutter); }
.lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); padding: 12px 0; }
.lightbox__nav--prev { left: var(--gutter); }
.lightbox__nav--next { right: var(--gutter); }
.lightbox__close:hover, .lightbox__nav:hover { color: var(--accent); }
.lightbox__count { position: absolute; bottom: 22px; left: 0; right: 0; text-align: center; color: rgba(253,250,205,.6); }
body.no-scroll { overflow: hidden; }

/* =================================================================
   Tablet & phone
   ================================================================= */
@media (max-width: 1024px) {
  .header__nav { grid-column: 4 / -1; }
  .header { font-size: 12px; }
  .about__notes { gap: 24%; }
  .timeline { grid-template-columns: minmax(130px, 1fr) 4fr minmax(170px, 1fr); }
}

@media (max-width: 760px) {
  .intro.header-in .header__nav a { opacity: 1; transition-delay: 0s; }
  :root { --header-h: 52px; --timeline-h: 36px; }
  .header { grid-template-columns: 1fr auto; }
  .header__logo { grid-column: 1; }
  .header__menu { display: block; grid-column: 2; position: relative; z-index: 2; }
  .header__nav {
    position: fixed; inset: 0; z-index: 1; display: flex; flex-direction: column; justify-content: center; gap: 2px;
    padding: 0 var(--gutter); background: #000;
    opacity: 0; visibility: hidden; transition: opacity .4s ease, visibility 0s .4s;
  }
  .header__nav.is-open { opacity: 1; visibility: visible; transition: opacity .4s ease; }
  .header__nav a { font-size: 44px; line-height: 1.1; letter-spacing: -.05em; font-weight: 500; opacity: 1; padding-left: 0; }
  .header__nav a::before { display: none; }
  .header.menu-open { mix-blend-mode: normal; }
  .header__progress { display: none; }

  .timeline { grid-template-columns: auto 1fr; column-gap: 14px; }
  .timeline__tc { display: none; }

  .section__head { grid-template-columns: auto auto 1fr; column-gap: 14px; }
  .section__head > .label:first-child, .section__head h2, .wave { grid-column: auto; }

  .about__l2 { padding-left: 12%; }
  .about__l3 { padding-left: 0; }
  .about__frame { height: 92vh; }
  .about__notes { gap: 26%; bottom: 7%; }
  .about__note { font-size: 12px; max-width: none; flex: 1; }
  .about__note .mono { display: block; margin-bottom: 4px; }

  .index__row { grid-template-columns: 32px 1fr 56px; padding: 20px 0; }
  .index__num, .index__title, .index__logo { grid-column: auto; }
  .index__logo, .index__logo img { height: 44px; max-height: 44px; }
  .education__photos { grid-template-columns: repeat(6, 1fr); }
  .education__photo--a { grid-column: 1 / -1; }
  .education__photo--b { grid-column: 3 / -1; margin-top: 0; }
  .education__photo--c { grid-column: 1 / span 5; }

  .worklist li { grid-template-columns: 32px 1fr auto; column-gap: 10px; padding: 12px 0 10px; }
  .worklist li > .mono:first-child, .worklist__t, .worklist__y { grid-column: auto; }
  .stills__grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }

  .viewfinder__c { width: 16px; height: 16px; }
  .viewfinder__c--tl, .viewfinder__c--bl { left: 8px; }
  .viewfinder__c--tr, .viewfinder__c--br { right: 8px; }
  .viewfinder__c--tl, .viewfinder__c--tr { top: 8px; }
  .viewfinder__c--bl, .viewfinder__c--br { bottom: 8px; }

  .side__intro { display: block; }
  .side__note { display: block; margin-top: 14px; }
  .slider__bar { grid-template-columns: 1fr auto auto; row-gap: 12px; column-gap: 18px; }
  .slider__counter { grid-column: 1; grid-row: 1; }
  .slider__btn--prev { grid-column: 2; grid-row: 1; }
  .slider__btn--next { grid-column: 3; grid-row: 1; }
  .slider__progress { grid-column: 1 / -1; grid-row: 2; }

  .exlist__item { grid-template-columns: 32px 1fr; row-gap: 10px; }
  .exlist__num, .exlist__name { grid-column: auto; }
  .exlist__place { grid-column: 2; justify-self: start; text-align: left; }

  .lightbox__img { max-width: 100vw; max-height: 74vh; }
  .lightbox__nav { top: auto; bottom: 18px; transform: none; }
  .lightbox__count { bottom: 30px; }
}

/* =================================================================
   No JS / reduced motion: everything visible, nothing moves
   ================================================================= */
.no-js .hero__word .c, .no-js .hero__role .mask > span, .no-js .hero__scroll .mask > span,
.no-js [data-reveal], .no-js .worklist li, .no-js .still, .no-js .viewfinder__box { transform: none !important; opacity: 1 !important; clip-path: none !important; }
.no-js .still img, .no-js .hero__word .c { filter: none; }
.no-js [data-dark] { --lit: 1; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .hero__word .c, .hero__role .mask > span, .hero__scroll .mask > span, [data-reveal], .worklist li, .still, .viewfinder__box { transform: none !important; opacity: 1 !important; clip-path: none !important; }
  .hero__word .c { filter: none !important; }
  .still img { filter: none !important; }
  [data-dark] { --lit: 1 !important; }
  .about__lead .w { opacity: 1 !important; }
  .rec { animation: none; }
}
