/* ============ RESET & VARS ============ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0a0c;
  --bg-soft: #101014;
  --ink: #f2f0ea;
  --muted: #8a8a93;
  --accent: #d8ff3e;
  --line: rgba(242, 240, 234, 0.1);
  --font-display: "Archivo", "Inter", sans-serif;
  --font-hero: "Syne", "Archivo", sans-serif; /* yalnız ASCII mətnlər üçün — Syne Ə/ə dəstəkləmir */
  --font-body: "Inter", sans-serif;
  --pad: clamp(1.25rem, 4vw, 4rem);
}

html { scroll-behavior: smooth; }
html.lenis { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: #000; }

img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ============ PRELOADER ============ */
.preloader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg);
  display: flex; flex-direction: column; gap: 1.5rem;
  align-items: center; justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s;
}
.preloader.done { opacity: 0; visibility: hidden; }
.preloader__logo {
  font-family: var(--font-hero); font-weight: 800;
  font-size: clamp(1.5rem, 4vw, 2.5rem); letter-spacing: -0.02em;
}
.preloader__logo sup { color: var(--accent); font-size: 0.5em; }
.preloader__bar {
  width: min(240px, 60vw); height: 1px;
  background: var(--line); overflow: hidden;
}
.preloader__bar span {
  display: block; height: 100%; width: 100%;
  background: var(--accent);
  transform: translateX(-100%);
  animation: load 1.2s ease forwards;
}
@keyframes load { to { transform: translateX(0); } }

/* ============ 3D CANVAS ============ */
#webgl {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}

/* ============ NAV ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.2rem var(--pad);
  mix-blend-mode: difference;
}
.nav__logo {
  font-family: var(--font-hero); font-weight: 800;
  font-size: 1.3rem; letter-spacing: -0.02em;
}
.nav__logo sup { color: var(--accent); }
.nav__links { display: flex; gap: 2rem; }
.nav__links a, .nav__cta {
  font-size: 0.85rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.08em;
  position: relative; padding: 0.2rem 0;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.4s cubic-bezier(0.65, 0, 0.35, 1);
}
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav__cta {
  border: 1px solid currentColor; border-radius: 99px;
  padding: 0.5rem 1.2rem;
  transition: background 0.3s, color 0.3s;
}
.nav__cta:hover { background: var(--ink); color: var(--bg); }
@media (max-width: 640px) { .nav__links { display: none; } }

/* ============ SECTIONS COMMON ============ */
main { position: relative; z-index: 1; }
section { position: relative; }
.section-tag {
  font-size: 0.8rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.15em;
  color: var(--muted); margin-bottom: 1.5rem;
}
.accent { color: var(--accent); }

/* ============ HERO ============ */
.hero {
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: flex-end;
  padding: var(--pad);
  padding-bottom: clamp(2rem, 6vh, 5rem);
}
.hero__inner { width: 100%; min-width: 0; }
.hero__eyebrow {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 0.9rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.12em;
  margin-bottom: 2rem;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease infinite;
}
@keyframes pulse { 50% { opacity: 0.3; } }
.hero__title {
  font-family: var(--font-hero); font-weight: 800;
  font-size: min(calc(10.2vw - 3px), 12rem);
  line-height: 0.95; letter-spacing: -0.03em;
  text-transform: uppercase;
  max-width: 100%;
}
.hero__line { display: block; overflow: hidden; }
.hero__line > span { display: inline-block; }
.hero__line--outline > span {
  color: transparent;
  -webkit-text-stroke: 2px var(--ink);
}
.hero__bottom {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 2rem; margin-top: 3rem; flex-wrap: wrap;
}
.hero__desc {
  max-width: 34ch;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  color: var(--muted);
}
.hero__desc em { color: var(--ink); font-style: normal; border-bottom: 1px solid var(--accent); }
.hero__scroll {
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.2em;
  color: var(--muted);
}
.hero__scroll-line {
  width: 1px; height: 48px;
  background: linear-gradient(var(--accent), transparent);
  animation: drip 1.8s ease infinite;
}
@keyframes drip {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ============ MARQUEE ============ */
.marquee {
  overflow: hidden; white-space: nowrap;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1.2rem 0;
  background: rgba(10, 10, 12, 0.6);
  backdrop-filter: blur(6px);
}
.marquee__track {
  display: inline-flex;
  animation: marquee 24s linear infinite;
}
.marquee__track span {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.1rem, 2.4vw, 1.8rem);
  text-transform: uppercase; letter-spacing: 0.04em;
  color: transparent; -webkit-text-stroke: 1px var(--muted);
  padding-right: 1rem;
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ============ ABOUT ============ */
.about { padding: clamp(6rem, 14vh, 12rem) var(--pad); }
.about__inner { max-width: 1100px; }
.about__text {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.6rem, 3.6vw, 3.2rem);
  line-height: 1.25; letter-spacing: -0.01em;
}
.about__text .word { display: inline-block; }
.about__stats {
  display: flex; gap: clamp(2rem, 6vw, 6rem);
  margin-top: 4rem; flex-wrap: wrap;
}
.stat { display: flex; flex-direction: column; }
.stat__num {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.4rem, 5vw, 4rem); color: var(--accent);
  line-height: 1;
}
.stat__label {
  font-size: 0.85rem; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--muted); margin-top: 0.5rem;
}

/* ============ WORKS ============ */
.works { padding: clamp(4rem, 10vh, 8rem) var(--pad); }
.works__header { margin-bottom: clamp(3rem, 8vh, 6rem); }
.works__title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(3rem, 10vw, 9rem);
  text-transform: uppercase; letter-spacing: -0.03em; line-height: 1;
}
.works__list {
  display: flex; flex-direction: column;
  gap: clamp(4rem, 10vh, 9rem);
}

.project {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  cursor: pointer;
}
.project:nth-child(even) .project__media { order: 2; }
.project__media {
  position: relative; overflow: hidden;
  border-radius: 12px;
  aspect-ratio: 4 / 3;
  background: var(--bg-soft);
  transform-style: preserve-3d;
}
.project__media img {
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.12);
  transition: transform 1s cubic-bezier(0.25, 1, 0.3, 1);
}
.project:hover .project__media img { transform: scale(1.03); }
.project__placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(3rem, 8vw, 7rem);
  color: rgba(242, 240, 234, 0.08);
  letter-spacing: -0.02em;
}
.project__index {
  font-family: var(--font-display); font-weight: 600;
  color: var(--muted); font-size: 1rem; margin-bottom: 1rem;
}
.project__name {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.8rem, 4.4vw, 3.6rem);
  line-height: 1.05; letter-spacing: -0.02em;
  text-transform: uppercase;
  transition: color 0.3s;
}
.project:hover .project__name { color: var(--accent); }
.project__tag {
  color: var(--muted); font-size: 0.95rem;
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-top: 0.8rem;
}
.project__open {
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin-top: 2rem; font-size: 0.85rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 0.3rem;
  transition: gap 0.3s;
}
.project:hover .project__open { gap: 1rem; }
@media (max-width: 768px) {
  .project { grid-template-columns: 1fr; }
  .project:nth-child(even) .project__media { order: 0; }
}

/* ============ CONTACT ============ */
.contact {
  padding: clamp(6rem, 16vh, 14rem) var(--pad) clamp(4rem, 10vh, 8rem);
  text-align: center;
}
.contact__title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.6rem, 9vw, 8rem);
  line-height: 1; letter-spacing: -0.03em;
  text-transform: uppercase;
}
.contact__line { display: block; overflow: hidden; }
.contact__line > span { display: inline-block; }
.contact__line--accent > span { color: var(--accent); }
.contact__links {
  display: flex; justify-content: center; gap: clamp(1.5rem, 4vw, 3rem);
  margin-top: 4rem; flex-wrap: wrap;
}
.contact__link {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1rem, 2vw, 1.4rem);
  display: inline-flex; gap: 0.4rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.4rem;
  transition: border-color 0.3s, color 0.3s;
}
.contact__link:hover { color: var(--accent); border-color: var(--accent); }
.contact__link span { transition: transform 0.3s; display: inline-block; }
.contact__link:hover span { transform: translate(3px, -3px); }

/* ============ FOOTER ============ */
.footer {
  position: relative; z-index: 1;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  padding: 2rem var(--pad);
  border-top: 1px solid var(--line);
  font-size: 0.8rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em;
}

.footer__credit {
  display: inline-flex; align-items: center; gap: 0.55rem;
  transition: opacity 0.3s;
}
.footer__credit:hover { opacity: 0.75; }
.footer__credit-logo { height: 15px; width: auto; }
.footer__credit-text {
  display: inline-flex; align-items: center; gap: 0.15rem;
  font-weight: 600; color: var(--ink);
  text-transform: lowercase; letter-spacing: 0.04em;
}
.footer__credit-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); display: inline-block;
  margin: 0 0.1rem;
}

/* ============ MODAL ============ */
.modal {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: stretch; justify-content: flex-end;
  visibility: hidden;
}
.modal.open { visibility: visible; }
.modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  opacity: 0; transition: opacity 0.4s;
}
.modal.open .modal__backdrop { opacity: 1; }
.modal__panel {
  position: relative;
  width: min(860px, 94vw);
  background: var(--bg-soft);
  border-left: 1px solid var(--line);
  overflow-y: auto;
  padding: clamp(1.5rem, 4vw, 3rem);
  transform: translateX(100%);
  transition: transform 0.55s cubic-bezier(0.65, 0, 0.35, 1);
}
.modal.open .modal__panel { transform: translateX(0); }
.modal__close {
  position: sticky; top: 0; float: right;
  background: none; border: 1px solid var(--line); color: var(--ink);
  width: 44px; height: 44px; border-radius: 50%;
  font-size: 1rem; cursor: pointer;
  transition: background 0.3s, color 0.3s;
}
.modal__close:hover { background: var(--accent); color: #000; border-color: var(--accent); }
.modal__head { margin-bottom: 2rem; }
.modal__title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 3rem);
  text-transform: uppercase; letter-spacing: -0.02em;
}
.modal__tag {
  color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.12em; font-size: 0.85rem; margin-top: 0.4rem;
}
.modal__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
}
.modal__grid figure {
  position: relative; margin: 0;
  aspect-ratio: 1 / 1; overflow: hidden;
  border-radius: 8px; cursor: pointer;
  background: var(--bg);
}
.modal__grid img, .modal__grid video {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s ease;
}
.modal__grid figure:hover img,
.modal__grid figure:hover video { transform: scale(1.08); }
.modal__grid figure video { pointer-events: none; }
.modal__grid figure::after {
  content: "⤢"; position: absolute; top: 8px; right: 8px;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(10, 10, 12, 0.6); color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; opacity: 0; transition: opacity 0.3s;
}
.modal__grid figure:hover::after { opacity: 1; }
.modal__grid figure.is-video::before {
  content: "▶"; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; color: var(--ink);
  background: rgba(10, 10, 12, 0.25); z-index: 1;
}
.modal__empty {
  grid-column: 1 / -1;
  color: var(--muted); font-size: 0.95rem;
  border: 1px dashed var(--line); border-radius: 8px;
  padding: 3rem 2rem; text-align: center;
}
.modal__loading {
  display: flex; align-items: center; justify-content: center;
  padding: 5rem 0; width: 100%;
}
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 640px) {
  .modal__grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============ LIGHTBOX ============ */
.lightbox {
  position: fixed; inset: 0; z-index: 120;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6, 6, 8, 0.96);
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s ease;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox__stage {
  width: min(1100px, 88vw); height: min(80vh, 780px);
  display: flex; align-items: center; justify-content: center;
}
.lightbox__stage img, .lightbox__stage video {
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain; border-radius: 6px;
}
.lightbox__close, .lightbox__nav {
  position: absolute;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line); color: var(--ink);
  cursor: pointer; transition: background 0.3s, color 0.3s;
  display: flex; align-items: center; justify-content: center;
}
.lightbox__close:hover, .lightbox__nav:hover { background: var(--accent); color: #000; }
.lightbox__close {
  top: 1.5rem; right: 1.5rem;
  width: 46px; height: 46px; border-radius: 50%;
  font-size: 1.1rem;
}
.lightbox__nav {
  top: 50%; transform: translateY(-50%);
  width: 54px; height: 54px; border-radius: 50%;
  font-size: 1.8rem; line-height: 1;
}
.lightbox__nav--prev { left: 1.5rem; }
.lightbox__nav--next { right: 1.5rem; }
.lightbox__counter {
  position: absolute; bottom: 1.5rem; left: 50%;
  transform: translateX(-50%);
  font-size: 0.85rem; letter-spacing: 0.08em;
  color: var(--muted);
}
@media (max-width: 640px) {
  .lightbox__nav { width: 42px; height: 42px; font-size: 1.4rem; }
  .lightbox__nav--prev { left: 0.5rem; }
  .lightbox__nav--next { right: 0.5rem; }
  .lightbox__close { top: 0.8rem; right: 0.8rem; }
}
