/* Железняк Кристина — портфолио. Стиль повторяет презентацию: тёмный фон, светлый шрифт, красные скобки. */

@font-face {
  font-family: "YG Light";
  src: local("Yu Gothic UI Light"), local("YuGothicUI-Light");
  font-weight: 300;
}

:root {
  --bg: #141414;
  --fg: #f2f2f2;
  --muted: #ababab;
  --dim: #6e6e6e;
  --red: #d2392b;
  --line: #2e2e2e;
  --g: clamp(16px, 3.125vw, 60px);      /* боковое поле, как 60pt на слайде 1920 */
  --gap: clamp(6px, 0.625vw, 12px);
  --font: "YG Light", "Yu Gothic UI Light", "Manrope", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(.19, 1, .22, 1);
  --ease-io: cubic-bezier(.77, 0, .175, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-weight: 300;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--red); color: var(--fg); }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--g); top: 12px; z-index: 100; }

/* ---------- small type ---------- */
.lbl, .desc, .sub, .nav, .hero-meta, .idx-sub {
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.lbl { white-space: nowrap; }
.lbl .b { color: var(--red); display: inline-block; transition: transform .5s var(--ease); }
a:hover .lbl .b:first-child, button:hover .lbl .b:first-child { transform: translateX(-4px); }
a:hover .lbl .b:last-child,  button:hover .lbl .b:last-child  { transform: translateX(4px); }
.desc { margin: 0; color: var(--fg); }
.sub { margin: 8px 0 0; color: var(--muted); }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 22px var(--g);
  background: linear-gradient(var(--bg) 35%, rgba(20,20,20,0));
  pointer-events: none;
}
.nav > * { pointer-events: auto; }
.nav-name { color: var(--muted); transition: color .3s; }
.nav-name:hover { color: var(--fg); }
.nav-label { justify-self: center; transition: opacity .35s, transform .35s var(--ease); }
.nav-label.swap { opacity: 0; transform: translateY(-6px); }
.nav-count { justify-self: end; color: var(--muted); font-variant-numeric: tabular-nums; }
.nav { opacity: 0; transform: translateY(-10px); transition: opacity .8s .2s, transform .8s .2s var(--ease); }
.ready .nav { opacity: 1; transform: none; }

/* ---------- split text ---------- */
[data-split] { overflow: hidden; }
.ch {
  display: inline-block;
  transform: translateY(105%);
  transition: transform 1.1s var(--ease) calc(var(--i) * 35ms + var(--sd, 0ms));
}
.is-in .ch, .is-in.ch { transform: none; }

/* ---------- reveal ---------- */
[data-reveal]:not(.tile):not(.idx-row) {
  opacity: 0; transform: translateY(24px);
  transition: opacity 1s var(--ease) var(--d, 0ms), transform 1.2s var(--ease) var(--d, 0ms);
}
[data-reveal].is-in:not(.tile):not(.idx-row) { opacity: 1; transform: none; }

/* ---------- hero ---------- */
.hero {
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  padding: 76px var(--g) 28px;
}
.hero-meta { display: flex; justify-content: space-between; color: var(--muted); opacity: 0; transition: opacity 1s .3s; }
.ready .hero-meta { opacity: 1; }
.hero-title {
  margin: 2vh 0 0;
  font-weight: 300;
  font-size: clamp(64px, 17.4vw, 340px);
  line-height: .95;
  letter-spacing: -.02em;
  text-align: right;
  white-space: nowrap;
}
.hero-title .ch { --sd: 150ms; transition-duration: 1.4s; }
.hero-tag { margin: 3vh 0 12px; opacity: 0; transition: opacity 1s 1.1s; }
.ready .hero-tag { opacity: 1; }
.hero-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--gap); min-height: 0; }
.hero-tile { margin: 0; overflow: hidden; clip-path: inset(100% 0 0 0); transition: clip-path 1.3s var(--ease-io) var(--d); min-height: 34vh; }
.hero-tile img {
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.25) translateY(var(--py, 0px));
  transition: transform 1.8s var(--ease) var(--d);
}
.ready .hero-tile { clip-path: inset(0 0 0 0); }
.ready .hero-tile img { transform: scale(1.08) translateY(var(--py, 0px)); }
.ready .hero-tile.settled img { transition: transform .2s linear; }
.hero-down { justify-self: start; margin-top: 18px; color: var(--muted); opacity: 0; transition: opacity 1s 1.6s, color .3s; }
.ready .hero-down { opacity: 1; }
.hero-down:hover { color: var(--fg); }

/* ---------- section head ---------- */
.sec, .index { padding: 22vh var(--g) 0; }
.sec-head {
  display: grid;
  grid-template-columns: 1fr minmax(0, 36%);
  grid-template-areas: "label label" "title desc";
  align-items: end;
  margin-bottom: 36px;
}
.sec-label { grid-area: label; margin: 0 0 10px; }
.sec-title {
  grid-area: title;
  margin: 0;
  font-weight: 300;
  font-size: clamp(48px, 7vw, 132px);
  line-height: 1;
  letter-spacing: -.01em;
  padding-bottom: .08em;
}
.sec-desc { grid-area: desc; padding-bottom: 1.2vw; }

/* ---------- rows & tiles ---------- */
.row {
  display: grid;
  grid-template-columns: var(--cols);
  gap: var(--gap);
  align-items: end;
  margin-top: 48px;
}
.grid6 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--gap); margin-top: 0; }
.grid6 .cap { display: none; }

.tile { margin: 0; display: flex; flex-direction: column; cursor: pointer; outline: none; }
.cap { height: 30px; display: flex; align-items: flex-start; overflow: visible; position: relative; z-index: 1; }
.cap--empty { visibility: hidden; }
.media {
  position: relative;
  aspect-ratio: var(--ar);
  overflow: hidden;
  background: #1b1b1b;
  clip-path: inset(100% 0 0 0);
  transition: clip-path 1.25s var(--ease-io) var(--d, 0ms);
}
.media > img:not(.inset), .media > video {
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.18);
  transition: transform 1.7s var(--ease) var(--d, 0ms), filter .6s;
}
.tile.is-in .media { clip-path: inset(0 0 0 0); }
.tile.is-in .media > img:not(.inset), .tile.is-in .media > video { transform: scale(1); }
.tile.is-in.hovered .media > img:not(.inset), .tile.is-in.hovered .media > video { transform: scale(1.045); transition: transform 1.1s var(--ease); }
.tile:focus-visible .media { outline: 1px solid var(--red); outline-offset: 3px; }
.inset {
  position: absolute; left: 0; top: 0; width: 32%; height: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  opacity: 0; transform: translateY(12px);
  transition: opacity .9s var(--ease) calc(var(--d) + 700ms), transform .9s var(--ease) calc(var(--d) + 700ms);
}
.tile.is-in .inset { opacity: 1; transform: none; }

.play {
  position: absolute; right: 12px; bottom: 10px;
  font-size: 12px; letter-spacing: .06em;
  opacity: 0; transition: opacity .5s;
  text-shadow: 0 1px 8px rgba(0,0,0,.6);
}
.play .b { color: var(--red); }
.tile.is-in .play { opacity: .9; }

.cell-text { display: flex; flex-direction: column; justify-content: flex-end; padding-left: clamp(8px, 1.6vw, 28px); padding-bottom: 2px; }

/* ---------- index ---------- */
.idx { list-style: none; margin: 0; padding: 0; margin-left: 33.5%; border-bottom: 1px solid var(--line); position: relative; }
.idx-row { position: relative; }
.idx-row::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line);
  transform: scaleX(0); transform-origin: left; transition: transform 1.4s var(--ease-io) var(--d);
}
.idx-row.is-in::before { transform: scaleX(1); }
.idx-row a {
  display: grid; grid-template-columns: 110px 1fr auto; grid-template-areas: "num name arrow" "num sub arrow";
  padding: 26px 0 28px; column-gap: 20px;
  opacity: 0; transform: translateY(20px);
  transition: opacity 1s var(--ease) calc(var(--d) + 200ms), transform 1.1s var(--ease) calc(var(--d) + 200ms);
}
.idx-row.is-in a { opacity: 1; transform: none; }
.idx-num { grid-area: num; padding-top: 10px; }
.idx-name { grid-area: name; font-size: clamp(30px, 3.1vw, 58px); line-height: 1.1; transition: transform .7s var(--ease), color .4s; }
.idx-sub { grid-area: sub; color: var(--muted); margin-top: 10px; transition: transform .7s var(--ease) .03s; }
.idx-arrow { grid-area: arrow; align-self: center; font-size: 28px; color: var(--dim); transition: transform .6s var(--ease), color .4s; }
.idx-row a:hover .idx-name, .idx-row a:hover .idx-sub { transform: translateX(18px); }
.idx-row a:hover .idx-arrow { transform: translateX(6px); color: var(--red); }
.idx:hover .idx-row a:not(:hover) .idx-name { color: var(--dim); }

.preview {
  position: fixed; left: 0; top: 0; width: 240px; aspect-ratio: 3/4; z-index: 30;
  pointer-events: none; overflow: hidden;
  opacity: 0; transform: translate(-50%, -50%) scale(.85);
  transition: opacity .4s, transform .6s var(--ease);
}
.preview.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.preview img { width: 100%; height: 100%; object-fit: cover; transition: opacity .3s; }

/* ---------- footer ---------- */
.foot { padding: 26vh var(--g) 36px; }
.foot-title {
  margin: 10px 0 6vh;
  font-size: clamp(56px, 12vw, 240px);
  line-height: .98;
  letter-spacing: -.02em;
  overflow: hidden;
}
.foot-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 22px; }
.to-top { color: var(--muted); transition: color .3s; }
.to-top:hover { color: var(--fg); }

/* ---------- lightbox ---------- */
.lb {
  position: fixed; inset: 0; z-index: 60;
  background: var(--bg);
  display: grid; grid-template-rows: auto 1fr auto;
  padding: 18px var(--g);
  opacity: 0; transition: opacity .45s;
}
.lb.open { opacity: 1; }
.lb[hidden] { display: none; }
.lb-close { justify-self: end; color: var(--muted); }
.lb-close:hover { color: var(--fg); }
.lb-stage { display: grid; place-items: center; min-height: 0; padding: 14px 0; }
.lb-stage img, .lb-stage video {
  max-width: 100%; max-height: calc(100svh - 140px); object-fit: contain;
  opacity: 0; transform: scale(.97);
  transition: opacity .5s, transform .8s var(--ease);
}
.lb-stage .shown { opacity: 1; transform: none; }
.lb-bar { display: grid; grid-template-columns: auto 1fr auto auto; gap: 24px; align-items: center; font-size: 13px; letter-spacing: .06em; }
.lb-cap { color: var(--muted); text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-count { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- cursor ---------- */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 70; pointer-events: none;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--fg); mix-blend-mode: difference;
  display: grid; place-items: center;
  transform: translate(-50%, -50%);
  transition: width .5s var(--ease), height .5s var(--ease), background .3s, opacity .3s;
  opacity: 0;
}
.cursor span { font-size: 10px; letter-spacing: .08em; color: var(--bg); opacity: 0; transition: opacity .3s; }
.cursor.vis { opacity: 1; }
.cursor.big { width: 84px; height: 84px; mix-blend-mode: normal; background: var(--fg); }
.cursor.big span { opacity: 1; }
.cursor.link { width: 34px; height: 34px; }
@media (hover: none), (pointer: coarse) { .cursor, .preview { display: none; } }

/* ---------- mobile ---------- */
@media (max-width: 900px) {
  .lbl, .desc, .sub, .nav, .hero-meta, .idx-sub { font-size: 11px; }
  .nav { grid-template-columns: 1fr auto; padding: 14px var(--g); }
  .nav-label { display: none; }
  .hero { padding-top: 54px; grid-template-rows: auto auto auto 1fr auto; }
  .hero-meta { flex-direction: column; gap: 2px; }
  .hero-title { text-align: left; margin-top: 4vh; }
  .hero-strip { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; }
  .hero-tile { min-height: 22vh; }
  .sec, .index { padding-top: 14vh; }
  .sec-head { grid-template-columns: 1fr; grid-template-areas: "label" "title" "desc"; margin-bottom: 20px; }
  .sec-desc { padding: 14px 0 0; }
  .row { grid-template-columns: repeat(2, 1fr); margin-top: 28px; row-gap: 18px; }
  .row[data-m="1"] { grid-template-columns: 1fr; }
  .row .media { aspect-ratio: 3 / 4; }
  .row[data-m="1"] .media { aspect-ratio: var(--ar); }
  .row[data-m="1"] .tile + .tile .media { aspect-ratio: 4 / 5; }
  .cap { height: auto; min-height: 22px; padding-bottom: 6px; }
  .cap .lbl { white-space: normal; }
  .cell-text { grid-column: 1 / -1; padding: 6px 0 0; }
  .grid6 { grid-template-columns: repeat(3, 1fr); }
  .idx { margin-left: 0; }
  .idx-row a { grid-template-columns: 52px 1fr auto; padding: 18px 0 20px; column-gap: 10px; }
  .idx-num { padding-top: 6px; }
  .lb-bar { grid-template-columns: auto 1fr auto; }
  .lb-cap { display: none; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; transition-delay: 0ms !important; }
  .ch { transform: none; }
  .media, .hero-tile { clip-path: none; }
}
