/* ============================================================
   Biomorph Systems — style.css
   NORN EMISSARY DESIGN SYSTEM  (Hive Fleet Leviathan)
   Tokens, reset, context theming, typography, utilities

   Anatomy → UI mapping
   ------------------------------------------------------------
   Carapace / cranial crest  #12061C  headers, hero, big banners
   Alien skin (bone)         #F5F2EB / #E6DFD3  canvas, cards, text
   Carapace highlights       #9B5DE5  thin borders, divider lines
   Apex psychic node         #FF007F  PRIMARY CTA + critical hover ONLY
   Warp energy               #00FFCC  form focus + status ONLY
   Talons & hooves           #9A031E → #000  footer, warning, heavy buttons
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Space+Grotesk:wght@500;600;700&display=swap');

/* ------------------------------------------------------------
   Design Tokens
   ------------------------------------------------------------ */
:root {
  /* Carapace — alien night-purple */
  --color-carapace: #12061c;
  --color-carapace-2: #1b0b2a;
  --color-carapace-3: #26103a;

  /* Alien skin — bone */
  --color-bone: #f5f2eb;
  --color-bone-2: #e6dfd3;
  --color-bone-3: #d6cdbd;

  /* Carapace highlight — lilac */
  --color-lilac: #9b5de5;
  --color-lilac-soft: #b98cf0;
  --color-lilac-deep: #6a2fb5;
  --color-lilac-line: rgba(155, 93, 229, 0.45);
  --color-lilac-faint: rgba(155, 93, 229, 0.18);

  /* Apex psychic node — synapse magenta (CTA only) */
  --color-synapse: #ff007f;
  --color-synapse-hot: #ff3399;
  --color-synapse-glow: rgba(255, 0, 127, 0.55);

  /* Warp energy — toxic cyan (focus + status only) */
  --color-warp: #00ffcc;
  --color-warp-glow: rgba(0, 255, 204, 0.4);
  --color-warp-ink: #00805f; /* readable status text on bone */

  /* Talons & hooves — crimson → black */
  --color-crimson: #9a031e;
  --color-crimson-deep: #5a0212;
  --color-black: #000000;
  --gradient-talon: linear-gradient(180deg, #9a031e 0%, #4a0210 55%, #000000 100%);
  --gradient-talon-diag: linear-gradient(135deg, #9a031e 0%, #000000 100%);

  --color-white: #f5f2eb;
  --color-ink: #12061c;

  /* Context-aware text (light / bone context is the default) */
  --color-text-primary: #12061c;
  --color-text-secondary: #4a3a5e;
  --color-text-muted: #75668a;
  --color-label: #6a2fb5;
  --color-line: rgba(155, 93, 229, 0.5);
  --color-card-bg: #e6dfd3;
  --color-card-bg-hover: #f5f2eb;

  /* Typography */
  --font-display: 'Space Grotesk', -apple-system, sans-serif;
  --font-base: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  --font-size-5xl: 3rem;
  --font-size-6xl: 4rem;
  --font-size-7xl: 4.75rem;

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --line-height-tight: 1.1;
  --line-height-snug: 1.35;
  --line-height-normal: 1.55;
  --line-height-relaxed: 1.7;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Layout */
  --max-width: 1240px;
  --max-width-wide: 1400px;
  --max-width-prose: 720px;
  --nav-height: 76px;

  /* Radii — armor plates are sharp, not bubbly */
  --radius-xs: 2px;
  --radius-sm: 3px;
  --radius-md: 4px;
  --radius-lg: 6px;
  --radius-xl: 8px;
  --radius-full: 9999px;

  /* Beveled armor-plate corner (used via clip-path) */
  --plate-cut: 14px;

  /* Shadows & glows */
  --shadow-sm: 0 2px 8px rgba(18, 6, 28, 0.18);
  --shadow-md: 0 10px 28px rgba(18, 6, 28, 0.25);
  --shadow-lg: 0 22px 50px rgba(18, 6, 28, 0.38);
  --glow-synapse: 0 0 24px rgba(255, 0, 127, 0.45);
  --glow-synapse-lg: 0 0 48px rgba(255, 0, 127, 0.7);
  --glow-lilac: 0 0 22px rgba(155, 93, 229, 0.35);

  /* Transitions */
  --transition-fast: 160ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 280ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ------------------------------------------------------------
   Dark context: anything built from carapace plates.
   Re-points the text tokens so children adapt automatically.
   ------------------------------------------------------------ */
.nav,
.nav__mobile,
.hero,
.page-hero,
.section--dark,
.pull-quote,
.contact-info-card,
.error-page,
.footer,
.on-dark {
  --color-text-primary: #f5f2eb;
  --color-text-secondary: rgba(245, 242, 235, 0.78);
  --color-text-muted: rgba(245, 242, 235, 0.55);
  --color-label: #b98cf0;
  --color-line: rgba(155, 93, 229, 0.55);
  --color-card-bg: #f5f2eb;
  --color-card-bg-hover: #ffffff;
}

/* Light context re-asserted for bone plates sitting on dark sections */
.card,
.showcase-card,
.contact-card,
.pipeline-step {
  --color-text-primary: #12061c;
  --color-text-secondary: #4a3a5e;
  --color-text-muted: #75668a;
  --color-label: #6a2fb5;
  --color-line: rgba(155, 93, 229, 0.5);
}

/* ------------------------------------------------------------
   Reset & Base
   ------------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background-color: var(--color-carapace);
}

body {
  font-family: var(--font-base);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bone);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

button {
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: none;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
}

::selection {
  background: var(--color-synapse);
  color: #fff;
}

/* ------------------------------------------------------------
   Layout Utilities
   ------------------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-6);
  position: relative;
  z-index: 1;
}

.container--wide { max-width: var(--max-width-wide); }
.container--narrow { max-width: var(--max-width-prose); }

@media (min-width: 640px) {
  .container { padding-inline: var(--space-8); }
}

@media (min-width: 1024px) {
  .container { padding-inline: var(--space-12); }
}

/* Sections */
.section {
  padding-block: var(--space-20);
  position: relative;
  z-index: 1;
}

@media (min-width: 768px) { .section { padding-block: var(--space-24); } }
@media (min-width: 1024px) { .section { padding-block: var(--space-32); } }

/* Carapace slab — massive structural container */
.section--dark {
  background-color: var(--color-carapace);
  background-image:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(155, 93, 229, 0.16), transparent 70%),
    linear-gradient(180deg, var(--color-carapace-2) 0%, var(--color-carapace) 40%);
  color: var(--color-text-primary);
  border-top: 1px solid var(--color-lilac-line);
  border-bottom: 1px solid var(--color-lilac-line);
}

/* Bone canvas */
.section--surface,
.section--light,
.section--gray {
  background-color: var(--color-bone);
  background-image:
    radial-gradient(ellipse 60% 40% at 80% 0%, rgba(155, 93, 229, 0.07), transparent 70%),
    radial-gradient(ellipse 50% 40% at 0% 100%, rgba(230, 223, 211, 0.9), transparent 70%);
  color: var(--color-text-primary);
}

/* Grids */
.grid { display: grid; gap: var(--space-8); }
.grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }

@media (min-width: 640px) { .grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) { .grid--3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .grid--4 { grid-template-columns: repeat(4, 1fr); } }

/* Flex */
.flex { display: flex; }
.flex--center { align-items: center; justify-content: center; }
.flex--between { align-items: center; justify-content: space-between; }
.flex--col { flex-direction: column; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ------------------------------------------------------------
   Typography Utilities
   ------------------------------------------------------------ */
.heading-xl { font-size: var(--font-size-4xl); line-height: var(--line-height-tight); letter-spacing: -0.03em; }
.heading-lg { font-size: var(--font-size-3xl); line-height: var(--line-height-tight); letter-spacing: -0.02em; }
.heading-md { font-size: var(--font-size-2xl); line-height: var(--line-height-snug); letter-spacing: -0.01em; }
.heading-sm { font-size: var(--font-size-xl); font-weight: var(--font-weight-semibold); line-height: var(--line-height-snug); }

@media (min-width: 768px) {
  .heading-xl { font-size: var(--font-size-5xl); }
  .heading-lg { font-size: var(--font-size-4xl); }
}

@media (min-width: 1024px) {
  .heading-xl { font-size: var(--font-size-6xl); }
  .heading-lg { font-size: var(--font-size-5xl); }
}

.body-lg { font-size: var(--font-size-lg); line-height: var(--line-height-relaxed); color: var(--color-text-secondary); }
.body-base { font-size: var(--font-size-base); line-height: var(--line-height-relaxed); color: var(--color-text-secondary); }
.body-sm { font-size: var(--font-size-sm); line-height: var(--line-height-normal); color: var(--color-text-muted); }
.text-muted { color: var(--color-text-muted); }
.text-muted--dark { color: var(--color-text-secondary); }

/* Accent text */
.accent-lilac { color: var(--color-label); }
.accent-crimson { color: var(--color-crimson); font-weight: var(--font-weight-semibold); }

/* Legacy hooks kept so existing markup keeps working */
.accent-cyan { color: var(--color-crimson); font-weight: var(--font-weight-semibold); }
.accent-purple { color: var(--color-label); }

.gradient-text-cyan,
.gradient-text-synth {
  background: linear-gradient(100deg, #f5f2eb 0%, #b98cf0 55%, #9b5de5 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline;
}

/* ------------------------------------------------------------
   Armor HUD Elements
   ------------------------------------------------------------ */
.hud-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-primary);
  background: rgba(155, 93, 229, 0.12);
  border: 1px solid var(--color-lilac);
  border-radius: var(--radius-xs);
  padding: 4px 10px;
}

.hud-tag--purple {
  color: var(--color-lilac-soft);
  background: rgba(18, 6, 28, 0.55);
}

/* Status indicator — warp energy */
.hud-tag--status { position: relative; padding-left: 22px; }

.hud-tag--status::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-warp);
  box-shadow: 0 0 10px var(--color-warp), 0 0 2px var(--color-warp);
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: translateY(-50%) scale(1); }
  50% { opacity: 0.4; transform: translateY(-50%) scale(0.75); }
}

/* Feathered-plate corner brackets (thin lilac armor edges) */
.hud-bracket { position: relative; }

.hud-bracket::before,
.hud-bracket::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
  transition: all var(--transition-normal);
  z-index: 2;
}

.hud-bracket::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid var(--color-lilac);
  border-left: 2px solid var(--color-lilac);
}

.hud-bracket::after {
  bottom: -1px;
  right: -1px;
  border-bottom: 2px solid var(--color-lilac);
  border-right: 2px solid var(--color-lilac);
}

/* ------------------------------------------------------------
   Animations
   ------------------------------------------------------------ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes synapsePulse {
  0%, 100% { box-shadow: 0 0 22px rgba(255, 0, 127, 0.5), 0 0 0 0 rgba(255, 0, 127, 0.45); }
  50% { box-shadow: 0 0 40px rgba(255, 0, 127, 0.85), 0 0 0 10px rgba(255, 0, 127, 0); }
}

@keyframes crestDrift {
  0%, 100% { opacity: 0.75; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.04); }
}

@media (prefers-reduced-motion: no-preference) {
  .fade-in-up {
    opacity: 0;
    transform: translateY(28px);
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  .fade-in-up--delay-1 { animation-delay: 140ms; }
  .fade-in-up--delay-2 { animation-delay: 280ms; }
  .fade-in-up--delay-3 { animation-delay: 420ms; }
  .fade-in-up--delay-4 { animation-delay: 560ms; }
}

@media (prefers-reduced-motion: reduce) {
  .fade-in-up { opacity: 1; transform: none; animation: none; }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}