/* Resurgent Technologies — www
   Motif: geometric logo (white line art) + danger/perimeter contrast.
   Avoid generic “AI purple gradient” and soft SaaS blue. */

@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Space+Grotesk:wght@500;600;700&family=Source+Sans+3:ital,wght@0,400;0,600;0,700;1,400&display=swap");

:root {
  --bg: #07080b;
  --bg-elevated: #0e1016;
  --bg-alt: #0c0e14;
  --fg: #f2f4f8;
  --muted: #9aa3b5;
  --muted-2: #6b7385;
  --border: #1e2433;
  --border-strong: #2c3548;
  --card: #12151e;
  --card-hover: #161b28;

  /* Ice / blueprint — matches white geometric logo, not soft product-blue */
  --accent: #7ee0ff;
  --accent-dim: color-mix(in srgb, var(--accent) 14%, transparent);
  --accent-glow: color-mix(in srgb, var(--accent) 35%, transparent);
  --accent-fg: #041018;

  /* Danger / paradox — sparingly */
  --warn: #ff8a4c;
  --warn-dim: color-mix(in srgb, var(--warn) 16%, transparent);
  --safe: #5dffa8;
  --safe-dim: color-mix(in srgb, var(--safe) 12%, transparent);

  --max: 42rem;
  --wide: 68rem;
  --font: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Space Grotesk", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --radius: 0.65rem;
  --shadow-glow: 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent),
    0 0 40px -8px var(--accent-glow);
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Blueprint grid under everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    linear-gradient(color-mix(in srgb, var(--accent) 5%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 5%, transparent) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 20%, transparent 75%);
  opacity: 0.55;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 0.15s ease;
}

a:hover {
  color: #b6efff;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-fg);
  padding: 0.5rem 1rem;
  z-index: 100;
  font-weight: 600;
}

.skip:focus {
  left: 0.5rem;
  top: 0.5rem;
}

.wrap {
  width: min(100% - 2rem, var(--wide));
  margin-inline: auto;
}

.prose {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* ——— Header ——— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 0.9rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}

.brand-logo {
  display: block;
  height: 2.15rem;
  width: auto;
  max-width: min(240px, 50vw);
  filter: drop-shadow(0 0 12px color-mix(in srgb, var(--accent) 25%, transparent));
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.15rem;
  font-size: 0.9rem;
  font-family: var(--mono);
  letter-spacing: 0.02em;
}

.nav a:not(.btn) {
  color: var(--muted);
  text-decoration: none;
  padding: 0.4rem 0.65rem;
  border-radius: 0.35rem;
}

.nav a:not(.btn):hover {
  color: var(--fg);
  background: color-mix(in srgb, var(--fg) 6%, transparent);
}

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.15rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent),
    0 8px 28px -6px var(--accent-glow);
}

.btn-primary:hover {
  background: #a8ebff;
  color: var(--accent-fg);
  box-shadow: 0 0 0 1px var(--accent), 0 12px 36px -4px var(--accent-glow);
}

.btn-ghost {
  border-color: var(--border-strong);
  color: var(--fg);
  background: color-mix(in srgb, var(--fg) 3%, transparent);
}

.btn-ghost:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  color: var(--fg);
  background: var(--accent-dim);
}

.btn-lg {
  padding: 0.8rem 1.4rem;
  font-size: 1.02rem;
}

/* ——— Hero ——— */
.hero {
  position: relative;
  padding: 5.5rem 0 4.5rem;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto;
  height: 70%;
  background:
    radial-gradient(ellipse 50% 60% at 50% 0%, var(--accent-dim), transparent 70%),
    radial-gradient(ellipse 30% 40% at 80% 20%, var(--warn-dim), transparent 60%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  width: min(100% - 2rem, 46rem);
}

.hero-logo {
  display: block;
  width: min(100%, 32rem);
  height: auto;
  margin: 0 0 2rem;
  filter: drop-shadow(0 0 28px color-mix(in srgb, var(--accent) 30%, transparent));
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 500;
  background: var(--accent-dim);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: 999px;
}

.hero h1 {
  margin: 0 0 1.15rem;
  font-family: var(--display);
  font-size: clamp(2.35rem, 6vw, 3.35rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.035em;
  max-width: 14ch;
  background: linear-gradient(180deg, #fff 30%, color-mix(in srgb, var(--accent) 55%, #fff) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  margin: 0 0 2rem;
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 38rem;
  line-height: 1.7;
}

.lede strong {
  color: var(--fg);
  font-weight: 600;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
}

.hero-proof,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 1.5rem 0 0;
  padding: 0;
  border: none;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  text-transform: none;
  color: var(--fg);
}

.hero-proof span,
.chip-row span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, var(--card));
  color: var(--fg);
}

.hero-proof span::before,
.chip-row span::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  flex-shrink: 0;
}

.prose-wide {
  width: min(100% - 2rem, 52rem);
}

/* ——— Demo panels (Markdown + amber terminal, BitFlux-inspired motion) ——— */
.demo-pair {
  display: grid;
  gap: 1rem;
  margin: 2rem 0 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 800px) {
  .demo-pair {
    grid-template-columns: 1fr 1fr;
  }
}

.demo-panel {
  margin: 0;
}

.demo-panel figcaption {
  margin: 0 0 0.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.demo-screen {
  position: relative;
  border-radius: 0.5rem;
  overflow: hidden;
  min-height: 14.5rem;
  border: 1px solid var(--border-strong);
}

.demo-screen-md {
  background: #0d1118;
  box-shadow: inset 0 0 40px color-mix(in srgb, var(--accent) 8%, transparent);
}

.demo-screen-term {
  /* Amber monochrome CRT, BitFlux-style motion language */
  background: #120e06;
  border-color: color-mix(in srgb, #ffb000 35%, #333);
  box-shadow:
    inset 0 0 60px rgba(255, 140, 0, 0.08),
    0 0 24px rgba(255, 160, 0, 0.08);
}

.demo-screen-term::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.12) 2px,
    rgba(0, 0, 0, 0.12) 3px
  );
  opacity: 0.45;
  animation: term-scan 8s linear infinite;
}

@keyframes term-scan {
  0% {
    opacity: 0.35;
  }
  50% {
    opacity: 0.55;
  }
  100% {
    opacity: 0.35;
  }
}

.md-type,
.term-type {
  margin: 0;
  padding: 1rem 1.1rem 1.25rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.md-type {
  color: #c8d0dc;
}

.md-type .md-line {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  width: 0;
  animation: type-line 0.01s linear forwards;
  border-right: 0;
}

/* Stagger “typing” reveal — loops */
.md-type .md-line:nth-child(1) {
  animation: type-line 12s steps(28, end) infinite;
}
.md-type .md-line:nth-child(2) {
  animation: type-line 12s steps(2, end) infinite;
  animation-delay: 0.9s;
}
.md-type .md-line:nth-child(3) {
  animation: type-line 12s steps(8, end) infinite;
  animation-delay: 1.1s;
}
.md-type .md-line:nth-child(4) {
  animation: type-line 12s steps(28, end) infinite;
  animation-delay: 1.6s;
}
.md-type .md-line:nth-child(5) {
  animation: type-line 12s steps(28, end) infinite;
  animation-delay: 2.4s;
}
.md-type .md-line:nth-child(6) {
  animation: type-line 12s steps(2, end) infinite;
  animation-delay: 3.1s;
}
.md-type .md-line:nth-child(7) {
  animation: type-line 12s steps(8, end) infinite;
  animation-delay: 3.3s;
}
.md-type .md-line:nth-child(8) {
  animation: type-line 12s steps(24, end) infinite;
  animation-delay: 3.8s;
}
.md-type .md-line:nth-child(9) {
  animation: type-line 12s steps(28, end) infinite;
  animation-delay: 4.6s;
}

@keyframes type-line {
  0%,
  4% {
    width: 0;
  }
  18%,
  78% {
    width: 100%;
  }
  92%,
  100% {
    width: 0;
  }
}

.md-cursor {
  color: var(--accent);
  animation: blink-cursor 1s step-end infinite;
}

.term-type {
  color: #ffb000;
  text-shadow:
    0 0 4px rgba(255, 160, 0, 0.55),
    0 0 12px rgba(255, 120, 0, 0.25);
  letter-spacing: 0.02em;
  animation: term-flicker 3.5s infinite;
}

.term-type .term-line {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  width: 0;
}

.term-type .term-line:nth-child(1) {
  animation: type-line 14s steps(32, end) infinite;
}
.term-type .term-line:nth-child(2) {
  animation: type-line 14s steps(22, end) infinite;
  animation-delay: 1.2s;
}
.term-type .term-line:nth-child(3) {
  animation: type-line 14s steps(36, end) infinite;
  animation-delay: 2s;
}
.term-type .term-line:nth-child(4) {
  animation: type-line 14s steps(36, end) infinite;
  animation-delay: 3s;
}
.term-type .term-line:nth-child(5) {
  animation: type-line 14s steps(24, end) infinite;
  animation-delay: 4.2s;
}
.term-type .term-line:nth-child(6) {
  animation: type-line 14s steps(18, end) infinite;
  animation-delay: 5.2s;
}
.term-type .term-line:nth-child(7) {
  animation: type-line 14s steps(42, end) infinite;
  animation-delay: 6s;
}
.term-type .term-line:nth-child(8) {
  animation: type-line 14s steps(4, end) infinite;
  animation-delay: 7.2s;
}

.term-cursor {
  animation: blink-cursor 1s step-end infinite;
}

@keyframes blink-cursor {
  50% {
    opacity: 0;
  }
}

@keyframes term-flicker {
  0%,
  19%,
  21%,
  23%,
  25%,
  54%,
  56%,
  100% {
    opacity: 1;
  }
  20%,
  24%,
  55% {
    opacity: 0.82;
  }
}

.demo-note {
  margin-top: 0.25rem !important;
  font-size: 0.98rem;
}

@media (prefers-reduced-motion: reduce) {
  .md-type .md-line,
  .term-type .term-line {
    animation: none !important;
    width: 100% !important;
  }

  .md-cursor,
  .term-cursor,
  .term-type,
  .demo-screen-term::after {
    animation: none !important;
  }
}

/* ——— Sections ——— */
.band {
  position: relative;
  padding: 4.25rem 0;
  border-bottom: 1px solid var(--border);
}

.band-alt {
  background: linear-gradient(180deg, var(--bg-alt), var(--bg));
}

.section-label {
  display: block;
  margin: 0 0 0.75rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-label.warn {
  color: var(--warn);
}

.prose h2 {
  margin: 0 0 1.15rem;
  font-family: var(--display);
  font-size: clamp(1.7rem, 3.5vw, 2.15rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.18;
}

.prose h3 {
  margin: 0 0 0.45rem;
  font-family: var(--display);
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.prose p {
  margin: 0 0 1.05rem;
  color: var(--muted);
}

.prose p strong {
  color: var(--fg);
  font-weight: 600;
}

/* Pull quote — the competitive differentiator moment */
.prose blockquote,
.pull-quote {
  margin: 2rem 0;
  padding: 1.5rem 1.4rem 1.5rem 1.5rem;
  border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--border));
  border-left: 3px solid var(--warn);
  background:
    linear-gradient(135deg, var(--warn-dim), transparent 55%),
    var(--card);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--fg);
  font-family: var(--display);
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -0.015em;
  box-shadow: 0 12px 40px -20px color-mix(in srgb, var(--warn) 40%, transparent);
}

.pull-quote strong {
  color: #ffc9a8;
  font-weight: 650;
}

.section-lede {
  margin-bottom: 1.75rem !important;
  font-size: 1.08rem;
}

.subhead {
  margin: 2.25rem 0 1rem !important;
  font-family: var(--display);
}

/* Danger / safe compare strip */
.compare {
  display: grid;
  gap: 0.85rem;
  margin: 1.75rem 0 0.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .compare {
    grid-template-columns: 1fr 1fr;
  }
}

.compare-card {
  margin: 0;
  padding: 1.15rem 1.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
}

.compare-card h3 {
  margin: 0 0 0.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.compare-card p {
  margin: 0;
  font-size: 0.98rem;
  color: var(--muted);
  line-height: 1.5;
}

.compare-card.bad {
  border-color: color-mix(in srgb, var(--warn) 40%, var(--border));
  background: linear-gradient(160deg, var(--warn-dim), var(--card) 60%);
}

.compare-card.bad h3 {
  color: var(--warn);
}

.compare-card.good {
  border-color: color-mix(in srgb, var(--safe) 35%, var(--border));
  background: linear-gradient(160deg, var(--safe-dim), var(--card) 60%);
}

.compare-card.good h3 {
  color: var(--safe);
}

/* Cards */
.cards {
  list-style: none;
  margin: 1.85rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(14.5rem, 1fr));
}

.cards-3 {
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
}

.cards li {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.2rem 1.2rem;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease,
    transform 0.15s ease;
}

.cards li:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: var(--card-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.cards li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 1.1rem;
  right: 1.1rem;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.55;
  border-radius: 0 0 2px 2px;
}

.cards h3 {
  color: var(--fg);
}

.cards p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

/* Steps as numbered rails */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
  display: grid;
  gap: 0.75rem;
}

.steps li {
  counter-increment: step;
  position: relative;
  margin: 0;
  padding: 1rem 1rem 1rem 3.4rem;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.steps strong {
  color: var(--fg);
  font-weight: 600;
}

.quiet h2 {
  font-size: 1.55rem;
}

/* CTA band */
.cta-band {
  position: relative;
  padding: 4.5rem 0;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 80% at 50% 100%, var(--accent-dim), transparent 65%),
    radial-gradient(ellipse 30% 50% at 10% 50%, var(--warn-dim), transparent 60%);
  pointer-events: none;
}

.cta-band-inner {
  position: relative;
  width: min(100% - 2rem, 36rem);
  text-align: center;
}

.cta-band h2 {
  margin: 0 0 1.5rem;
  font-family: var(--display);
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.cta-band .cta-row {
  justify-content: center;
}

/* Footer */
.site-footer {
  padding: 2rem 0 2.75rem;
  color: var(--muted-2);
  font-size: 0.88rem;
  font-family: var(--mono);
  letter-spacing: 0.02em;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  align-items: center;
}

.footer-inner p {
  margin: 0;
}

.footer-inner a {
  color: var(--muted);
  text-decoration: none;
}

.footer-inner a:hover {
  color: var(--accent);
}

@media (max-width: 720px) {
  .hero {
    padding-top: 3.5rem;
  }

  .hero h1 {
    max-width: none;
  }

  .nav .btn-primary {
    width: 100%;
  }

  .nav {
    width: 100%;
  }
}
