/* ═══════════════════════════════════════════════
   DENIS DASEN // ANIMATION DIRECTOR
   main.css — all visual styles
   ═══════════════════════════════════════════════ */

/* ── 1. RESET & VARIABLES ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:       #080808;
  --lime:     #ccff00;
  --white:    #ffffff;
  --mono:     'JetBrains Mono', monospace;
  --display:  'Bebas Neue', sans-serif;
  --body:     'Barlow', sans-serif;
  --grid-c:   rgba(255, 255, 255, 0.034);
  --nav-h:    72px;
  --gap:      6px;
  --ease:     cubic-bezier(0.16, 1, 0.3, 1);
  --dur:      0.72s;
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--white);
  user-select: none;
}

/* ── 2. BACKGROUND GRID ── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(var(--grid-c) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-c) 1px, transparent 1px);
  background-size: 56px 56px;
  pointer-events: none;
  z-index: 0;
}

/* ── GRID GLOW ORBS ── */
.grid-glow {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.grid-glow__orb {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}

/* Orb 1 — lime, large, slow drift across top-left → bottom-right */
.grid-glow__orb:nth-child(1) {
  width: 520px; height: 520px;
  top: -260px; left: -260px;
  background: radial-gradient(circle, rgba(204,255,0,0.042) 0%, transparent 65%);
  animation: glow-1 28s ease-in-out infinite;
}

/* Orb 2 — white, medium, opposite diagonal */
.grid-glow__orb:nth-child(2) {
  width: 340px; height: 340px;
  top: 0; right: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.028) 0%, transparent 65%);
  animation: glow-2 22s ease-in-out infinite;
}

/* Orb 3 — lime, small, vertical center wander */
.grid-glow__orb:nth-child(3) {
  width: 260px; height: 260px;
  top: 30%; left: 40%;
  background: radial-gradient(circle, rgba(204,255,0,0.03) 0%, transparent 65%);
  animation: glow-3 34s ease-in-out infinite;
}

/* Orb 4 — white, large, bottom sweep */
.grid-glow__orb:nth-child(4) {
  width: 440px; height: 440px;
  bottom: -220px; right: 20%;
  background: radial-gradient(circle, rgba(255,255,255,0.022) 0%, transparent 65%);
  animation: glow-4 40s ease-in-out infinite;
}

@keyframes glow-1 {
  0%   { transform: translate(0px, 0px); }
  25%  { transform: translate(55vw, 35vh); }
  50%  { transform: translate(80vw, 10vh); }
  75%  { transform: translate(30vw, 75vh); }
  100% { transform: translate(0px, 0px); }
}
@keyframes glow-2 {
  0%   { transform: translate(0px, 0px); }
  30%  { transform: translate(-60vw, 55vh); }
  60%  { transform: translate(-20vw, 90vh); }
  100% { transform: translate(0px, 0px); }
}
@keyframes glow-3 {
  0%   { transform: translate(0px, 0px); }
  20%  { transform: translate(-25vw, -20vh); }
  45%  { transform: translate(30vw, 40vh); }
  70%  { transform: translate(-15vw, 25vh); }
  100% { transform: translate(0px, 0px); }
}
@keyframes glow-4 {
  0%   { transform: translate(0px, 0px); }
  35%  { transform: translate(-50vw, -40vh); }
  65%  { transform: translate(20vw, -60vh); }
  100% { transform: translate(0px, 0px); }
}

/* CRT scanlines */
body::after {
  content: '';
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,.022) 2px,
    rgba(0,0,0,.022) 4px
  );
  pointer-events: none;
  z-index: 900;
}

/* ── 3. CAROUSEL ── */
.track {
  display: flex;
  width: 500vw; /* updated to 700vw via JS after clones added */
  height: 100vh;
  transform: translateX(0);
  transition: transform var(--dur) var(--ease);
  will-change: transform;
}

.slide {
  width: 100vw;
  height: 100vh;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

/* ── 4. BOTTOM NAV ── */
.nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(8, 8, 8, 0.93);
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 500;
  backdrop-filter: blur(14px);
}

.nav__item {
  font-family: var(--display);
  font-size: 21px;
  letter-spacing: .11em;
  color: rgba(255,255,255,.32);
  cursor: pointer;
  padding: 0 24px;
  display: inline-block;
  transition: color .4s ease-in-out,
              letter-spacing .4s ease-in-out,
              opacity .4s ease-in-out;
}
.nav__item:hover {
  color: rgba(255,255,255,.65);
  letter-spacing: .16em;
}
.nav__item.active {
  color: var(--white);
  letter-spacing: .22em;
}

/* ── 5. PROGRESS DOTS ── */
.progress {
  position: fixed;
  right: 18px; top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 500;
}

.progress__dot {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  cursor: pointer;
  transition: background .3s, height .3s, border-radius .3s;
}
.progress__dot.on {
  background: var(--lime);
  height: 18px;
  border-radius: 2px;
}

/* ── 6. SHARED TAGS ── */
.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .13em;
  padding: 3px 9px;
  white-space: nowrap;
}
.tag--lime    { background: var(--lime); color: #000; }
.tag--outline { border: 1px solid rgba(255,255,255,.38); color: var(--white); }
.tag--lime-outline { border: 1px solid var(--lime); color: var(--lime); }
.tag--mono    { border: 1px solid rgba(255,255,255,.18); color: rgba(255,255,255,.45); }

/* ── 7. SLIDE HEADER (shared) ── */
.slide-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}

.slide-header__title {
  font-family: var(--display);
  font-size: clamp(22px, 3.5vw, 46px);
  letter-spacing: .05em;
  line-height: 1;
}
.slide-header__title .accent { color: var(--lime); }

.slide-header__meta {
  font-family: var(--mono);
  font-size: 10px;
  color: rgba(255,255,255,.38);
  letter-spacing: .1em;
  display: flex;
  gap: 16px;
  align-items: center;
}
.slide-header__meta-box {
  border: 1px solid rgba(255,255,255,.24);
  padding: 2px 8px;
  color: var(--white);
}

/* ════════════════════════════════════════
   SLIDE 1 — HERO / SHOWREEL
════════════════════════════════════════ */
#s-hero {
  padding: 28px 36px calc(var(--nav-h) + 14px);
}

.hero__name {
  font-family: var(--display);
  font-size: clamp(62px, 9.5vw, 134px);
  line-height: .88;
  letter-spacing: .01em;
  position: relative;
  z-index: 2;
  -webkit-text-stroke: 2px var(--white);
}

.hero__tags {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  align-items: center;
  position: relative;
  z-index: 3;
}

/* Showreel frame */
.reel {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -52%);
  width: 83%;
}

.reel__frame {
  aspect-ratio: 16 / 7.5;
  border: 1.5px solid rgba(255,255,255,.22);
  position: relative;
  background: #000;
  overflow: hidden;
}

/* Video inside the frame */
.reel__video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 1;
  opacity: 0;
  transition: opacity .8s ease;
}
.reel__video.loaded { opacity: 1; }

/* Dark overlay on top of video — keeps corner marks legible */
.reel__frame-overlay {
  position: absolute; inset: 0;
  z-index: 2;
  pointer-events: none;
  /* subtle vignette */
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,.35));
}

/* ── Card loading overlay (artworks + motion) ── */
.card-loading {
  position: absolute; inset: 0;
  z-index: 2;
  background: rgba(8,8,8,.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: opacity .5s ease-in-out;
  pointer-events: none;
}
.card-loading.hidden {
  opacity: 0;
}
.card-loading__bar {
  width: 120px;
  height: 1.5px;
  background: rgba(255,255,255,.08);
  position: relative;
  overflow: hidden;
}
.card-loading__bar::after {
  content: '';
  position: absolute;
  top: 0; left: -60%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, var(--lime), transparent);
  animation: scan-bar 1.6s linear infinite;
}
.card-loading__text {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .18em;
  color: rgba(255,255,255,.25);
}


/* Loading state */
.reel__loading {
  position: absolute; inset: 0;
  z-index: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  transition: opacity .6s ease-in-out;
}
.reel__loading.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Scanning progress bar */
.reel__loading-bar {
  width: 220px;
  height: 2px;
  background: rgba(255,255,255,.08);
  position: relative;
  overflow: hidden;
}
.reel__loading-bar::after {
  content: '';
  position: absolute;
  top: 0; left: -60%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, var(--lime), transparent);
  animation: scan-bar 1.8s linear infinite;
}
@keyframes scan-bar {
  0%   { left: -60%; }
  100% { left: 110%; }
}

/* Text + blinking dots */
.reel__loading-text {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .2em;
  color: rgba(255,255,255,.35);
}
.reel__loading-label { color: rgba(255,255,255,.35); }

.reel__loading-dots span {
  animation: blink 1.2s step-start infinite;
  color: var(--lime);
}
.reel__loading-dots span:nth-child(2) { animation-delay: .4s; }
.reel__loading-dots span:nth-child(3) { animation-delay: .8s; }
@keyframes blink {
  0%, 100% { opacity: 0; }
  50%       { opacity: 1; }
}

/* Horizontal noise lines */
.reel__loading-lines {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  padding: 20px 0;
  pointer-events: none;
}
.reel__loading-lines div {
  height: 1px;
  background: rgba(255,255,255,.03);
  animation: flicker 3s ease-in-out infinite;
}
.reel__loading-lines div:nth-child(2) { animation-delay: .6s; }
.reel__loading-lines div:nth-child(3) { animation-delay: 1.1s; }
.reel__loading-lines div:nth-child(4) { animation-delay: 1.8s; }
.reel__loading-lines div:nth-child(5) { animation-delay: 2.4s; }
@keyframes flicker {
  0%,100% { opacity: 1; }
  45%     { opacity: 1; }
  50%     { opacity: 0.1; }
  55%     { opacity: 1; }
}

/* frame corner marks */
.reel__corner {
  position: absolute;
  width: 10px; height: 10px;
  z-index: 4;
}
.reel__corner::before, .reel__corner::after {
  content: '';
  position: absolute;
  background: rgba(255,255,255,.4);
}
.reel__corner::before { width: 1px; height: 100%; }
.reel__corner::after  { height: 1px; width: 100%; }
.reel__corner--tl { top: 8px; left: 8px; }
.reel__corner--tr { top: 8px; right: 8px; }
.reel__corner--tr::before { right: 0; }
.reel__corner--bl { bottom: 8px; left: 8px; }
.reel__corner--bl::after  { bottom: 0; }
.reel__corner--br { bottom: 8px; right: 8px; }
.reel__corner--br::before { right: 0; }
.reel__corner--br::after  { bottom: 0; }

/* frame floating labels */
.reel__label {
  position: absolute;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
}
.reel__label--cam { top: -26px; right: 0; color: rgba(255,255,255,.4); }
.reel__label--sys { bottom: -25px; left: 0; color: rgba(255,255,255,.3); }
.reel__label--tc  { bottom: -25px; right: 0; color: var(--lime); }

.hero__copy {
  position: absolute;
  bottom: calc(var(--nav-h) + 10px); left: 36px;
  font-family: var(--mono);
  font-size: 9px;
  color: rgba(255,255,255,.15);
  letter-spacing: .1em;
}

/* ════════════════════════════════════════
   SLIDE 2 — ARTWORKS
════════════════════════════════════════ */
#s-artworks {
  padding: 22px 28px calc(var(--nav-h) + 10px);
}

/* 4-col asymmetric mosaic */
.artworks-grid {
  display: grid;
  grid-template-columns: 1fr 1.55fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: var(--gap);
  height: calc(100% - 80px);
}

/* slot assignments — 4 cards */
.art-card:nth-child(1) { grid-row: 1 / 3; }                        /* ROBOTS — tall left */
.art-card:nth-child(2) { grid-column: 2 / 4; grid-row: 1; }        /* ABSTRACTION — wide top */
.art-card:nth-child(3) { grid-column: 4; grid-row: 1 / 3; }        /* DESIGN — tall right, full height */
.art-card:nth-child(4) { grid-column: 2; grid-row: 2; }             /* BACKGROUNDS */
.art-card:nth-child(5) { grid-column: 3; grid-row: 2; }             /* LOW POLY */

.art-card {
  position: relative;
  overflow: hidden;
  cursor: default;
}

.art-card__hover { display: none; }

/* Placeholder bg (shown when no images loaded yet) */
.art-card__bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* ── Slideshow images ── */
@keyframes pan {
  from { transform: scale(1.06) translateX(-3%); }
  to   { transform: scale(1.06) translateX(3%);  }
}

.art-card__slide {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 1;
  opacity: 0;
  transition: opacity 1.4s ease-in-out;
  will-change: opacity, transform;
}
.art-card__slide.active { opacity: 1; }

/* alternate — идёт туда потом обратно, ease-in-out гасит разворот.
   Длительность одного прохода 12-18s, разворот плавный и незаметный. */
.art-card:nth-child(1) .art-card__slide { animation: pan 14s ease-in-out infinite alternate; animation-delay: -3s;  }
.art-card:nth-child(2) .art-card__slide { animation: pan 18s ease-in-out infinite alternate; animation-delay: -10s; }
.art-card:nth-child(3) .art-card__slide { animation: pan 12s ease-in-out infinite alternate; animation-delay: -6s;  }
.art-card:nth-child(4) .art-card__slide { animation: pan 16s ease-in-out infinite alternate; animation-delay: -2s;  }
.art-card:nth-child(5) .art-card__slide { animation: pan 20s ease-in-out infinite alternate; animation-delay: -14s; }

.art-card__hover {
  position: absolute; inset: 0;
  background: rgba(204,255,0,.06);
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
  z-index: 3;
}

/* crosshair marker */
.crosshair {
  position: absolute;
  top: 10px; left: 10px;
  width: 13px; height: 13px;
  z-index: 4;
}
.crosshair::before, .crosshair::after {
  content: '';
  position: absolute;
  background: rgba(255,255,255,.65);
}
.crosshair::before { width: 1px; height: 100%; left: 50%; transform: translateX(-50%); }
.crosshair::after  { height: 1px; width: 100%; top: 50%; transform: translateY(-50%); }

.art-card__img-id {
  position: absolute;
  top: 9px; right: 10px;
  font-family: var(--mono);
  font-size: 9px;
  color: rgba(255,255,255,.32);
  letter-spacing: .08em;
  z-index: 4;
}

.art-card__label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 8px 11px;
  background: linear-gradient(transparent, rgba(0,0,0,.88));
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.art-card__name {
  font-family: var(--body);
  font-weight: 900;
  font-size: clamp(9px, .95vw, 14px);
  letter-spacing: .05em;
}

.art-card__type {
  position: absolute;
  bottom: 9px; right: 10px;
  font-family: var(--mono);
  font-size: 8px;
  color: rgba(255,255,255,.35);
  letter-spacing: .1em;
}

/* ════════════════════════════════════════
   SLIDE 3 — MOTION / HIGHLIGHTS
════════════════════════════════════════ */
#s-motion {
  padding: 22px 28px calc(var(--nav-h) + 10px);
}

.motion-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: var(--gap);
  height: calc(100% - 80px);
}

.project-card:first-child { grid-row: 1 / 3; }

.project-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: #0b0b0b;
}

/* Media layer (video + fallback) */
.project-card__media {
  position: absolute; inset: 0;
}

.project-card__fallback {
  position: absolute; inset: 0;
  z-index: 1;
}

.project-card__video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 2;
  /* video shows on top of fallback once loaded */
}

/* scale on hover */
.project-card__video,
.project-card__fallback { transition: transform .55s var(--ease); }
.project-card:hover .project-card__video,
.project-card:hover .project-card__fallback { transform: scale(1.04); }

/* UI overlays */
.project-card__plus {
  position: absolute;
  top: 10px; left: 10px;
  font-family: var(--mono);
  font-size: 15px;
  color: rgba(255,255,255,.35);
  z-index: 5;
  line-height: 1;
}

.project-card__tag {
  position: absolute;
  top: 10px; right: 10px;
  z-index: 5;
}

.project-card__info {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 10px 13px;
  background: linear-gradient(transparent, rgba(0,0,0,.92));
  z-index: 5;
}

.project-card__title {
  font-family: var(--body);
  font-weight: 900;
  font-size: clamp(10px, 1.1vw, 16px);
  letter-spacing: .04em;
  margin-bottom: 4px;
}

.project-card__role {
  font-family: var(--mono);
  font-size: 8px;
  color: rgba(255,255,255,.42);
  letter-spacing: .08em;
}

/* progress bar */
.project-card__progress {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: rgba(255,255,255,.07);
  z-index: 6;
}
.project-card__progress::after {
  content: '';
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  width: var(--prog, 0%);
  background: var(--lime);
  transition: width .25s linear;
}

/* ════════════════════════════════════════
   SLIDE 4 — BIO / THE SYNTHESIS
════════════════════════════════════════ */
#s-bio {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 56px calc(var(--nav-h) + 14px);
  gap: 56px;
  height: 100vh;
}

.bio__photo {
  flex: 0 0 auto;
  width: clamp(320px, 48vh, 520px);
  height: clamp(320px, 48vh, 520px);
  aspect-ratio: 1;
  position: relative;
  overflow: hidden;
}

.bio__photo-inner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* fallback gradient shown behind image while loading */
  background: radial-gradient(
    ellipse at 35% 28%,
    rgba(255,255,255,.13) 0%,
    rgba(0,0,0,.98) 68%
  );
}

/* corner bracket marks */
.bio__corner {
  position: absolute;
  width: 18px; height: 18px;
}
.bio__corner::before, .bio__corner::after {
  content: '';
  position: absolute;
  background: rgba(255,255,255,.55);
}
.bio__corner::before { width: 1px; height: 100%; }
.bio__corner::after  { height: 1px; width: 100%; }
.bio__corner--tl { top: 0; left: 0; }
.bio__corner--tr { top: 0; right: 0; }
.bio__corner--tr::before { right: 0; }
.bio__corner--bl { bottom: 0; left: 0; }
.bio__corner--bl::after  { bottom: 0; }
.bio__corner--br { bottom: 0; right: 0; }
.bio__corner--br::before { right: 0; }
.bio__corner--br::after  { bottom: 0; }

.bio__text { flex: 1; max-width: 640px; }

.bio__heading {
  font-family: var(--display);
  font-size: clamp(50px, 7.5vw, 106px);
  line-height: .87;
  margin-bottom: 32px;
}

.bio__paragraph {
  font-family: var(--mono);
  font-size: clamp(10px, .84vw, 13px);
  line-height: 1.85;
  color: rgba(255,255,255,.65);
  margin-bottom: 18px;
}

.bio__inline-tag {
  display: inline-block;
  border: 1px solid rgba(255,255,255,.35);
  padding: 1px 6px;
  font-size: .9em;
  color: var(--white);
}

.bio__divider {
  width: 100%; height: 1px;
  background: rgba(255,255,255,.08);
  margin: 22px 0;
}

.bio__tools {
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(255,255,255,.28);
  letter-spacing: .1em;
}

/* ════════════════════════════════════════
   SLIDE 5 — CONTACTS
════════════════════════════════════════ */
#s-contacts {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-bottom: var(--nav-h);
}

.contacts__sub {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .32em;
  color: var(--lime);
  margin-bottom: 10px;
}

.contacts__title {
  font-family: var(--display);
  font-size: clamp(56px, 11.5vw, 150px);
  line-height: .86;
  letter-spacing: .01em;
  margin-bottom: 18px;
}
.contacts__title .outline {
  -webkit-text-stroke: 2px var(--lime);
  color: transparent;
}

.contacts__desc {
  font-family: var(--mono);
  font-size: clamp(9px, .9vw, 13px);
  color: rgba(255,255,255,.38);
  letter-spacing: .1em;
  margin-bottom: 38px;
}

.contacts__email {
  display: inline-block;
  background: var(--lime);
  color: #000;
  text-decoration: none;
  font-family: var(--mono);
  font-size: clamp(12px, 1.5vw, 20px);
  font-weight: 700;
  letter-spacing: .18em;
  padding: 18px 44px;
  transition: background .2s, transform .15s, box-shadow .2s;
}
.contacts__email:hover {
  background: #fff;
  transform: scale(1.025);
  box-shadow: 0 0 40px rgba(204,255,0,.25);
}

.contacts__footer {
  position: absolute;
  bottom: calc(var(--nav-h) + 14px);
  font-family: var(--mono);
  font-size: 9px;
  color: rgba(255,255,255,.17);
  letter-spacing: .18em;
}

/* ════════════════════════════════════════
   LIGHTBOX
════════════════════════════════════════ */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.95);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
  z-index: 9000;
}
.lightbox.open { display: flex; }

.lightbox__frame {
  max-width: 88vw;
  max-height: 80vh;
  border: 1px solid rgba(255,255,255,.15);
  overflow: hidden;
}

.lightbox__close {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .2em;
  color: rgba(255,255,255,.45);
  cursor: pointer;
  padding: 6px 16px;
  border: 1px solid rgba(255,255,255,.18);
  transition: color .2s, border-color .2s;
}
.lightbox__close:hover { color: var(--lime); border-color: var(--lime); }

/* ════════════════════════════════════════
   SHOWREEL OVERLAY
════════════════════════════════════════ */
.showreel-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.97);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 18px;
  z-index: 8000;
}

.showreel-overlay__label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .2em;
  color: rgba(255,255,255,.3);
}

.showreel-overlay__player {
  width: min(860px, 88vw);
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(255,255,255,.12);
  background: #000;
  overflow: hidden;
  position: relative;
}
.showreel-overlay__player video {
  width: 100%; height: 100%;
  object-fit: cover;
}
.showreel-overlay__placeholder {
  position: absolute; inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.showreel-overlay__placeholder-title {
  font-family: var(--display);
  font-size: clamp(28px, 5vw, 64px);
  color: rgba(255,255,255,.12);
}
.showreel-overlay__placeholder-hint {
  font-family: var(--mono);
  font-size: 10px;
  color: rgba(255,255,255,.18);
  letter-spacing: .15em;
}

.showreel-overlay__close {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .2em;
  color: rgba(255,255,255,.28);
  cursor: pointer;
  padding: 6px 16px;
  border: 1px solid rgba(255,255,255,.14);
  transition: color .2s, border-color .2s;
}
.showreel-overlay__close:hover { color: var(--lime); border-color: var(--lime); }


/* ════════════════════════════════════════
   MOBILE  (≤ 768px)
════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Nav ── */
  .nav { justify-content: space-between; padding: 0 12px; }
  .nav__item { font-size: 13px; padding: 0 8px; letter-spacing: .06em; }
  .nav__item.active { letter-spacing: .1em; }

  /* ── Progress dots — hide on mobile ── */
  .progress { display: none; }

  /* ── Hero ── */
  #s-hero { padding: 20px 20px calc(var(--nav-h) + 8px); }
  .hero__name { font-size: clamp(48px, 14vw, 80px); }
  .reel { width: 92%; }
  .reel__frame { aspect-ratio: 16 / 10; }

  /* ── BIO — фото на всю ширину, текст снизу ── */
  #s-bio {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0 0 calc(var(--nav-h) + 10px);
    gap: 0;
    overflow-y: auto;
  }
  .bio__photo {
    width: 100%;
    height: 72vw;
    flex: 0 0 auto;
  }
  .bio__text {
    max-width: 100%;
    padding: 20px 20px 0;
  }
  .bio__heading {
    font-size: clamp(40px, 12.5vw, 62px);
    margin-bottom: 16px;
    white-space: nowrap;
  }
  .bio__heading br { display: none; }
  .bio__paragraph { font-size: 11px; line-height: 1.7; }
  .bio__tools { font-size: 10px; }

  /* ── CONTACTS ── */
  #s-contacts { padding: 0 20px calc(var(--nav-h) + 10px); }
  .contacts__title { font-size: clamp(38px, 13vw, 72px); }
  .contacts__title .outline { -webkit-text-stroke: 1.5px var(--lime); }
  .contacts__email {
    font-size: 11px;
    padding: 14px 20px;
    width: auto;
    max-width: 88vw;
    word-break: break-all;
    text-align: center;
  }
  .contacts__sub { font-size: 9px; letter-spacing: .2em; }
  .contacts__desc { font-size: 9px; }

  /* ── Motion grid — 1 колонка, 2.5 карточки видно, остальное свайп вверх ── */
  #s-motion {
    overflow: hidden;
    padding-bottom: var(--nav-h);
  }
  .motion-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(5, calc((100vh - 220px) / 2.5));
    height: calc(100vh - 220px);
    overflow-y: scroll;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 4px;
  }
  .motion-grid::-webkit-scrollbar { display: none; }
  .project-card:first-child {
    grid-row: auto;
    grid-column: auto;
  }

  /* ── Artworks grid — 2 col, 4 cards, DESIGN taller ── */
  .artworks-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
  }
  .art-card:nth-child(1) { grid-column: 1; grid-row: 1 / 3; }   /* ROBOTS tall left */
  .art-card:nth-child(2) { grid-column: 2; grid-row: 1; }        /* ABSTRACTION */
  .art-card:nth-child(3) { grid-column: 2; grid-row: 2 / 4; }    /* DESIGN taller */
  .art-card:nth-child(4) { grid-column: 1; grid-row: 3; }        /* BACKGROUNDS */
  .art-card:nth-child(5) { display: none; }                      /* hidden if exists */

  /* ── Slide header ── */
  .slide-header { flex-direction: column; gap: 6px; margin-bottom: 10px; }
  .slide-header__title { font-size: clamp(18px, 5.5vw, 28px); }
  .slide-header__meta { font-size: 8px; gap: 8px; }

  /* ── Glow orbs — off on mobile (perf) ── */
  .grid-glow { display: none; }
}