/* ===================================================================
   Alex Buzgoi — site styles
   Organised: reset → tokens → typography → layout → components →
              page blocks → media queries
   =================================================================== */

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

html, body, h1, h2, h3, h4, p, ul, ol, li, figure, blockquote, dl, dd { margin: 0; }

ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }

html { -moz-text-size-adjust: none; -webkit-text-size-adjust: none; text-size-adjust: none; scroll-behavior: smooth; }

body { min-height: 100vh; line-height: 1.6; -webkit-font-smoothing: antialiased; }

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

input, button, textarea, select { font: inherit; color: inherit; }

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

button { background: none; border: 0; cursor: pointer; }

/* ---------- Design tokens ---------- */
:root {
  --bg:           #0d0d0f;
  --bg-elev:      #16161a;
  --bg-elev-2:    #1f1f25;
  --fg:           #f5f5f5;
  --fg-muted:     #b5b5bd;
  --fg-dim:       #7a7a82;
  --accent:       #d62828;
  --accent-hover: #ef3b3b;
  --accent-text:  #ee4444; /* lighter shade of accent for text-on-dark; meets WCAG AA on --bg and --bg-elev */
  --border:       #2a2a32;
  --success:      #2e8b57;
  --error:        #ff5454;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Archivo Black", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;

  --max-w: 1100px;
  --pad-x: clamp(1rem, 4vw, 2rem);

  --radius: 4px;

  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.5);
}

/* ---------- Typography ---------- */
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  font-size: 17px;
}

h1, h2 {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
h3 {
  font-family: var(--font-sans);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

h1 { font-size: clamp(2.25rem, 7vw, 4.5rem); text-transform: uppercase; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.6rem, 4.2vw, 2.5rem); text-transform: uppercase; letter-spacing: -0.025em; }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.4rem); }

p { color: var(--fg-muted); }

.subtitle { color: var(--fg-muted); font-size: clamp(1rem, 1.8vw, 1.15rem); }

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

/* ---------- Layout primitives ---------- */
.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding-inline: var(--pad-x); }

.section { padding-block: clamp(3rem, 8vw, 6rem); }

.section--alt { background: var(--bg-elev); }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 1rem; top: 1rem; background: var(--accent); color: #fff; padding: 0.5rem 1rem; z-index: 100; }

/* ---------- Header & nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 3px solid var(--accent);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1rem;
}

.site-logo {
  font-weight: 900;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.site-logo span { color: var(--accent); }

.nav-toggle {
  display: block;
  padding: 0.5rem;
  color: var(--fg);
}
.nav-toggle::before { content: "☰"; font-size: 1.5rem; }
.nav-toggle[aria-expanded="true"]::before { content: "✕"; }

.site-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}
.site-nav[data-open="true"] { display: block; }

.site-nav ul { list-style: none; padding: 0; margin: 0; }
.site-nav a {
  display: block;
  padding: 1rem var(--pad-x);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border);
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent-text); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg-elev);
  border-top: 1px solid var(--border);
  padding-block: 2rem;
  font-size: 0.9rem;
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  align-items: center;
}
.site-footer p { color: var(--fg-dim); }
.site-footer a:hover { color: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.95rem 1.6rem;
  font-weight: 800;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: var(--radius);
  transition: background 0.15s, color 0.15s, transform 0.05s;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); }
.btn--ghost { border: 2px solid var(--fg); color: var(--fg); padding: calc(0.95rem - 2px) calc(1.6rem - 2px); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn:active { transform: translateY(1px); }

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

/* ---------- Responsive (desktop ≥ 768px) ---------- */
@media (min-width: 768px) {
  .nav-toggle { display: none; }
  .site-nav {
    display: block;
    position: static;
    background: transparent;
    border: 0;
  }
  .site-nav ul {
    display: flex;
    gap: 2rem;
  }
  .site-nav a {
    padding: 0.5rem 0;
    border: 0;
  }
}

/* ===== Home page ===== */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(3.5rem, 9vw, 7rem);
  background:
    radial-gradient(ellipse 60% 70% at 85% 15%, rgba(214, 40, 40, 0.22), transparent 60%),
    radial-gradient(ellipse 40% 50% at 10% 90%, rgba(214, 40, 40, 0.08), transparent 60%),
    var(--bg);
}
/* Grain texture overlay for depth */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
/* Vertical accent line on desktop */
.hero::after {
  content: "";
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--accent) 30%, var(--accent) 70%, transparent);
  opacity: 0;
}
.hero__inner {
  position: relative;
  display: grid;
  gap: 2.5rem;
  align-items: center;
}
.hero__copy h1 { margin-block: 1rem 1.5rem; }
.hero__copy h1 .accent { color: var(--accent); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }
.hero__photo { position: relative; }
.hero__photo img {
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.04);
}
/* Stat callouts — numbers that anchor the hero */
.hero__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.hero__stat { position: relative; padding-right: 1rem; display: flex; flex-direction: column-reverse; }
.hero__stat + .hero__stat { padding-left: 1rem; border-left: 1px solid var(--border); }
.hero__stat-num {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.4rem);
  font-weight: 900;
  color: var(--fg);
  line-height: 1;
  letter-spacing: -0.03em;
}
.hero__stat-num span { color: var(--accent); }
.hero__stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-muted);
  margin-top: 0.5rem;
}

.trust-strip__items {
  display: grid;
  gap: 1.25rem;
}
.trust-strip__item {
  position: relative;
  padding: 1.5rem 1.25rem 1.5rem 4.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  transition: border-color 0.2s, transform 0.2s;
}
.trust-strip__item:hover { border-left-color: var(--accent-hover); transform: translateY(-2px); }
.trust-strip__icon {
  position: absolute;
  left: 1.25rem;
  top: 1.5rem;
  width: 2rem;
  height: 2rem;
  color: var(--accent);
  flex-shrink: 0;
}
.trust-strip__item .eyebrow { margin-bottom: 0.4rem; }
.trust-strip__detail { color: var(--fg); line-height: 1.5; font-weight: 500; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 0.85rem; color: var(--fg-muted); }

.about-30 { max-width: 820px; }
.about-30 h2 { margin-bottom: 1.5rem; }
.about-30 p + p { margin-top: 1.25rem; }
.inline-link { color: var(--accent-text); font-weight: 700; }
.inline-link:hover { color: var(--accent-hover); }

@media (min-width: 768px) {
  .hero__inner { grid-template-columns: 1.4fr 1fr; gap: 4rem; }
  .hero::after { opacity: 1; }
  .trust-strip__items { grid-template-columns: repeat(3, 1fr); }
}

/* ===== Security page ===== */
.hero--security {
  padding-block: clamp(3rem, 8vw, 6rem);
  background: linear-gradient(180deg, var(--bg) 0%, #15050a 100%);
  border-bottom: 3px solid var(--accent);
}
.hero--security h1 { margin-block: 0.75rem 1.5rem; }
.hero--security .subtitle { max-width: 600px; margin-bottom: 2rem; }

.two-col { display: grid; gap: 3rem; }
.two-col h2 { margin-bottom: 1.25rem; }

.bullet-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.6rem;
}
.bullet-list li {
  position: relative;
  padding-left: 1.5rem;
  color: var(--fg);
}
.bullet-list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.rates-panel {
  margin-top: 2rem;
  padding: 1.75rem;
  background: var(--bg-elev);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  text-align: center;
}
.rates-panel__price {
  font-size: clamp(2.75rem, 7vw, 3.75rem);
  font-weight: 900;
  color: var(--fg);
  line-height: 1;
  margin-block: 0.5rem 0.25rem;
}
.rates-panel__price span { font-size: 0.4em; color: var(--fg-muted); font-weight: 600; }
.rates-panel__min { color: var(--fg-muted); font-size: 0.95rem; }

.case-study {
  max-width: 780px;
  margin: 0 auto;
  padding: 2.5rem;
  background: var(--bg-elev-2);
  border-left: 6px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.case-study h2 { margin-block: 0.75rem 1.5rem; }
.case-study p { color: var(--fg); line-height: 1.7; }
.case-study__takeaway {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-style: italic;
  color: var(--fg-muted);
  font-size: 1.1rem;
}

.credentials {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.credentials li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1rem 1.25rem;
  background: var(--bg-elev);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
}
.credentials strong { font-weight: 700; color: var(--fg); }
.credentials span { color: var(--fg-muted); font-size: 0.85rem; }

.testimonials {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
}
.testimonial {
  margin: 0;
  padding: 1.75rem;
  background: var(--bg-elev);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.testimonial--placeholder {
  border-color: var(--accent);
  border-style: dashed;
  background: rgba(214, 40, 40, 0.05);
}
.testimonial blockquote {
  margin: 0 0 1rem;
  color: var(--fg);
  font-style: italic;
  line-height: 1.6;
}
.testimonial figcaption { color: var(--fg-muted); font-size: 0.9rem; }

.cta-repeat { text-align: center; }
.cta-repeat h2 { margin-bottom: 0.75rem; }
.cta-repeat p { margin-bottom: 1.5rem; }

@media (min-width: 768px) {
  .two-col { grid-template-columns: 1fr 1fr; gap: 4rem; }
  .testimonials { grid-template-columns: repeat(3, 1fr); }
}

/* ===== Experience page ===== */
.hero--experience {
  padding-block: clamp(3rem, 8vw, 6rem);
  background: linear-gradient(180deg, var(--bg) 0%, #100a14 100%);
  border-bottom: 3px solid var(--accent);
}
.hero--experience h1 { margin-block: 0.75rem 1.5rem; }

.timeline {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: grid;
  gap: 1.5rem;
}
.timeline__item {
  padding: 1.75rem;
  background: var(--bg-elev);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
}
.timeline__head h3 { color: var(--fg); margin-bottom: 0.35rem; }
.timeline__meta { color: var(--fg-muted); font-size: 0.9rem; font-style: italic; }
.timeline__item ul {
  margin-top: 1rem;
  padding-left: 1.25rem;
  color: var(--fg);
  display: grid;
  gap: 0.5rem;
}
.timeline__item ul li { line-height: 1.55; }

.quals {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.quals li {
  padding: 1rem 1.25rem;
  background: var(--bg-elev);
  border-radius: var(--radius);
  color: var(--fg);
  font-size: 0.95rem;
}
.quals strong { color: var(--fg); }
.quals__refs { margin-top: 2rem; color: var(--fg-muted); font-style: italic; }

/* ===== Contact page ===== */
.hero--contact {
  padding-block: clamp(3rem, 8vw, 5rem);
  background: linear-gradient(180deg, var(--bg) 0%, #0a0f15 100%);
  border-bottom: 3px solid var(--accent);
}
.hero--contact h1 { margin-block: 0.75rem 1.25rem; }

.contact-grid { display: grid; gap: 3rem; }

.contact-details__row { margin-bottom: 1.5rem; line-height: 1.5; color: var(--fg); }
.contact-details__big {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--fg);
  display: inline-block;
  margin-top: 0.25rem;
}
.contact-details__big:hover { color: var(--accent); }

.contact-form-wrap h2 { margin-bottom: 1.5rem; }

.contact-form { display: grid; gap: 1.25rem; }
.field { display: grid; gap: 0.4rem; }
.field label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
}
.field input,
.field select,
.field textarea {
  padding: 0.85rem 1rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--fg);
  font-size: 1rem;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}
.field--invalid input,
.field--invalid select,
.field--invalid textarea { border-color: var(--error); }
.field__error { color: var(--error); font-size: 0.85rem; min-height: 1.2em; }

.honeypot { position: absolute; left: -9999px; top: -9999px; }

.form-success {
  padding: 1rem 1.25rem;
  background: rgba(46, 139, 87, 0.15);
  border: 1px solid var(--success);
  border-left: 4px solid var(--success);
  border-radius: var(--radius);
  color: var(--fg);
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .contact-grid { grid-template-columns: 1fr 1.4fr; gap: 4rem; align-items: start; }
}

/* ===================================================================
   Animations
   - On-load hero entrance (staggered)
   - Scroll-reveal via IntersectionObserver (adds .is-visible)
   - Card hover lifts
   - Fully disabled under prefers-reduced-motion
   =================================================================== */

@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scale-in {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04); }
  50%      { box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(214,40,40,0.35); }
}

/* Hero entrance — staggered */
.hero__copy > * {
  opacity: 0;
  animation: fade-up 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.hero__copy > *:nth-child(1) { animation-delay: 0.05s; }
.hero__copy > *:nth-child(2) { animation-delay: 0.15s; }
.hero__copy > *:nth-child(3) { animation-delay: 0.25s; }
.hero__copy > *:nth-child(4) { animation-delay: 0.35s; }
.hero__copy > *:nth-child(5) { animation-delay: 0.45s; }

.hero__photo img {
  animation: scale-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.2s both,
             pulse-ring 6s ease-in-out 2s infinite;
}

/* Scroll-reveal — initial state applied to elements with .reveal,
   switched to visible when JS adds .is-visible */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1),
              transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
/* Stagger children when parent has .reveal-stagger */
.reveal-stagger.is-visible > * { animation: fade-up 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.reveal-stagger.is-visible > *:nth-child(1) { animation-delay: 0.05s; }
.reveal-stagger.is-visible > *:nth-child(2) { animation-delay: 0.15s; }
.reveal-stagger.is-visible > *:nth-child(3) { animation-delay: 0.25s; }
.reveal-stagger.is-visible > *:nth-child(4) { animation-delay: 0.35s; }
.reveal-stagger.is-visible > *:nth-child(5) { animation-delay: 0.45s; }
.reveal-stagger.is-visible > *:nth-child(6) { animation-delay: 0.55s; }
.reveal-stagger.is-visible > *:nth-child(7) { animation-delay: 0.65s; }

/* Button shine on hover */
.btn { position: relative; overflow: hidden; }
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.18) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
  pointer-events: none;
}
.btn:hover::after { transform: translateX(100%); }

/* Nav link underline slide on desktop */
@media (min-width: 768px) {
  .site-nav a {
    position: relative;
  }
  .site-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    height: 2px;
    width: 100%;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
  }
  .site-nav a:hover::after,
  .site-nav a[aria-current="page"]::after {
    transform: scaleX(1);
  }
}

/* Timeline item hover */
.timeline__item {
  transition: border-left-width 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.timeline__item:hover {
  border-left-width: 8px;
  background: var(--bg-elev-2);
}

/* Credentials row hover */
.credentials li {
  transition: border-left-width 0.2s ease, transform 0.2s ease;
}
.credentials li:hover {
  border-left-width: 8px;
  transform: translateX(2px);
}

/* Case study subtle float */
.case-study {
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.3s ease;
}
.case-study:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

/* Respect user preference — kill all motion */
/* ===================================================================
   Tactical-themed animations
   (Shooting-range aesthetic — reticle, tracer, scan, muzzle-flash.
    UK SIA context is unarmed, so these are visual cues only.)
   =================================================================== */

/* ---- Scan line: horizontal sweep across hero on load ---- */
@keyframes scan-line {
  0%   { transform: translateY(-10vh); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(110vh); opacity: 0; }
}
.hero .scan-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(214, 40, 40, 0.0) 10%,
    rgba(214, 40, 40, 0.6) 50%,
    rgba(214, 40, 40, 0.0) 90%,
    transparent 100%);
  box-shadow: 0 0 12px rgba(214, 40, 40, 0.8);
  pointer-events: none;
  z-index: 1;
  animation: scan-line 1.6s cubic-bezier(0.7, 0, 0.3, 1) 0.1s 1 both;
}

/* ---- Scope reticle: four corner brackets around hero photo ---- */
.hero__photo { position: relative; }
.hero__photo .reticle {
  position: absolute;
  pointer-events: none;
  width: 28px;
  height: 28px;
  border: 2px solid var(--accent);
  opacity: 0;
  animation: reticle-draw 0.5s ease-out 0.9s forwards;
}
.hero__photo .reticle--tl { top: -10px; left: -10px; border-right: 0; border-bottom: 0; }
.hero__photo .reticle--tr { top: -10px; right: -10px; border-left: 0; border-bottom: 0; }
.hero__photo .reticle--bl { bottom: -10px; left: -10px; border-right: 0; border-top: 0; }
.hero__photo .reticle--br { bottom: -10px; right: -10px; border-left: 0; border-top: 0; }
@keyframes reticle-draw {
  0%   { opacity: 0; transform: scale(1.4); }
  60%  { opacity: 1; transform: scale(0.92); }
  100% { opacity: 1; transform: scale(1); }
}
/* Subtle reticle pulse after draw */
.hero__photo .reticle {
  animation:
    reticle-draw 0.5s ease-out 0.9s forwards,
    reticle-pulse 4s ease-in-out 2s infinite;
}
@keyframes reticle-pulse {
  0%, 100% { border-color: var(--accent); }
  50%      { border-color: var(--accent-hover); }
}
/* Center crosshair dot inside photo (tiny, top-right) */
.hero__photo::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border-radius: 50%;
  border: 1px solid rgba(214, 40, 40, 0.4);
  pointer-events: none;
  opacity: 0;
  animation: crosshair-lock 1s cubic-bezier(0.2, 0.8, 0.3, 1) 1.1s forwards;
}
.hero__photo::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 2px;
  margin: -1px 0 0 -1px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow:
    0 0 0 0 rgba(214, 40, 40, 0.6),
    14px 0 0 -1px var(--accent),
    -14px 0 0 -1px var(--accent),
    0 14px 0 -1px var(--accent),
    0 -14px 0 -1px var(--accent);
  pointer-events: none;
  opacity: 0;
  animation: crosshair-lock 1s cubic-bezier(0.2, 0.8, 0.3, 1) 1.1s forwards;
}
@keyframes crosshair-lock {
  0%   { opacity: 0; transform: scale(2.2); }
  60%  { opacity: 0.9; transform: scale(0.85); }
  100% { opacity: 0.7; transform: scale(1); }
}

/* ---- Tracer: bullet-point items get a red line shooting across on reveal ---- */
.bullet-list li { position: relative; overflow: hidden; }
.bullet-list li::after {
  content: "";
  position: absolute;
  left: -20%;
  top: 50%;
  width: 140%;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(214, 40, 40, 0) 30%,
    rgba(214, 40, 40, 0.9) 50%,
    rgba(214, 40, 40, 0) 70%,
    transparent 100%);
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
}
.reveal-stagger.is-visible .bullet-list li::after,
.is-visible .bullet-list li::after,
.bullet-list.is-visible li::after {
  animation: tracer 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.bullet-list li:nth-child(1)::after { animation-delay: 0.05s; }
.bullet-list li:nth-child(2)::after { animation-delay: 0.15s; }
.bullet-list li:nth-child(3)::after { animation-delay: 0.25s; }
.bullet-list li:nth-child(4)::after { animation-delay: 0.35s; }
.bullet-list li:nth-child(5)::after { animation-delay: 0.45s; }
.bullet-list li:nth-child(6)::after { animation-delay: 0.55s; }
@keyframes tracer {
  0%   { opacity: 0; transform: translateX(-100%); }
  30%  { opacity: 1; }
  70%  { opacity: 1; }
  100% { opacity: 0; transform: translateX(100%); }
}

/* Muzzle-flash on primary button: subtle warm pulse inside the button */
.btn--primary:hover { box-shadow: 0 0 0 2px rgba(255, 220, 160, 0.0), 0 0 24px -4px rgba(255, 200, 80, 0.6); }

/* ---- Stat count-up glow (number pulses once on reveal) ---- */
@keyframes num-lock {
  0%   { color: var(--fg); text-shadow: 0 0 0 rgba(214,40,40,0); }
  40%  { color: var(--accent-hover); text-shadow: 0 0 14px rgba(214,40,40,0.7); }
  100% { color: var(--fg); text-shadow: 0 0 0 rgba(214,40,40,0); }
}
.hero__stat-num { animation: num-lock 0.8s ease-out 1.3s both; }

/* ---- Case-study border: animated draw-in line on reveal ---- */
.case-study { position: relative; overflow: hidden; }
.case-study::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 0;
  background: var(--accent);
  transition: height 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.case-study.is-visible::before { height: 100%; }

/* ---- Timeline item: accent bar grows from top on reveal ---- */
.timeline__item { position: relative; }
/* Note: timeline already has border-left: 4px solid var(--accent). Enhance with a subtle pulse on reveal. */
@keyframes tl-pulse {
  0%   { box-shadow: -4px 0 0 0 var(--accent), 0 0 0 0 rgba(214,40,40,0); }
  50%  { box-shadow: -4px 0 0 0 var(--accent), -12px 0 24px 0 rgba(214,40,40,0.25); }
  100% { box-shadow: -4px 0 0 0 var(--accent), 0 0 0 0 rgba(214,40,40,0); }
}
.timeline__item.is-visible { animation: tl-pulse 1.2s ease-out; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .hero .scan-line,
  .hero__photo .reticle,
  .hero__photo::before,
  .hero__photo::after,
  .bullet-list li::after { display: none !important; }
}

/* ===================================================================
   Target Practice minigame (easter egg)
   Triggered by clicking the SIA badge number in the footer.
   =================================================================== */

.range-trigger {
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: border-bottom-color 0.2s, color 0.2s;
}
.range-trigger:hover { border-bottom-color: var(--accent); color: var(--accent); }

.range {
  position: fixed;
  /* `inset: 0` + explicit top/right/bottom/left for maximum browser compat */
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2147483000;
  display: none;
  background: radial-gradient(ellipse at center, #0a0a10 0%, #000 80%);
  cursor: none;
  overflow: hidden;
  user-select: none;
}
.range[data-open="true"] { display: block !important; }

/* Styling for the homepage CTA that opens the range */
.section--range-cta { background: linear-gradient(180deg, var(--bg) 0%, #0b0510 100%); border-top: 1px solid var(--border); }
.range-cta { text-align: center; max-width: 620px; margin: 0 auto; }
.range-cta h2 { margin-block: 0.75rem 1rem; }
.range-cta p { margin-bottom: 1.25rem; }
.range-trigger--button { border: 0; font-family: inherit; }

/* Vignette + scanline */
.range::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.02) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.9) 100%);
  pointer-events: none;
}

.range__hud {
  position: absolute;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--fg);
  font-family: var(--font-display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.9rem;
  pointer-events: none;
}
.range__hud > * { pointer-events: auto; }
.range__title { color: var(--accent); }
.range__score, .range__time { font-size: 1.4rem; color: var(--fg); }
.range__score span, .range__time span { color: var(--accent); }
.range__exit {
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  cursor: pointer;
}
.range__exit:hover { border-color: var(--accent); color: var(--accent); }

/* Crosshair follows pointer (JS sets --mx / --my) */
.range__crosshair {
  position: absolute;
  left: var(--mx, 50%);
  top: var(--my, 50%);
  width: 60px;
  height: 60px;
  margin: -30px 0 0 -30px;
  pointer-events: none;
  z-index: 4;
  transition: transform 0.05s;
}
.range__crosshair::before,
.range__crosshair::after {
  content: "";
  position: absolute;
  background: rgba(214, 40, 40, 0.85);
  box-shadow: 0 0 6px rgba(214, 40, 40, 0.8);
}
/* Horizontal */
.range__crosshair::before {
  left: 0; right: 0;
  top: 50%; height: 1px;
  margin-top: -0.5px;
}
/* Vertical */
.range__crosshair::after {
  top: 0; bottom: 0;
  left: 50%; width: 1px;
  margin-left: -0.5px;
}
.range__crosshair > span {
  position: absolute;
  top: 50%; left: 50%;
  width: 16px; height: 16px;
  margin: -8px 0 0 -8px;
  border: 1px solid rgba(214, 40, 40, 0.9);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(214, 40, 40, 0.4);
}
.range__crosshair > span::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 2px; height: 2px;
  margin: -1px 0 0 -1px;
  background: var(--accent);
}
.range.is-firing .range__crosshair { transform: scale(1.15); }

/* Targets (concentric rings) */
/* Running stick figure — black silhouette, glowing white eyes */
.range__target {
  position: absolute;
  width: 40px;
  height: 80px;
  cursor: none;
  z-index: 2;
  pointer-events: auto;
  /* translate via transform so left/top can be animated cleanly */
  transform: translate(-50%, -50%);
  will-change: left, transform;
}
.range__target svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
  animation: run-bob 0.32s ease-in-out infinite;
}
.range__target--flip svg { transform: scaleX(-1); }
@keyframes run-bob {
  0%, 100% { transform: translateY(0) scaleX(var(--dir, 1)); }
  50%      { transform: translateY(-3px) scaleX(var(--dir, 1)); }
}
/* Two-pose running — alternate limb groups for a sprite-like effect */
.range__target .limbs-b { opacity: 0; }
.range__target .limbs-a { animation: pose-a 0.32s steps(1) infinite; }
.range__target .limbs-b { animation: pose-b 0.32s steps(1) infinite; }
@keyframes pose-a { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes pose-b { 0%, 49% { opacity: 0; } 50%, 100% { opacity: 1; } }
/* Pulsing white eyes */
.range__target .eye {
  animation: eye-glow 1.2s ease-in-out infinite;
  transform-origin: center;
}
@keyframes eye-glow {
  0%, 100% { filter: drop-shadow(0 0 1px rgba(255,255,255,0.8)); }
  50%      { filter: drop-shadow(0 0 4px rgba(255,255,255,1)); }
}

/* Hit state: stop, flash red, fall over, fade */
.range__target.is-hit {
  pointer-events: none;
  animation: target-hit-flash 0.15s ease-out 1;
}
.range__target.is-hit svg {
  animation: fall-over 0.55s cubic-bezier(0.4, 0, 0.3, 1) forwards;
  transform-origin: 50% 90%;
}
.range__target.is-hit .limbs-a,
.range__target.is-hit .limbs-b,
.range__target.is-hit .eye { animation: none; }
.range__target.is-hit .limbs-a { opacity: 1; }
.range__target.is-hit .limbs-b { opacity: 0; }
@keyframes target-hit-flash {
  0%   { filter: none; }
  50%  { filter: drop-shadow(0 0 16px rgba(214,40,40,1)) brightness(1.5); }
  100% { filter: none; }
}
@keyframes fall-over {
  0%   { transform: scaleX(var(--dir, 1)) rotate(0deg) translateY(0); opacity: 1; }
  70%  { transform: scaleX(var(--dir, 1)) rotate(90deg) translateY(6px); opacity: 1; }
  100% { transform: scaleX(var(--dir, 1)) rotate(90deg) translateY(6px); opacity: 0; }
}

/* Bullet holes left on misses */
.range__hole {
  position: absolute;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: radial-gradient(circle, #000 40%, rgba(60,20,20,0.8) 70%, transparent 100%);
  box-shadow: 0 0 8px rgba(0,0,0,0.8), inset 0 0 4px rgba(214,40,40,0.5);
  pointer-events: none;
  z-index: 1;
  animation: hole-appear 0.15s ease-out forwards, hole-fade 1s ease 2s forwards;
}
@keyframes hole-appear {
  from { transform: scale(0); } to { transform: scale(1); }
}
@keyframes hole-fade {
  to { opacity: 0; }
}

/* Muzzle flash at cursor on fire */
.range__flash {
  position: absolute;
  width: 60px; height: 60px;
  margin: -30px 0 0 -30px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, rgba(255,220,120,0.8) 25%, rgba(214,40,40,0.4) 55%, transparent 75%);
  pointer-events: none;
  z-index: 5;
  animation: flash-burst 0.25s ease-out forwards;
}
@keyframes flash-burst {
  0%   { transform: scale(0.2); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* HIT / MISS text popups */
.range__popup {
  position: absolute;
  pointer-events: none;
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  text-shadow: 0 0 8px rgba(0,0,0,0.9);
  animation: popup-rise 0.8s ease-out forwards;
  z-index: 5;
}
.range__popup--miss { color: var(--fg-muted); font-size: 0.85rem; }
@keyframes popup-rise {
  0%   { opacity: 0; transform: translateY(0) scale(0.6); }
  20%  { opacity: 1; transform: translateY(-4px) scale(1.1); }
  100% { opacity: 0; transform: translateY(-40px) scale(1); }
}

/* End screen */
.range__end {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  z-index: 10;
  background: rgba(0,0,0,0.85);
  color: var(--fg);
  text-align: center;
  font-family: var(--font-sans);
}
/* Class selector above beats UA [hidden] { display: none }, so restore it explicitly */
.range__end[hidden] { display: none; }
.range__end h2 { font-family: var(--font-display); color: var(--accent); letter-spacing: 0.05em; margin-bottom: 0.5rem; }
.range__end-score { font-family: var(--font-display); font-size: clamp(3rem, 10vw, 5rem); color: var(--fg); line-height: 1; }
.range__end-score span { color: var(--accent); }
.range__end-label { color: var(--fg-muted); letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.85rem; }
.range__end-actions { display: flex; gap: 1rem; margin-top: 1.5rem; }

@media (prefers-reduced-motion: reduce) {
  .range__target { animation: none !important; }
  .range { display: none !important; }
}
