/* ==========================================================================
   StealerHunt — design system
   Ported 1:1 from the original Next.js build's design tokens.
   Hand-authored semantic CSS (no build step) so the theme stays editable.
   ========================================================================== */

:root {
  /* Typography */
  --font-sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Sora", "Instrument Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Surfaces */
  --surface: #ffffff;
  --canvas: #f7f8fa;
  --canvas-2: #eef1f6;
  --mist: #edf2fa;

  /* Ink */
  --ink: #0f1222;
  --ink-2: #5b6072;
  --ink-3: #7a8095;

  /* Brand */
  --accent: #3866f0;
  --accent-hover: #2b54d4;
  --link: #2b54d4;
  --brand: #009cff;
  --brand-light: #6ec6ff;
  --brand-soft: #eaf0ff;
  --violet: #6d5de6;
  --teal: #0d9488;

  /* Night */
  --night: #070d1a;
  --night-2: #0b1426;
  --night-edge: #16233d;
  --abyss: #04070f;

  /* Lines */
  --line: #e7e9ee;
  --line-strong: #d5dae3;

  /* Risk */
  --warning: #b45309;
  --risk-critical: #991b1b;
  --risk-high: #dc2626;
  --risk-medium: #b45309;
  --risk-low: #15803d;

  /* Radii */
  --r-md: 0.375rem;
  --r-lg: 0.5rem;
  --r-xl: 0.75rem;
  --r-2xl: 1rem;
  --r-3xl: 1.5rem;
  --r-card: 0.875rem;

  /* Elevation */
  --shadow-card: 0 1px 2px rgb(15 18 34 / 0.04), 0 2px 8px rgb(15 18 34 / 0.05);
  --shadow-card-hover: 0 2px 4px rgb(15 18 34 / 0.05), 0 14px 30px -10px rgb(56 102 240 / 0.2);
  --shadow-float: 0 4px 12px rgb(15 18 34 / 0.07), 0 24px 60px -16px rgb(15 18 34 / 0.16);
  --shadow-pop: 0 1px 3px rgb(15 18 34 / 0.08), 0 32px 80px -20px rgb(56 102 240 / 0.26);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Reset ───────────────────────────────────────────────────────────────── */

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

* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg, video { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }
hr { border: 0; border-top: 1px solid var(--line); }

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

.sh-skip-link {
  position: absolute;
  left: -9999px;
  z-index: 100;
}
.sh-skip-link:focus {
  left: 0.75rem;
  top: 0.75rem;
  background: var(--surface);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.625rem 1rem;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-float);
}

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

/* ── Layout primitives ───────────────────────────────────────────────────── */

.container-site {
  width: 100%;
  max-width: 76rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}
@media (min-width: 640px) { .container-site { padding-inline: 2rem; } }
@media (min-width: 1024px) { .container-site { padding-inline: 2.5rem; } }

.sh-main { flex: 1; }

.band { background: var(--surface); }
.band-alt { background: var(--canvas); }
.band-seam { box-shadow: inset 0 1px 0 var(--line); }

.section { padding-block: 5rem; }
@media (min-width: 640px) { .section { padding-block: 7rem; } }
.section-sm { padding-block: 3.5rem; }
@media (min-width: 640px) { .section-sm { padding-block: 5rem; } }

.horizon-line {
  height: 1px;
  width: 100%;
  background-image: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 55%, transparent) 50%, transparent);
}
.horizon-line--brand {
  background-image: linear-gradient(90deg, transparent, color-mix(in srgb, var(--brand) 60%, transparent) 50%, transparent);
}

/* Dark ambience — used by heroes and dark interludes */
.night-mesh {
  background-color: var(--night);
  background-image:
    radial-gradient(40rem 28rem at 16% 0%, rgb(0 156 255 / 0.13), transparent 60%),
    radial-gradient(36rem 26rem at 86% 100%, rgb(109 93 230 / 0.1), transparent 62%);
}
.night-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgb(255 255 255 / 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(255 255 255 / 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 30%, black 30%, transparent 85%);
  mask-image: radial-gradient(ellipse 90% 80% at 50% 30%, black 30%, transparent 85%);
}

/* ── Typography scale ────────────────────────────────────────────────────── */

.text-h1 {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 1.6rem + 2.6vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.028em;
  font-weight: 600;
}
.text-h2 {
  font-family: var(--font-display);
  font-size: clamp(1.625rem, 1.2rem + 1.4vw, 2.125rem);
  line-height: 1.15;
  letter-spacing: -0.022em;
  font-weight: 600;
}
.text-h3 {
  font-family: var(--font-display);
  font-size: 1.375rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
  font-weight: 600;
}
.text-h4 {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
  font-weight: 600;
}
.text-lede {
  font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);
  line-height: 1.55;
  color: var(--ink-2);
}
.text-body { font-size: 0.9375rem; line-height: 1.65; color: var(--ink-2); }
.text-small { font-size: 0.875rem; line-height: 1.6; color: var(--ink-2); }
.text-micro { font-size: 0.8125rem; line-height: 1.55; color: var(--ink-3); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.eyebrow--accent { color: var(--accent); }
/* On the night bands the muted ink tone falls below contrast — use the brand. */
.eyebrow--dark { color: var(--brand-light); }
.mono { font-family: var(--font-mono); }
.tabular { font-variant-numeric: tabular-nums; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--r-xl);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.625rem 1.25rem;
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background-color 150ms, border-color 150ms, box-shadow 150ms, transform 150ms, color 150ms;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; pointer-events: none; }
.btn-lg { padding: 0.875rem 1.75rem; font-size: 1rem; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 1px 2px rgb(10 15 30 / 0.12), inset 0 1px 0 rgb(255 255 255 / 0.18);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 2px 8px rgb(0 114 198 / 0.35), inset 0 1px 0 rgb(255 255 255 / 0.18);
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
  box-shadow: 0 1px 2px rgb(10 15 30 / 0.05);
}
.btn-secondary:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  color: var(--accent);
  box-shadow: 0 2px 8px rgb(0 114 198 / 0.12);
}

.btn-inverse {
  background: #fff;
  color: var(--ink);
  border-color: #fff;
  box-shadow: 0 2px 12px rgb(0 156 255 / 0.25);
}
.btn-inverse:hover { background: var(--brand-soft); border-color: var(--brand-soft); }

.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover { color: var(--ink); background: rgb(15 18 34 / 0.04); }

.btn-ghost-inverse { color: rgb(255 255 255 / 0.8); }
.btn-ghost-inverse:hover { color: #fff; background: rgb(255 255 255 / 0.07); }

/* ── Cards & panels ──────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
}
.card-pad { padding: 1.5rem; }
.card-hover { transition: border-color 180ms ease, box-shadow 200ms ease, transform 200ms ease; }
.card-hover:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-3px);
}

/* Dark surface panel (inside night bands) */
.panel {
  background-image: linear-gradient(180deg, rgb(255 255 255 / 0.06), rgb(255 255 255 / 0.015));
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: var(--r-card);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.05), 0 18px 40px -26px rgb(0 0 0 / 0.8);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 9999px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 0.25rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.pill--dark {
  border-color: rgb(255 255 255 / 0.15);
  background: rgb(255 255 255 / 0.05);
  color: rgb(255 255 255 / 0.75);
  backdrop-filter: blur(8px);
}

.dot {
  position: relative;
  display: inline-flex;
  height: 0.5rem;
  width: 0.5rem;
  align-items: center;
  justify-content: center;
  flex: none;
}
.dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--accent) 50%, transparent);
  animation: signal-pulse 2.2s ease-in-out infinite;
}
.dot::before {
  content: "";
  position: relative;
  height: 0.375rem;
  width: 0.375rem;
  border-radius: 9999px;
  background: var(--accent);
  z-index: 1;
}
.dot--brand::after { background: color-mix(in srgb, var(--brand) 55%, transparent); }
.dot--brand::before { background: var(--brand); }

/* ── Section header ──────────────────────────────────────────────────────── */

.section-header { display: flex; flex-direction: column; gap: 1rem; }
.section-header--left {
  align-items: flex-start;
  border-left: 2px solid var(--accent);
  padding-left: 1.5rem;
}
.section-header--center { align-items: center; text-align: center; }
.section-header--center .section-header__rule {
  height: 2px;
  width: 2.5rem;
  border-radius: 9999px;
  background: var(--accent);
}
.section-header .text-lede { max-width: 42rem; }
.section-header--dark .text-h2 { color: #fff; }
.section-header--dark .text-lede { color: rgb(255 255 255 / 0.7); }
.section-header--dark .eyebrow { color: rgb(255 255 255 / 0.45); }
.section-header--dark { border-left-color: var(--brand); }
.section-header--dark .section-header__rule { background: var(--brand); }

/* ── Animations ──────────────────────────────────────────────────────────── */

@keyframes signal-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scan-sweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@keyframes spin { to { transform: rotate(360deg); } }

.animate-fade-in-up { animation: fade-in-up 0.6s var(--ease-out) both; }
.stagger-1 { animation-delay: 90ms; }
.stagger-2 { animation-delay: 180ms; }
.stagger-3 { animation-delay: 270ms; }
.stagger-4 { animation-delay: 360ms; }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(20px); }
.reveal.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
