/* ============================================================
   VECTOR 48 — shared core
   Loaded before each page's inline styles; page styles may
   override. New pages can run on this file alone.
   ============================================================ */

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

:root {
  --bg: #0A0908;
  --bg-2: #1A140F;
  --bg-3: #221C16;
  --text: #F5F1EA;
  --text-muted: #8A8580;
  --text-subtle: #7D7871;
  --accent: #FF8700;
  --accent-deep: #B85E00;
  --accent-glow: rgba(255, 135, 0, 0.08);
  --accent-tint: rgba(255, 135, 0, 0.04);
  --rule: #1F1A18;
  --rule-bright: #2A2422;

  --max: 1440px;
  --pad-x: clamp(24px, 5vw, 80px);
}

html { scroll-behavior: smooth; background: var(--bg); }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.5;
  mix-blend-mode: overlay;
}

nav, main, footer, .hero, section { position: relative; z-index: 2; }

/* NAV */
.global-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(10, 9, 8, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad-x);
  height: 68px;
}

.nav-logo { display: flex; align-items: center; text-decoration: none; color: var(--text); }
.nav-logo svg { height: 28px; width: auto; display: block; flex-shrink: 0; }

.nav-links { display: flex; align-items: center; gap: 36px; }
.nav-links a:not(.btn) { display: inline-block; overflow: hidden; }
.nav-links a {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }

/* BUTTONS */
.btn {
  position: relative;
  z-index: 0;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  background: transparent;
  color: var(--bg) !important;
  text-decoration: none;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--text);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--text);
  z-index: -2;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: translateX(-101%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: -1;
}
.btn:hover { border-color: var(--accent); color: var(--text) !important; }
.btn:hover::before { transform: translateX(0); }
.btn-ghost::before, .btn-ghost::after { display: none; }
.btn-ghost { background: transparent; border: 1px solid var(--rule-bright); color: var(--text) !important; }
.btn-ghost:hover { background: transparent; border-color: var(--text); color: var(--text) !important; }
.btn .arrow { display: inline-block; transition: transform 0.2s ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* SECTION PILL */
.section-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: rgba(245, 241, 234, 0.04);
  border: 1px solid rgba(245, 241, 234, 0.12);
  border-radius: 24px;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 24px 0;
  width: auto;
  align-self: flex-start;
}

/* CTA */
.cta {
  padding: clamp(56px, 7vh, 88px) var(--pad-x) clamp(80px, 10vh, 120px) var(--pad-x);
  max-width: var(--max);
  margin: 0 auto;
}
.cta-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: end;
  padding: 60px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.cta h2 {
  font-family: 'Geist', system-ui, sans-serif;
  font-size: clamp(36px, 4.5vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 600;
  margin-bottom: 20px;
  max-width: 18ch;
  text-wrap: balance;
}
.cta p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 50ch;
  font-weight: 300;
  text-wrap: balance;
}
.cta-action { padding-bottom: 8px; }

/* FOOTER */
footer {
  padding: 32px var(--pad-x);
  border-top: 1px solid var(--rule);
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
footer .foot-meta { display: flex; align-items: center; gap: 24px; }
footer span, footer a {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-subtle);
  text-decoration: none;
  transition: color 0.2s ease;
}
footer a:hover { color: var(--text); }

/* REVEAL — gated on .rv, set by site.js itself. Fail-open: if site.js
   never loads, nothing gets hidden and the page renders fully. */
.rv .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.rv .reveal.in-view { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .rv .reveal { opacity: 1; transform: none; transition: none; }
  .rv .stagger > * { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* STACK TILES — used on the index stacks band and stacks.html */
.stack-links { display: flex; flex-direction: column; gap: 14px; }
.stack-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 26px;
  border: 1px solid var(--rule-bright);
  background: linear-gradient(180deg, var(--bg-3) 0%, var(--bg-2) 100%);
  text-decoration: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.stack-link:hover {
  border-color: rgba(255, 135, 0, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 1px 0 0 rgba(245, 241, 234, 0.12) inset,
              0 20px 44px -14px rgba(0, 0, 0, 0.7),
              0 0 80px -30px rgba(255, 135, 0, 0.22);
}
.stack-link-text { display: flex; flex-direction: column; gap: 5px; }
.stack-link-eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.stack-link-name {
  font-family: 'Geist', system-ui, sans-serif;
  font-size: clamp(17px, 1.3vw, 20px);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
}
.stack-link-desc {
  font-size: 13.5px;
  line-height: 1.55;
  font-weight: 400;
  color: var(--text-muted);
  max-width: 52ch;
}
.stack-link-arrow { color: var(--accent); font-size: 18px; flex-shrink: 0; transition: transform 0.2s ease; }
.stack-link:hover .stack-link-arrow { transform: translateX(4px); }

/* SHARED RESPONSIVE */
@media (max-width: 960px) {
  :root { --pad-x: 24px; }

  .global-nav { height: 60px; padding: 0 20px; }
  .nav-links { gap: 16px; }
  .nav-links a:not(.btn) { font-size: 11px; letter-spacing: 0.06em; }
  .nav-links a.btn { padding: 7px 12px; font-size: 10px; letter-spacing: 0.06em; gap: 4px; }
  .nav-logo svg { height: 22px; }

  .cta-grid { grid-template-columns: 1fr; gap: 24px; }

  footer { flex-direction: column; align-items: flex-start; gap: 16px; padding: 24px; }
  .foot-meta { gap: 16px; }
}

/* STAGGER — children of a .stagger container cascade in once their
   .reveal ancestor lands. Same fail-open gate as reveal. */
.rv .stagger > * {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.rv .reveal.in-view .stagger > * { opacity: 1; transform: none; }
.rv .reveal.in-view .stagger > *:nth-child(1) { transition-delay: 0.05s; }
.rv .reveal.in-view .stagger > *:nth-child(2) { transition-delay: 0.13s; }
.rv .reveal.in-view .stagger > *:nth-child(3) { transition-delay: 0.21s; }
.rv .reveal.in-view .stagger > *:nth-child(4) { transition-delay: 0.29s; }
.rv .reveal.in-view .stagger > *:nth-child(5) { transition-delay: 0.37s; }
.rv .reveal.in-view .stagger > *:nth-child(6) { transition-delay: 0.45s; }
.rv .reveal.in-view .stagger > *:nth-child(7) { transition-delay: 0.53s; }
.rv .reveal.in-view .stagger > *:nth-child(8) { transition-delay: 0.61s; }

/* NAV — hairline sharpens once the page moves */
.rv .global-nav {
  border-bottom-color: transparent;
  background: rgba(10, 9, 8, 0.6);
  transition: border-color 0.35s ease, background 0.35s ease;
}
.rv .global-nav.scrolled {
  border-bottom-color: var(--rule);
  background: rgba(10, 9, 8, 0.85);
}

/* FAQ — shared accordion styles */
/* FAQ — ported from stack page */
.faq-section {
  padding: clamp(96px, 12vh, 140px) var(--pad-x);
  max-width: var(--max);
  margin: 0 auto;
}
.faq-inner {
  display: grid;
  grid-template-columns: 0.7fr 1fr;
  gap: clamp(48px, 6vw, 100px);
  align-items: start;
}
.faq-label-col { position: sticky; top: 100px; }
.faq-headline {
  font-family: 'Geist', sans-serif;
  font-size: clamp(32px, 3.6vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 18px;
  text-wrap: balance;
}
.faq-sub {
  font-size: clamp(14px, 1.1vw, 16px);
  line-height: 1.6;
  color: var(--text-muted);
  font-weight: 400;
  max-width: 36ch;
}
.faq-list { display: flex; flex-direction: column; }
.faq-item { border-top: 1px solid var(--rule); }
.faq-item:last-child { border-bottom: 1px solid var(--rule); }
.faq-q {
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  text-align: left;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: clamp(15px, 1.1vw, 17px);
  font-weight: 500;
  line-height: 1.4;
  padding: 24px 0;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  transition: color 0.2s ease;
}
.faq-q:hover { color: var(--accent); }
.faq-q-icon {
  flex: 0 0 18px;
  width: 18px; height: 18px;
  color: var(--accent);
  transition: transform 0.3s ease;
}
.faq-q-icon svg { width: 100%; height: 100%; display: block; }
.faq-item.open .faq-q-icon { transform: rotate(45deg); }
.faq-a {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-muted);
  font-weight: 300;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease;
}
.faq-item.open .faq-a {
  max-height: 360px;
  padding-bottom: 24px;
}
@media (max-width: 900px) {
  .faq-inner { grid-template-columns: 1fr; gap: 32px; }
  .faq-label-col { position: static; }
}

/* FOCUS — keyboard users get a visible papaya ring */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ============================================================
   MOTION LAYER — demonstrative, fail-open, reduced-motion aware
   ============================================================ */

/* Hero brief pre-hide: armed by the same-document head script (html.js),
   released by the same-document body script. Cannot strand on a 404. */
.js .v48-pb .v48-pb-header, .js .v48-pb .v48-pb-eyebrow, .js .v48-pb .v48-pb-title,
.js .v48-pb .v48-pb-subtitle, .js .v48-pb .v48-pb-rule, .js .v48-pb .v48-pb-section-label,
.js .v48-pb .v48-pb-q-item, .js .v48-pb .v48-pb-prose, .js .v48-pb .v48-pb-beat-item,
.js .v48-pb .v48-pb-foot { opacity: 0; }

@keyframes v48-tagflash {
  0% { box-shadow: 0 0 0 1px var(--accent); color: var(--text); }
  100% { box-shadow: 0 0 0 1px rgba(255, 135, 0, 0); }
}
.v48-pb-q-tag.asm-flash { animation: v48-tagflash 0.9s ease-out; }

/* Ambient: the machine is on */
@keyframes v48-breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.rv .module-diamond, .rv .v48-pb-diamond { animation: v48-breathe 4s ease-in-out infinite; }

@keyframes v48-rowpulse {
  0%, 100% { background-color: transparent; }
  1.2% { background-color: rgba(255, 135, 0, 0.06); }
  4% { background-color: transparent; }
}
.rv .v48-cos-rows .v48-cos-row { animation: v48-rowpulse 16s linear infinite; }
.rv .v48-cos-rows .v48-cos-row:nth-child(1) { animation-delay: 3s; }
.rv .v48-cos-rows .v48-cos-row:nth-child(2) { animation-delay: 7s; }
.rv .v48-cos-rows .v48-cos-row:nth-child(3) { animation-delay: 11s; }
.rv .v48-cos-rows .v48-cos-row:nth-child(4) { animation-delay: 15s; }

/* Carousel live wire */
@keyframes v48-dash { from { background-position: 0 100%; } to { background-position: 240px 100%; } }
.rv .running-card-name {
  border-bottom-color: transparent;
  background-image: repeating-linear-gradient(90deg, rgba(255, 135, 0, 0.45) 0 6px, transparent 6px 12px);
  background-size: 12px 1px;
  background-repeat: repeat-x;
  background-position: 0 100%;
  animation: v48-dash 24s linear infinite;
}

/* Masked headline rise */
.rv .reveal .section-headline, .rv .reveal .svc-headline, .rv .reveal .faq-headline {
  clip-path: inset(0 0 100% 0);
  transform: translateY(16px);
  transition: clip-path 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.08s,
              transform 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.08s;
}
.rv .reveal.in-view .section-headline, .rv .reveal.in-view .svc-headline, .rv .reveal.in-view .faq-headline {
  clip-path: inset(-6% 0 -6% 0);
  transform: none;
}

/* Link roll */
.rl {
  position: relative;
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.rl::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 100%;
}
.rv .nav-links a:hover .rl { transform: translateY(-100%); }

/* Nav diamond quarter-turn */
.nav-logo svg > path:first-of-type {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-logo:hover svg > path:first-of-type { transform: rotate(90deg); }

@media (prefers-reduced-motion: reduce) {
  .js .v48-pb .v48-pb-header, .js .v48-pb .v48-pb-eyebrow, .js .v48-pb .v48-pb-title,
  .js .v48-pb .v48-pb-subtitle, .js .v48-pb .v48-pb-rule, .js .v48-pb .v48-pb-section-label,
  .js .v48-pb .v48-pb-q-item, .js .v48-pb .v48-pb-prose, .js .v48-pb .v48-pb-beat-item,
  .js .v48-pb .v48-pb-foot { opacity: 1; }
  .rv .module-diamond, .rv .v48-pb-diamond,
  .rv .v48-cos-rows .v48-cos-row,
  .rv .running-card-name,
  .v48-pb-q-tag.asm-flash { animation: none; }
  .rv .reveal .section-headline, .rv .reveal .svc-headline, .rv .reveal .faq-headline {
    clip-path: none; transform: none; transition: none;
  }
  .rl, .btn::before, .nav-logo svg > path:first-of-type { transition: none; }
  .pb-beat-flash, .pb-beat-flash .v48-pb-beat-dot { animation: none; }
}

/* Living-beat flashes on the hero brief */
@keyframes v48-dotflash {
  0% { box-shadow: 0 0 0 3px rgba(255, 135, 0, 0.35); }
  100% { box-shadow: 0 0 0 3px rgba(255, 135, 0, 0); }
}
@keyframes v48-beattext {
  0%, 25% { color: var(--text); }
  100% { color: var(--text-muted); }
}
.pb-beat-flash { animation: v48-beattext 1.4s ease-out; }
.pb-beat-flash .v48-pb-beat-dot { animation: v48-dotflash 1.4s ease-out; border-radius: 50%; }

/* Nav never truncates: links hold their width, the wordmark yields to the compact lockup */
.nav-links { flex-shrink: 0; }
.nav-links a { white-space: nowrap; }
.nav-logo .logo-compact { display: none; }
@media (max-width: 1024px) {
  .nav-logo .logo-full { display: none; }
  .nav-logo .logo-compact { display: block; }
}
