/* ============================================================
   NK — Nodari Khomeriki
   Design system + motion primitives
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=Familjen+Grotesk:wght@400;500;600;700&family=Martian+Mono:wght@300;400;500&display=swap');

/* ---------- tokens ---------- */
:root {
  --ink:        #07070a;
  --ink-soft:   #16161b;
  --paper:      #c7c5c0;
  --paper-lit:  #e4e2dd;
  --bone:       #f2f0ec;
  --gold:       #c9a961;
  --gold-lit:   #e3c98d;
  --muted:      rgba(7,7,10,.52);
  --muted-inv:  rgba(242,240,236,.48);
  --line:       rgba(7,7,10,.14);
  --line-inv:   rgba(242,240,236,.14);

  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans:  'Familjen Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --mono:  'Martian Mono', ui-monospace, monospace;

  --pad: clamp(20px, 4vw, 64px);
  --ease: cubic-bezier(.16,1,.3,1);
  --ease-io: cubic-bezier(.76,0,.24,1);

  --vh: 1vh;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-size-adjust: 100%;
}

body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

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

/* Lenis smooth-scroll rig */
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; }

img, video, canvas, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--gold); color: var(--ink); }

/* ---------- type scale ---------- */
.d-xl {
  font-family: var(--serif);
  font-weight: 300;
  /* also capped against viewport HEIGHT so two lines always clear the nav
     and the hero footer on short laptop screens */
  font-size: clamp(2.9rem, min(10.5vw, 17vh), 11.5rem);
  line-height: .88;
  letter-spacing: -.03em;
}
.d-lg {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.6rem, 7.6vw, 8.5rem);
  line-height: .92;
  letter-spacing: -.025em;
}
.d-md {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.9rem, 4.2vw, 4rem);
  line-height: 1.04;
  letter-spacing: -.02em;
}
.d-it { font-style: italic; color: var(--gold); }

.lead {
  font-size: clamp(1rem, 1.55vw, 1.35rem);
  line-height: 1.5;
  font-weight: 400;
  max-width: 44ch;
}

.mono {
  font-family: var(--mono);
  font-size: clamp(.56rem, .72vw, .7rem);
  font-weight: 400;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.tick { display: inline-flex; align-items: center; gap: .6em; }
.tick::before {
  content: ''; width: 28px; height: 1px; background: currentColor; opacity: .5;
}

/* ============================================================
   PRELOADER
   ============================================================ */
#preloader {
  position: fixed; inset: 0; z-index: 9000;
  background: var(--ink);
  display: grid;
  grid-template-rows: 1fr auto;
  padding: var(--pad);
  will-change: transform;
}
#preloader.done { pointer-events: none; }

.pre-center {
  display: grid; place-items: center; position: relative;
}
.pre-mono {
  font-family: var(--serif);
  font-size: clamp(5rem, 22vw, 20rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -.05em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(242,240,236,.28);
  position: relative;
}
.pre-mono span.fill {
  position: absolute; inset: 0;
  color: var(--bone);
  -webkit-text-stroke: 0;
  clip-path: inset(100% 0 0 0);
  will-change: clip-path;
}
.pre-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
.pre-count { font-family: var(--mono); font-size: clamp(2rem,6vw,4.5rem); font-weight: 300; line-height: 1; letter-spacing: -.04em; }
.pre-label { color: var(--muted-inv); }
.pre-bar { position: absolute; left: var(--pad); right: var(--pad); bottom: calc(var(--pad) + 5.4rem); height: 1px; background: var(--line-inv); }
.pre-bar i { display: block; height: 100%; width: 0%; background: var(--gold); }

/* curtain panels used to wipe the preloader away */
.curtain { position: fixed; inset: 0; z-index: 8999; pointer-events: none; display: flex; }
.curtain i { flex: 1; background: var(--ink); transform-origin: bottom; }

/* ============================================================
   CURSOR
   ============================================================ */
#cursor {
  position: fixed; top: 0; left: 0; z-index: 9500;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--gold);
  pointer-events: none;
  mix-blend-mode: difference;
  will-change: transform;
}
#cursor-ring {
  position: fixed; top: 0; left: 0; z-index: 9499;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(201,169,97,.5);
  pointer-events: none;
  will-change: transform;
}
#cursor-ring .clabel {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--mono); font-size: .5rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold); opacity: 0; white-space: nowrap;
}
@media (hover: none), (max-width: 860px) { #cursor, #cursor-ring { display: none; } }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 800;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--pad) * .62) var(--pad);
  mix-blend-mode: difference;
  color: var(--bone);
}
.nav-mark { display: flex; align-items: baseline; gap: .55em; font-family: var(--serif); font-size: 1.05rem; letter-spacing: .02em; }
.nav-mark b { font-weight: 400; }
.nav-mark i { font-style: italic; color: var(--gold); }
.nav-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); align-self: center; }
.nav-links { display: flex; gap: clamp(14px, 2.4vw, 40px); align-items: center; }
.nav-links a { position: relative; overflow: hidden; display: block; height: 1.1em; }
.nav-links a span { display: block; transition: transform .5s var(--ease); }
.nav-links a span + span { position: absolute; top: 100%; left: 0; color: var(--gold); }
.nav-links a:hover span { transform: translateY(-100%); }
.nav-sound { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.nav-sound i { width: 2px; background: currentColor; height: 4px; transform-origin: bottom; }
.nav-sound.on i { animation: eq .9s ease-in-out infinite alternate; }
.nav-sound.on i:nth-child(2) { animation-delay: .15s; }
.nav-sound.on i:nth-child(3) { animation-delay: .3s; }
.nav-sound.on i:nth-child(4) { animation-delay: .45s; }
@keyframes eq { to { height: 14px; } }
@media (max-width: 720px) { .nav-links .nav-hide { display: none; } }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  height: calc(var(--vh, 1vh) * 100);
  min-height: 620px;
  overflow: hidden;
  background: var(--ink);
}
.hero-media { position: absolute; inset: 0; }
.hero-media video,
.hero-media .hero-fallback {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero-fallback {
  background:
    radial-gradient(120% 90% at 50% 42%, rgba(201,169,97,.20) 0%, rgba(201,169,97,.05) 38%, transparent 70%),
    radial-gradient(80% 60% at 78% 78%, rgba(120,150,190,.10) 0%, transparent 62%),
    var(--ink);
}
.hero-grain {
  position: absolute; inset: -50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  opacity: .09; pointer-events: none; mix-blend-mode: overlay;
  animation: grain 6s steps(6) infinite;
}
@keyframes grain {
  0%{transform:translate(0,0)} 20%{transform:translate(-4%,3%)} 40%{transform:translate(3%,-4%)}
  60%{transform:translate(-3%,-3%)} 80%{transform:translate(4%,4%)} 100%{transform:translate(0,0)}
}
.hero-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(7,7,10,.72) 0%, rgba(7,7,10,.34) 34%, rgba(7,7,10,.55) 72%, var(--ink) 100%);
}

/* particle monogram canvas sits above video, below copy */
#nk-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.hero-inner {
  position: relative; z-index: 4;
  height: 100%;
  /* top pad clears the fixed nav; bottom pad clears the scroll hint */
  padding: calc(var(--pad) * 1.9) var(--pad) var(--pad);
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 24px;
  overflow: hidden;
}
.hero-copy { align-self: center; max-width: min(1100px, 92vw); }
.hero-eyebrow { color: var(--gold); margin-bottom: clamp(18px, 3vh, 34px); }
.hero-title { margin-bottom: clamp(18px, 3vh, 30px); }
.hero-sub { display: flex; flex-wrap: wrap; gap: 8px 26px; color: rgba(242,240,236,.62); }

.hero-foot {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 20px;
}
.hero-foot .r { justify-self: end; text-align: right; }
.hold {
  justify-self: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: rgba(242,240,236,.55);
  user-select: none;
}
.hold-ring {
  width: 56px; height: 56px; border-radius: 50%;
  border: 1px solid rgba(242,240,236,.22);
  display: grid; place-items: center;
  position: relative;
  cursor: pointer;
}
.hold-ring svg { position: absolute; inset: -1px; transform: rotate(-90deg); }
.hold-ring circle { fill: none; stroke: var(--gold); stroke-width: 1; }
.hold-ring b { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }

/* scroll hint line */
.scroll-hint { position: absolute; left: 50%; bottom: 0; width: 1px; height: 64px; background: linear-gradient(var(--gold), transparent); transform: translateX(-50%); }

/* ============================================================
   SECTION FRAME
   ============================================================ */
section { position: relative; }
.pane { padding: clamp(90px, 14vh, 190px) var(--pad); }
.pane--paper { background: var(--paper); color: var(--ink); }
.pane--bone   { background: var(--bone);  color: var(--ink); }
.pane--ink    { background: var(--ink);   color: var(--bone); }

.rule { height: 1px; background: var(--line); width: 100%; transform-origin: left; }
.pane--ink .rule, .pane--dark .rule { background: var(--line-inv); }

.grid2 { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(20px, 3vw, 48px); }
.c-1-5 { grid-column: 1 / span 5; }
.c-6-12 { grid-column: 6 / span 7; }
.c-1-12 { grid-column: 1 / span 12; }
@media (max-width: 900px) { .c-1-5, .c-6-12 { grid-column: 1 / -1; } }

.sec-label { display: flex; align-items: center; gap: 14px; margin-bottom: clamp(28px, 5vh, 60px); color: var(--muted); }
.pane--ink .sec-label { color: var(--muted-inv); }

/* line-mask reveal */
.reveal-line { display: block; overflow: hidden; }
.reveal-line > * { display: block; will-change: transform; }

/* char split */
.ch { display: inline-block; will-change: transform, opacity; }
.wordwrap { display: inline-block; overflow: hidden; vertical-align: top; }

/* ============================================================
   MARQUEE
   ============================================================ */
.marquee {
  overflow: hidden; white-space: nowrap;
  padding: clamp(22px, 4vh, 46px) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}
.marquee--ink { background: var(--ink); color: var(--bone); border-color: var(--line-inv); }
.marquee-track { display: inline-flex; gap: clamp(30px, 5vw, 90px); align-items: center; will-change: transform; }
.marquee-track > span {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(2.2rem, 6.6vw, 6.4rem); line-height: 1; letter-spacing: -.02em;
  display: inline-flex; align-items: center; gap: clamp(30px, 5vw, 90px);
}
.marquee-track em { font-style: italic; color: var(--gold); }
.marquee-track .dot { width: .18em; height: .18em; border-radius: 50%; background: currentColor; opacity: .45; }

/* ============================================================
   STATS
   ============================================================ */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: clamp(40px,7vh,80px); }
.stat { background: var(--paper); padding: clamp(24px,3.4vw,44px); }
.pane--bone .stat { background: var(--bone); }
.stat .n { font-family: var(--serif); font-weight: 300; font-size: clamp(2.8rem, 6vw, 5.4rem); line-height: 1; letter-spacing: -.03em; }
.stat .n em { font-style: italic; color: var(--gold); }
.stat .k { margin-top: 12px; color: var(--muted); }

/* ============================================================
   WORK — horizontal pinned rail
   ============================================================ */
.workwrap { background: var(--ink); color: var(--bone); }
.work-head { padding: clamp(80px,12vh,150px) var(--pad) clamp(30px,5vh,60px); }
.rail { height: calc(var(--vh,1vh) * 100); display: flex; align-items: center; overflow: hidden; }
.rail-track { display: flex; gap: clamp(18px, 2.6vw, 44px); padding: 0 var(--pad); will-change: transform; }

.card {
  position: relative; flex: 0 0 auto;
  width: clamp(260px, 30vw, 460px);
  cursor: pointer;
}
.card-shot {
  position: relative; overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--ink-soft);
  border: 1px solid var(--line-inv);
}
.card-shot img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1) contrast(1.05) brightness(.82);
  transform: scale(1.06);
  transition: filter .8s var(--ease), transform 1.1s var(--ease);
}
.card:hover .card-shot img { filter: grayscale(0) contrast(1) brightness(1); transform: scale(1); }
.card-shot::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(7,7,10,.7) 100%);
  opacity: .9;
}
.card-idx { position: absolute; top: 12px; left: 14px; z-index: 2; color: var(--gold); }
.card-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-top: 16px; }
.card-meta h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.15rem, 1.7vw, 1.6rem); letter-spacing: -.01em; }
.card-meta .tag { color: var(--gold); }
.card-note { margin-top: 6px; color: var(--muted-inv); font-size: .86rem; }

.rail-progress { position: absolute; left: var(--pad); right: var(--pad); bottom: clamp(28px,5vh,56px); height: 1px; background: var(--line-inv); }
.rail-progress i { display: block; height: 100%; width: 0; background: var(--gold); }

@media (max-width: 860px) {
  .rail { height: auto; display: block; padding: 0 0 clamp(40px,8vh,80px); }
  .rail-track { flex-direction: column; transform: none !important; }
  .card { width: 100%; }
  .rail-progress { display: none; }
}

/* ============================================================
   EXPERIENCE
   ============================================================ */
.xp { border-top: 1px solid var(--line); }
.xp-row {
  display: grid; grid-template-columns: 1fr auto;
  gap: 10px 28px; align-items: baseline;
  padding: clamp(20px, 2.8vw, 34px) 0;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.xp-row::before {
  content: ''; position: absolute; left: -2vw; right: -2vw; top: 0; bottom: 0;
  background: var(--ink); transform: scaleY(0); transform-origin: bottom; z-index: 0;
  transition: transform .55s var(--ease);
}
.xp-row:hover::before { transform: scaleY(1); transform-origin: top; }
.xp-row > * { position: relative; z-index: 1; transition: color .45s var(--ease); }
.xp-row:hover .xp-role, .xp-row:hover .xp-co, .xp-row:hover .xp-date { color: var(--bone); }
.xp-role { font-family: var(--serif); font-size: clamp(1.3rem, 2.5vw, 2.3rem); font-weight: 400; letter-spacing: -.015em; }
.xp-role em { font-style: normal; color: var(--gold); }
.xp-co { color: var(--muted); margin-top: 4px; }
.xp-date { color: var(--muted); text-align: right; white-space: nowrap; }
.xp-chip { display: inline-block; border: 1px solid currentColor; padding: 3px 9px; margin-left: 10px; opacity: .55; vertical-align: middle; }

/* ============================================================
   SERVICES
   ============================================================ */
.svc { border-top: 1px solid var(--line-inv); }
.svc-row {
  display: grid; grid-template-columns: auto 1fr; gap: clamp(16px,3vw,48px);
  padding: clamp(24px,3.4vw,44px) 0;
  border-bottom: 1px solid var(--line-inv);
  align-items: start;
}
.svc-n { color: var(--gold); padding-top: .6em; }
.svc-t { font-family: var(--serif); font-weight: 300; font-size: clamp(1.8rem, 4.4vw, 3.6rem); line-height: 1.02; letter-spacing: -.02em; }
.svc-d { color: var(--muted-inv); margin-top: 12px; max-width: 52ch; }

/* ============================================================
   CONTACT / FOOTER
   ============================================================ */
.cta { background: var(--bone); color: var(--ink); padding: clamp(100px,18vh,220px) var(--pad); text-align: center; }
.cta a.big {
  display: inline-block;
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(2.4rem, 9vw, 9rem); line-height: .95; letter-spacing: -.035em;
  position: relative;
}
.cta a.big em { font-style: italic; color: var(--gold); }
.cta a.big::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: .08em; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform .8s var(--ease);
}
.cta a.big:hover::after { transform: scaleX(1); transform-origin: left; }

.foot { background: var(--ink); color: var(--bone); padding: clamp(50px,8vh,90px) var(--pad) calc(var(--pad) * .8); }
.foot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); gap: clamp(28px,4vw,60px); }
.foot-grid h4 { color: var(--muted-inv); margin-bottom: 18px; font-weight: 400; }
.foot-grid ul { list-style: none; display: grid; gap: 9px; }
.foot-grid a { position: relative; display: inline-block; }
.foot-grid a::after { content: ''; position: absolute; left: 0; bottom: -2px; width: 100%; height: 1px; background: var(--gold); transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease); }
.foot-grid a:hover::after { transform: scaleX(1); transform-origin: left; }
.foot-mark { margin-top: clamp(50px,9vh,110px); }
.foot-mark .big {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(4rem, 22vw, 22rem); line-height: .8; letter-spacing: -.05em;
  color: transparent; -webkit-text-stroke: 1px rgba(242,240,236,.2);
}
.foot-bar { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--line-inv); color: var(--muted-inv); }

/* ---------- utility ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid currentColor; border-radius: 999px;
  padding: 12px 22px;
  transition: background .45s var(--ease), color .45s var(--ease);
}
.pill:hover { background: var(--gold); border-color: var(--gold); color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
