/* ═══════════════════════════════════════════════════════════════════════════
   Nirco — apex homepage. Editorial rhythm: warm cream base with a few cinematic
   DARK moments (hero, value, footer). Calm motion, confident type. Same house
   "Cinematic Luxury" language as the hotel sites, applied to the studio brand.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --cream:     245 241 234;  /* #f5f1ea  page base */
  --cream-2:   237 230 219;  /* #ede6db  alt light band */
  --ink:        26  25  22;  /* #1a1916  text on light */
  --ink-soft:   92  86  78;  /* #5c564e  muted text on light */
  --dark:       18  17  15;  /* #12110f  dark sections */
  --on-dark:   245 241 234;  /* cream text on dark */
  --on-dark-soft: 178 172 162;
  --accent:    194 156  92;  /* #c29c5c  gold, slightly deeper for cream contrast */

  --font-display: "Playfair Display", Georgia, serif;
  --font-sans:    "Inter", system-ui, -apple-system, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --container: 1240px;
  --pad: clamp(20px, 5vw, 80px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  background: rgb(var(--cream));
  color: rgb(var(--ink));
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  min-height: 100vh;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 300; line-height: 1.05; }
em { font-style: italic; color: rgb(var(--accent)); }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

::selection { background: rgb(var(--accent) / 0.3); }
:focus-visible { outline: 2px solid rgb(var(--accent)); outline-offset: 3px; border-radius: 2px; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--pad); }

.eyebrow {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.24em;
  color: rgb(var(--accent)); font-weight: 500;
}

/* Dark section wrapper — text flips to cream. */
.theme-dark { background: rgb(var(--dark)); color: rgb(var(--on-dark)); }
.theme-dark h1, .theme-dark h2, .theme-dark h3 { color: rgb(var(--on-dark)); }
.theme-alt { background: rgb(var(--cream-2)); }

/* Static, cheap film grain — only on dark scenes. */
.grain::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 100px; padding: 15px 30px; font-size: 14px; font-weight: 500;
  cursor: pointer; border: 1px solid transparent;
  transition: background .4s var(--ease-out), color .4s var(--ease-out),
              border-color .4s var(--ease-out), transform .4s var(--ease-out);
  will-change: transform;
}
.btn-primary { background: rgb(var(--accent)); color: #fff; }
.btn-primary:hover { background: rgb(var(--ink)); }
.btn-ghost { border-color: currentColor; color: inherit; }
.btn-ghost:hover { background: rgb(255 255 255 / 0.12); }

/* ── Preloader (dark) ────────────────────────────────────────────────────── */
.preloader {
  position: fixed; inset: 0; z-index: 1000; background: rgb(var(--dark));
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
}
.preloader__inner { display: flex; align-items: baseline; gap: 18px; }
.preloader__mark { font-family: var(--font-display); font-size: clamp(48px, 9vw, 96px); color: rgb(var(--on-dark)); }
.preloader__count { font-variant-numeric: tabular-nums; font-size: 14px; letter-spacing: 0.1em; color: rgb(var(--on-dark-soft)); }
.preloader__rule { width: min(280px, 50vw); height: 1px; background: rgb(var(--on-dark) / 0.15); overflow: hidden; }
.preloader__rule i { display: block; height: 100%; width: 0; background: rgb(var(--accent)); }

/* ── Nav ─────────────────────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px var(--pad); opacity: 0;
  color: rgb(var(--on-dark)); /* light over the dark hero */
  transition: background .4s var(--ease-out), color .4s var(--ease-out),
              padding .4s var(--ease-out), opacity .8s var(--ease-out);
}
.nav.is-in { opacity: 1; }
.nav__brand { font-family: var(--font-display); font-size: 24px; letter-spacing: 0.02em; }
.nav__links { display: flex; align-items: center; gap: clamp(16px, 3vw, 38px); font-size: 14px; }
.nav__links a { opacity: 0.85; transition: opacity .3s; }
.nav__links a:hover { opacity: 1; }
.nav__cta { border: 1px solid currentColor; border-radius: 100px; padding: 9px 20px; opacity: 1 !important; }
.nav__cta:hover { background: rgb(var(--accent)); border-color: rgb(var(--accent)); color: #fff; }
/* Scrolled onto the cream page → cream bar, dark text. */
.nav.is-scrolled { background: rgb(var(--cream) / 0.95); color: rgb(var(--ink)); padding-block: 16px; border-bottom: 1px solid rgb(var(--ink) / 0.08); }
.nav.is-scrolled .nav__cta:hover { color: #fff; }

/* ── Hero (dark, cinematic, alive) ───────────────────────────────────────── */
.hero {
  position: relative; min-height: 100svh; display: flex; align-items: flex-end;
  padding: 0 var(--pad) clamp(48px, 9vh, 110px); overflow: hidden;
  background: rgb(var(--dark)); color: rgb(var(--on-dark));
}
.hero__media { position: absolute; inset: -6%; z-index: 0; }
.hero__layer { position: absolute; inset: 0; }
.hero__layer--img {
  background: #14110d center/cover no-repeat;
  background-image: var(--hero-img, radial-gradient(120% 90% at 70% 20%, #2b2418, #12110f 70%));
  transform: scale(1.08); will-change: transform;
}
.hero__layer--sheen { background: radial-gradient(60% 50% at 30% 25%, rgb(var(--accent) / 0.14), transparent 70%); }
.hero__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgb(var(--dark)) 1%, rgb(var(--dark) / 0.35) 36%, rgb(var(--dark) / 0.1) 62%, rgb(var(--dark) / 0.5) 100%);
}
.hero__content { position: relative; z-index: 3; max-width: 1100px; }
.hero h1, .hero__title { color: rgb(var(--on-dark)); }
.hero__title { font-size: clamp(44px, 9vw, 128px); letter-spacing: -0.02em; margin: 18px 0 26px; }
.hero__title .line { display: block; overflow: hidden; }
.hero__title .line > span { display: block; will-change: transform; }
.hero__sub { max-width: 54ch; font-size: clamp(16px, 1.5vw, 20px); line-height: 1.6; color: rgb(var(--on-dark) / 0.82); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.hero__cue {
  position: absolute; right: var(--pad); bottom: clamp(48px, 9vh, 110px); z-index: 3;
  display: flex; align-items: center; gap: 10px; font-size: 11px; letter-spacing: 0.22em;
  text-transform: uppercase; color: rgb(var(--on-dark-soft));
}
.hero__cue span { width: 1px; height: 46px; background: linear-gradient(rgb(var(--accent)), transparent); display: inline-block; transform-origin: top; animation: cue 2.4s var(--ease-out) infinite; }
@keyframes cue { 0% { transform: scaleY(0); } 40% { transform: scaleY(1); } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ── Shared section heads ────────────────────────────────────────────────── */
section { position: relative; }
.section-head { max-width: 800px; margin-bottom: clamp(36px, 5vw, 70px); }
.section-title { font-size: clamp(32px, 5vw, 68px); letter-spacing: -0.015em; margin-top: 14px; }

/* ── Manifesto — scroll-scrubbed living scene ────────────────────────────────
   Tall track; the stage sticks to the viewport while the video scrubs with
   scroll. CSS position:sticky (no GSAP pin) keeps native scroll smooth. */
.story { position: relative; height: 240vh; background: #0a0f14; }
.story__stage {
  position: sticky; top: 0; height: 100vh; overflow: hidden;
  display: flex; align-items: flex-end;
}
.story__video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 68% center; background: #0a0f14;
}
.story__scrim {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to top, rgb(var(--ink) / 0.72) 0%, rgb(var(--ink) / 0.15) 45%, transparent 75%),
    linear-gradient(to right, rgb(var(--ink) / 0.45) 0%, transparent 55%);
}
.story__content { position: relative; z-index: 2; width: 100%; padding-bottom: clamp(48px, 9vh, 120px); }

.manifesto__lines { max-width: 980px; }
.manifesto__lines p {
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(26px, 4vw, 56px); line-height: 1.22; letter-spacing: -0.01em;
  color: rgb(var(--on-dark)); max-width: 20ch;
}
.manifesto__lines p + p { margin-top: clamp(12px, 1.8vw, 22px); }
.manifesto__sub { margin-top: clamp(22px, 3vw, 38px); max-width: 50ch; color: rgb(var(--on-dark) / 0.78); font-size: clamp(15px, 1.4vw, 18px); line-height: 1.7; }

/* Reduced-motion / no-JS: collapse the tall track to a single calm screen. */
.no-scrub .story { height: auto; }
.no-scrub .story__stage { position: relative; height: auto; min-height: 80vh; }

/* ── Work (cream-alt) ────────────────────────────────────────────────────── */
.work { padding: clamp(70px, 12vh, 140px) 0; }

/* ── Horizontal drag/swipe gallery ───────────────────────────────────────── */
.work__gallery { position: relative; margin-top: clamp(28px, 4vw, 48px); }
.work__rail {
  display: flex; gap: clamp(16px, 2.2vw, 32px);
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 8px var(--pad) 12px; cursor: grab; scrollbar-width: none;
}
.work__rail::-webkit-scrollbar { display: none; }
.work__rail.is-dragging { cursor: grabbing; scroll-behavior: auto; scroll-snap-type: none; }
.work__card { flex: 0 0 auto; width: clamp(260px, 38vw, 520px); scroll-snap-align: start; }
@media (prefers-reduced-motion: reduce) { .work__rail { scroll-behavior: auto; } }

/* Edge fades into the cream-alt band */
.work__gallery::before, .work__gallery::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: clamp(24px, 6vw, 90px);
  z-index: 4; pointer-events: none;
}
.work__gallery::before { left: 0; background: linear-gradient(90deg, rgb(var(--cream-2)), transparent); }
.work__gallery::after  { right: 0; background: linear-gradient(270deg, rgb(var(--cream-2)), transparent); }

/* Arrow buttons (pointer devices; phones swipe instead) */
.work__nav {
  position: absolute; top: 42%; transform: translateY(-50%); z-index: 5;
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  font-size: 18px; line-height: 1; background: rgb(var(--cream)); color: rgb(var(--ink));
  border: 1px solid rgb(var(--ink) / 0.14); cursor: pointer;
  box-shadow: 0 10px 26px -12px rgb(var(--ink) / 0.45);
  transition: opacity .3s var(--ease-out), background .3s, color .3s, transform .3s;
}
.work__nav:hover { background: rgb(var(--accent)); color: #fff; border-color: transparent; }
.work__nav--prev { left: clamp(6px, 1.5vw, 22px); }
.work__nav--next { right: clamp(6px, 1.5vw, 22px); }
.work__nav[disabled] { opacity: 0; pointer-events: none; }
/* Phones swipe instead — hide arrows on touch and on narrow screens. */
@media (hover: none) { .work__nav { display: none; } }
@media (max-width: 700px) { .work__nav { display: none; } }

/* "drag →" cue (fades out after the first scroll) */
.work__cue {
  display: inline-block; margin-left: 16px; font-size: 12px; letter-spacing: 0.14em;
  text-transform: uppercase; color: rgb(var(--ink-soft));
  animation: work-drag-cue 2.2s var(--ease-out) infinite;
}
.rail-moved .work__cue { opacity: 0; animation: none; transition: opacity .5s; }
@media (hover: hover) { .work__cue::after { content: " or use the arrows"; opacity: 0.6; } }
@keyframes work-drag-cue { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(6px); } }

.work__media { position: relative; overflow: hidden; border-radius: 6px; aspect-ratio: 16 / 10; background: rgb(var(--ink) / 0.06); }
.work__media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.03); transition: transform 1.1s var(--ease-out); will-change: transform; }
/* "View live →" pill (revealed on hover) */
.work__media::after {
  content: "View live →"; position: absolute; left: 18px; bottom: 18px; z-index: 3;
  font-size: 12px; letter-spacing: 0.08em; padding: 8px 14px; border-radius: 100px;
  background: rgb(var(--dark) / 0.78); color: rgb(var(--on-dark));
  opacity: 0; transform: translateY(8px); transition: .4s var(--ease-out);
}
/* Cinematic light sweep + legibility veil */
.work__media::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(105deg, transparent 32%, rgb(255 255 255 / 0.16) 48%, transparent 64%);
  transform: translateX(-120%); transition: transform .9s var(--ease-out);
}

/* Hover "come alive" — desktop pointers only so mobile just taps through. */
@media (hover: hover) and (pointer: fine) {
  .work__card:hover { transform: translateY(-6px); box-shadow: 0 26px 60px -28px rgb(var(--ink) / 0.55); }
  .work__card:hover .work__media::after { opacity: 1; transform: translateY(0); }
  .work__card:hover .work__media::before { transform: translateX(120%); }
  .work__card:hover .work__media img { transform: scale(1.07); }
  @media (prefers-reduced-motion: no-preference) {
    /* slow living drift while the pointer rests on the card */
    .work__card:hover .work__media img { animation: work-kenburns 7s var(--ease-out) infinite alternate; }
  }
}
@keyframes work-kenburns {
  0%   { transform: scale(1.06) translate(0, 0); }
  100% { transform: scale(1.12) translate(-1.6%, -1.2%); }
}
.work__meta { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-top: 18px; }
.work__name { font-family: var(--font-display); font-size: clamp(22px, 2.4vw, 32px); }
.work__tag, .work__year { font-size: 13px; color: rgb(var(--ink-soft)); }
.work__year { font-variant-numeric: tabular-nums; }

/* ── Approach (cream) ────────────────────────────────────────────────────── */
.approach { padding: clamp(70px, 12vh, 140px) 0; }
.approach__list { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(24px, 3vw, 44px); }
.approach__list li { padding-top: 26px; border-top: 1px solid rgb(var(--ink) / 0.16); }
.approach__num { font-family: var(--font-display); font-size: 14px; color: rgb(var(--accent)); display: block; }
.approach__list h3 { font-size: clamp(20px, 2.2vw, 28px); margin: 12px 0 10px; }
.approach__list p { color: rgb(var(--ink-soft)); line-height: 1.6; font-size: 15px; }

/* ── Value scene (DARK full-bleed cinematic moment) ──────────────────────── */
.value { position: relative; min-height: 92svh; display: flex; align-items: center; padding: 16vh 0; overflow: hidden; background: rgb(var(--dark)); color: rgb(var(--on-dark)); }
.value__media { position: absolute; inset: 0; z-index: 0; }
.value__img { position: absolute; inset: -8%; background: #12100c center/cover no-repeat; background-image: var(--value-img, radial-gradient(120% 100% at 60% 50%, #221b12, #12110f 75%)); will-change: transform; }
.value__scrim { position: absolute; inset: 0; background: linear-gradient(90deg, rgb(var(--dark) / 0.88) 0%, rgb(var(--dark) / 0.5) 55%, rgb(var(--dark) / 0.25) 100%); }
.value__content { position: relative; z-index: 3; }
.value h2, .value__quote { color: rgb(var(--on-dark)); }
.value__quote { font-size: clamp(32px, 5.5vw, 84px); letter-spacing: -0.02em; margin: 18px 0 26px; max-width: 15ch; }
.value__quote .line { display: block; overflow: hidden; }
.value__quote .line > span { display: block; will-change: transform; }
.value__note { max-width: 52ch; color: rgb(var(--on-dark) / 0.8); line-height: 1.65; font-size: clamp(15px, 1.4vw, 18px); }

/* ── Marquee (cream divider) ─────────────────────────────────────────────── */
.marquee { overflow: hidden; border-block: 1px solid rgb(var(--ink) / 0.12); padding: clamp(22px, 3vw, 38px) 0; }
.marquee__track { display: inline-flex; align-items: center; gap: 30px; white-space: nowrap; will-change: transform; }
.marquee__track span { font-family: var(--font-display); font-size: clamp(28px, 4vw, 56px); font-weight: 300; }
.marquee__track i { color: rgb(var(--accent)); font-style: normal; font-size: clamp(20px, 3vw, 38px); }

/* ── Contact (cream) ─────────────────────────────────────────────────────── */
.contact { padding: clamp(70px, 12vh, 140px) 0; }
.contact__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(36px, 6vw, 90px); align-items: start; }
.contact__lead { color: rgb(var(--ink-soft)); line-height: 1.7; margin: 22px 0; max-width: 42ch; }
.contact__mail { font-family: var(--font-display); font-size: clamp(20px, 2vw, 28px); color: rgb(var(--accent)); border-bottom: 1px solid rgb(var(--accent) / 0.4); padding-bottom: 2px; }
.contact__form { display: flex; flex-direction: column; gap: 22px; }
.field { display: flex; flex-direction: column; gap: 9px; }
.field label { font-size: 13px; letter-spacing: 0.04em; color: rgb(var(--ink-soft)); }
.field label span { opacity: 0.6; }
.field input, .field textarea {
  background: transparent; border: none; border-bottom: 1px solid rgb(var(--ink) / 0.28);
  color: rgb(var(--ink)); font-family: var(--font-sans); font-size: 16px; padding: 12px 2px; border-radius: 0;
  transition: border-color .3s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: rgb(var(--accent)); }
.field textarea { resize: vertical; min-height: 90px; }
.field.invalid input, .field.invalid textarea { border-color: #c0584e; }
.contact__submit { align-self: flex-start; margin-top: 6px; }
.contact__status { font-size: 14px; min-height: 1.2em; color: rgb(var(--ink-soft)); }
.contact__status.ok { color: rgb(var(--accent)); }
.contact__status.err { color: #c0584e; }

/* ── Footer (dark) ───────────────────────────────────────────────────────── */
.footer { background: rgb(var(--dark)); color: rgb(var(--on-dark)); padding: 56px 0; }
.footer__inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer__brand { font-family: var(--font-display); font-size: 22px; }
.footer__meta { display: flex; gap: 22px; font-size: 14px; }
.footer__meta a { color: rgb(var(--on-dark-soft)); transition: color .3s; }
.footer__meta a:hover { color: rgb(var(--on-dark)); }
.footer__copy { font-size: 13px; color: rgb(var(--on-dark-soft)); }

/* ── Custom cursor (desktop) ─────────────────────────────────────────────── */
.cursor { position: fixed; top: 0; left: 0; width: 8px; height: 8px; border-radius: 50%; background: rgb(var(--accent)); pointer-events: none; z-index: 999; transform: translate(-50%, -50%); transition: width .3s, height .3s, opacity .3s; opacity: 0; }
.cursor.is-active { opacity: 1; }
.cursor.is-hover { width: 42px; height: 42px; background: rgb(var(--accent) / 0.18); border: 1px solid rgb(var(--accent)); }
@media (hover: none) { .cursor { display: none; } }

/* ── Reveals — CSS-driven (IntersectionObserver adds .is-in). Robust: if JS or
   rAF stalls, a failsafe still adds .is-in, so content is NEVER stuck hidden.
   No-JS users get everything visible (the .js gate). ─────────────────────── */
[data-rd] { opacity: 1; }
.js [data-rd] { opacity: 0; transform: translateY(22px); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); }
.js [data-rd].is-in { opacity: 1; transform: none; }

/* Masked line reveal for big display headings (CSS, staggered) */
.js .hero__title .line > span,
.js .value__quote .line > span { transform: translateY(110%); transition: transform 1s var(--ease-out); }
.js .hero__title.is-in .line > span,
.js .value__quote.is-in .line > span { transform: translateY(0); }
.js .hero__title.is-in .line:nth-child(2) > span,
.js .value__quote.is-in .line:nth-child(2) > span { transition-delay: .08s; }
.js .hero__title.is-in .line:nth-child(3) > span,
.js .value__quote.is-in .line:nth-child(3) > span { transition-delay: .16s; }
.js .value__quote.is-in .line:nth-child(4) > span { transition-delay: .24s; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .nav__links a:not(.nav__cta) { display: none; }
  .work__grid { grid-template-columns: 1fr; }
  .work__card.is-featured { grid-column: auto; }
  .work__card.is-featured .work__media { aspect-ratio: 16 / 10; }
  .approach__list { grid-template-columns: 1fr 1fr; gap: 28px; }
  .contact__grid { grid-template-columns: 1fr; }
  .hero__cue { display: none; }
  .work__media::after { opacity: 1; transform: none; }
}
@media (max-width: 540px) {
  .approach__list { grid-template-columns: 1fr; }
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .js [data-rd] { opacity: 1; transform: none; }
  .js .hero__title .line > span, .js .value__quote .line > span { transform: none; }
  .hero__layer--img { transform: none; }
}
