/* ============================================================
   NERVOUSYSTEMS — site styles
   Light/editorial base, dark full-bleed moments, brand tokens
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Serif:ital,wght@0,400;0,500;0,600;1,400&display=swap');

@font-face {
  font-family: 'Holiday';
  src: url('fonts/Holiday.otf') format('opentype');
  font-display: swap;
}
@font-face {
  font-family: 'TimesCondensed';
  src: url('fonts/TimesNewRomanMTCondensed-Regular.otf') format('opentype');
  font-display: swap;
}
@font-face {
  font-family: 'IBMPlexMono';
  src: url('fonts/IBMPlexMono-Regular.ttf') format('truetype');
  font-display: swap;
}

:root {
  --glitch-cyan: rgba(0,255,255,0.7);
  --glitch-red: rgba(255,0,80,0.7);
  --charcoal:#303030;
  --forest:  #102818;
  --acid:    #F0FD71;
  --mist:    #EDF0F2;
  --paper:   #F4F5F3;   /* slightly warmer mist for big light fields */
  --ink:     #14160F;

  --font-script:  'Holiday', cursive;
  --font-display: 'TimesCondensed', 'Times New Roman', serif;
  --font-mono:    'IBMPlexMono', 'Courier New', monospace;
  --font-body:    'IBM Plex Serif', Georgia, serif;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --pad: clamp(20px, 5vw, 72px);
  --btn-radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ---- TYPE ROLES ---- */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: normal;
  line-height: 0.96;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.script { font-family: var(--font-script); font-weight: 400; line-height: 1; }
.label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.body-lg { font-family: var(--font-body); font-size: clamp(18px, 1.7vw, 22px); line-height: 1.7; }
.muted { opacity: 0.95; }
.accent { color: var(--forest); }
em.acid, .acid-text { font-style: normal; background: var(--acid); padding: 0.02em 0.22em; color: var(--ink); }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px var(--pad);
  color: var(--mist);
  transition: background var(--ease) 350ms, color var(--ease) 350ms, padding var(--ease) 350ms, border-color var(--ease) 350ms;
  border-bottom: 1px solid transparent;
  mix-blend-mode: normal;
}
.nav.solid {
  background: rgba(244,245,243,0.50);
  backdrop-filter: blur(12px);
  color: var(--ink);
  padding: 16px var(--pad);
  border-bottom: 1px solid rgba(20,22,15,0.1);
}
.nav__brand { font-family: var(--font-script); font-size: 28px; line-height: 1; cursor: pointer; color: var(--acid); transition: color 350ms; }
.nav.solid .nav__brand { color: #333; }
.nav.solid .nav__logo--icon-light { display: none !important; }
.nav.solid .nav__logo--icon-dark { display: block !important; }
.nav.solid .nav__logo--light { display: none !important; }
.nav.solid .nav__logo--dark { display: block !important; }
.nav__logo--icon { animation: nav-icon-spin 5s ease-in-out infinite; transform-origin: center; }
@keyframes nav-icon-spin {
  0% { transform: rotate(0deg); }
  18% { transform: rotate(360deg); }
  18.01%, 100% { transform: rotate(360deg); }
}
.nav.solid .nav__link,
.nav.solid .nav__cta { color: #333; }
.nav.solid .nav__cta { border-color: #333; }
.nav.solid .nav__cta:hover { background: #333; color: var(--mist); border-color: #333; }
.nav.solid .nav__link.active::after { background: #333; }
.nav__links { display: flex; gap: clamp(18px, 2.4vw, 40px); align-items: center; }
.nav__link {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  opacity: 0.8; transition: opacity 200ms var(--ease); position: relative; padding-bottom: 3px;
}
.nav__link:hover { opacity: 1; }
.nav__link.active { opacity: 1; }
.nav__link.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--acid);
}
.nav__cta {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  border: 1px solid var(--acid); padding: 9px 18px; transition: background 200ms var(--ease), color 200ms var(--ease);
  border-radius: var(--btn-radius, 6px);
}
.nav__cta:hover { background: var(--acid); color: var(--ink); border-color: var(--acid); }
.nav__burger { display: none; flex-direction: column; gap: 5px; cursor: pointer; background: none; border: none; padding: 6px; }
.nav__burger span { width: 24px; height: 1.5px; background: var(--acid); transition: 250ms var(--ease); }

/* ============================================================
   HERO (full-bleed image header)
   ============================================================ */
.hero {
  position: relative; min-height: 96svh; display: flex; flex-direction: column;
  justify-content: flex-end; padding: 0 var(--pad) clamp(80px, 12vh, 120px);
  overflow: hidden; color: var(--mist); margin-bottom: -1px; background: var(--forest);
}
.hero__bg { position: absolute; inset: -8% 0 -6% 0; z-index: 0; will-change: transform; }
.hero__bg img { width: 100%; height: 120%; object-fit: cover; }
.hero__scrim { position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top, rgba(8,14,8,0.85) 0%, rgba(8,14,8,0.18) 48%, rgba(8,14,8,0.28) 100%); }
.hero__inner { position: relative; z-index: 2; width: 100%; }
.hero__title { font-size: clamp(48px, 11vw, 168px); }
.hero__meta {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 24px; margin-top: 10px;
}
.hero__sub { max-width: 40ch; line-height: 1.65; opacity: 0.86; }
.eyebrow img { animation: icon-spin 6s ease-in-out infinite; transform-origin: center; }
@keyframes icon-spin {
  0% { transform: rotate(0deg); }
  20% { transform: rotate(360deg); }
  20.01%, 100% { transform: rotate(360deg); }
}
.star-spin { animation: star-chain 5s ease-in-out infinite; transform-origin: center; }
@keyframes star-chain {
  0%, 100% { transform: rotate(0deg); }
  8% { transform: rotate(360deg); }
  8.01%, 99.99% { transform: rotate(360deg); }
}
@keyframes icon-spin {
  0% { transform: rotate(0deg); }
  20% { transform: rotate(360deg); }
  20.01%, 100% { transform: rotate(360deg); }
}
.hero__cue { font-family: var(--font-mono); font-size: 22px; letter-spacing: 0.22em; opacity: 0.7; display: flex; align-items: center; justify-content: center; animation: cue-bounce 2.4s ease-in-out infinite; }
.hero__cue::before { content: '↓'; }
@keyframes cue-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50% { transform: translateY(6px); opacity: 1; }
}
.crt-filter { position: absolute; inset: 0; z-index: 0; }
.crt-filter img { width:100%; height:100%; object-fit:cover; display:block; }
.crt-filter::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.25) 2px,
        rgba(0, 0, 0, 0.25) 4px
    );
    pointer-events: none;
    z-index: 1;
    animation: crt-scanline-flicker 0.08s steps(2) infinite;
}
@keyframes crt-scanline-flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.92; }
}
.acc-glitch:not(.acc-open):hover {
  animation: card-glitch 0.4s steps(2);
}
@keyframes card-glitch {
  0%  { transform: translateX(0);   box-shadow: 0 0 18px rgba(240,253,113,0.5); }
  20% { transform: translateX(-3px); box-shadow: 3px 0 0 rgba(255,71,87,0.5), -3px 0 0 rgba(0,217,255,0.5), 0 0 18px rgba(240,253,113,0.5); }
  40% { transform: translateX(3px);  box-shadow: -3px 0 0 rgba(255,71,87,0.5), 3px 0 0 rgba(0,217,255,0.5), 0 0 18px rgba(240,253,113,0.5); }
  60% { transform: translateX(-2px); box-shadow: 2px 0 0 rgba(255,71,87,0.4), 0 0 18px rgba(240,253,113,0.5); }
  80% { transform: translateX(1px);  box-shadow: 0 0 18px rgba(240,253,113,0.5); }
  100%{ transform: translateX(0);   box-shadow: 0 0 18px rgba(240,253,113,0.5); }
}
.chromatic-wrapper { position: relative; display: inline-block; animation: chromatic-anim 0.13s steps(2) infinite; }
.chromatic-wrapper .layer-main { display: block; position: relative; z-index: 1; }
.chromatic-wrapper .layer-red,
.chromatic-wrapper .layer-cyan { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.layer-red { mix-blend-mode: multiply; opacity: 0.6; animation: chromatic-red 0.12s steps(2) infinite; }
.layer-cyan { mix-blend-mode: screen; opacity: 0.5; animation: chromatic-cyan 0.15s steps(2) infinite; }
@keyframes chromatic-anim {
  0%,100% { filter: drop-shadow(2px 1px 0 rgba(255,0,80,0.7)) drop-shadow(-2px -1px 0 rgba(0,220,255,0.7)); }
  50%     { filter: drop-shadow(3px 0 0 rgba(255,0,80,0.7)) drop-shadow(-3px 1px 0 rgba(0,220,255,0.7)); }
}
@keyframes chromatic-red { 0%,100% { transform: translate(2px,1px); } 50% { transform: translate(3px,0); } }
@keyframes chromatic-cyan { 0%,100% { transform: translate(-2px,-1px); } 50% { transform: translate(-3px,1px); } }
.glitch-text {
    animation: text-glitch 4s ease-in-out infinite;
}
@keyframes text-glitch {
    0%, 88%, 100% { transform: translateX(0); text-shadow: none; }
    89% { transform: translateX(-2px); text-shadow: 2px 0 var(--glitch-cyan), -2px 0 var(--glitch-red); }
    90% { transform: translateX(2px); text-shadow: -2px 0 var(--glitch-cyan), 2px 0 var(--glitch-red); }
    91% { transform: translateX(-1px); text-shadow: 1px 0 var(--glitch-cyan), -1px 0 var(--glitch-red); }
    92% { transform: translateX(1px); text-shadow: none; }
    95% { transform: translateX(-1px); text-shadow: 1px 0 var(--glitch-cyan), -1px 0 var(--glitch-red); }
    96% { transform: translateX(1px); text-shadow: none; }
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section { padding: clamp(64px, 13vh, 168px) var(--pad); }
.section--dark { background: var(--forest); color: var(--mist); }
.section--ink { background: var(--ink); color: var(--mist); }
.section--mist { background: var(--mist); color: var(--ink); }
.wrap { max-width: 1320px; margin: 0 auto; }
.measure { max-width: 56ch; }

.eyebrow { display: flex; align-items: center; gap: 14px; margin-bottom: clamp(28px, 5vh, 56px); }
.eyebrow .label { opacity: 0.55; }
.eyebrow::before { display: none; }

/* Big statement block */
.statement { font-size: clamp(28px, 4.4vw, 64px); line-height: 1.08; }
.statement .accent { color: var(--forest); }
.section--dark .statement .accent, .section--ink .statement .accent { color: var(--acid); }

/* ============================================================
   IMAGE MARQUEE (infinite horizontal)
   ============================================================ */
.marquee { position: relative; width: 100%; overflow: hidden; padding: clamp(28px, 6vh, 64px) 0; }
.marquee__track { display: flex; width: max-content; gap: 20px; animation: scrollX 46s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee--rev .marquee__track { animation-direction: reverse; animation-duration: 56s; }
.marquee__item { flex: 0 0 auto; width: clamp(260px, 32vw, 460px); aspect-ratio: 4/3; overflow: hidden; position: relative; }
.marquee__item img { width: 100%; height: 100%; object-fit: cover; transition: transform 900ms var(--ease); }
.marquee__item:hover img { transform: scale(1.05); }
.marquee__cap { position: absolute; left: 14px; bottom: 12px; color: var(--mist); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; mix-blend-mode: difference; }
@keyframes scrollX { to { transform: translateX(calc(-50% - 10px)); } }

/* ============================================================
   TEXT TICKER
   ============================================================ */
.ticker { overflow: hidden; border-top: 1px solid; border-bottom: 1px solid; border-color: currentColor; padding: 18px 0; }
.ticker--mist { border-color: rgba(20,22,15,0.18); }
.ticker--dark { border-color: rgba(237,240,242,0.2); }
.ticker__track { display: flex; width: max-content; align-items: center; animation: scrollX 32s linear infinite; }
.ticker__item { display: flex; align-items: center; gap: 28px; padding-right: 28px; }
.ticker__item span { font-family: var(--font-display); font-size: clamp(22px, 3vw, 40px); letter-spacing: -0.01em; white-space: nowrap; }
.ticker__dot { width: 8px; height: 8px; background: var(--acid); flex: 0 0 auto; }

/* ============================================================
   SERVICES LIST (big editorial rows)
   ============================================================ */
.svc-list { border-top: 1px solid rgba(20,22,15,0.16); }
.section--dark .svc-list, .section--ink .svc-list { border-color: rgba(237,240,242,0.18); }
.svc-row {
  display: grid; grid-template-columns: 80px 1fr auto; align-items: center; gap: clamp(16px, 4vw, 56px);
  padding: clamp(26px, 4vh, 44px) 0; border-bottom: 1px solid rgba(20,22,15,0.16);
  transition: padding-left 400ms var(--ease), background 400ms var(--ease);
}
.section--dark .svc-row, .section--ink .svc-row { border-color: rgba(237,240,242,0.18); }
.svc-row:hover { padding-left: 18px; }
.svc-row__num { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.16em; opacity: 0.5; }
.svc-row__title { font-family: var(--font-display); font-size: clamp(28px, 4.5vw, 60px); line-height: 1; letter-spacing: -0.02em; }
.svc-row__arrow { font-family: var(--font-mono); font-size: 22px; opacity: 0.4; transition: transform 400ms var(--ease), opacity 400ms var(--ease); }
.svc-row:hover .svc-row__arrow { opacity: 1; transform: translate(6px, -6px); }

/* ============================================================
   SPLIT (image + text)
   ============================================================ */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 6vw, 88px); align-items: center; }
.split--rev .split__media { order: 2; }
.split__media { position: relative; overflow: hidden; aspect-ratio: 4/5; }
.split__media img { width: 100%; height: 100%; object-fit: cover; }
.split__title { font-family: var(--font-display); font-size: clamp(36px, 6vw, 88px); line-height: 0.96; letter-spacing: -0.02em; margin-bottom: 28px; }

/* ============================================================
   CTA BLOCK
   ============================================================ */
.cta { text-align: center; }
.cta__title { font-size: clamp(40px, 9vw, 132px); margin-bottom: 36px; }
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase;
  padding: 16px 34px; border: 1px solid var(--acid); transition: 220ms var(--ease); cursor: pointer; background: none; color: inherit;
  border-radius: var(--btn-radius, 6px);
}
.btn:hover { background: var(--acid); color: var(--ink); border-color: var(--acid); }
.btn--acid { background: var(--acid); color: var(--ink); border-color: var(--acid); }
.btn--acid:hover { background: transparent; color: var(--acid); border-color: var(--acid); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(240,253,113,0.28); }
.btn--acid-grey { background: var(--acid); color: var(--ink); border-color: #808080; }
.btn--acid-grey:hover { background: transparent; color: var(--ink); border-color: #808080; transform: translateY(-2px); box-shadow: 0 6px 22px rgba(200,225,40,0.6); }
.btn--solid { background: var(--ink); color: var(--mist); border-color: var(--ink); }
.btn--solid:hover { background: var(--acid); color: var(--ink); border-color: var(--acid); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: var(--black); color: var(--mist); padding: clamp(56px, 9vh, 110px) var(--pad) 40px; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 48px; align-items: start; }
.footer__brand .script { font-size: 40px; }
.footer__brand p { margin-top: 18px; max-width: 34ch; opacity: 0.6; font-size: 14px; }
.footer__col h4 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.45; margin-bottom: 18px; font-weight: 400; }
.footer__col a { display: block; padding: 6px 0; opacity: 0.8; transition: opacity 200ms, color 200ms; font-size: 15px; }
.footer__col a:hover { opacity: 1; color: var(--acid); }
.footer__bottom { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center;
  margin-top: clamp(48px, 8vh, 96px); padding-top: 26px; border-top: none; }
.footer__bottom span { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; opacity: 0.45; }
.footer__bottom span.copyright { opacity: 1; color: #ffffff; }
.t-slide { font-style: italic; }

/* Philosophy section title — Nervousystems always italic */
#ns-what-title { font-style: normal; }
#ns-what-title em { font-style: italic; }

   ============================================================ */
.reveal { opacity: 0; transform: translateY(36px); transition: opacity 1100ms var(--ease), transform 1100ms var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal-left { opacity: 0; transform: translateX(-56px); transition: opacity 1100ms var(--ease), transform 1100ms var(--ease); }
.reveal-left.in { opacity: 1; transform: none; }
.reveal-right { opacity: 0; transform: translateX(56px); transition: opacity 1100ms var(--ease), transform 1100ms var(--ease); }
.reveal-right.in { opacity: 1; transform: none; }
.reveal-scale { opacity: 0; transform: scale(0.94); transition: opacity 1100ms var(--ease), transform 1100ms var(--ease); }
.reveal-scale.in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: 120ms; }
.reveal[data-d="2"] { transition-delay: 240ms; }
.reveal[data-d="3"] { transition-delay: 360ms; }
.reveal-left[data-d="1"],.reveal-right[data-d="1"] { transition-delay: 120ms; }
.reveal-left[data-d="2"],.reveal-right[data-d="2"] { transition-delay: 240ms; }
.reveal-left[data-d="3"],.reveal-right[data-d="3"] { transition-delay: 360ms; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  .marquee__track, .ticker__track { animation: none; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   PAGE HEADER (interior pages)
   ============================================================ */
.pagehead { position: relative; min-height: 64svh; display: flex; align-items: flex-end; padding: 0 var(--pad) clamp(40px,6vh,72px); overflow: hidden; color: var(--mist); }
.pagehead__bg { position: absolute; inset: -8% 0 0 0; z-index: 0; will-change: transform; }
.pagehead__bg img { width: 100%; height: 116%; object-fit: cover; }
.pagehead__scrim { position: absolute; inset: 0; z-index: 1; background: linear-gradient(to top, rgba(8,14,8,0.72), rgba(8,14,8,0.15) 60%, rgba(8,14,8,0.3)); }
.pagehead__inner { position: relative; z-index: 2; }
.pagehead__title { font-size: clamp(44px, 9vw, 132px); }

.nav__close { display: none; }

/* ---- RESPONSIVE ---- */
@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__burger { display: flex; }
  /* Nav solid on mobile — stronger background so it's legible on scroll */
  .nav.solid {
    background: rgba(8,14,8,0.85) !important;
    backdrop-filter: blur(12px);
  }
  .nav.solid .nav__brand { color: var(--acid) !important; }
  .nav.solid .nav__burger span { background: var(--mist) !important; }
  .nav.solid .nav__link, .nav.solid .nav__cta { color: var(--mist) !important; }
  .nav.solid .nav__logo--light { display: block !important; }
  .nav.solid .nav__logo--dark { display: none !important; }
  .nav.solid .nav__logo--icon-light { display: block !important; }
  .nav.solid .nav__logo--icon-dark { display: none !important; }
  /* Testimonials — smaller text on mobile */
  #t-quote { font-size: 13px !important; line-height: 1.4 !important; margin-bottom: 16px !important; }
  .nav.open .nav__links {
    display: flex; flex-direction: column; position: fixed; inset: 0; z-index: 190;
    min-height: 100dvh; height: 100%;
    background: var(--ink); color: var(--mist); align-items: center; justify-content: center;
    padding: var(--pad); padding-top: 100px; gap: 28px;
  }
  .nav.open .nav__links .nav__link,
  .nav.open .nav__links .nav__cta { font-size: 20px; letter-spacing: 0.12em; text-align: center; }
  .nav.open .nav__links .nav__cta { padding: 10px 24px; width: auto; height: auto !important; border-radius: 4px; }
  .nav.open .nav__links { gap: 32px; }
  .nav.open .nav__close {
    display: block;
    position: absolute; top: 20px; right: var(--pad);
    background: none; border: none; cursor: pointer;
    font-family: var(--font-mono); font-size: 20px; color: var(--mist);
    opacity: 0.7; transition: opacity 200ms; z-index: 1;
  }
  /* When menu open + scrolled, keep acid/mist colors on CTA border and active link */
  .nav.open .nav__links .nav__link { color: var(--mist) !important; }
  .nav.open .nav__links .nav__link.active::after { background: var(--acid) !important; }
  .nav.open .nav__links .nav__cta { border-color: var(--acid) !important; color: var(--acid) !important; }
  /* Keep brand logo + icon visible when menu is open */
  .nav.open .nav__logo--icon-light { display: block !important; }
  .nav.open .nav__logo--icon-dark { display: none !important; }
  .nav.open .nav__logo--light { display: block !important; }
  .nav.open .nav__logo--dark { display: none !important; }
  .nav.open .nav__brand { color: var(--acid) !important; position: relative; z-index: 201; }
  .nav.open .nav__burger { position: relative; z-index: 201; visibility: hidden; }
  .split { grid-template-columns: 1fr; }
  .split--rev .split__media { order: 0; }
  .svc-row { grid-template-columns: 48px 1fr auto; }
  .footer__grid { grid-template-columns: 1fr; gap: 36px; }
}
