/* Nsane Media — design system */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/spacegrotesk.woff2") format("woff2");
}

:root {
  --bg: #0a0a0a;
  --bg-2: #131312;
  --text: #f5f5f2;
  --dim: #9d9d96;
  --accent: #ffd234;
  --line: rgba(255, 255, 255, 0.12);
  --font: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --pad: clamp(20px, 5vw, 72px);
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
::selection { background: var(--accent); color: #0a0a0a; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 90;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--pad);
  transition: background 0.3s, backdrop-filter 0.3s;
}
.nav.scrolled {
  background: rgba(10, 10, 10, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding-top: 12px; padding-bottom: 12px;
}
.nav-logo { display: flex; align-items: center; gap: 10px; z-index: 92; }
.nav-logo img { height: 44px; width: auto; filter: invert(1); }
.nav-logo span { font-weight: 700; letter-spacing: 0.06em; font-size: 18px; }
.nav-links { display: flex; gap: clamp(18px, 3vw, 44px); align-items: center; }
.nav-links a {
  font-size: 15px; letter-spacing: 0.02em; color: var(--text);
  opacity: 0.85; position: relative; padding: 4px 0;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { opacity: 1; }
.nav-links a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2px; background: var(--accent);
}
.nav-burger {
  display: none; z-index: 92; background: none; border: 0;
  width: 44px; height: 44px; position: relative;
}
.nav-burger span, .nav-burger span::before, .nav-burger span::after {
  content: ""; position: absolute; left: 10px; width: 24px; height: 2px;
  background: var(--text); transition: transform 0.25s, opacity 0.25s;
}
.nav-burger span { top: 21px; }
.nav-burger span::before { left: 0; top: -7px; }
.nav-burger span::after { left: 0; top: 7px; }
body.menu-open .nav-burger span { background: transparent; }
body.menu-open .nav-burger span::before { transform: translateY(7px) rotate(45deg); }
body.menu-open .nav-burger span::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 760px) {
  .nav-burger { display: block; }
  .nav-links {
    position: fixed; inset: 0; z-index: 91;
    flex-direction: column; justify-content: center; gap: 34px;
    background: rgba(10, 10, 10, 0.97);
    opacity: 0; pointer-events: none; transition: opacity 0.25s;
  }
  .nav-links a { font-size: 30px; font-weight: 700; }
  body.menu-open .nav-links { opacity: 1; pointer-events: auto; }
  body.menu-open { overflow: hidden; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: flex; align-items: flex-end;
  padding: var(--pad); padding-bottom: clamp(40px, 8vh, 90px);
  overflow: hidden;
}
.hero-media { position: absolute; inset: 0; z-index: -1; }
.hero-media video, .hero-media img {
  width: 100%; height: 100%; object-fit: cover;
}
.hero-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,10,10,0.35) 0%, rgba(10,10,10,0.15) 45%, rgba(10,10,10,0.85) 100%);
}
.hero h1 {
  font-size: clamp(3rem, 11vw, 8.75rem);
  line-height: 0.95; font-weight: 700; letter-spacing: -0.03em;
  max-width: 12ch;
}
.hero h1 .accent { color: var(--accent); }
.hero-sub {
  margin-top: 22px; max-width: 46ch;
  color: var(--dim); font-size: clamp(1rem, 1.6vw, 1.2rem);
}
.hero-cta { margin-top: 34px; display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px; border-radius: 999px;
  font-size: 15.5px; font-weight: 700; letter-spacing: 0.02em;
  border: 1px solid var(--line); color: var(--text); background: transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}
.btn:hover { border-color: var(--text); transform: translateY(-1px); }
.btn.solid { background: var(--accent); border-color: var(--accent); color: #0a0a0a; }
.btn.solid:hover { background: #ffdd66; border-color: #ffdd66; }

/* ---------- Sections ---------- */
.section { padding: clamp(70px, 12vh, 140px) var(--pad); }
.section.tight { padding-top: clamp(40px, 7vh, 80px); }
.kicker {
  color: var(--accent); font-size: 13.5px; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase; margin-bottom: 18px;
}
.h2 {
  font-size: clamp(2rem, 5vw, 3.9rem);
  line-height: 1.05; font-weight: 700; letter-spacing: -0.02em;
  max-width: 22ch;
}
.h2 .dim { color: var(--dim); }
.lead { color: var(--dim); font-size: clamp(1.05rem, 1.6vw, 1.25rem); max-width: 58ch; margin-top: 20px; }

/* Marquee */
.marquee {
  overflow: hidden; white-space: nowrap; border-block: 1px solid var(--line);
  padding: 18px 0; user-select: none;
}
.marquee-track { display: inline-block; animation: marquee 28s linear infinite; }
.marquee span {
  font-size: clamp(1.6rem, 3.6vw, 3rem); font-weight: 700; letter-spacing: -0.01em;
  margin-right: 3rem; color: var(--text);
}
.marquee span:nth-child(even) { -webkit-text-stroke: 1px var(--dim); color: transparent; }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
  html { scroll-behavior: auto; }
}

/* Pillars */
.pillars {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px; background: var(--line); border-block: 1px solid var(--line);
  margin-top: clamp(40px, 6vh, 70px);
}
.pillar { background: var(--bg); padding: clamp(28px, 4vw, 48px); }
.pillar .num { color: var(--accent); font-weight: 700; font-size: 14px; letter-spacing: 0.15em; }
.pillar h3 { font-size: clamp(1.3rem, 2vw, 1.7rem); margin: 14px 0 10px; letter-spacing: -0.01em; }
.pillar p { color: var(--dim); font-size: 15.5px; }

/* Work grid (home featured strip: uniform tiles) */
.work-grid {
  display: grid; gap: clamp(14px, 2vw, 26px);
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  margin-top: clamp(34px, 5vh, 60px);
}
/* Works page: masonry honoring each work's natural aspect ratio */
.work-masonry {
  columns: 3; column-gap: clamp(14px, 2vw, 26px);
  margin-top: clamp(34px, 5vh, 60px);
}
.work-masonry .work-card {
  margin-bottom: clamp(14px, 2vw, 26px);
  break-inside: avoid; display: block;
}
@media (max-width: 1100px) { .work-masonry { columns: 2; } }
@media (max-width: 640px) { .work-masonry { columns: 1; } }
.work-card {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--bg-2); cursor: pointer; border: 0; padding: 0;
  text-align: left; color: inherit; width: 100%; display: block;
}
.work-card .frame { position: relative; width: 100%; overflow: hidden; }
.work-card .frame > img, .work-card .frame > video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; transition: transform 0.5s ease;
}
.work-card:hover .frame > img, .work-card:hover .frame > video { transform: scale(1.04); }
.work-card .meta {
  position: absolute; inset: auto 0 0 0; z-index: 2;
  padding: 40px 18px 16px;
  background: linear-gradient(0deg, rgba(0,0,0,0.78), transparent);
  display: flex; align-items: flex-end; justify-content: space-between; gap: 10px;
}
.work-card .meta h3 { font-size: 17px; font-weight: 700; letter-spacing: 0; line-height: 1.25; }
.work-card .meta .tag {
  font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); white-space: nowrap; padding-bottom: 2px;
}
.work-card .play {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(10,10,10,0.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}
.work-card .play svg { width: 14px; height: 14px; fill: #fff; margin-left: 2px; }

/* Home accent loop strip */
.loop-strip {
  display: grid; gap: clamp(14px, 2vw, 26px);
  grid-template-columns: 1fr 1fr;
}
.loop-strip video {
  width: 100%; aspect-ratio: 960 / 506; object-fit: cover;
  border-radius: var(--radius); background: var(--bg-2);
}
@media (max-width: 700px) { .loop-strip { grid-template-columns: 1fr; } }

/* Filter chips */
.chips { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.chip {
  padding: 9px 20px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--dim); font-size: 14px; font-weight: 500;
  transition: all 0.2s;
}
.chip:hover { color: var(--text); border-color: var(--text); }
.chip.active { background: var(--text); color: #0a0a0a; border-color: var(--text); font-weight: 700; }

/* Services */
.svc-list { margin-top: clamp(34px, 5vh, 60px); border-top: 1px solid var(--line); }
.svc {
  display: grid; grid-template-columns: auto 1fr; gap: 8px clamp(20px, 6vw, 90px);
  padding: clamp(24px, 4vh, 42px) 0; border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.svc h3 { font-size: clamp(1.5rem, 3.4vw, 2.6rem); font-weight: 700; letter-spacing: -0.02em; }
.svc p { color: var(--dim); font-size: clamp(0.95rem, 1.4vw, 1.1rem); max-width: 44ch; }
@media (max-width: 700px) { .svc { grid-template-columns: 1fr; } }

/* CTA band */
.cta-band { text-align: center; }
.cta-band .h2 { margin: 0 auto; }
.cta-band .btn { margin-top: 34px; }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--line);
  padding: clamp(44px, 7vh, 80px) var(--pad) 34px;
}
.foot-grid {
  display: grid; gap: 36px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.foot-grid h4 {
  font-size: 12.5px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--dim); margin-bottom: 14px; font-weight: 700;
}
.foot-grid p, .foot-grid a { color: var(--text); font-size: 15.5px; line-height: 1.7; }
.foot-grid a:hover { color: var(--accent); }
.foot-social { display: flex; gap: 14px; }
.foot-social a {
  width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.foot-social a:hover { border-color: var(--accent); color: var(--accent); }
.foot-social svg { width: 17px; height: 17px; fill: currentColor; }
.foot-bottom {
  margin-top: 46px; padding-top: 22px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  color: var(--dim); font-size: 13.5px;
}

/* ---------- Page hero (inner pages) ---------- */
.page-head { padding: calc(clamp(70px, 14vh, 150px) + 40px) var(--pad) 0; }
.page-head h1 {
  font-size: clamp(2.6rem, 8vw, 6.5rem); font-weight: 700;
  letter-spacing: -0.03em; line-height: 1;
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid; gap: clamp(40px, 6vw, 90px);
  grid-template-columns: 1.1fr 1fr; margin-top: clamp(36px, 6vh, 64px);
}
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.c-block + .c-block { margin-top: 34px; }
.c-block h4 {
  font-size: 12.5px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--dim); margin-bottom: 10px; font-weight: 700;
}
.c-block a, .c-block p { font-size: clamp(1.05rem, 1.8vw, 1.35rem); line-height: 1.6; }
.c-block a:hover { color: var(--accent); }

.form label { display: block; margin-bottom: 22px; }
.form .lbl {
  display: block; font-size: 12.5px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--dim); margin-bottom: 8px; font-weight: 700;
}
.form input, .form textarea {
  width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line);
  color: var(--text); font: inherit; font-size: 17px; padding: 10px 2px 12px;
  border-radius: 0; transition: border-color 0.2s;
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--accent); }
.form textarea { min-height: 110px; resize: vertical; }
.form .consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--dim); }
.form .consent input { width: auto; margin-top: 3px; accent-color: var(--accent); }
.form .hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }
.form-msg { margin-top: 16px; font-size: 15px; display: none; }
.form-msg.ok { display: block; color: #7ddc7d; }
.form-msg.err { display: block; color: #ff7b6b; }

/* ---------- Project detail page ---------- */
.detail-main { border-radius: var(--radius); overflow: hidden; margin-bottom: clamp(16px, 3vw, 28px); }
.detail-main video, .detail-main > img { width: 100%; display: block; }
.yt-facade { position: relative; cursor: pointer; border: 0; padding: 0; background: var(--bg-2); }
.yt-facade img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform 0.5s ease; }
.yt-facade:hover img { transform: scale(1.02); }
.big-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: clamp(64px, 9vw, 92px); height: clamp(64px, 9vw, 92px); border-radius: 50%;
  background: rgba(10, 10, 10, 0.6); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.25); transition: background 0.2s, transform 0.2s;
}
.yt-facade:hover .big-play { background: var(--accent); transform: translate(-50%, -50%) scale(1.05); }
.big-play svg { width: 30%; height: 30%; fill: #fff; margin-left: 4%; }
.yt-facade:hover .big-play svg { fill: #0a0a0a; }
.yt-embed { position: relative; width: 100%; aspect-ratio: 16 / 9; }
.yt-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.detail-gallery { columns: 2; column-gap: clamp(14px, 2vw, 26px); }
@media (max-width: 640px) { .detail-gallery { columns: 1; } }
.g-item {
  display: block; width: 100%; margin-bottom: clamp(14px, 2vw, 26px);
  break-inside: avoid; border: 0; padding: 0; background: var(--bg-2);
  border-radius: var(--radius); overflow: hidden; cursor: pointer; position: relative;
}
.g-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.g-item:hover img { transform: scale(1.03); }
.g-item.g-video { cursor: default; }
.g-item video { width: 100%; display: block; }

.detail-nav {
  display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap;
  margin-top: clamp(30px, 5vh, 50px); border-top: 1px solid var(--line);
  padding-top: clamp(20px, 3vh, 32px);
}
.detail-nav .btn { max-width: 32ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }

/* ---------- Lightbox ---------- */
.lightbox {
  border: 0; padding: 0; background: transparent; max-width: none; max-height: none;
  width: 100%; height: 100%;
}
.lightbox::backdrop { background: rgba(5, 5, 5, 0.92); }
.lb-inner {
  width: 100vw; height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: clamp(14px, 4vw, 60px); position: relative;
}
.lb-media { max-width: min(1280px, 100%); width: 100%; position: relative; }
.lb-media video, .lb-media img { width: 100%; max-height: 82dvh; object-fit: contain; border-radius: 10px; }
.lb-media .yt {
  position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden;
  width: min(100%, calc(78dvh * 16 / 9)); margin: 0 auto;
}
.lb-media .yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lb-title { text-align: center; margin-top: 14px; font-size: 16px; color: var(--text); }
.lb-btn {
  position: absolute; z-index: 2; background: rgba(255,255,255,0.08);
  border: 1px solid var(--line); color: var(--text); border-radius: 50%;
  width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
  font-size: 20px; line-height: 1; transition: background 0.2s;
}
.lb-btn:hover { background: rgba(255,255,255,0.18); }
.lb-close { top: 18px; right: 18px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
@media (max-width: 700px) { .lb-prev, .lb-next { display: none; } }

/* ---------- Utility ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* Stagger: siblings reveal one after another */
.pillars .pillar:nth-child(2), .svc-list .svc:nth-child(2) { transition-delay: 0.12s; }
.pillars .pillar:nth-child(3), .svc-list .svc:nth-child(3) { transition-delay: 0.24s; }
.svc-list .svc:nth-child(4) { transition-delay: 0.36s; }

/* Gallery / featured card reveal */
.reveal-card { opacity: 0; transform: translateY(28px) scale(0.985); transition: opacity 0.65s ease, transform 0.65s ease; }
.reveal-card.in { opacity: 1; transform: none; }

/* ---------- Hero entrance ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(36px); }
  to { opacity: 1; transform: none; }
}
.hero h1 { animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both; }
.hero-sub { animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.32s both; }
.hero-cta { animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.48s both; }
.hero-media video, .hero-media img { will-change: transform; }

/* ---------- Nav auto-hide ---------- */
.nav { transition: background 0.3s, backdrop-filter 0.3s, transform 0.35s ease; }
.nav.nav-hidden { transform: translateY(-100%); }

/* ---------- Custom cursor (precise pointers only) ---------- */
@media (pointer: fine) {
  body.has-cursor, body.has-cursor a, body.has-cursor button,
  body.has-cursor input, body.has-cursor textarea, body.has-cursor select,
  body.has-cursor label { cursor: none; }
  .cur-dot, .cur-ring {
    position: fixed; top: 0; left: 0; z-index: 999; pointer-events: none;
    border-radius: 50%; transform: translate(-50%, -50%);
  }
  .cur-dot {
    width: 8px; height: 8px; background: var(--accent);
    transition: width 0.2s, height 0.2s, opacity 0.2s;
  }
  .cur-ring {
    width: 24px; height: 24px; border: 1.5px solid rgba(255, 255, 255, 0.55);
    transition: width 0.25s ease, height 0.25s ease, border-color 0.25s, background 0.25s, opacity 0.2s;
    mix-blend-mode: difference;
  }
  body.cur-hover .cur-dot { width: 4px; height: 4px; }
  body.cur-hover .cur-ring {
    width: 40px; height: 40px;
    border-color: var(--accent); background: rgba(255, 210, 52, 0.12);
    mix-blend-mode: normal;
  }
  body.cur-gone .cur-dot, body.cur-gone .cur-ring { opacity: 0; }
}
@media (pointer: coarse), (prefers-reduced-motion: reduce) {
  .cur-dot, .cur-ring { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-card { opacity: 1; transform: none; transition: none; }
  .hero h1, .hero-sub, .hero-cta { animation: none; }
}
.empty-note { color: var(--dim); padding: 40px 0; font-size: 16px; }
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--accent); color: #0a0a0a; padding: 10px 18px; font-weight: 700;
}
.skip:focus { left: 0; }
