/* ==========================================================================
   Averra Security — base.css
   Tokens, reset, typography, shared primitives
   ========================================================================== */

:root {
  /* Surfaces */
  --bg: #0A0F14;
  --bg-2: #0F1720;
  --bg-3: #111827;
  --line: rgba(148, 163, 184, 0.14);
  --line-strong: rgba(148, 163, 184, 0.28);

  /* Brand green (from the Averra mark) */
  --green: #3FD37A;
  --green-deep: #128A4B;
  --green-soft: #86EFAC;
  --green-ink: #062B18;
  --grad: linear-gradient(135deg, #3FD37A 0%, #14B87A 100%);
  --grad-text: linear-gradient(120deg, #F8FAFC 0%, #B9F5D1 45%, #3FD37A 100%);

  /* Signal colours (used only for alert states) */
  --amber: #FBBF24;
  --red: #F87171;

  /* Text */
  --fg: #F8FAFC;
  --fg-2: #94A3B8;
  --fg-3: #64748B;

  /* Type */
  --font: "Manrope", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-hero: clamp(2.5rem, 5.6vw, 5.4rem);
  --fs-h2: clamp(2rem, 4.6vw, 3.9rem);
  --fs-h3: clamp(1.25rem, 2vw, 1.6rem);
  --fs-lead: clamp(1.05rem, 1.35vw, 1.25rem);
  --fs-body: 1rem;
  --fs-small: 0.8125rem;
  --fs-micro: 0.6875rem;

  /* Layout */
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --max: 1280px;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 30px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --t-fast: 180ms;
  --t-med: 420ms;
  --t-slow: 900ms;

  --header-h: 72px;
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, svg, video, canvas { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: fixed; top: -100px; left: 16px; z-index: 1000;
  padding: 10px 16px; background: var(--green); color: var(--green-ink);
  border-radius: var(--r-sm); font-weight: 700;
  transition: top var(--t-fast) var(--ease);
}
.skip-link:focus { top: 16px; }

/* Layout helpers */
.wrap { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; }
.section { position: relative; padding-block: clamp(5rem, 11vw, 9.5rem); }
.section--tight { padding-block: clamp(3.5rem, 7vw, 6rem); }

/* Type */
.h2 {
  font-size: var(--fs-h2);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.h3 { font-size: var(--fs-h3); font-weight: 700; line-height: 1.2; letter-spacing: -0.015em; }
.lead { font-size: var(--fs-lead); color: var(--fg-2); line-height: 1.55; max-width: 34em; text-wrap: pretty; }
.text-grad {
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: var(--fs-small); font-weight: 600; color: var(--green);
  margin-bottom: 1.25rem;
}
.kicker::before {
  content: ""; width: 22px; height: 2px; background: var(--grad); border-radius: 2px;
}
.mono { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }

/* Buttons */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  border-radius: 999px; font-weight: 700; font-size: 0.95rem;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-med) var(--ease),
              background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease);
  will-change: transform;
  white-space: nowrap;
}
.btn--primary {
  background: var(--grad); color: var(--green-ink);
  box-shadow: 0 10px 30px -12px rgba(63, 211, 122, 0.55);
}
.btn--primary:hover { box-shadow: 0 16px 40px -12px rgba(63, 211, 122, 0.7); }
.btn--ghost {
  border: 1px solid var(--line-strong); color: var(--fg);
  background: rgba(15, 23, 32, 0.4);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.btn--ghost:hover { border-color: var(--green); color: var(--green-soft); }
.btn--sm { min-height: 40px; padding: 0 16px; font-size: 0.85rem; }
.btn .ico { width: 16px; height: 16px; }

/* Status dot */
.dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 0 0 rgba(63, 211, 122, 0.6);
  animation: pulse 2.2s var(--ease-io) infinite;
}
.dot--red { background: var(--red); box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.6); animation-name: pulse-red; }
.dot--amber { background: var(--amber); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(63,211,122,.55); } 70% { box-shadow: 0 0 0 9px rgba(63,211,122,0); } 100% { box-shadow: 0 0 0 0 rgba(63,211,122,0); } }
@keyframes pulse-red { 0% { box-shadow: 0 0 0 0 rgba(248,113,113,.55); } 70% { box-shadow: 0 0 0 9px rgba(248,113,113,0); } 100% { box-shadow: 0 0 0 0 rgba(248,113,113,0); } }

/* Glass surface (used sparingly) */
.glass {
  background: rgba(15, 23, 32, 0.62);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

/* Scroll reveal primitives */
.rv { opacity: 0; transform: translate3d(0, 22px, 0); filter: blur(6px);
      transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease), filter var(--t-slow) var(--ease); }
.rv.is-in { opacity: 1; transform: none; filter: blur(0); }
.rv[data-delay="1"] { transition-delay: 90ms; }
.rv[data-delay="2"] { transition-delay: 180ms; }
.rv[data-delay="3"] { transition-delay: 270ms; }
.rv[data-delay="4"] { transition-delay: 360ms; }

/* Reduced motion: everything settles instantly */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .rv { opacity: 1; transform: none; filter: none; }
}
