/* ============================================================
   Enspara Platform — platform.enspara.com
   Dark, infrastructure-grade marketing site. No frameworks.
   ============================================================ */

/* ---------- fonts (self-hosted, latin subsets) ---------- */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../assets/fonts/space-grotesk-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../assets/fonts/inter-var.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* canvas */
  --bg-0: #05090f;
  --bg-1: #070d16;
  --bg-2: #0a1220;
  --bg-3: #0e1829;

  /* ink */
  --text: #e7edf5;
  --text-dim: #9aa8bb;
  --text-faint: #66748a;

  /* brand */
  --green: #34e07c;
  --green-soft: rgba(52, 224, 124, 0.14);
  --blue: #56b8ff;
  --amber: #ffb454;
  --btn-bg: #34e07c;
  --btn-ink: #04130a;

  /* lines & surfaces */
  --keyline: rgba(154, 168, 187, 0.14);
  --keyline-strong: rgba(154, 168, 187, 0.26);
  --glow: 0 0 24px rgba(52, 224, 124, 0.25);
  --edge-light: rgba(231, 237, 245, 0.05);

  /* themed component tones */
  --nav-glass: rgba(5, 9, 15, 0.78);
  --menu-bg: rgba(5, 9, 15, 0.96);
  --tag-bg: rgba(5, 9, 15, 0.85);
  --alert-bg: rgba(14, 24, 41, 0.92);
  --ghost-btn-bg: rgba(10, 18, 32, 0.4);
  --sk-mid: #14233c;
  --sk-bar-grad: linear-gradient(180deg, rgba(52, 224, 124, 0.5), rgba(52, 224, 124, 0.08));
  --ghost-stroke: rgba(154, 168, 187, 0.09);
  --ghost-fill: rgba(154, 168, 187, 0.04);
  --aura-color: rgba(52, 224, 124, 0.05);
  --spot-color: rgba(52, 224, 124, 0.07);
  --ed-acc-stroke: rgba(52, 224, 124, 0.55);
  --ed-blue-stroke: rgba(86, 184, 255, 0.5);
  --ed-buf: rgba(52, 224, 124, 0.4);
  --cap-hover: #0a1220;
  --grain-o: 0.045;
  --logo-invert: 0;
  --is-light: 0;
  color-scheme: dark;

  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;

  --max: 1160px;
  --radius: 14px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- light theme (explicit, or system preference) ---------- */
:root[data-theme='light'] {
  --bg-0: #f8f8f6;
  --bg-1: #efeeea;
  --bg-2: #ffffff;
  --bg-3: #f1f0ec;
  --text: #161b24;
  --text-dim: #4b5768;
  --text-faint: #75808f;
  --green: #087a43;
  --green-soft: rgba(8, 122, 67, 0.12);
  --blue: #2563eb;
  --amber: #b45309;
  --btn-bg: #0b8f4d;
  --btn-ink: #ffffff;
  --keyline: rgba(23, 32, 44, 0.12);
  --keyline-strong: rgba(23, 32, 44, 0.24);
  --glow: 0 0 24px rgba(11, 143, 77, 0.25);
  --edge-light: rgba(255, 255, 255, 0.7);
  --nav-glass: rgba(248, 248, 246, 0.82);
  --menu-bg: rgba(248, 248, 246, 0.97);
  --tag-bg: rgba(248, 248, 246, 0.9);
  --alert-bg: rgba(255, 255, 255, 0.94);
  --ghost-btn-bg: rgba(255, 255, 255, 0.5);
  --sk-mid: #e4e2db;
  --sk-bar-grad: linear-gradient(180deg, rgba(8, 122, 67, 0.55), rgba(8, 122, 67, 0.08));
  --ghost-stroke: rgba(23, 32, 44, 0.14);
  --ghost-fill: rgba(23, 32, 44, 0.05);
  --aura-color: rgba(8, 122, 67, 0.055);
  --spot-color: rgba(8, 122, 67, 0.06);
  --ed-acc-stroke: rgba(8, 122, 67, 0.6);
  --ed-blue-stroke: rgba(37, 99, 235, 0.45);
  --ed-buf: rgba(8, 122, 67, 0.45);
  --cap-hover: #f4f3ee;
  --grain-o: 0.035;
  --logo-invert: 1;
  --is-light: 1;
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']):not([data-theme='light']) {
    --bg-0: #f8f8f6;
    --bg-1: #efeeea;
    --bg-2: #ffffff;
    --bg-3: #f1f0ec;
    --text: #161b24;
    --text-dim: #4b5768;
    --text-faint: #75808f;
    --green: #087a43;
    --green-soft: rgba(8, 122, 67, 0.12);
    --blue: #2563eb;
    --amber: #b45309;
    --btn-bg: #0b8f4d;
    --btn-ink: #ffffff;
    --keyline: rgba(23, 32, 44, 0.12);
    --keyline-strong: rgba(23, 32, 44, 0.24);
    --glow: 0 0 24px rgba(11, 143, 77, 0.25);
    --edge-light: rgba(255, 255, 255, 0.7);
    --nav-glass: rgba(248, 248, 246, 0.82);
    --menu-bg: rgba(248, 248, 246, 0.97);
    --tag-bg: rgba(248, 248, 246, 0.9);
    --alert-bg: rgba(255, 255, 255, 0.94);
    --ghost-btn-bg: rgba(255, 255, 255, 0.5);
    --sk-mid: #e4e2db;
    --sk-bar-grad: linear-gradient(180deg, rgba(8, 122, 67, 0.55), rgba(8, 122, 67, 0.08));
    --ghost-stroke: rgba(23, 32, 44, 0.14);
    --ghost-fill: rgba(23, 32, 44, 0.05);
    --aura-color: rgba(8, 122, 67, 0.055);
    --spot-color: rgba(8, 122, 67, 0.06);
    --ed-acc-stroke: rgba(8, 122, 67, 0.6);
    --ed-blue-stroke: rgba(37, 99, 235, 0.45);
    --ed-buf: rgba(8, 122, 67, 0.45);
    --cap-hover: #f4f3ee;
    --grain-o: 0.035;
    --logo-invert: 1;
    --is-light: 1;
    color-scheme: light;
  }
}

/* white brand SVGs flip to ink in light theme */
.nav-logo img,
.footer-brand img {
  filter: invert(var(--logo-invert));
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

::selection {
  background: color-mix(in srgb, var(--green) 30%, transparent);
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-weight: 600;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; top: 0; }

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- type ---------- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h2 { font-size: clamp(1.9rem, 4.2vw, 3rem); }
h3 { font-size: 1.25rem; letter-spacing: -0.01em; }

.eyebrow {
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 1.1rem;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 1.5rem clamp(2rem, 6vw, 5rem);
  align-items: end;
  margin-bottom: clamp(2.75rem, 6vw, 4.5rem);
}

.section-lede {
  color: var(--text-dim);
  font-size: 1.0625rem;
  max-width: 34em;
}

@media (max-width: 800px) {
  .section-head { grid-template-columns: 1fr; align-items: start; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.6rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out),
    background 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--btn-bg);
  color: var(--btn-ink);
  box-shadow: 0 0 0 rgba(52, 224, 124, 0);
}
.btn-primary:hover {
  box-shadow: 0 0 30px color-mix(in srgb, var(--btn-bg) 50%, transparent),
    0 6px 22px color-mix(in srgb, var(--btn-bg) 22%, transparent);
}

.btn-ghost {
  border: 1px solid var(--keyline-strong);
  color: var(--text);
  background: var(--ghost-btn-bg);
}
.btn-ghost:hover {
  border-color: color-mix(in srgb, var(--green) 75%, transparent);
  color: var(--green);
  box-shadow: 0 0 24px color-mix(in srgb, var(--green) 18%, transparent),
    inset 0 0 14px color-mix(in srgb, var(--green) 5%, transparent);
}

.btn-sm { padding: 0.55rem 1.1rem; font-size: 0.875rem; }

/* ---------- nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  transition: background 0.35s ease, border-color 0.35s ease;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: var(--nav-glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--keyline);
}

.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.9rem clamp(1.25rem, 4vw, 2.5rem);
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.nav-logo {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-shrink: 0;
}
.nav-logo img { height: 22px; width: auto; }
.nav-logo-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--green);
  /* lift the tag off the wordmark's descender so both share a baseline */
  transform: translateY(-7px);
}

.nav-links {
  position: relative;
  display: flex;
  gap: 1.9rem;
  margin-left: auto;
}
.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dim);
  transition: color 0.2s ease;
}
.nav-links a:hover,
.nav-links a.is-active { color: var(--text); }

.nav-indicator {
  position: absolute;
  bottom: -6px;
  left: 0;
  height: 2px;
  width: 0;
  border-radius: 2px;
  background: var(--green);
  opacity: 0;
  transition: left 0.35s var(--ease-out), width 0.35s var(--ease-out), opacity 0.25s ease;
}
.nav-indicator.is-on { opacity: 1; }

.nav-cta { flex-shrink: 0; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border: 1px solid var(--keyline-strong);
  border-radius: 9px;
  color: var(--text-dim);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.theme-toggle:hover {
  color: var(--green);
  border-color: var(--green);
}
.theme-toggle svg {
  width: 17px;
  height: 17px;
  display: none;
}
.theme-toggle[data-mode='light'] .tt-sun { display: block; }
.theme-toggle[data-mode='dark'] .tt-moon { display: block; }
.theme-toggle[data-mode='system'] .tt-auto { display: block; }

.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 40px;
  height: 40px;
  margin-left: auto;
}
.nav-burger span {
  display: block;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.3s var(--ease-out), opacity 0.3s;
}
.nav-burger[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:last-child { transform: translateY(-3.75px) rotate(-45deg); }

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.75rem clamp(1.25rem, 4vw, 2.5rem) 1.5rem;
  background: var(--menu-bg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--keyline);
}
.mobile-menu a:not(.btn) {
  padding: 0.7rem 0;
  font-weight: 500;
  color: var(--text-dim);
  border-bottom: 1px solid var(--keyline);
}
.mobile-menu .btn { margin-top: 1rem; }

@media (max-width: 800px) {
  .nav-links, .nav-cta { display: none; }
  .theme-toggle { margin-left: auto; }
  .nav-burger { display: flex; margin-left: 0.25rem; }
  .nav.menu-open .mobile-menu { display: flex; }
  .nav.menu-open { background: var(--menu-bg); }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(7rem, 16vh, 10rem) 0 3rem;
  overflow: hidden;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  -webkit-mask-image: linear-gradient(to bottom, black 62%, transparent 98%);
  mask-image: linear-gradient(to bottom, black 62%, transparent 98%);
  opacity: 0;
  transition: opacity 1.4s ease 0.2s;
}
.hero-canvas.is-lit { opacity: 1; }

.hero-inner { position: relative; z-index: 2; }

/* typewriter caret for the hero eyebrow */
.type-caret {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  margin-left: 3px;
  vertical-align: -0.18em;
  background: var(--green);
  animation: caret-blink 1.1s steps(2, start) infinite;
}
.type-caret.is-done {
  opacity: 0;
  transition: opacity 0.5s ease;
  animation: none;
}
@keyframes caret-blink {
  50% { opacity: 0; }
}

.hero-title {
  font-size: clamp(2.7rem, 7.2vw, 6.25rem);
  letter-spacing: -0.03em;
  line-height: 1.03;
  margin-bottom: 1.6rem;
}

/* per-line mask reveal */
.hero-title .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em; /* keep descenders inside the mask */
  margin-bottom: -0.08em;
}
.line-inner {
  display: block;
  transform: translateY(114%) rotate(2.2deg);
  transform-origin: 0 100%;
  animation: line-up 1s cubic-bezier(0.16, 1, 0.3, 1) calc(0.42s + var(--l, 0s)) forwards;
}
@keyframes line-up {
  to { transform: translateY(0) rotate(0deg); }
}

.hero-sub {
  color: var(--text-dim);
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  max-width: 36em;
  margin-bottom: 2.4rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }

/* ---------- sections ---------- */
.section { padding: clamp(5.5rem, 11vw, 9rem) 0; position: relative; }

.section-alt {
  background: var(--bg-1);
  border-top: 1px solid var(--keyline);
  border-bottom: 1px solid var(--keyline);
}

/* ---------- lifecycle ---------- */
.lifecycle {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2rem 1.25rem;
  position: relative;
  counter-reset: stage;
  /* progress line */
  --progress: 0;
}
.lifecycle::before,
.lifecycle::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 0;
  height: 2px;
  border-radius: 2px;
}
.lifecycle::before {
  width: 100%;
  background: var(--keyline);
}
.lifecycle::after {
  width: calc(var(--progress) * 100%);
  background: linear-gradient(90deg, var(--green), var(--blue));
  box-shadow: 0 0 12px rgba(52, 224, 124, 0.5);
  transition: width 0.15s linear;
}

.stage { position: relative; padding-top: 2.1rem; }

.stage-dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-0);
  border: 2px solid var(--text-faint);
  z-index: 1;
  transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}
.stage.is-active .stage-dot {
  border-color: var(--green);
  background: var(--green);
  box-shadow: 0 0 12px rgba(52, 224, 124, 0.7);
}

.stage-num {
  color: var(--text-faint);
  display: block;
  margin-bottom: 0.5rem;
  transition: color 0.3s ease;
}
.stage.is-active .stage-num { color: var(--green); }

.stage h3 { margin-bottom: 0.45rem; font-size: 1.15rem; }
.stage p { color: var(--text-dim); font-size: 0.92rem; line-height: 1.55; }

@media (max-width: 900px) {
  .lifecycle { grid-template-columns: 1fr; gap: 0; }
  .lifecycle::before, .lifecycle::after { width: 2px; height: 100%; left: 5px; top: 0; }
  .lifecycle::after {
    height: calc(var(--progress) * 100%);
    width: 2px;
    background: linear-gradient(180deg, var(--green), var(--blue));
    transition: height 0.15s linear;
  }
  .stage { padding: 0 0 2.25rem 2.25rem; }
  .stage:last-child { padding-bottom: 0.5rem; }
  .stage-dot { top: 6px; }
}

/* ---------- capability grid ---------- */
.cap-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--keyline);
  border: 1px solid var(--keyline);
  border-radius: var(--radius);
  overflow: hidden;
}

.cap-card {
  position: relative;
  background: var(--bg-1);
  padding: 1.8rem 1.7rem 1.9rem;
  transition: background 0.3s ease;
  /* spotlight vars set from JS */
  --mx: 50%;
  --my: 50%;
}
.cap-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
  background: radial-gradient(340px circle at var(--mx) var(--my),
      var(--spot-color), transparent 65%);
  pointer-events: none;
}
.cap-card:hover::before { opacity: 1; }
.cap-card:hover { background: var(--cap-hover); }

.cap-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.3rem;
}

.cap-icon {
  width: 30px;
  height: 30px;
  color: var(--green);
}

.cap-index { color: var(--text-faint); }

.cap-card h3 { margin-bottom: 0.35rem; }
.cap-card > p {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-bottom: 1.1rem;
}

.cap-card ul {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  border-top: 1px solid var(--keyline);
  padding-top: 1.1rem;
}
.cap-card li {
  position: relative;
  padding-left: 1.1rem;
  color: var(--text-faint);
  font-size: 0.875rem;
  line-height: 1.5;
}
.cap-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.58em;
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: var(--green);
  opacity: 0.65;
}

@media (max-width: 980px) { .cap-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .cap-grid { grid-template-columns: 1fr; } }

/* ---------- features (measure / understand / prove) ---------- */
.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  padding: clamp(2.5rem, 6vw, 4.5rem) 0;
}
.feature + .feature,
.microgrid + .feature { border-top: 1px solid var(--keyline); }
.feature-flip .feature-copy { order: 2; }
.feature-flip .feature-visual { order: 1; }

.feature-tag {
  color: var(--green);
  letter-spacing: 0.2em;
  margin-bottom: 0.9rem;
}
.feature-copy h3 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  margin-bottom: 1rem;
}
.feature-copy > p { color: var(--text-dim); margin-bottom: 1.4rem; max-width: 32em; }

.feature-list { display: flex; flex-direction: column; gap: 0.55rem; }
.feature-list li {
  position: relative;
  padding-left: 1.5rem;
  color: var(--text-dim);
  font-size: 0.95rem;
}
.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--green);
}

.badge-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; }
.badge {
  padding: 0.42rem 0.8rem;
  border: 1px solid var(--keyline-strong);
  border-radius: 999px;
  color: var(--text-dim);
  background: var(--bg-2);
}

@media (max-width: 900px) {
  .feature { grid-template-columns: 1fr; gap: 2.25rem; }
  .feature-flip .feature-copy { order: 1; }
  .feature-flip .feature-visual { order: 2; }
}

/* ---------- edge diagram ---------- */
.edge-diagram {
  width: 100%;
  height: auto;
  overflow: visible;
}
.edge-diagram rect {
  fill: var(--bg-2);
  stroke: var(--keyline-strong);
  stroke-width: 1;
}
.ed-gateway > rect { stroke: var(--ed-acc-stroke); fill: var(--bg-3); }
.ed-cloud > rect { stroke: var(--ed-blue-stroke); }

.ed-label {
  fill: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  text-anchor: middle;
}
.ed-sub {
  fill: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-anchor: middle;
}

.ed-wire {
  fill: none;
  stroke: rgba(154, 168, 187, 0.4);
  stroke-width: 1.2;
  stroke-dasharray: 5 6;
  animation: wire-flow 1.6s linear infinite;
}
.ed-uplink {
  stroke: var(--green);
  stroke-width: 1.6;
  filter: drop-shadow(0 0 5px rgba(52, 224, 124, 0.55));
}

@keyframes wire-flow {
  to { stroke-dashoffset: -11; }
}

.ed-buf {
  fill: var(--ed-buf);
  stroke: none;
  animation: buf-pulse 2.4s ease-in-out infinite;
}
.ed-buf-2 { animation-delay: 0.3s; }
.ed-buf-3 { animation-delay: 0.6s; }

@keyframes buf-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

/* ---------- anomaly chart ---------- */
.chart-wrap {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--keyline);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem 0.9rem;
}
.chart-chrome {
  display: flex;
  justify-content: space-between;
  color: var(--text-faint);
  margin-bottom: 0.8rem;
}
.chart-wrap svg { width: 100%; height: auto; }

.ch-grid path { stroke: var(--keyline); stroke-width: 1; }

.ch-band { fill: rgba(86, 184, 255, 0.08); }

.ch-forecast {
  fill: none;
  stroke: rgba(86, 184, 255, 0.55);
  stroke-width: 1.4;
  stroke-dasharray: 4 5;
}

.ch-actual {
  fill: none;
  stroke: var(--green);
  stroke-width: 2;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(52, 224, 124, 0.4));
}
.chart-wrap.is-in .ch-actual {
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: draw-line 2.2s var(--ease-out) 0.2s forwards;
}
@keyframes draw-line { to { stroke-dashoffset: 0; } }

.ch-dot { fill: var(--amber); }
.ch-ping {
  fill: none;
  stroke: var(--amber);
  stroke-width: 1.5;
  opacity: 0;
}
.chart-wrap.is-in .ch-ping { animation: ping 2.6s ease-out 2.2s infinite; }
@keyframes ping {
  0% { opacity: 0.9; transform: scale(0.5); transform-origin: 316px 38px; }
  70%, 100% { opacity: 0; transform: scale(2.6); transform-origin: 316px 38px; }
}

.ch-times text {
  fill: var(--text-faint);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.chart-alert {
  position: absolute;
  top: 18%;
  right: 6%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  background: var(--alert-bg);
  border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent);
  border-radius: 8px;
  color: var(--amber);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.5s ease 2.4s, transform 0.5s var(--ease-out) 2.4s;
}
.chart-wrap.is-in .chart-alert { opacity: 1; transform: none; }
.alert-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  animation: buf-pulse 1.6s ease-in-out infinite;
}

/* ---------- screenshot placeholders ---------- */
.browser-frame,
.phone-frame {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--keyline-strong);
  border-radius: var(--radius);
  overflow: hidden;
}

.browser-bar {
  display: flex;
  gap: 6px;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--keyline);
  background: var(--bg-3);
}
.browser-bar span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--keyline-strong);
}

/* skeleton internals */
.shot-skeleton {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 1.1rem;
  padding: 1.1rem;
  min-height: 300px;
}
.sk-side { display: flex; flex-direction: column; gap: 0.8rem; padding-top: 0.3rem; }
.sk-main { display: flex; flex-direction: column; gap: 1.1rem; }

.sk-line {
  height: 9px;
  border-radius: 4px;
  background: linear-gradient(100deg, var(--bg-3) 40%, var(--sk-mid) 50%, var(--bg-3) 60%);
  background-size: 200% 100%;
  animation: shimmer 2.2s linear infinite;
}
.w40 { width: 40%; } .w50 { width: 50%; } .w60 { width: 60%; }
.w70 { width: 70%; } .w80 { width: 80%; }

@keyframes shimmer {
  to { background-position: -200% 0; }
}

.sk-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; }
.sk-tile {
  height: 58px;
  border-radius: 8px;
  border: 1px solid var(--keyline);
  background: var(--bg-3);
}

.sk-chart {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 0.7rem;
  padding: 1rem;
  border: 1px solid var(--keyline);
  border-radius: 8px;
  min-height: 130px;
}
.sk-bar {
  flex: 1;
  height: var(--h, 50%);
  border-radius: 4px 4px 0 0;
  background: var(--sk-bar-grad);
}

/* phone */
.auditor-band {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 7vw, 6rem);
  align-items: center;
}

.phone-frame {
  width: min(270px, 80%);
  margin: 0 auto;
  border-radius: 30px;
  padding: 0.9rem;
  border-color: var(--keyline-strong);
}
.phone-notch {
  width: 86px;
  height: 18px;
  margin: 0 auto 0.9rem;
  background: var(--bg-0);
  border-radius: 0 0 12px 12px;
}
.phone-skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-height: 380px;
  padding: 0.4rem 0.5rem;
}
.sk-photo {
  height: 120px;
  border-radius: 10px;
  border: 1px solid var(--keyline);
  background:
    radial-gradient(circle at 30% 40%, rgba(86, 184, 255, 0.1), transparent 55%),
    var(--bg-3);
}
.sk-check-row { display: flex; align-items: center; gap: 0.7rem; }
.sk-check-row .sk-line { flex: 0 1 auto; }
.sk-check {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 4px;
  border: 1.5px solid var(--green);
  position: relative;
}
.sk-check::after {
  content: "";
  position: absolute;
  inset: 3px 3px 5px 3px;
  border-left: 1.5px solid var(--green);
  border-bottom: 1.5px solid var(--green);
  transform: rotate(-45deg);
}

.auditor-copy h2 { margin-bottom: 1.1rem; }
.auditor-copy .section-lede { margin-bottom: 1.6rem; }

@media (max-width: 900px) {
  .auditor-band { grid-template-columns: 1fr; }
}

/* ---------- architecture ---------- */
.arch {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.arch-stack {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 26px;
}

.arch-beam {
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: repeating-linear-gradient(
    180deg,
    var(--green) 0 6px,
    transparent 6px 14px
  );
  opacity: 0.5;
  animation: beam-flow 1.4s linear infinite;
}
@keyframes beam-flow {
  to { background-position: 0 -14px; }
}

.arch-layer {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  text-align: left;
  padding: 0.95rem 1.2rem;
  background: var(--bg-1);
  border: 1px solid var(--keyline);
  border-radius: 10px;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s var(--ease-out);
}
.arch-layer:hover { border-color: var(--keyline-strong); }
.arch-layer.is-active {
  border-color: rgba(52, 224, 124, 0.6);
  background: var(--bg-2);
  transform: translateX(6px);
}

.arch-num { color: var(--text-faint); width: 2rem; flex-shrink: 0; }
.arch-layer.is-active .arch-num { color: var(--green); }
.arch-name { font-weight: 600; font-size: 0.98rem; }

.arch-detail {
  position: sticky;
  top: 110px;
  padding: 2rem;
  border: 1px solid var(--keyline);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 85% 15%, rgba(52, 224, 124, 0.05), transparent 55%),
    var(--bg-1);
  min-height: 220px;
}
.arch-detail-num { color: var(--green); margin-bottom: 0.8rem; }
.arch-detail h3 { font-size: 1.6rem; margin-bottom: 0.8rem; }
.arch-detail p:last-child { color: var(--text-dim); }

@media (max-width: 900px) {
  .arch { grid-template-columns: 1fr; }
  .arch-detail { position: static; min-height: 0; }
}

/* ---------- pillars ---------- */
.pillar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.pillar {
  padding: 1.7rem 1.5rem;
  border: 1px solid var(--keyline);
  border-radius: var(--radius);
  background: var(--bg-1);
  transition: border-color 0.3s ease, transform 0.3s var(--ease-out);
}
.pillar:hover {
  border-color: rgba(52, 224, 124, 0.45);
  transform: translateY(-3px);
}
.pillar svg {
  width: 26px;
  height: 26px;
  color: var(--green);
  margin-bottom: 1.1rem;
}
.pillar h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.pillar p { color: var(--text-dim); font-size: 0.9rem; line-height: 1.6; }

@media (max-width: 980px) { .pillar-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .pillar-grid { grid-template-columns: 1fr; } }

/* ---------- cta ---------- */
.cta {
  position: relative;
  padding: clamp(6rem, 13vw, 10rem) 0;
  text-align: center;
  overflow: hidden;
}
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 55% at 50% 100%, rgba(52, 224, 124, 0.1), transparent 70%);
  pointer-events: none;
}
.cta-inner { position: relative; }
.cta .eyebrow { justify-self: center; }
.cta h2 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); margin-bottom: 1.2rem; }
.cta .section-lede { margin: 0 auto 2.4rem; }
.cta .hero-actions { justify-content: center; }

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--keyline);
  background: var(--bg-1);
  padding: 3.5rem 0 2rem;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
  padding-bottom: 2.5rem;
}
.footer-brand img { height: 20px; width: auto; margin-bottom: 1rem; opacity: 0.9; }
.footer-brand p { color: var(--text-faint); font-size: 0.875rem; line-height: 1.7; }

.footer-links { display: flex; gap: 1.9rem; flex-wrap: wrap; }
.footer-links a {
  font-size: 0.9rem;
  color: var(--text-dim);
  transition: color 0.2s ease;
}
.footer-links a:hover { color: var(--green); }

.footer-legal {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1.5rem;
  border-top: 1px solid var(--keyline);
  color: var(--text-faint);
}

/* ---------- reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease-out) var(--d, 0s),
    transform 0.7s var(--ease-out) var(--d, 0s);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ============================================================
   Signature layer — thread, depth, entrances
   ============================================================ */

main { position: relative; }

/* film grain — barely there, kills the "flat black" look */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: var(--grain-o);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* one light source: faint aura near each section head */
.section::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(720px 340px at 16% 2%, var(--aura-color), transparent 70%);
}

/* consistent top-edge highlight on raised surfaces */
.cap-card, .pillar, .arch-layer, .arch-detail, .chart-wrap,
.browser-frame, .phone-frame, .badge, .sk-tile, .sk-chart {
  box-shadow: inset 0 1px 0 var(--edge-light);
}

/* display scale */
h2 { font-size: clamp(2rem, 4.4vw, 3.4rem); }

/* oversized ghost numerals behind section heads */
.section, .cta { isolation: isolate; }
.section > .container { position: relative; }
.ghost-num {
  position: absolute;
  z-index: -1;
  top: -2.5rem;
  right: clamp(0.5rem, 3vw, 2.5rem);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(7rem, 17vw, 14rem);
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--ghost-fill);
  pointer-events: none;
  user-select: none;
}
@supports (-webkit-text-stroke: 1px black) {
  .ghost-num {
    color: transparent;
    -webkit-text-stroke: 1.5px var(--ghost-stroke);
  }
}

/* the telemetry thread — one line from framework to CTA */
.thread {
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.thread.is-on { opacity: 1; }
.thread-rail {
  position: absolute;
  inset: 0;
  background: var(--keyline);
}
/* stacking: rail < nodes < fill < head, so the green line rides over circles */
.thread-node { z-index: 1; }
.thread-fill { z-index: 2; }
.thread-head { z-index: 3; }
.thread-fill {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0;
  background: linear-gradient(180deg, transparent,
    color-mix(in srgb, var(--green) 55%, transparent) 70%, var(--green));
  box-shadow: 0 0 10px rgba(52, 224, 124, 0.35);
}
.thread-head {
  position: absolute;
  left: 50%;
  top: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 16px rgba(52, 224, 124, 0.9);
  transform: translate(-50%, -50%);
}
.thread-node {
  position: absolute;
  left: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg-0);
  border: 2px solid var(--text-faint);
  transform: translate(-50%, -50%);
  transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}
.thread-node.is-passed {
  border-color: var(--green);
  background: var(--green);
  box-shadow: 0 0 10px rgba(52, 224, 124, 0.7);
}
@media (max-width: 1099px) { .thread { display: none; } }

/* architecture: staggered entrance + packet */
.arch.reveal .arch-layer {
  opacity: 0;
  translate: -16px 0;
  transition: border-color 0.25s ease, background 0.25s ease,
    transform 0.25s var(--ease-out),
    opacity 0.55s var(--ease-out) calc(var(--i, 0) * 70ms),
    translate 0.55s var(--ease-out) calc(var(--i, 0) * 70ms);
}
.arch.reveal.is-in .arch-layer { opacity: 1; translate: 0 0; }

.arch-packet {
  position: absolute;
  left: 4.5px;
  top: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(52, 224, 124, 0.9);
  opacity: 0;
  pointer-events: none;
}

/* edge diagram assembles when it enters view */
.feature-visual.reveal .ed-devices,
.feature-visual.reveal .ed-gateway,
.feature-visual.reveal .ed-cloud {
  opacity: 0;
  translate: 0 12px;
  transition: opacity 0.6s ease, translate 0.6s var(--ease-out);
}
.feature-visual.reveal .edge-diagram .ed-wire,
.feature-visual.reveal .edge-diagram > text {
  opacity: 0;
  transition: opacity 0.6s ease;
}
.feature-visual.reveal.is-in .ed-devices { opacity: 1; translate: 0 0; transition-delay: 0.05s; }
.feature-visual.reveal.is-in .edge-diagram .ed-wire { opacity: 1; transition-delay: 0.35s; }
.feature-visual.reveal.is-in .ed-gateway { opacity: 1; translate: 0 0; transition-delay: 0.45s; }
.feature-visual.reveal.is-in .edge-diagram .ed-uplink,
.feature-visual.reveal.is-in .edge-diagram > text { opacity: 1; transition-delay: 0.65s; }
.feature-visual.reveal.is-in .ed-cloud { opacity: 1; translate: 0 0; transition-delay: 0.75s; }

/* nightjar meter */
#nightjar .feature { padding-top: 0; }
.nightjar-img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 18px 44px rgba(0, 0, 0, 0.45));
}

/* footer link underlines */
.footer-links a { position: relative; }
.footer-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  height: 1px;
  width: 100%;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease-out);
}
.footer-links a:hover::after { transform: scaleX(1); }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .ed-wire, .ed-buf, .arch-beam, .sk-line, .alert-dot { animation: none; }
  .chart-wrap.is-in .ch-actual { animation: none; stroke-dasharray: none; }
  .chart-wrap.is-in .ch-ping { animation: none; opacity: 0.5; }
  .chart-wrap .chart-alert { transition: none; }
  .lifecycle::after { transition: none; }
  .line-inner { animation: none; transform: none; }
  .hero-canvas { opacity: 1; transition: none; }
  .thread { display: none; }
  .arch.reveal .arch-layer { opacity: 1; translate: none; transition: none; }
  .feature-visual.reveal .ed-devices,
  .feature-visual.reveal .ed-gateway,
  .feature-visual.reveal .ed-cloud,
  .feature-visual.reveal .edge-diagram .ed-wire,
  .feature-visual.reveal .edge-diagram > text { opacity: 1; translate: none; transition: none; }
  .nav-indicator { transition: none; }
  * { scroll-behavior: auto !important; }
}
