/* ============================================================
   NiteNite - v4
   Pure white + silver, dark "night" hero card, silver star (tall),
   sparkle cursor, and a light -> night -> light scroll story.
   ============================================================ */

:root {
  --paper: #ffffff;
  --paper-2: #f2f2f3;
  --ink: #0d0d0d;
  --ink-soft: #363636;
  --muted: rgba(15,15,15,.55);
  --line: rgba(0,0,0,.12);

  --night: #0b0b0d;
  --night-2: #15151a;
  --on-night: #ffffff;
  --on-night-mute: rgba(255,255,255,.62);
  --line-night: rgba(255,255,255,.12);

  --silver: #c9ccd1;

  --pad: clamp(18px, 4.5vw, 72px);
  --maxw: 1360px;
  --r: 26px;
  --r-sm: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  line-height: 1.55; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1,h2,h3,p { margin: 0; }
.display { font-family: "Space Grotesk", "Inter", sans-serif; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }

/* sparkle canvas lives inside the hero card only */
#sparkle-canvas { position: absolute; inset: 0; z-index: 2; pointer-events: none; }

/* ---------- Nav (theme-aware) ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px var(--pad);
  color: var(--ink);
  transition: background-color .3s ease, border-color .3s ease, color .3s ease;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled { background: rgba(255,255,255,.82); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.nav__logo { width: 98px; display: block; position: relative; }
.nav__logo .l-lite { display: none; }
.nav__links { display: flex; gap: 26px; align-items: center; }
.nav__links a { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; font-weight: 500; opacity: .72; transition: opacity .2s ease; }
.nav__links a:hover, .nav__links a.is-active { opacity: 1; }
.nav__cta { padding: 9px 16px; border: 1px solid currentColor; border-radius: 999px; opacity: 1 !important; }
.nav__cta:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.nav__burger { display: none; }   /* shown only on mobile */
/* over the night section */
.nav--on-dark { color: #fff; }
.nav--on-dark .nav__logo .l-dark { display: none; }
.nav--on-dark .nav__logo .l-lite { display: block; }
.nav--on-dark.is-scrolled { background: rgba(10,10,12,.55); border-bottom-color: var(--line-night); }
.nav--on-dark .nav__cta:hover { background: #fff; color: #0b0b0d; border-color: #fff; }

/* ---------- HERO ---------- */
.hero { padding: 82px var(--pad) clamp(30px,5vw,60px); }
.herocard {
  position: relative; max-width: var(--maxw); margin: 0 auto;
  min-height: min(86vh, 820px);
  background:
    radial-gradient(46% 40% at 50% 40%, rgba(130,150,205,.14), transparent 72%),
    radial-gradient(120% 90% at 50% 0%, var(--night-2), var(--night) 60%);
  color: var(--on-night); border-radius: var(--r); overflow: hidden;
  border: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 40px 90px -50px rgba(0,0,0,.7);
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: clamp(40px,7vw,80px) clamp(20px,5vw,60px);
}
.herocard::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(60% 60% at 50% 45%, transparent 42%, rgba(8,8,10,.6) 100%); }
/* deep-space starfield behind the hero content */
#hero-stars { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.herocard__inner { position: relative; z-index: 3; width: 100%; max-width: 880px; }
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: "Space Grotesk", sans-serif; font-size: 12px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--on-night-mute);
  border: 1px solid var(--line-night); border-radius: 999px; padding: 7px 15px; margin-bottom: 22px;
}
.hero__eyebrow b { color: #fff; font-weight: 600; }
#star { width: min(230px, 50vw); height: min(300px, 58vw); margin: 0 auto 6px; pointer-events: none; }
.no-three #star { position: relative; }
.no-three #star::before {
  content: ""; position: absolute; inset: 12% 34%;
  background: linear-gradient(135deg,#fff,#9aa0a6);
  clip-path: polygon(50% 0, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0 50%, 42% 42%);
  animation: spin 16s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hero__title { font-family: "Space Grotesk", sans-serif; font-weight: 600; font-size: clamp(34px, 6.4vw, 82px); line-height: 1.0; letter-spacing: -0.03em; }
.hero__title em { font-style: italic; font-weight: 500; }
.hero__sub { margin: 20px auto 0; max-width: 540px; font-size: clamp(15px,1.7vw,18px); color: var(--on-night-mute); }
.hero__cta { margin-top: 32px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn-primary { display: inline-flex; align-items: center; gap: 8px; background: #fff; color: #0b0b0d; padding: 14px 26px; border-radius: 999px; font-family: "Space Grotesk", sans-serif; font-weight: 600; font-size: 15px; transition: transform .2s ease, box-shadow .2s ease; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -12px rgba(255,255,255,.5); }
.btn-ghost { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-night); color: #fff; padding: 14px 24px; border-radius: 999px; font-family: "Space Grotesk", sans-serif; font-weight: 500; font-size: 15px; transition: background-color .2s ease; }
.btn-ghost:hover { background: rgba(255,255,255,.08); }
.hero__stats { margin-top: 36px; display: flex; gap: clamp(24px,5vw,64px); justify-content: center; flex-wrap: wrap; }
.hero__stat b { font-family: "Space Grotesk", sans-serif; font-size: clamp(22px,3vw,32px); font-weight: 600; display: block; }
.hero__stat span { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--on-night-mute); }

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 10vw, 138px) 0; }
.eyebrow { font-family: "Space Grotesk", sans-serif; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.eyebrow::before { content: "✦"; color: var(--ink); }
.section__title { font-family: "Space Grotesk", sans-serif; font-weight: 600; letter-spacing: -0.02em; font-size: clamp(30px, 5vw, 56px); line-height: 1.04; max-width: 16ch; }

/* ---------- Work ---------- */
.work { margin-top: 56px; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px,3vw,40px); }
.work__item { display: block; color: var(--ink); }
.work__media { position: relative; overflow: hidden; border-radius: var(--r-sm); aspect-ratio: 5/4; background: var(--paper-2); border: 1px solid var(--line); }
.work__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s cubic-bezier(.2,.7,.2,1); }
.work__item:hover .work__media img { transform: scale(1.04); }
.work__index { position: absolute; top: 14px; left: 16px; z-index: 2; font-family: "Space Grotesk", sans-serif; font-size: 13px; letter-spacing: .1em; color: #fff; mix-blend-mode: difference; }
.work__meta { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-top: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--ink); }
.work__client { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.work__name { font-family: "Space Grotesk", sans-serif; font-size: clamp(20px,2.4vw,27px); font-weight: 600; letter-spacing: -.01em; margin-top: 3px; }
.work__arrow { font-size: 20px; transition: transform .3s ease; }
.work__item:hover .work__arrow { transform: translate(4px,-4px); }

/* ---------- SCROLL STORY (light -> night -> light) ---------- */
.story { position: relative; height: 460vh; background: #fff; }
.story__sticky { position: sticky; top: 0; height: 100vh; overflow: hidden; background: #fff; }
.story__stars { position: absolute; inset: 0; z-index: 0; opacity: 0; pointer-events: none; }
.story__stage {
  position: absolute; inset: 0; z-index: 1; opacity: 0;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; gap: 16px; padding: 0 var(--pad); will-change: opacity;
}
.story__eyebrow { font-family: "Space Grotesk", sans-serif; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; opacity: .7; }
.story__big { font-family: "Space Grotesk", sans-serif; font-weight: 600; font-size: clamp(40px, 8.4vw, 108px); line-height: 1.0; letter-spacing: -.035em; }
.story__sub { font-size: clamp(16px,2vw,20px); max-width: 520px; margin: 0 auto; opacity: .78; }
.story__scroll { margin-top: 26px; font-family: "Space Grotesk", sans-serif; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; opacity: .6; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.story__scroll span { font-size: 16px; animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 0%,100% { transform: translateY(0); opacity: .5; } 50% { transform: translateY(6px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .story__scroll span { animation: none; } }
.story__stage[data-stage="0"] { color: var(--ink); }
.story__stage[data-stage="1"] { color: #fff; }
.story__stage[data-stage="2"] { color: var(--ink); }
.story__word {
  background: linear-gradient(180deg, #ffffff 0%, #c7cbd1 55%, #8b9096 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-size: clamp(52px, 12vw, 150px);
}

/* thin line leading from the story into the CTA */
.lead-line { width: 1px; height: clamp(200px, 32vh, 380px); margin: 0 auto; background: linear-gradient(180deg, transparent, transparent 22%, var(--ink) 55%); }

/* ---------- Contact (loved "Say nitenite" + form) ---------- */
.contact { text-align: center; }
.cta__title { font-family: "Space Grotesk", sans-serif; font-weight: 600; letter-spacing: -.02em; font-size: clamp(30px,5.6vw,68px); line-height: 1.02; }
.cta__title em { font-style: italic; font-weight: 500; }
.cta__sub { margin-top: 18px; color: var(--muted); font-size: 18px; }

.form { max-width: 600px; margin: 46px auto 0; text-align: left; display: grid; gap: 16px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field span { font-family: "Space Grotesk", sans-serif; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.field input, .field textarea { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; font: inherit; font-size: 16px; color: var(--ink); transition: border-color .2s ease; }
.field input::placeholder, .field textarea::placeholder { color: rgba(15,15,15,.38); opacity: 1; }
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink); }
.form button[type=submit] { justify-self: start; cursor: pointer; }
.form button[type=submit]:disabled { opacity: .6; }
.form .hidden { position: absolute; left: -9999px; }
.form__actions { display: flex; align-items: center; justify-content: flex-start; gap: 14px 20px; flex-wrap: wrap; margin-top: 6px; }
.form__or { color: var(--muted); font-size: 14px; display: inline-flex; align-items: center; gap: 10px; }
.form__done { font-family: "Space Grotesk", sans-serif; font-size: clamp(18px, 2.4vw, 24px); color: var(--ink); text-align: center; padding: 26px 0; }
.contact__or { margin-top: 24px; display: flex; gap: 14px; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; }
.btn-send { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--ink); background: var(--ink); color: #fff; border-radius: 999px; padding: 10px 18px; font: inherit; font-family: "Space Grotesk", sans-serif; font-size: 14px; cursor: pointer; transition: background-color .2s ease, color .2s ease; }
.btn-send:hover { background: #fff; color: var(--ink); }
.copy { border: 0; background: transparent; color: var(--ink); padding: 0; font: inherit; font-family: "Space Grotesk", sans-serif; font-size: 14px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.copy:hover, .copy.is-copied { color: var(--ink); }

/* ---------- Footer ---------- */
.footer { background: var(--night); color: #fff; padding: 58px 0 44px; position: relative; z-index: 1; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 22px; align-items: center; justify-content: space-between; }
.footer__logo { width: 96px; }
.footer__nav, .footer__socials { display: flex; gap: 24px; }
.footer__nav a, .footer__socials a { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--on-night-mute); transition: color .2s ease; }
.footer__nav a:hover, .footer__socials a:hover { color: #fff; }
.footer__copy { width: 100%; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line-night); font-size: 12px; color: var(--on-night-mute); letter-spacing: .04em; }

/* ============================================================
   Interior pages
   ============================================================ */
.page-top { padding-top: 128px; }
.about__head { display: flex; gap: 32px; align-items: flex-end; flex-wrap: wrap; }
.about__portrait { width: 180px; height: 216px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); }
.about__name { font-family: "Space Grotesk", sans-serif; font-size: clamp(50px, 9vw, 108px); font-weight: 600; letter-spacing: -.04em; line-height: .9; }
.about__role { margin-top: 12px; font-size: 16px; letter-spacing: 0; color: var(--muted); }
.prose { max-width: 760px; margin-top: 52px; }
.prose p { font-size: clamp(18px,2.1vw,21px); color: var(--ink-soft); margin-bottom: 24px; }
.prose p strong { color: var(--ink); font-weight: 700; }
.prose p.lead { font-family: "Space Grotesk", sans-serif; font-size: clamp(23px,3vw,34px); line-height: 1.25; color: var(--ink); font-weight: 500; }
.clients { margin-top: 56px; padding: 24px 0; text-align: center; }
.clients__label { font-size: clamp(18px, 2.4vw, 24px); letter-spacing: 0; color: var(--ink-soft); margin-bottom: 48px; }
.clients__row { display: flex; align-items: center; justify-content: center; gap: clamp(34px, 6vw, 76px); flex-wrap: wrap; }
.clients__row img { height: 36px; width: auto; opacity: .9; }
.clients__row .client-logo--ugla { height: 30px; }
.clients__row .client-logo--acquire { width: 130px; height: 36px; object-fit: cover; object-position: center; }
.services { margin-top: 84px; display: grid; grid-template-columns: repeat(3,1fr); gap: 38px; }
.svc h3 { font-family: "Space Grotesk", sans-serif; font-size: 23px; font-weight: 600; padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid var(--ink); }
.svc ul { list-style: none; padding: 0; margin: 0; }
.svc li { font-size: 16px; color: var(--muted); padding: 7px 0; }
.case__title { font-family: "Space Grotesk", sans-serif; font-weight: 600; font-size: clamp(34px, 6vw, 72px); line-height: 1.02; letter-spacing: -.03em; max-width: 16ch; }
.case__lede { margin-top: 22px; font-size: clamp(18px,2.2vw,22px); color: var(--muted); max-width: 620px; }
.btn { display: inline-flex; align-items: center; gap: 8px; margin-top: 28px; background: var(--ink); color: var(--paper); padding: 14px 24px; border-radius: 999px; font-family: "Space Grotesk", sans-serif; font-size: 15px; font-weight: 500; transition: opacity .2s ease; }
.btn:hover { opacity: .82; }
.meta { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; margin-top: 52px; padding: 28px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.meta__k { font-family: "Space Grotesk", sans-serif; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.meta__v { font-size: 17px; font-weight: 600; }
.case section { margin-top: 80px; }
.case h2 { font-family: "Space Grotesk", sans-serif; font-size: clamp(26px,3.6vw,38px); font-weight: 600; letter-spacing: -.02em; margin-bottom: 18px; }
.case p { font-size: 18px; color: var(--ink-soft); max-width: 720px; margin-bottom: 16px; }
.case ul.bullets { list-style: none; padding: 0; margin: 6px 0 16px; max-width: 720px; }
.case ul.bullets li { position: relative; padding: 8px 0 8px 24px; font-size: 18px; color: var(--ink-soft); }
.case ul.bullets li::before { content: "✦"; position: absolute; left: 0; top: 9px; font-size: 12px; }
.shots { margin-top: 32px; display: grid; gap: 20px; }
.shots img { width: 100%; border-radius: var(--r-sm); border: 1px solid var(--line); }
.shots--two { grid-template-columns: 1fr 1fr; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .work { grid-template-columns: 1fr; }
  .services { grid-template-columns: 1fr; gap: 26px; }
  .shots--two { grid-template-columns: 1fr; }
  .meta { grid-template-columns: 1fr; gap: 18px; }
  .form__row { grid-template-columns: 1fr; }
  .about__portrait { width: 135px; height: 162px; }
}
/* ---------- Mobile: hamburger menu + touch tuning ---------- */
@media (max-width: 760px) {
  body.menu-lock { overflow: hidden; }
  .nav { padding: 12px var(--pad); }

  .nav__burger {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; padding: 10px; margin: -10px -8px -10px 0;
    background: none; border: 0; color: currentColor; cursor: pointer; z-index: 70;
  }
  .nav__burger span { display: block; height: 2px; width: 100%; background: currentColor; border-radius: 2px; transition: transform .3s ease, opacity .2s ease; }

  .nav__links {
    position: fixed; left: 0; right: 0; top: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(255,255,255,.98);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    padding: 78px var(--pad) 28px;
    transform: translateY(-102%); transition: transform .4s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 24px 50px -28px rgba(0,0,0,.45); border-bottom: 1px solid var(--line);
  }
  .nav__links a { font-family: "Space Grotesk", sans-serif; font-size: 24px; letter-spacing: -.01em; text-transform: none; opacity: 1; padding: 16px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
  .nav__cta { border: 0 !important; border-radius: 0 !important; padding: 16px 0 !important; width: auto; }
  .nav__cta:hover { background: none; color: var(--ink); }

  .nav.menu-open { color: var(--ink); }
  .nav.menu-open .nav__burger { color: var(--ink); }
  .nav.menu-open .nav__links { transform: translateY(0); }
  .nav.menu-open .nav__burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav.menu-open .nav__burger span:nth-child(2) { opacity: 0; }
  .nav.menu-open .nav__burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* hero fits a phone screen */
  .hero { padding-top: 76px; }
  .herocard { min-height: min(88vh, 720px); padding: 60px 22px; }
  #star { width: min(190px, 52vw); height: min(240px, 62vw); }
  .hero__cta { gap: 10px; }
  .btn-primary, .btn-ghost { padding: 13px 22px; }

  /* shorter story so it isn't endless thumb-scrolling */
  .story { height: 320vh; }
  .story__big { font-size: clamp(40px, 13vw, 74px); }
  .story__word { font-size: clamp(58px, 20vw, 120px); }

  /* form actions stack neatly */
  .form__actions { flex-direction: column; align-items: stretch; gap: 16px; }
  .form__actions .btn-send { justify-content: center; }
  .form__or { justify-content: center; }

  .footer .wrap { flex-direction: column; align-items: flex-start; gap: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
