/* ============================================================
   CyberSpark Labs — styles.css
   Dark defense-tech design system
   ============================================================ */

:root {
  --bg: #05070d;
  --surface: #0a0f1a;
  --surface-2: #0d1422;
  --border: rgba(96, 115, 151, 0.22);
  --border-strong: rgba(96, 115, 151, 0.4);
  --text: #f2f7ff;
  --text-dim: #8c99b0;
  --accent: #4ee1ff;
  --accent-dim: #0a90b8;
  --steel: #607397;
  --steel-dark: #2a3d63;
  --font-head: "Archivo", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --nav-h: 72px;
  --radius: 3px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }

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

h1, h2, h3 { font-family: var(--font-head); line-height: 1.12; letter-spacing: -0.015em; }

h1 { font-size: clamp(2.4rem, 6vw, 4.1rem); font-weight: 700; }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; }
h3 { font-size: 1.12rem; font-weight: 600; }

a { color: inherit; text-decoration: none; }

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

.accent-text { color: var(--accent); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.1rem;
}
.eyebrow::before { content: "// "; color: var(--steel); }

/* ============ Buttons ============ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.9em 1.8em;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease, color 0.3s ease;
  cursor: pointer;
  white-space: nowrap;
}

.btn svg { width: 1.2em; height: 1.2em; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #04121a;
  box-shadow: 0 0 20px rgba(78, 225, 255, 0.2);
}
.btn-primary:hover {
  background: #7deaff;
  border-color: #7deaff;
  box-shadow: 0 0 32px rgba(78, 225, 255, 0.4);
}

.btn-ghost {
  border-color: var(--border-strong);
  color: var(--text);
  background: rgba(96, 115, 151, 0.06);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 20px rgba(78, 225, 255, 0.12);
}

.btn-small {
  padding: 0.6em 1.3em;
  font-size: 0.78rem;
  background: transparent;
  border-color: var(--accent-dim);
  color: var(--accent);
}
.btn-small:hover {
  background: rgba(78, 225, 255, 0.08);
  border-color: var(--accent);
  box-shadow: 0 0 18px rgba(78, 225, 255, 0.18);
}

.btn-large { font-size: 0.95rem; padding: 1.05em 2.4em; }

/* ============ Nav ============ */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: background 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  background: rgba(5, 7, 13, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}

.nav-inner {
  max-width: 1160px;
  margin: 0 auto;
  height: var(--nav-h);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { display: inline-flex; align-items: center; gap: 0.7rem; }
.brand-lockup { width: auto; height: 44px; }
.brand-mark { width: 34px; height: 34px; }
.brand-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.brand-accent { color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a:not(.btn) {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  transition: color 0.2s ease;
}
.nav-links a:not(.btn):hover { color: var(--accent); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============ Hero ============ */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-h) + 2rem) 1.5rem 5.5rem;
  overflow: hidden;
}

/* Technical grid backdrop */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(96, 115, 151, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 115, 151, 0.09) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 45%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 75% 65% at 50% 45%, #000 30%, transparent 100%);
  pointer-events: none;
}

#spark-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-glow {
  position: absolute;
  width: 720px;
  height: 480px;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(10, 144, 184, 0.14), transparent 70%);
  filter: blur(60px);
  pointer-events: none;
}

.hero-content { position: relative; z-index: 2; max-width: 860px; }

.hero-sub {
  margin: 1.6rem auto 2.6rem;
  max-width: 640px;
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-dim);
}

.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.hero-strip {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 2.8rem;
  padding: 1.1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: rgba(5, 7, 13, 0.6);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--steel);
}
.hero-strip span { position: relative; }
.hero-strip span:not(:last-child)::after {
  content: "+";
  position: absolute;
  right: -1.75rem;
  color: var(--steel-dark);
}

/* ============ Sections ============ */

.section {
  position: relative;
  max-width: 1160px;
  margin: 0 auto;
  padding: 6.5rem 1.5rem;
}

.section-alt {
  max-width: none;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(13, 20, 34, 0.5), rgba(10, 15, 26, 0.3));
}
.section-alt > * { max-width: 1160px; margin-left: auto; margin-right: auto; }

.section-head {
  text-align: left;
  max-width: 720px;
  margin-bottom: 3.5rem;
  padding-left: 1.4rem;
  border-left: 2px solid var(--accent-dim);
}
.section-sub {
  margin: 1rem 0 0;
  max-width: 600px;
  color: var(--text-dim);
  font-size: 1.02rem;
}

/* ============ Capability cards ============ */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}

.card {
  position: relative;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.9rem 1.6rem 1.7rem;
  transition: transform 0.25s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Corner brackets */
.card::before,
.card::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid var(--steel);
  opacity: 0.55;
  transition: border-color 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}
.card::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.card::after { bottom: -1px; right: -1px; border-left: none; border-top: none; }

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(78, 225, 255, 0.45);
  box-shadow: 0 0 0 1px rgba(78, 225, 255, 0.08), 0 14px 40px rgba(0, 0, 0, 0.45), 0 0 28px rgba(78, 225, 255, 0.08);
}
.card:hover::before,
.card:hover::after { border-color: var(--accent); opacity: 1; }

.card-num {
  position: absolute;
  top: 1.35rem;
  right: 1.3rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--steel);
}

.card-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  margin-bottom: 1.2rem;
  background: rgba(78, 225, 255, 0.06);
  border: 1px solid rgba(78, 225, 255, 0.28);
  color: var(--accent);
}
.card-icon svg { width: 24px; height: 24px; }

.card h3 { margin-bottom: 0.6rem; }
.card p { color: var(--text-dim); font-size: 0.94rem; }

/* ============ Why grid ============ */

.why-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem 3rem;
  max-width: 900px !important;
}

.why-item {
  position: relative;
  padding-left: 3.6rem;
}

.why-num {
  position: absolute;
  left: 0;
  top: 0.15rem;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--accent);
}
.why-num::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 2.1rem;
  bottom: -0.4rem;
  width: 1px;
  background: linear-gradient(180deg, var(--steel-dark), transparent);
}

.why-item h3 { margin-bottom: 0.4rem; }
.why-item p { color: var(--text-dim); font-size: 0.95rem; }

/* ============ Contact ============ */

.contact { text-align: center; }

.contact-inner {
  position: relative;
  z-index: 2;
  padding: 3.5rem 2rem 4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(13, 20, 34, 0.65), rgba(10, 15, 26, 0.4)),
    radial-gradient(ellipse at 50% 0%, rgba(10, 144, 184, 0.1), transparent 65%);
}
.contact-inner .section-head { border: none; padding: 0; }
.contact-inner .eyebrow { margin-bottom: 1.1rem; }
.contact-inner .section-sub { margin-left: auto; margin-right: auto; }
.contact-inner .btn-large { margin-top: 2.2rem; }

.contact-email { margin-top: 1.4rem; font-family: var(--font-mono); font-size: 0.95rem; }
.contact-email a {
  color: var(--text-dim);
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.contact-email a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ============ Footer ============ */

.footer { border-top: 1px solid var(--border); padding: 2.2rem 1.5rem; }

.footer-inner {
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-note { color: var(--text-dim); font-family: var(--font-mono); font-size: 0.8rem; }
.footer-note a { color: var(--text-dim); transition: color 0.2s ease; }
.footer-note a:hover { color: var(--accent); }

/* ============ Reveal animation ============ */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Stagger cards within a grid */
.card-grid .reveal:nth-child(2) { transition-delay: 0.08s; }
.card-grid .reveal:nth-child(3) { transition-delay: 0.16s; }
.card-grid .reveal:nth-child(4) { transition-delay: 0.08s; }
.card-grid .reveal:nth-child(5) { transition-delay: 0.16s; }
.card-grid .reveal:nth-child(6) { transition-delay: 0.24s; }

/* ============ Responsive ============ */

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

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .brand-lockup { height: 38px; }

  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: center;
    gap: 1.6rem;
    padding: 2rem 1.5rem 2.5rem;
    background: rgba(5, 7, 13, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-130%);
    transition: transform 0.3s ease;
  }
  .nav-links.open { transform: translateY(0); }

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

  .hero-strip { gap: 0.5rem 1.6rem; font-size: 0.66rem; }
  .hero-strip span:not(:last-child)::after { display: none; }
}

@media (max-width: 560px) {
  .card-grid { grid-template-columns: 1fr; }
  .hero-cta .btn { width: 100%; justify-content: center; }
}

/* ============ Reduced motion ============ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
  #spark-canvas { display: none; }
}
