/*
Theme Name: BallisticPress
Theme URI: https://ballisticpress.com/
Author: BallisticPress
Author URI: https://ballisticpress.com/
Description: A cinematic WordPress theme for BallisticPress defence simulation, ballistic analytics, embedded systems, and immersive training.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: Proprietary
Text Domain: ballisticpress
*/

/* BallisticPress — shared stylesheet
   System: cinematic dark canvas, bold display, mono labels, restrained yellow.
*/

:root {
  --ink: #0a0a09;
  --ink-2: #111110;
  --ink-3: #1a1a18;
  --ink-4: #232220;
  --line: rgba(232, 227, 212, 0.10);
  --line-strong: rgba(232, 227, 212, 0.22);
  --bone: #e8e3d4;
  --bone-2: #c9c2af;
  --ash: #8a8474;
  --ash-2: #5a5546;
  --yellow: #f7d600;
  --yellow-deep: #e2c200;
  --brass: #b89456;
  --signal: #62ded7;

  --maxw: 1280px;
  --gutter: clamp(1rem, 3vw, 2rem);

  --font-display: "Space Grotesk", "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

::selection { background: var(--yellow); color: var(--ink); }

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

/* ───────────────── Page chrome ───────────────── */

.bp-shell {
  width: min(var(--maxw), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}

.bp-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 2rem;
  padding: 0.9rem var(--gutter);
  background: rgba(10, 10, 9, 0.78);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

body.admin-bar .bp-header { top: 32px; }

@media (max-width: 782px) {
  body.admin-bar .bp-header { top: 46px; }
}

.bp-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.bp-brand-mark {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  background: var(--yellow);
  border-radius: 4px;
  overflow: hidden;
}

.bp-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bp-brand-word {
  display: grid;
  line-height: 1;
}

.bp-brand-word b {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--bone);
}

.bp-brand-word small {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ash);
  margin-top: 0.25rem;
}

.bp-nav {
  display: flex;
  justify-content: center;
  gap: 0.2rem;
}

.bp-nav ul,
ul.bp-nav {
  display: flex;
  justify-content: center;
  gap: 0.2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bp-nav li {
  list-style: none;
}

.bp-nav a {
  position: relative;
  padding: 0.55rem 0.9rem;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--bone-2);
  border-radius: 4px;
  transition: color 180ms ease;
}

.bp-nav a:hover { color: var(--bone); }

.bp-nav a.is-active,
.bp-nav .current-menu-item > a,
.bp-nav .current_page_item > a {
  color: var(--bone);
}

.bp-nav a.is-active::after,
.bp-nav .current-menu-item > a::after,
.bp-nav .current_page_item > a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -2px;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  background: var(--yellow);
  border-radius: 50%;
}

.bp-header-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--bone);
  transition: background 180ms ease, border-color 180ms ease;
}

.bp-header-cta:hover {
  background: var(--bone);
  color: var(--ink);
  border-color: var(--bone);
}

.bp-header-cta::after {
  content: "→";
  font-family: var(--font-mono);
}

.bp-menu-toggle {
  display: none;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--bone);
  border-radius: 4px;
  position: relative;
}
.bp-menu-toggle::before, .bp-menu-toggle::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 1rem; height: 1.5px; background: currentColor;
  transition: transform 180ms ease;
}
.bp-menu-toggle::before { transform: translate(-50%, -5px); }
.bp-menu-toggle::after  { transform: translate(-50%, 4px); }
body.nav-open .bp-menu-toggle::before { transform: translate(-50%, -50%) rotate(45deg); }
body.nav-open .bp-menu-toggle::after  { transform: translate(-50%, -50%) rotate(-45deg); }

/* ───────────────── Type ───────────────── */

.bp-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ash);
  margin: 0;
}

.bp-eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--yellow);
}

.bp-eyebrow.is-bone::before { background: var(--bone); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--bone);
}

.bp-display {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(3rem, 9.5vw, 8.6rem);
  line-height: 0.94;
  letter-spacing: -0.04em;
  margin: 0;
}

.bp-display em {
  font-style: normal;
  color: var(--yellow);
}

.bp-h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.02;
}

.bp-h3 {
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  line-height: 1.15;
}

.bp-lead {
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  line-height: 1.5;
  color: var(--bone-2);
  max-width: 60ch;
}

.bp-body { color: var(--bone-2); }
.bp-mono { font-family: var(--font-mono); letter-spacing: 0.04em; }

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

.bp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.95rem 1.3rem;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease, border-color 180ms ease;
  white-space: nowrap;
}

.bp-btn:hover { transform: translateY(-1px); }

.bp-btn-primary {
  background: var(--bone);
  color: var(--ink);
}
.bp-btn-primary:hover { background: var(--yellow); }

.bp-btn-ghost {
  background: transparent;
  color: var(--bone);
  border-color: var(--line-strong);
}
.bp-btn-ghost:hover { border-color: var(--bone); background: rgba(232, 227, 212, 0.04); }

.bp-btn .bp-arrow {
  font-family: var(--font-mono);
  font-weight: 500;
  transition: transform 180ms ease;
}
.bp-btn:hover .bp-arrow { transform: translateX(3px); }

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

.bp-section {
  position: relative;
  padding: clamp(4.5rem, 9vw, 8rem) 0;
}

.bp-section--tight { padding: clamp(3rem, 6vw, 5rem) 0; }

.bp-section--bone {
  background: var(--bone);
  color: var(--ink);
}
.bp-section--bone h1, .bp-section--bone h2, .bp-section--bone h3 { color: var(--ink); }
.bp-section--bone .bp-lead, .bp-section--bone .bp-body { color: #2c2a23; }
.bp-section--bone .bp-eyebrow { color: var(--ash-2); }
.bp-section--bone .bp-eyebrow::before { background: var(--ink); }

.bp-rule {
  height: 1px;
  background: var(--line);
  margin: 0;
  border: 0;
}

.bp-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: end;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.bp-section-head .bp-eyebrow { grid-column: 1 / -1; margin-bottom: -1.2rem; }

@media (max-width: 880px) {
  .bp-section-head { grid-template-columns: 1fr; gap: 1rem; }
}

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

.bp-footer {
  background: var(--ink-2);
  border-top: 1px solid var(--line);
  padding: 4rem var(--gutter) 1.5rem;
}

.bp-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 3rem;
  width: min(var(--maxw), 100%);
  margin: 0 auto;
}

.bp-footer h4 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ash);
  margin: 0 0 1rem;
}

.bp-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.55rem; }
.bp-footer a { color: var(--bone-2); font-size: 0.92rem; }
.bp-footer a:hover { color: var(--bone); }

.bp-footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 3rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  width: min(var(--maxw), 100%);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ash);
  letter-spacing: 0.06em;
}

@media (max-width: 880px) {
  .bp-footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
@media (max-width: 520px) {
  .bp-footer-grid { grid-template-columns: 1fr; }
}

/* ───────────────── Reveal ───────────────── */

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 700ms cubic-bezier(.2,.6,.2,1), transform 700ms cubic-bezier(.2,.6,.2,1);
}
[data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ───────────────── Hero (shared shell, variants override) ───────────────── */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  border-bottom: 1px solid var(--line);
}

.hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-shell {
  position: relative;
  z-index: 2;
  width: min(var(--maxw), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
  padding: clamp(5rem, 12vw, 9rem) 0 clamp(3rem, 7vw, 5rem);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ash);
  margin-bottom: 2rem;
}

.hero-meta span b {
  color: var(--bone);
  font-weight: 500;
  margin-left: 0.4rem;
}

.hero-meta .live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--yellow);
  border-radius: 50%;
  margin-right: 0.4rem;
  box-shadow: 0 0 0 0 rgba(247, 214, 0, 0.7);
  animation: live-pulse 1.6s infinite;
}

@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(247, 214, 0, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(247, 214, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(247, 214, 0, 0); }
}

.hero-actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-top: clamp(1.6rem, 3vw, 2.4rem);
}

.hero-foot {
  position: relative;
  z-index: 2;
  width: min(var(--maxw), calc(100% - var(--gutter) * 2));
  margin: 0 auto;
  padding: 1.4rem 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--ash);
}

.hero-foot div b {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  color: var(--bone);
  margin-bottom: 0.2rem;
}

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

/* ───────────────── Tweaks panel ───────────────── */

.bp-tweaks {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  width: 280px;
  background: rgba(17, 17, 16, 0.96);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 1rem;
  backdrop-filter: blur(18px);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--bone);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
}

.bp-tweaks-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ash);
}

.bp-tweaks-close {
  width: 1.2rem; height: 1.2rem; line-height: 0;
  border: 0; background: transparent; color: var(--ash);
}

.bp-tweak-group { margin-bottom: 0.9rem; }
.bp-tweak-label { display: block; color: var(--ash); margin-bottom: 0.4rem; text-transform: uppercase; letter-spacing: 0.16em; }

.bp-radio-row { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.bp-radio-row button {
  appearance: none; border: 0; background: transparent; color: var(--bone-2);
  padding: 0.5rem 0.4rem; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em;
  text-transform: uppercase; border-right: 1px solid var(--line);
}
.bp-radio-row button:last-child { border-right: 0; }
.bp-radio-row button.is-on { background: var(--yellow); color: var(--ink); }

/* ───────────────── Utilities ───────────────── */

.bp-grid-bg {
  background-image:
    linear-gradient(rgba(232, 227, 212, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 227, 212, 0.04) 1px, transparent 1px);
  background-size: 64px 64px;
}

.bp-noise::after {
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.91  0 0 0 0 0.89  0 0 0 0 0.83  0 0 0 0.05 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 0.5;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.bp-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: var(--ash);
  border-style: solid;
  border-width: 0;
}
.bp-corner.tl { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.bp-corner.tr { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.bp-corner.bl { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }
.bp-corner.br { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }

@media (max-width: 880px) {
  .bp-nav { display: none; position: fixed; left: 1rem; right: 1rem; top: 4.5rem; background: rgba(10,10,9,.97); border: 1px solid var(--line); border-radius: 6px; padding: 0.6rem; flex-direction: column; align-items: stretch; }
  body.nav-open .bp-nav { display: flex; }
  .bp-menu-toggle { display: grid; place-items: center; }
  .bp-header-cta { display: none; }
  .bp-header { grid-template-columns: auto 1fr auto; gap: 1rem; }
}
