/* ───────────────────────────────────────────
   Reach Technical Operations – Magic Box
   Dark tactical-tech theme
   ─────────────────────────────────────────── */

:root {
  /* surfaces */
  --bg:             #060a13;
  --bg-subtle:      #0b1120;
  --surface:        #111827;
  --surface-raised: #1a2436;
  --surface-glass:  rgba(17, 24, 39, 0.55);

  /* text */
  --text:           #e8ecf1;
  --text-secondary: #94a3b8;
  --text-dim:       #64748b;

  /* brand */
  --accent:         #ff5a1f;
  --accent-bright:  #ff7a45;
  --accent-glow:    rgba(255, 90, 31, 0.25);
  --accent-subtle:  rgba(255, 90, 31, 0.08);

  /* secondary accent – teal/cyber */
  --cyan:           #06b6d4;
  --cyan-glow:      rgba(6, 182, 212, 0.2);

  /* borders */
  --line:           rgba(255, 255, 255, 0.06);
  --line-hover:     rgba(255, 255, 255, 0.12);

  /* effects */
  --shadow:         0 4px 30px rgba(0, 0, 0, 0.4);
  --shadow-lg:      0 20px 60px rgba(0, 0, 0, 0.5);
  --radius:         16px;
  --radius-sm:      10px;
  --max-width:      1200px;

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

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

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: "Inter", "SF Pro Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
}

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

a { color: inherit; }

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

/* ── Container ─────────────────────────── */

.container {
  width: min(calc(100% - 2.5rem), var(--max-width));
  margin: 0 auto;
}

/* ── Header ────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 10, 19, 0.8);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}

.header-inner,
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-inner {
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand-mark {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 0 8px var(--accent-glow));
  transition: filter 300ms var(--ease-out);
}

.brand:hover .brand-mark {
  filter: drop-shadow(0 0 16px var(--accent-glow));
}

/* nav */
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.88rem;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  transition: color 200ms, background 200ms;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

/* mobile menu toggle */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
  transition: color 200ms, border-color 200ms;
}

.nav-toggle:hover {
  color: var(--text);
  border-color: var(--line-hover);
}

/* ── Hero ──────────────────────────────── */

.hero {
  position: relative;
  padding: 6rem 0 4rem;
  overflow: hidden;
}

/* animated grid background */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(var(--bg) 0%, transparent 20%, transparent 80%, var(--bg) 100%),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    linear-gradient(0deg, var(--line) 1px, transparent 1px);
  background-size: 100% 100%, 60px 60px, 60px 60px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 70%);
  animation: gridPulse 8s ease-in-out infinite alternate;
  opacity: 0.4;
}

/* radial glow */
.hero::after {
  content: "";
  position: absolute;
  top: -20%;
  left: 30%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  opacity: 0.5;
  pointer-events: none;
  animation: glowDrift 12s ease-in-out infinite alternate;
}

@keyframes gridPulse {
  0%   { opacity: 0.3; }
  100% { opacity: 0.55; }
}

@keyframes glowDrift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(60px, 30px) scale(1.15); }
}

.hero-grid,
.split-layout {
  display: grid;
  gap: 3rem;
}

.hero-grid {
  position: relative;
  z-index: 1;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  align-items: center;
}

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

.eyebrow {
  margin: 0 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
}

h1, h2, h3 {
  margin-top: 0;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

h1 {
  margin-bottom: 1.25rem;
  font-size: clamp(2.2rem, 4.5vw, 3.8rem);
  font-weight: 800;
  max-width: 16ch;
  background: linear-gradient(135deg, var(--text) 40%, var(--accent-bright));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  margin-bottom: 0.8rem;
  font-size: clamp(1.75rem, 3.2vw, 2.6rem);
  font-weight: 700;
}

h3 {
  margin-bottom: 0.6rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

p { margin-top: 0; }

.hero-text,
.section-heading p,
.card p,
.fact-panel p,
.contact-block p,
.media-card p {
  color: var(--text-secondary);
}

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

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2rem 0 2.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  border: none;
  cursor: pointer;
  transition: transform 200ms var(--ease-out), box-shadow 200ms, background 200ms;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
}

.button-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #e8461a 100%);
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.15);
}

.button-primary:hover,
.button-primary:focus-visible {
  box-shadow: 0 8px 32px rgba(255, 90, 31, 0.4), inset 0 1px 0 rgba(255,255,255,0.15);
}

.button-secondary {
  border: 1px solid var(--line-hover);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ── Hero metrics ──────────────────────── */

.hero-metrics,
.cards,
.spec-grid {
  display: grid;
  gap: 0.75rem;
}

.hero-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hero-metrics div {
  padding: 1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 300ms, box-shadow 300ms;
}

.hero-metrics div:hover {
  border-color: var(--accent-glow);
  box-shadow: 0 0 20px rgba(255, 90, 31, 0.08);
}

.hero-metrics strong {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-bright);
}

.hero-metrics span {
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ── Hero media ────────────────────────── */

.hero-media {
  display: flex;
  justify-content: center;
}

.media-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transition: transform 500ms var(--ease-out), box-shadow 500ms var(--ease-out);
}

.media-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
}

.media-card img {
  width: 100%;
  background: radial-gradient(circle at 50% 30%, #1a2436, #0b1120);
}

.media-card p {
  padding: 1.1rem 1.25rem 1.2rem;
  margin: 0;
  font-size: 0.9rem;
  border-top: 1px solid var(--line);
}

/* ── Sections ──────────────────────────── */

.section {
  padding: 5rem 0;
  position: relative;
}

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

.section-heading {
  max-width: 720px;
  margin-bottom: 2.5rem;
}

.section-heading.left {
  margin-bottom: 1.5rem;
}

/* ── Cards ─────────────────────────────── */

.three-up { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.two-up   { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  position: relative;
  transition: border-color 300ms, transform 300ms var(--ease-out), box-shadow 300ms;
}

.card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: var(--radius);
  padding: 1px;
  background: linear-gradient(135deg, transparent 40%, var(--accent) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 400ms;
  pointer-events: none;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.card:hover::before {
  opacity: 1;
}

.card h3 {
  color: var(--text);
}

.card p:last-child {
  margin-bottom: 0;
}

/* ── Security section ──────────────────── */

.split-layout {
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  align-items: start;
}

.security-callout {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.security-callout h3 {
  font-size: 1rem;
  color: var(--cyan);
  margin-bottom: 1rem;
}

.feature-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  position: relative;
  padding-left: 1.4rem;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan-glow);
}

.feature-list li + li {
  margin-top: 0.7rem;
}

.fact-panel {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--surface) 0%, rgba(6, 182, 212, 0.03) 100%);
}

.fact-panel h3 {
  color: var(--cyan);
}

.key-message {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin: 1.25rem 0;
}

/* ── Spec grid ─────────────────────────── */

.spec-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.spec-item {
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color 300ms;
}

.spec-item:hover {
  border-color: var(--line-hover);
}

.spec-label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--text-dim);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.spec-item strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

/* ── CTA section ───────────────────────── */

.cta-section {
  padding-bottom: 6rem;
}

.cta-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.75fr);
  gap: 2rem;
  padding: 2.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--surface) 0%, rgba(255, 90, 31, 0.04) 100%);
  position: relative;
  overflow: hidden;
}

.cta-card::before {
  content: "";
  position: absolute;
  top: -60%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  opacity: 0.3;
  pointer-events: none;
}

.contact-block p {
  margin-bottom: 0.5rem;
}

.contact-block strong {
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.contact-block a {
  text-decoration: none;
  transition: color 200ms;
}

.contact-block a:hover,
.contact-block a:focus-visible {
  color: var(--accent-bright);
}

/* ── Footer ────────────────────────────── */

.site-footer {
  padding: 1.5rem 0 2rem;
  border-top: 1px solid var(--line);
}

.site-footer p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ── Scroll reveal ─────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
}

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

/* stagger children */
.reveal-stagger .card,
.reveal-stagger .spec-item,
.reveal-stagger .hero-metrics div {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out);
}

.reveal-stagger.visible .card,
.reveal-stagger.visible .spec-item,
.reveal-stagger.visible .hero-metrics div {
  opacity: 1;
  transform: translateY(0);
}

/* stagger delays (set via JS data-attribute, but define base here) */
.reveal-stagger.visible .card:nth-child(1),
.reveal-stagger.visible .spec-item:nth-child(1),
.reveal-stagger.visible .hero-metrics div:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger.visible .card:nth-child(2),
.reveal-stagger.visible .spec-item:nth-child(2),
.reveal-stagger.visible .hero-metrics div:nth-child(2) { transition-delay: 80ms; }
.reveal-stagger.visible .card:nth-child(3),
.reveal-stagger.visible .spec-item:nth-child(3),
.reveal-stagger.visible .hero-metrics div:nth-child(3) { transition-delay: 160ms; }
.reveal-stagger.visible .card:nth-child(4),
.reveal-stagger.visible .spec-item:nth-child(4),
.reveal-stagger.visible .hero-metrics div:nth-child(4) { transition-delay: 240ms; }
.reveal-stagger.visible .card:nth-child(5),
.reveal-stagger.visible .spec-item:nth-child(5) { transition-delay: 320ms; }
.reveal-stagger.visible .card:nth-child(6),
.reveal-stagger.visible .spec-item:nth-child(6) { transition-delay: 400ms; }
.reveal-stagger.visible .card:nth-child(7),
.reveal-stagger.visible .spec-item:nth-child(7) { transition-delay: 480ms; }
.reveal-stagger.visible .card:nth-child(8),
.reveal-stagger.visible .spec-item:nth-child(8) { transition-delay: 560ms; }

/* ── Responsive ────────────────────────── */

@media (max-width: 1024px) {
  .hero-grid,
  .split-layout,
  .cta-card {
    grid-template-columns: 1fr;
  }

  .three-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .spec-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    padding: 4.5rem 0 3rem;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    padding: 0.75rem 1.25rem 1rem;
    background: rgba(6, 10, 19, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--line);
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    padding: 0.65rem 0.5rem;
    font-size: 0.95rem;
  }

  .three-up,
  .two-up,
  .spec-grid {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 3.5rem 0 2.5rem;
  }

  h1 {
    max-width: none;
  }

  .hero-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section {
    padding: 3.5rem 0;
  }

  .cta-card {
    padding: 1.75rem;
  }
}

@media (max-width: 480px) {
  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .brand span {
    font-size: 0.82rem;
  }
}

/* ── Reduced motion ────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .reveal-stagger .card,
  .reveal-stagger .spec-item,
  .reveal-stagger .hero-metrics div {
    opacity: 1;
    transform: none;
  }
}
