/* =========================================================
   Nihat Peri — Visual Director
   Dark cinematic single-page portfolio
   ========================================================= */

:root {
  --bg:      #0a0b0f;        /* near-black, faint navy shadow */
  --bg-2:    #121521;        /* dusty navy panel */
  --fg:      #e9e1d2;        /* warm beige off-white */
  --muted:   #8b8475;        /* warm taupe */
  --line:    rgba(233, 225, 210, 0.13);
  --accent:  #cf4438;        /* cinematic red, used sparingly */
  --navy:    #4a5b80;        /* pastel navy, secondary accent / gradients */
  --ease:    cubic-bezier(0.16, 1, 0.3, 1);
  --pad:     clamp(20px, 5vw, 80px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

/* Lenis smooth-scroll (required so it doesn't fight native scroll) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-smooth iframe { pointer-events: none; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(15px, 1.05vw, 18px);
  line-height: 1.5;
  letter-spacing: -0.01em;
  overflow-x: hidden;
  cursor: none;
}

@media (hover: none) { body { cursor: auto; } }

/* custom scrollbar */
html { scrollbar-width: thin; scrollbar-color: #2e2e36 var(--bg); }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2e2e36; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

a { color: inherit; text-decoration: none; }
img, video { display: block; width: 100%; height: 100%; object-fit: cover; }
em { font-family: "Instrument Serif", serif; font-style: italic; font-weight: 400; }
::selection { background: var(--accent); color: #fff; }

/* ===================== Overlays ===================== */
.grain {
  position: fixed; inset: -50%; z-index: 9000; pointer-events: none;
  opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.6s steps(3) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0); }
  33% { transform: translate(-3%, 2%); }
  66% { transform: translate(2%, -3%); }
}
.vignette {
  position: fixed; inset: 0; z-index: 8000; pointer-events: none;
  box-shadow: inset 0 0 240px 40px rgba(0,0,0,0.7);
}

/* ===================== Cursor ===================== */
.cursor {
  position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--fg);
  transform: translate(-50%, -50%);
  transition: width .35s var(--ease), height .35s var(--ease),
              background .35s var(--ease), opacity .3s;
  mix-blend-mode: difference;
}
.cursor.is-hover {
  width: 90px; height: 90px;
  mix-blend-mode: normal;
  background: rgba(233, 225, 210, 0.06);
  backdrop-filter: blur(5px) saturate(150%) brightness(1.15);
  -webkit-backdrop-filter: blur(5px) saturate(150%) brightness(1.15);
  border: 1px solid rgba(233, 225, 210, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.cursor.is-view  { width: 116px; height: 116px; background: var(--accent); mix-blend-mode: normal; }
.cursor.is-view::after {
  content: "VIEW"; position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 11px; letter-spacing: 0.1em; color: #fff; font-weight: 600;
}
@media (hover: none) { .cursor { display: none; } }

/* ===================== Loader ===================== */
.loader {
  position: fixed; inset: 0; z-index: 10000; background: var(--bg);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: var(--pad);
  overflow: hidden; /* clip the grain/aurora so nothing leaks once the curtain lifts */
  transition: transform 1s var(--ease);
}
.loader.is-done { transform: translateY(-100%); }
.loader__inner {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px solid var(--line); padding-bottom: 18px;
}
.loader__name { font-size: clamp(28px, 7vw, 80px); font-weight: 500; letter-spacing: -0.03em; }
.loader__count { font-size: clamp(28px, 7vw, 80px); font-family: "Instrument Serif", serif; color: var(--muted); }
.loader__bar { height: 2px; background: var(--line); margin-top: 18px; }
.loader__bar span { display: block; height: 100%; width: 0; background: var(--fg); }

/* Aurora gradient loader visual */
.loader__visual {
  position: absolute; inset: 0; display: grid; place-items: center;
  pointer-events: none; overflow: hidden;
}
.loader__aurora { position: absolute; inset: 0; }
.loader__aurora i {
  position: absolute; border-radius: 50%;
  filter: blur(72px) saturate(1.15); will-change: transform;
}
.loader__aurora i:nth-child(1) {
  width: 64vmax; height: 64vmax; top: -28%; left: -14%;
  background: radial-gradient(circle, rgba(207, 68, 56, 0.55), transparent 62%);
  animation: aur1 9s ease-in-out infinite alternate;
}
.loader__aurora i:nth-child(2) {
  width: 70vmax; height: 70vmax; bottom: -34%; right: -18%;
  background: radial-gradient(circle, rgba(74, 91, 128, 0.65), transparent 64%);
  animation: aur2 11s ease-in-out infinite alternate;
}
.loader__aurora i:nth-child(3) {
  width: 42vmax; height: 42vmax; top: 30%; left: 38%;
  background: radial-gradient(circle, rgba(201, 163, 106, 0.34), transparent 60%);
  animation: aur3 7.5s ease-in-out infinite alternate;
}
@keyframes aur1 { to { transform: translate(14%, 18%) scale(1.25); } }
@keyframes aur2 { to { transform: translate(-16%, -14%) scale(1.18); } }
@keyframes aur3 { to { transform: translate(-22%, 16%) scale(0.86); } }

.loader__num {
  position: relative; z-index: 1;
  font-weight: 600; line-height: 1; letter-spacing: -0.05em;
  font-size: clamp(110px, 24vmin, 250px);
  font-variant-numeric: tabular-nums;
  background: linear-gradient(100deg, #f2f0ec 8%, #cf4438 38%, #8fa3cc 68%, #f2f0ec 96%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: numFlow 2.8s linear infinite;
}
.loader__num b { font-weight: inherit; color: inherit; }
.loader__num em { font-style: normal; font-size: 0.3em; vertical-align: super; letter-spacing: 0; }
@keyframes numFlow { to { background-position: -220% 0; } }
/* projector grain on the loader itself */
.loader::after {
  content: ""; position: absolute; inset: -50%; pointer-events: none;
  opacity: 0.07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.5s steps(3) infinite;
}

/* ===================== Nav ===================== */
.nav {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 7000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--pad);
  transition: transform .5s var(--ease);
}
.nav.is-hidden { transform: translateY(-110%); }
.nav__logo { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.nav__logo span { color: var(--accent); font-size: 11px; vertical-align: super; }
/* liquid glass pill */
.nav__links {
  display: flex; gap: 26px; align-items: center;
  padding: 12px 26px; border-radius: 999px;
  background: rgba(233, 225, 210, 0.05);
  border: 1px solid rgba(233, 225, 210, 0.13);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 10px 30px rgba(0, 0, 0, 0.25);
}
.nav__links a { position: relative; font-size: 15px; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -4px; width: 0; height: 1px;
  background: currentColor; transition: width .4s var(--ease);
}
.nav__links a:hover::after { width: 100%; }
.nav__links a.is-active::after { width: 100%; background: var(--accent); }
.nav__cta {
  display: flex; align-items: center; gap: 8px; font-size: 14px;
  padding: 12px 22px; border-radius: 999px;
  background: rgba(233, 225, 210, 0.05);
  border: 1px solid rgba(233, 225, 210, 0.13);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 10px 30px rgba(0, 0, 0, 0.25);
  transition: background .4s var(--ease), border-color .4s var(--ease);
}
.nav__cta:hover { background: rgba(207, 68, 56, 0.14); border-color: rgba(207, 68, 56, 0.4); }
.nav__cta i {
  width: 7px; height: 7px; border-radius: 50%; background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74,222,128,.6); animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74,222,128,.5); }
  70% { box-shadow: 0 0 0 8px rgba(74,222,128,0); }
  100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}
.nav__burger { display: none; background: none; border: 0; cursor: none; width: 30px; height: 18px; position: relative; }
.nav__burger span { position: absolute; left: 0; width: 100%; height: 1.5px; background: var(--fg); transition: .4s var(--ease); }
.nav__burger span:nth-child(1) { top: 0; }
.nav__burger span:nth-child(2) { bottom: 0; }
.nav.is-open .nav__burger span:nth-child(1) { top: 8px; transform: rotate(45deg); }
.nav.is-open .nav__burger span:nth-child(2) { bottom: 8px; transform: rotate(-45deg); }

/* ===================== Mobile menu ===================== */
.menu {
  position: fixed; inset: 0; z-index: 6900;
  background: rgba(14, 16, 24, 0.62);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  display: flex; flex-direction: column; justify-content: center; gap: 8px;
  padding: var(--pad);
  clip-path: inset(0 0 100% 0); transition: clip-path .7s var(--ease);
  pointer-events: none;
}
.menu.is-open { clip-path: inset(0 0 0 0); pointer-events: auto; }
.menu a {
  font-size: clamp(40px, 12vw, 90px); font-weight: 500; letter-spacing: -0.03em;
  display: flex; align-items: baseline; gap: 18px; padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.menu a span { font-size: 16px; font-family: "Instrument Serif", serif; color: var(--muted); }

/* ===================== Hero ===================== */
.hero { position: relative; height: 100svh; min-height: 600px; overflow: hidden; }
.hero__media { position: absolute; inset: 0; z-index: 0; }
.hero__video { position: absolute; inset: 0; z-index: 1; opacity: 0; transition: opacity 1.2s ease; pointer-events: none; }
.hero__video.is-ready { opacity: 1; }
/* kill iOS' non-tappable play overlay on the background videos */
.hero__video::-webkit-media-controls,
.hero__video::-webkit-media-controls-start-playback-button,
.intro video::-webkit-media-controls,
.intro video::-webkit-media-controls-start-playback-button {
  display: none !important; -webkit-appearance: none;
}
.hero__fallback {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(120% 90% at 72% 8%, rgba(207,68,56,0.20), transparent 55%),
    radial-gradient(110% 85% at 15% 95%, rgba(74,91,128,0.36), transparent 62%),
    linear-gradient(180deg, #11131c, #07080c);
}
.hero__overlay {
  position: absolute; inset: 0; z-index: 2;
  /* light bej film: only a soft scrim top (nav) & bottom (wordmark) */
  background:
    linear-gradient(180deg, rgba(8, 8, 10, 0.45) 0%, rgba(8, 8, 10, 0) 18%),
    linear-gradient(0deg, rgba(8, 8, 10, 0.72) 0%, rgba(8, 8, 10, 0) 38%);
}

/* hero wordmark over the film (original beige; bottom scrim keeps it readable) */
.hero__content.hero__content--film { justify-content: flex-end; }
.hero__signrow { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
.hero__name { display: block; font-size: clamp(40px, 7vw, 112px); font-weight: 500; letter-spacing: -0.035em; line-height: 0.9; color: var(--fg); }
.hero__role { display: block; margin-top: 12px; font-size: clamp(12px, 1.3vw, 17px); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 760px) { .hero__signrow { flex-direction: column; align-items: flex-start; } }

/* ===== Intro film ===== */
.intro {
  position: fixed; inset: 0; z-index: 10001; background: #e9e1d2;
  display: grid; place-items: center; overflow: hidden;
  transition: opacity .9s var(--ease);
}
.intro.is-done { opacity: 0; pointer-events: none; }
.intro video { width: 100%; height: 100%; object-fit: cover; }
.intro__skip {
  position: absolute; bottom: clamp(20px, 4vw, 48px); right: clamp(20px, 4vw, 48px);
  background: rgba(21, 18, 12, 0.08); border: 1px solid rgba(21, 18, 12, 0.25); color: #15120c;
  font: inherit; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 10px 20px; border-radius: 999px; cursor: pointer;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: background .3s, border-color .3s;
}
.intro__skip:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.hero__content {
  position: relative; z-index: 2; height: 100%;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 110px var(--pad) calc(var(--pad));
}
.hero__top {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; color: #cfcdc8;
}
/* glass chips */
.hero__top > span {
  padding: 9px 18px; border-radius: 999px;
  background: rgba(233, 225, 210, 0.05);
  border: 1px solid rgba(233, 225, 210, 0.13);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.hero__title {
  font-weight: 500; line-height: 0.86; letter-spacing: -0.04em;
  font-size: clamp(64px, 19vw, 320px);
  margin-top: auto;
}
.hero__title .line { display: block; overflow: hidden; }
.hero__title .line > span {
  display: block; transform: translateY(110%);
  transition: transform 1.1s var(--ease);
}
.is-loaded .hero__title .line > span { transform: translateY(0); }
.hero__title .line:nth-child(2) > span { transition-delay: .1s; }
.hero__title em { color: var(--accent); font-size: 0.3em; vertical-align: super; }
.hero__bottom {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 20px;
  margin-top: 38px;
}
.hero__bottom p { max-width: 30ch; color: #cfcdc8; font-size: clamp(15px, 1.4vw, 20px); }
.hero__scroll { display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; }
.hero__scroll i { width: 1px; height: 46px; background: linear-gradient(var(--fg), transparent); animation: scrollLine 2s var(--ease) infinite; transform-origin: top; }
@keyframes scrollLine { 0% { transform: scaleY(0); } 40% { transform: scaleY(1); } 100% { transform: scaleY(0); transform-origin: bottom; } }


/* ===================== Marquee ===================== */
.marquee { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; padding: 26px 0; background: var(--bg-2); cursor: grab; }
.marquee.is-drag { cursor: grabbing; }
.marquee__track { display: flex; gap: 40px; align-items: center; width: max-content; animation: marquee 28s linear infinite; user-select: none; }
.marquee__track span { font-size: clamp(28px, 5vw, 64px); font-weight: 500; letter-spacing: -0.02em; white-space: nowrap; }
.marquee__track i { color: var(--accent); font-size: clamp(16px, 2.5vw, 30px); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ===================== Section head ===================== */
.section-head { padding: clamp(54px, 7vw, 100px) var(--pad) 0; }
.section-head__index { font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.section-head__title { font-size: clamp(44px, 9vw, 150px); font-weight: 500; letter-spacing: -0.04em; line-height: 0.92; margin-top: 26px; }
.section-head__title em { color: var(--accent); }
.section-head__sub {
  display: block; margin-top: 16px;
  color: var(--accent); font-family: "Instrument Serif", serif; font-style: italic;
  font-size: clamp(22px, 3vw, 42px); letter-spacing: -0.01em;
}

/* ===================== Ghost watermark typography ===================== */
.about, .contact, .ai { position: relative; overflow: hidden; }
.about > *, .contact > *, .ai > * { position: relative; z-index: 1; }
.section-ghost {
  position: absolute; z-index: 0; margin: 0; pointer-events: none; user-select: none;
  font-weight: 700; line-height: 0.78; letter-spacing: -0.05em; white-space: nowrap;
  color: transparent; -webkit-text-stroke: 1.3px rgba(233, 225, 210, 0.09);
  font-size: clamp(120px, 26vw, 460px);
  left: -0.04em; bottom: -0.14em;
}
.section-ghost--right { left: auto; right: -0.04em; bottom: auto; top: -0.08em; }

/* ===================== Work ===================== */
.work { padding-bottom: clamp(16px, 2vw, 36px); }
.projects {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(20px, 3vw, 50px);
  padding: clamp(40px, 6vw, 90px) var(--pad) 0;
}
.project { display: block; }
.project__media {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg-2);
  border: 1px solid var(--line);
}
.project__media img,
.project__media video { position: absolute; inset: 0; transition: transform 1.1s var(--ease), opacity .6s ease; }
.project__media video { opacity: 0; }
.project__media img { transform: scale(1.01); }
.project:hover .project__media img { transform: scale(1.06); opacity: 0; }
.project:hover .project__media video { opacity: 1; transform: scale(1.04); }
.project__meta {
  display: flex; align-items: baseline; gap: 14px; padding: 20px 4px 0; flex-wrap: wrap;
}
.project__meta h3 { font-size: clamp(24px, 3vw, 40px); font-weight: 500; letter-spacing: -0.02em; }
.project__tags { color: var(--muted); font-size: 14px; }
.project__year { margin-left: auto; color: var(--muted); font-family: "Instrument Serif", serif; font-size: 22px; }

/* ===================== Horizontal gallery ===================== */
.gallery {
  display: flex; align-items: center; gap: clamp(20px, 3vw, 64px);
  overflow-x: auto; overflow-y: hidden;
  padding: clamp(28px, 4vw, 56px) var(--pad);
  perspective: 1600px;
  cursor: grab; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery.is-drag { cursor: grabbing; }
.gallery.is-drag .tile { pointer-events: none; }

.tile {
  flex: 0 0 auto; width: clamp(280px, 38vw, 500px);
  transform-origin: center; will-change: transform, opacity; backface-visibility: hidden;
}
.tile--wide { width: clamp(420px, 52vw, 780px); }
.tile--wide .tile__media { aspect-ratio: 16 / 9; }
.tile--tall { width: clamp(240px, 26vw, 360px); }
.tile--tall .tile__media { aspect-ratio: 3 / 4; }
.tile__media {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 42%, rgba(207, 68, 56, 0.12), transparent 58%),
    linear-gradient(150deg, #1a1f30, #0c0e16);
}
.tile__media img,
.tile__media video { z-index: 1; }   /* loaded media covers the placeholder bg */
.tile__media::before {
  content: "▶"; position: absolute; inset: 0; z-index: 0;
  display: grid; place-items: center;
  font-size: clamp(22px, 3vw, 34px); color: rgba(233, 225, 210, 0.22);
}
.tile__media img,
.tile__media video { position: absolute; inset: 0; transition: transform 1.1s var(--ease), opacity .6s ease; }
.tile__media video { opacity: 0; }
.tile__media img { transform: scale(1.01); }
.tile:hover .tile__media img { transform: scale(1.06); opacity: 0; }
.tile:hover .tile__media video { opacity: 1; transform: scale(1.04); }
.tile__num {
  position: absolute; top: 14px; left: 16px; z-index: 2;
  font-size: 12px; letter-spacing: 0.14em; color: var(--fg); mix-blend-mode: difference;
}
.tile__media--cta {
  display: grid; place-items: center; text-align: center;
  font-family: "Instrument Serif", serif; font-size: clamp(26px, 3vw, 40px);
  color: var(--muted); background:
    radial-gradient(120% 120% at 50% 0%, rgba(207,68,56,0.10), transparent 60%), var(--bg-2);
}
.tile__meta { display: flex; align-items: baseline; gap: 12px; padding: 18px 2px 0; flex-wrap: wrap; }
.tile__meta h3 { font-size: clamp(20px, 2.4vw, 32px); font-weight: 500; letter-spacing: -0.02em; }
.tile__tags { color: var(--muted); font-size: 13px; }
.tile__year { margin-left: auto; color: var(--muted); font-family: "Instrument Serif", serif; font-size: 20px; }

.gallery__foot {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px;
  padding: 4px var(--pad) clamp(20px, 2.5vw, 40px);
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.gallery__cue { display: flex; align-items: center; gap: 14px; }
.gallery__arrow { display: inline-flex; gap: 5px; }
.gallery__arrow i {
  width: 9px; height: 9px; border-top: 1.5px solid var(--accent); border-right: 1.5px solid var(--accent);
  transform: rotate(45deg); animation: chev 1.4s var(--ease) infinite;
}
.gallery__arrow i:nth-child(2) { animation-delay: .15s; opacity: .55; }
.gallery__arrow i:nth-child(3) { animation-delay: .30s; opacity: .3; }
@keyframes chev {
  0%, 100% { transform: rotate(45deg) translate(0, 0); }
  50% { transform: rotate(45deg) translate(3px, -3px); }
}
.gallery__progress { display: flex; align-items: center; gap: 14px; font-variant-numeric: tabular-nums; }
.gallery__count { color: var(--fg); }
.gallery__bar { position: relative; width: clamp(120px, 18vw, 280px); height: 1px; background: var(--line); }
.gallery__bar b { position: absolute; inset: 0; background: var(--accent); transform: scaleX(0); transform-origin: left; }

/* ===================== AI Lab ===================== */
.ai__grid {
  display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: clamp(160px, 22vw, 300px);
  gap: clamp(14px, 1.8vw, 26px);
  padding: clamp(40px, 6vw, 90px) var(--pad) clamp(60px, 9vw, 130px);
}
.ai-cell {
  position: relative; overflow: hidden; margin: 0;
  border: 1px solid var(--line);
}
.ai-cell--big { grid-column: span 2; grid-row: span 2; }
.ai-cell--wide { grid-column: span 2; }
/* vivid placeholders until real AI stills land — also what makes the glass tags sing */
.ai-cell:nth-child(1) { background: linear-gradient(135deg, #ff5e3a, #b8174d 45%, #3b1d6e); }
.ai-cell:nth-child(2) { background: linear-gradient(150deg, #19c8b4, #156a8a 55%, #122a4e); }
.ai-cell:nth-child(3) { background: linear-gradient(140deg, #f3b13d, #d4502a 60%, #6e1430); }
.ai-cell:nth-child(4) { background: linear-gradient(120deg, #8e54e9, #4736c9 50%, #14104a); }
.ai-cell:nth-child(5) { background: linear-gradient(155deg, #ff8fb2, #c2336f 55%, #43123f); }
.ai-cell:nth-child(6) { background: linear-gradient(130deg, #5ad1ff, #2a6cd4 55%, #131e52); }
.ai-cell img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease); }
.ai-cell:hover img { transform: scale(1.05); }
/* liquid glass tag — real backdrop blur over colour, the way it's meant to be used */
.ai-cell__tag {
  position: absolute; left: 14px; right: 14px; bottom: 14px; z-index: 2;
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 12px 18px; border-radius: 14px;
  background: rgba(16, 14, 18, 0.30);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 8px 24px rgba(0, 0, 0, 0.25);
}
.ai-cell__tag b { font-weight: 500; font-size: clamp(15px, 1.4vw, 20px); letter-spacing: -0.01em; color: #fff; }
.ai-cell__tag span { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 255, 255, 0.75); }
@media (max-width: 860px) {
  .ai__grid { grid-template-columns: 1fr 1fr; }
  .ai-cell--big, .ai-cell--wide { grid-column: span 2; }
}
@media (max-width: 640px) {
  /* stack the glass tag so the model name never clips on narrow cells */
  .ai-cell__tag { flex-direction: column; align-items: flex-start; gap: 3px; padding: 11px 15px; }
  .ai-cell__tag span { font-size: 11px; }
  .ai__grid { grid-auto-rows: clamp(150px, 44vw, 240px); }
}

/* ===================== About ===================== */
.about__grid {
  display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(30px, 5vw, 80px);
  padding: clamp(40px, 6vw, 80px) var(--pad) clamp(60px, 8vw, 120px);
  align-items: start;
}
.about__portrait { aspect-ratio: 3 / 4; overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); position: sticky; top: 100px; }
.about__portrait img { transition: transform 1.2s var(--ease); }
.about__portrait:hover img { transform: scale(1.04); }
.about__lead { font-size: clamp(24px, 3.4vw, 46px); line-height: 1.18; letter-spacing: -0.02em; margin-bottom: 30px; }
.about__lead em { color: var(--accent); }
.about__text > p { color: #cfcdc8; max-width: 52ch; margin-bottom: 22px; }
.about__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 50px; }

/* Tools i command (in the right column, under the bio) */
.about__tools { margin-top: clamp(36px, 4vw, 56px); }
.about__tools-title { font-size: clamp(46px, 7vw, 112px); font-weight: 500; line-height: 0.92; letter-spacing: -0.035em; margin-bottom: clamp(28px, 3.5vw, 48px); }
.about__tools-title em { color: var(--accent); }
.about__tools-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(18px, 2vw, 32px) clamp(24px, 3vw, 48px); }
@media (max-width: 560px) { .about__tools-grid { grid-template-columns: 1fr; } }
.about__cols h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 16px; }
.about__cols ul { list-style: none; }
.about__cols li { padding: 9px 0; border-top: 1px solid var(--line); font-size: 17px; }

/* ===================== Toolkit ===================== */
.toolkit__grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(24px, 3vw, 54px);
  padding: clamp(40px, 6vw, 90px) var(--pad) clamp(60px, 10vw, 140px);
}
.tool-group h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 16px; }
.tool-group ul { list-style: none; }
.tool-group li {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 0; border-top: 1px solid var(--line);
  font-size: clamp(16px, 1.5vw, 20px);
  transition: color .3s var(--ease), padding-left .4s var(--ease);
}
.tool-group li:hover { color: var(--accent); padding-left: 8px; }
.tool-group li i {
  font-style: normal; font-size: 12px; letter-spacing: 0.05em; color: var(--muted);
  border: 1px solid rgba(233, 225, 210, 0.16); border-radius: 999px; padding: 4px 10px;
  background: rgba(233, 225, 210, 0.05);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transition: border-color .3s, color .3s;
}
.tool-group li:hover i { color: var(--accent); border-color: var(--accent); }

@media (max-width: 860px) { .toolkit__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .toolkit__grid { grid-template-columns: 1fr; } }

/* ===================== Contact ===================== */
.contact { padding-bottom: clamp(40px, 6vw, 80px); }
.contact__cta {
  display: block; padding: clamp(40px, 7vw, 90px) var(--pad) clamp(50px, 8vw, 110px);
  font-size: clamp(48px, 13vw, 220px); font-weight: 500; line-height: 0.9; letter-spacing: -0.04em;
}
.contact__cta span { display: block; }
.contact__cta em { color: var(--accent); }
.contact__cta:hover em { color: var(--fg); transition: color .4s; }
.contact__row {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px;
  padding: 30px var(--pad); border-top: 1px solid var(--line); font-size: clamp(16px, 2vw, 24px);
}
.contact__socials { display: flex; gap: 26px; }
.contact__socials a { position: relative; }
.contact__socials a::after { content: ""; position: absolute; left: 0; bottom: -3px; width: 0; height: 1px; background: currentColor; transition: width .4s var(--ease); }
.contact__socials a:hover::after { width: 100%; }

/* ===================== Footer ===================== */
.footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: 24px var(--pad); border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em;
}

/* ===================== Scroll progress ===================== */
.progress { position: fixed; top: 0; left: 0; width: 100%; height: 2px; z-index: 7500; pointer-events: none; }
.progress span { display: block; height: 100%; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }

/* ===================== Live clock ===================== */
.js-clock { font-variant-numeric: tabular-nums; }

/* ===================== Showreel button (nav + mobile) ===================== */
.nav__reel {
  background: none; border: 0; cursor: none; color: inherit; font: inherit; font-size: 15px;
  display: flex; align-items: center; gap: 8px;
}
.nav__reel i { font-size: 9px; color: var(--accent); }
.menu__reel {
  background: none; border: 0; border-bottom: 1px solid var(--line); cursor: none; color: inherit;
  font: inherit; font-size: clamp(40px, 12vw, 90px); font-weight: 500; letter-spacing: -0.03em;
  display: flex; align-items: baseline; gap: 18px; padding: 6px 0; text-align: left; width: 100%;
}
.menu__reel span { font-size: 16px; font-family: "Instrument Serif", serif; color: var(--accent); }

/* ===================== Hero play button ===================== */
.hero__play {
  position: absolute; z-index: 3; top: 46%; left: 50%; transform: translate(-50%, -50%);
  width: clamp(94px, 11vw, 150px); height: clamp(94px, 11vw, 150px); border-radius: 50%;
  background: rgba(233, 225, 210, 0.05); backdrop-filter: blur(4px);
  border: 1px solid var(--line); color: var(--fg); cursor: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  transition: background .45s var(--ease), border-color .45s var(--ease);
}
.hero__play span { font-size: 19px; color: var(--accent); margin-left: 3px; line-height: 1; }
.hero__play:hover { background: rgba(207, 68, 56, 0.16); border-color: var(--accent); }

/* ===================== Project lightbox ===================== */
.lightbox {
  position: fixed; inset: 0; z-index: 9500; padding: var(--pad);
  background: rgba(5, 6, 9, 0.93); backdrop-filter: blur(14px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .5s var(--ease);
}
.lightbox.is-open { opacity: 1; pointer-events: auto; }
.lightbox__frame {
  width: min(1100px, 100%); margin: 0;
  transform: scale(.96) translateY(14px); transition: transform .65s var(--ease);
}
.lightbox.is-open .lightbox__frame { transform: scale(1) translateY(0); }
.lightbox__media {
  position: relative; aspect-ratio: 16 / 9; background: #000;
  border: 1px solid var(--line); overflow: hidden;
}
.lightbox__media video { width: 100%; height: 100%; object-fit: contain; }
.lightbox__ph {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  padding: 20px; margin: 0;
  font-family: "Instrument Serif", serif; font-size: clamp(20px, 2.6vw, 34px); color: var(--muted);
  background:
    radial-gradient(circle at 50% 40%, rgba(207, 68, 56, 0.12), transparent 60%),
    linear-gradient(150deg, #161a28, #0a0c12);
}
.lightbox__ph em { color: var(--accent); }
.lightbox__frame figcaption {
  display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; padding-top: 18px;
}
.lightbox__frame figcaption h3 { font-size: clamp(24px, 3vw, 42px); font-weight: 500; letter-spacing: -0.02em; }
.lightbox__frame figcaption span { color: var(--muted); font-size: 14px; letter-spacing: 0.05em; text-transform: uppercase; }
.lightbox__close {
  position: absolute; top: 24px; right: var(--pad);
  color: var(--fg); font: inherit; font-size: 15px; cursor: none; letter-spacing: 0.05em;
  padding: 11px 22px; border-radius: 999px;
  background: rgba(233, 225, 210, 0.06);
  border: 1px solid rgba(233, 225, 210, 0.16);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
  transition: background .35s, border-color .35s;
}
.lightbox__close:hover { background: rgba(207, 68, 56, 0.16); border-color: rgba(207, 68, 56, 0.4); }
.lightbox__close:hover { color: var(--accent); }

/* ===================== Word-mask reveal ===================== */
.js-split .word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.15em; margin-bottom: -0.15em; }
.js-split .word > span { display: inline-block; transform: translateY(110%); transition: transform .9s var(--ease); }
.js-split.is-in .word > span { transform: translateY(0); }

/* ===================== Magnetic elements ===================== */
.magnet { display: inline-block; transition: transform .5s var(--ease); will-change: transform; }
.magnet.is-pull { transition: transform .15s ease-out; }

/* ===================== Reveal animation ===================== */
.reveal { opacity: 0; transform: translateY(36px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* #7 — clip-path "curtain" reveal */
.clip-reveal { opacity: 1; transform: none; clip-path: inset(0 0 100% 0); transition: clip-path 1.15s var(--ease); }
.clip-reveal.is-in { clip-path: inset(0 0 0 0); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
  .hero__title .line > span { transform: none; }
  .js-split .word > span { transform: none; }
  .clip-reveal { clip-path: none; }
  html { scroll-behavior: auto; }
}

/* ===================== Responsive ===================== */
@media (max-width: 860px) {
  .nav__links, .nav__cta { display: none; }
  .nav__burger { display: block; }
  .projects { grid-template-columns: 1fr; }
  .about__grid { grid-template-columns: 1fr; }
  .about__portrait { position: relative; top: 0; max-width: 420px; }
  .hero__content { padding-top: 90px; }
  .hero__bottom { flex-direction: column; align-items: flex-start; }
  .hero__scroll { display: none; }
  .about__cols { grid-template-columns: 1fr; }
  .hero__play { top: 38%; }
}
