/* =========================================================
   117 — Danylo Pushkarenko
   Font: Darker Grotesque (Google Fonts)
   ========================================================= */

:root {
  --bg: #0a0a0a;
  --fg: #ffffff;
  --muted: #b5b5b5;
  --line: rgba(255, 255, 255, 0.15);
  --font: "Darker Grotesque", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --gutter: 30px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

body.is-locked { overflow: hidden; height: 100vh; }

img { display: block; max-width: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; -webkit-appearance: none; appearance: none; }

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

.page { position: relative; width: 100%; background: var(--bg); }

/* ================= ROLLING TEXT (nav + links) ================= */
.rolling-text {
  display: inline-block;
  position: relative;
  overflow: hidden;
  height: 22px;
  line-height: 22px;
  padding: 0;
  font-family: var(--font);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #fff;
  background: none;
  border: 0;
  cursor: pointer;
  transform: translateZ(0);
}
.rolling-text .block { position: relative; }
.rolling-text .letter {
  display: inline-block;
  position: relative;
  transition: transform 0.6s cubic-bezier(0.76, 0, 0.24, 1);
}
.rolling-text .letter::before {
  content: attr(data-letter);
  position: absolute;
  top: 100%;
  left: 0;
}
.rolling-text:hover .letter { transform: translateY(-100%); }

/* ================= HEADER ================= */
.header {
  position: fixed;
  top: 20px;
  left: var(--gutter);
  right: var(--gutter);
  z-index: 1000;
  pointer-events: none;
  mix-blend-mode: difference;
  isolation: isolate;
  opacity: 0;
  filter: blur(16px);
  transform: translateY(-40px);
}
.header nav { display: flex; justify-content: space-between; align-items: center; }
.header .rolling-text { pointer-events: auto; }

/* ================= HERO ================= */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  width: 100%;
  background: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.preloader {
  position: relative;
  width: 300px;
  height: 400px;
  overflow: hidden;
  z-index: 5;
}

.image-wrapper {
  position: absolute;
  inset: 0;
  clip-path: inset(100% 0 0 0);
  will-change: clip-path;
  overflow: hidden;
}
.image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.final-image { z-index: 10; background: var(--bg); }

.year {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80vw;
  transform: translate(-50%, -50%);
  filter: blur(32px);
  will-change: transform, filter;
  z-index: 1;
}
.year-svg { display: block; width: 100%; height: auto; overflow: visible; }
.year-text {
  font-family: var(--font);
  font-weight: 400;
  font-size: 1720px;
  letter-spacing: -0.06em;
}

.hero-name {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  color: #fff;
  mix-blend-mode: difference;
  font-family: var(--font);
  font-weight: 400;
  /* layout from Figma (90.8px master): tracking -0.05em, line step 0.64em,
     2nd line indented 0.376em. Sized so it sits inside the 300px loader. */
  font-size: clamp(30px, 3.4vw, 54px);
  line-height: 0.64;
  letter-spacing: -0.05em;
  pointer-events: none;
  white-space: nowrap;
}
.hero-name .hn-2 { padding-left: 0.376em; }
.hero-name .hn-c { font-size: 0.645em; font-weight: 500; letter-spacing: 0; vertical-align: 0.62em; margin-left: 0.02em; }

.ui-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 20; }
.text-block {
  position: absolute;
  color: var(--muted);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.01em;
  opacity: 0;
  filter: blur(20px);
  will-change: opacity, transform, filter;
}
.text-block-1 { top: 50%; left: var(--gutter); margin-top: -1em; width: 200px; }
.text-block-2 { top: 50%; right: var(--gutter); margin-top: -1em; width: 200px; text-align: right; }
.text-block-5 { bottom: 20px; left: 0; right: 0; text-align: center; }

/* ================= PHILOSOPHY TEXT ================= */
.section-2 { padding: 160px var(--gutter); background: transparent; }
.philosophy-text {
  position: relative;
  width: 100%;
  font-family: var(--font);
  font-weight: 600;
  font-size: clamp(28px, 5.1vw, 104px);
  line-height: 0.92;
  letter-spacing: -0.04em;
  text-align: justify;
  color: rgba(255, 255, 255, 0.2);
  background: radial-gradient(
    300px circle at var(--x, -9999px) var(--y, -9999px),
    rgba(255, 255, 255, calc(var(--opacity, 0) * 1)) 0%,
    rgba(255, 255, 255, calc(var(--opacity, 0) * 0.6)) 20%,
    rgba(255, 255, 255, calc(var(--opacity, 0) * 0.3)) 40%,
    rgba(255, 255, 255, calc(var(--opacity, 0) * 0.1)) 60%,
    transparent 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: currentColor;
}
.philosophy-line { display: block; }
.philosophy-line.right { text-align: right; }

/* ================= SHOWCASE ================= */
.showcase {
  position: relative;
  height: 100vh;
  height: 100svh;
  width: 100%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  perspective: 2000px;
  transform-style: preserve-3d;
}
.orbits {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9;
}
.orbit { position: absolute; width: 50vh; height: 50vh; }
.orbit::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid #333;
  border-radius: 50%;
}
.orbit i {
  position: absolute;
  width: 4px;
  height: 4px;
  top: -2px;
  left: 50%;
  margin-left: -2px;
  border-radius: 50%;
  background: #fff;
}
.orbit-rot { position: absolute; inset: 0; }
.showcase-title {
  position: absolute;
  z-index: 11;
  text-align: center;
  color: #fff;
  font-size: 3.1vw;
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.035em;
  transform-origin: center top;
  transform-style: preserve-3d;
}
.showcase-images {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  pointer-events: none;
}
.showcase-item {
  position: absolute;
  --r: 1.1547;                      /* sqrt(w/h); 4:3 by default */
  width: calc(69.28vw * var(--r));   /* area = 80vw x 60vw for every ratio */
  height: calc(69.28vw / var(--r));
  overflow: hidden;
  opacity: 0.001;
  transform: scale(0.01) translateZ(-1000px);
  backface-visibility: hidden;
  z-index: 10;
}
.showcase-item img { width: 100%; height: 100%; object-fit: cover; }

/* ================= BIG MARQUEE ================= */
.big-marquee { width: 100%; background: var(--bg); overflow: hidden; position: relative; }
.big-row { width: 100%; overflow: hidden; }
.big-row.dim { opacity: 0.2; }
.big-track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  color: #fff;
  font-size: 34.2vw;
  font-weight: 400;
  line-height: 0.8;
  letter-spacing: -0.06em;
  padding: 0 0 1vw;
  will-change: transform;
}
.big-track .word { display: inline-block; }
.big-track .bar {
  display: inline-block;
  width: 15.6vw;
  height: 5px;
  margin: 0 4vw;
  background: #fff;
  vertical-align: middle;
  transform: translateY(1vw);
}

/* ================= WORKS LIST ================= */
.works {
  display: flex;
  flex-direction: column;
  gap: 120px;
  padding-top: 120px;
  background: var(--bg);
}
.works-head {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 32px var(--gutter);
  align-items: flex-end;
}
.works-head .meta {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  opacity: 0.7;
}
.works-head .meta.right { text-align: right; }
.works-quote {
  max-width: 440px;
  font-size: 30px;
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.02em;
  text-align: center;
  opacity: 0.7;
}
.works-quote.narrow { max-width: 340px; }

.works-list { border-bottom: 1px solid var(--line); }
.work-row {
  position: relative;
  display: flex;
  width: 100%;
  height: 200px;
  padding: 0 var(--gutter);
  border-top: 1px solid var(--line);
  overflow: hidden;
  cursor: pointer;
}
.work-row-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  width: 100%;
}
.work-row .tag,
.work-row .idx {
  flex: 1;
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.01em;
}
.work-row .idx { text-align: right; }
.work-row .name {
  font-size: 176px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.05em;
  text-align: center;
  transform: translateY(-0.08em);
}
.work-hover {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: #fff;
  overflow: hidden;
  clip-path: polygon(0 50%, 100% 50%, 100% 50%, 0 50%);
  transition: clip-path 0.4s cubic-bezier(0.1, 0.5, 0.5, 1);
}
.work-hover-shift {
  display: flex;
  align-items: center;
  height: 100%;
  transform: translateY(40px);
  transition: transform 0.6s cubic-bezier(0.215, 0.61, 0.355, 1);
}
.work-hover-track {
  display: flex;
  align-items: center;
  gap: 72px;
  animation: marqueeScroll 40s linear infinite;
  animation-play-state: paused;
  will-change: transform;
}
.work-hover-track .label {
  flex-shrink: 0;
  color: #0a0a0a;
  font-size: 120px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.05em;
  transform: translateY(-0.08em);
}
.work-hover-track img {
  flex-shrink: 0;
  width: 300px;
  height: 125px;
  border-radius: 999px;
  object-fit: cover;
}
.work-row:hover .work-hover { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
.work-row:hover .work-hover-shift { transform: translateY(0); }
.work-row:hover .work-hover-track { animation-play-state: running; }

/* mobile / touch alternative to the hover reveal */
.work-peek { display: none; }
@media (hover: none), (max-width: 1024px) {
  .work-hover { display: none; }
  .work-row .idx { transition: opacity 0.4s ease; }
  .work-peek {
    display: block;
    position: absolute;
    z-index: 2;
    top: 50%;
    right: var(--gutter);
    height: 64%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 2px;
    transform: translateY(-50%);
    clip-path: inset(50% 0 50% 0);
    transition: clip-path 0.6s cubic-bezier(0.215, 0.61, 0.355, 1);
    pointer-events: none;
  }
  .work-peek img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transform: scale(1.25);
    transition: transform 0.9s cubic-bezier(0.215, 0.61, 0.355, 1);
  }
  .work-row.is-peek .work-peek { clip-path: inset(0 0 0 0); }
  .work-row.is-peek .work-peek img { transform: scale(1); }
  .work-row.is-peek .idx { opacity: 0; }
}

@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ================= FULLSCREEN STACK ================= */
.stack { position: relative; height: 700vh; z-index: 1; background: transparent; }
.stack-sticky {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  transform-origin: center center;
  will-change: transform, border-radius;
  background: #000;
}
.stack-slides { position: absolute; inset: 0; }
.stack-slide {
  position: absolute;
  inset: 0;
  overflow: hidden;
  will-change: transform;
  transform: translate3d(0, 100%, 0);
}
.stack-slide:first-child { transform: none; }
.stack-slide .media {
  position: absolute;
  inset: 0;
  will-change: transform, filter;
  transform-origin: center center;
}
.stack-slide picture { display: block; width: 100%; height: 100%; }
.stack-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.1);
  will-change: transform;
}
.stack-slide .shade {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
}
.stack-caption {
  position: absolute;
  left: 60px;
  right: 60px;
  bottom: 72px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  color: #fff;
  z-index: 3;
  text-shadow: 0 1px 24px rgba(0, 0, 0, 0.35);
}
.stack-caption .title {
  font-size: clamp(48px, 7vw, 140px);
  font-weight: 500;
  line-height: 0.75;
  letter-spacing: -0.05em;
}
.stack-caption .info {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.05;
  text-align: right;
}
.stack-slide::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 45%;
  background: linear-gradient(to top, rgba(0,0,0,.45), transparent);
  z-index: 2;
  pointer-events: none;
}

.stack-bars {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 40px;
  padding: 0 60px;
  display: flex;
  gap: 12px;
  z-index: 100;
}
.stack-bar {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
}
.stack-bar i {
  display: block;
  height: 100%;
  width: 100%;
  background: #fff;
  transform-origin: left center;
  transform: scaleX(0);
}

/* ================= VIEW CURSOR ================= */
.svg-defs { position: absolute; width: 0; height: 0; }
.view-cursor {
  position: fixed;
  left: 0;
  top: 0;
  width: 200px;
  height: 200px;
  margin: -100px 0 0 -100px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transform: scale(0);
  will-change: transform;
}
.view-cursor .glass {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  -webkit-backdrop-filter: blur(6px) saturate(1.4) brightness(1.15);
  backdrop-filter: url(#liquid-glass) blur(2px) saturate(1.4) brightness(1.15);
  background: rgba(255, 255, 255, 0.04);
}
.view-cursor .ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 1px 2px 0 rgba(255, 255, 255, 0.6), inset 0 -10px 30px rgba(255,255,255,.08);
}
.view-cursor span {
  position: relative;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
}

/* ================= CONTACT ================= */
.contact {
  position: relative;
  height: 100vh;
  height: 100svh;
  width: 100%;
  background: var(--bg);
  overflow: hidden;
}
.contact-inner { position: relative; width: 100%; height: 100%; will-change: transform; }
.contact-mark {
  position: absolute;
  left: var(--gutter);
  right: calc(max(30vw, 470px) + 60px);
  /* bottom of H7T sits on the email baseline (set from JS) */
  bottom: var(--mark-bottom, 140px);
}
.contact-mark svg { width: 100%; height: auto; display: block; overflow: visible; }
.baseline-probe { display: inline-block; width: 0; height: 0; vertical-align: baseline; }
.contact-content {
  position: absolute;
  right: var(--gutter);
  bottom: var(--gutter);
  top: var(--content-top, 33.8vh);
  width: 30vw;
  min-width: 470px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
}
.contact-title {
  font-size: 42px;
  font-weight: 500;
  line-height: 0.85;
  letter-spacing: -0.03em;
}
.contact-info { display: flex; flex-direction: column; gap: 10vh; width: 100%; }
.email-section { display: flex; flex-direction: column; width: 100%; }
.email-label { font-size: 15px; font-weight: 500; opacity: 0.7; line-height: 1.3; }
.email-text { font-size: 28px; font-weight: 500; line-height: 1; letter-spacing: -0.02em; }
.contact-title > span { display: block; white-space: nowrap; }
.social-links { display: flex; justify-content: space-between; align-items: center; gap: 20px; width: 100%; }
/* stacked: title, then H7T, then email (set from JS when side-by-side gets too tight) */
.contact.is-stacked .contact-mark { right: var(--gutter); }
.contact.is-stacked .contact-content { width: auto; min-width: 0; left: var(--gutter); }

/* ================= RESPONSIVE ================= */
@media (max-width: 1100px) {
  .work-row .name { font-size: 12vw; }
  .work-row .tag, .work-row .idx { font-size: 18px; }
  .work-hover-track .label { font-size: 9vw; }
}
@media (max-width: 1024px) {
  /* hero: left text above the 117, right text below it (117 is 55vw wide, ~37vw tall) */
  .text-block-1, .text-block-2 {
    display: block;
    left: var(--gutter);
    right: var(--gutter);
    width: auto;
    max-width: none;
    margin: 0 auto;
    text-align: center;
    white-space: nowrap;           /* same two-line breaks as on desktop */
  }
  .text-block-1 { top: auto; bottom: calc(50% + 18.5vw + clamp(56px, 13vw, 110px)); }
  .text-block-2 { top: calc(50% + 18.5vw + clamp(56px, 13vw, 110px)); }
  /* philosophy: let the lines flow so it re-wraps cleanly */
  .philosophy-text { text-align: left; font-size: clamp(28px, 6.4vw, 72px); line-height: 0.95; }
  .philosophy-line, .philosophy-line.right { display: inline; text-align: left; }
}
@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .rolling-text { font-size: 16px; }
  .hero-name { font-size: min(10.5vw, 46px); }
  .section-2 { padding: 100px var(--gutter); }
  .showcase-title { font-size: 6vw; }
  .works { gap: 64px; padding-top: 64px; }
  .works-head .meta { display: none; }
  .works-quote { font-size: 24px; margin: 0 auto; }
  .work-row { height: 120px; }
  .work-row .tag { display: none; }
  .work-row .name { text-align: left; }
  .work-row .idx { flex: 0 0 auto; margin-left: auto; }
  .stack-caption { left: 16px; right: 16px; bottom: 64px; flex-direction: column; align-items: flex-start; gap: 12px; }
  .stack-caption .info { text-align: left; }
  .stack-bars { padding: 0 16px; }
  .contact-title { font-size: 34px; }
  .contact-title > span { white-space: normal; }
  .email-text { font-size: 22px; }
  .view-cursor { display: none; }
}

/* ================= PAGE VEIL ================= */
.page-veil {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 20000;
  opacity: 0;
  pointer-events: none;
}
