/* ========================================
   GRIDWATCH — Website Stylesheet
   ======================================== */

:root {
  --bg:               #1A1D23;
  --bg-deep:          #12141A;
  --surface:          #252830;
  --surface-elevated: #2E323B;
  --accent:           #6B8F3C;
  --accent-light:     #8AB450;
  --gold:             #C4A44A;
  --friendly:         #4A7EC8;
  --hostile:          #C84A4A;
  --text-primary:     #E8E8E8;
  --text-secondary:   #A0A5B0;
  --text-muted:       #6E7380;
  --divider:          #333740;
}

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

html {
  scroll-behavior: smooth;
  background: var(--bg-deep);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Inter', sans-serif;
  line-height: 1.2;
}

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

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

.main-header {
  background: var(--bg-deep);
  border-bottom: 1px solid var(--divider);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.logo-icon {
  color: var(--text-secondary);
}

.logo-text {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.2em;
}

.main-nav {
  display: flex;
  gap: 2rem;
}

.main-nav a {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.15s;
}

.main-nav a:hover {
  color: var(--text-primary);
}

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

.hero {
  position: relative;
  background:
    linear-gradient(160deg, var(--bg-deep) 0%, var(--bg) 40%, #1E2128 100%);
  color: var(--text-primary);
  padding: 8rem 2rem 3rem;
  overflow: hidden;
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 39px,
      rgba(107,143,60,0.04) 39px,
      rgba(107,143,60,0.04) 40px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 39px,
      rgba(107,143,60,0.04) 39px,
      rgba(107,143,60,0.04) 40px
    );
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  top: -200px;
  right: -200px;
  width: 800px;
  height: 800px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(107,143,60,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  width: 100%;
}

.hero h1 {
  font-size: 4.5rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1;
  margin-bottom: 1.5rem;
}

.hero-tagline {
  font-size: 1.25rem;
  color: var(--accent-light);
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-bottom: 1.5rem;
}

.hero-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.7;
  margin-bottom: 2.5rem;
  font-weight: 300;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 4rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 3px;
  letter-spacing: 0.02em;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

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

.btn-primary:hover {
  background: var(--accent-light);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--text-muted);
}

.btn-ghost:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.hero-stats {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 3rem;
  padding-top: 3rem;
  border-top: 1px solid var(--divider);
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.25rem;
}

/* ── Screen Mockup ───────────────────── */

.mockup-section {
  background: var(--bg-deep);
  padding: 4rem 2rem;
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
}

.mockup-inner {
  max-width: 800px;
  margin: 0 auto;
}

.screen-mockup {
  width: 100%;
}

.screen-bezel {
  background: #0D0D0D;
  border-radius: 12px;
  padding: 8px;
  box-shadow:
    0 0 0 1px rgba(107,143,60,0.15),
    0 24px 80px rgba(0,0,0,0.6),
    0 0 60px rgba(107,143,60,0.04);
}

.screen-content {
  background: #0F1218;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.screen-topbar {
  background: rgba(107,143,60,0.08);
  border-bottom: 1px solid rgba(107,143,60,0.15);
  padding: 0.4rem 1rem;
  display: flex;
  justify-content: space-between;
}

.screen-label {
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.1em;
}

.screen-map {
  position: relative;
  height: 380px;
  background:
    linear-gradient(180deg, #0F161E 0%, #131D28 50%, #0F161E 100%);
  overflow: hidden;
}

/* Grid overlay */
.grid-overlay {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 31px,
      rgba(107,143,60,0.05) 31px,
      rgba(107,143,60,0.05) 32px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 31px,
      rgba(107,143,60,0.05) 31px,
      rgba(107,143,60,0.05) 32px
    );
}

/* Contour lines */
.contour-lines {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 350px 220px at 55% 35%, transparent 40%, rgba(107,143,60,0.04) 41%, transparent 42%),
    radial-gradient(ellipse 300px 190px at 55% 35%, transparent 50%, rgba(107,143,60,0.04) 51%, transparent 52%),
    radial-gradient(ellipse 250px 160px at 55% 35%, transparent 60%, rgba(107,143,60,0.04) 61%, transparent 62%),
    radial-gradient(ellipse 400px 280px at 30% 70%, transparent 35%, rgba(107,143,60,0.03) 36%, transparent 37%),
    radial-gradient(ellipse 350px 250px at 30% 70%, transparent 45%, rgba(107,143,60,0.03) 46%, transparent 47%);
  pointer-events: none;
}

/* Unit markers */
.unit-marker {
  position: absolute;
  transform: translate(-50%, -50%);
}

.unit-marker.friendly .unit-box { filter: drop-shadow(0 0 6px rgba(74,126,200,0.4)); }
.unit-marker.hostile .unit-box { filter: drop-shadow(0 0 6px rgba(200,74,74,0.4)); }

/* Range circle */
.range-circle {
  position: absolute;
  top: 35%;
  left: 20%;
  transform: translate(-50%, -50%);
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 1px dashed rgba(74,126,200,0.25);
  background: radial-gradient(circle, rgba(74,126,200,0.05) 0%, transparent 70%);
}

.range-circle-outer {
  position: absolute;
  top: 35%;
  left: 20%;
  transform: translate(-50%, -50%);
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 1px dotted rgba(74,126,200,0.12);
}

/* LOS line */
.los-line {
  position: absolute;
  top: 35%;
  left: 20%;
  width: 250px;
  height: 1px;
  background: linear-gradient(90deg, rgba(74,126,200,0.5), rgba(74,126,200,0.1) 40%, rgba(200,74,74,0.1) 60%, rgba(200,74,74,0.5));
  transform-origin: left center;
  transform: rotate(-8deg);
}

/* Objective */
.objective-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  background: rgba(196,164,74,0.12);
  box-shadow: 0 0 10px rgba(196,164,74,0.25);
}

.objective-marker::after {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid var(--gold);
  border-radius: 50%;
}

/* Fog edge */
.fog-edge {
  position: absolute;
  top: 0;
  right: 0;
  width: 35%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(15,18,24,0.6) 40%, rgba(15,18,24,0.9) 100%);
  pointer-events: none;
}

.screen-bottombar {
  background: rgba(0,0,0,0.5);
  border-top: 1px solid rgba(107,143,60,0.1);
  padding: 0.4rem 1rem;
  display: flex;
  justify-content: space-between;
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 0.55rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* ── Features ────────────────────────── */

.features-section {
  padding: 5rem 2rem;
  background: var(--bg);
}

.section-inner {
  max-width: 1120px;
  margin: 0 auto;
}

.section-header {
  margin-bottom: 3rem;
}

.section-header h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 4px;
  padding: 2rem;
  transition: border-color 0.2s;
}

.feature-card:hover {
  border-color: var(--accent);
}

.feature-icon {
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.feature-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ── QRF Section ─────────────────────── */

.qrf-section {
  padding: 5rem 2rem;
  background: var(--bg);
  border-top: 1px solid var(--divider);
}

.qrf-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 4rem;
  align-items: start;
}

.qrf-eyebrow {
  text-transform: uppercase;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--gold);
  margin-bottom: 1rem;
}

.qrf-text h2 {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.qrf-subtitle {
  font-size: 0.9rem;
  color: var(--accent-light);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.qrf-text p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.qrf-features {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 2rem;
}

.qrf-features li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.qrf-features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 1px;
}

/* QRF Phone Mockup */

.qrf-visual {
  display: flex;
  justify-content: center;
  padding-top: 1rem;
}

.qrf-phone {
  width: 280px;
}

.qrf-phone-bezel {
  background: #0D0D0D;
  border-radius: 28px;
  padding: 12px 8px;
  box-shadow:
    0 0 0 1px rgba(196,164,74,0.1),
    0 20px 60px rgba(0,0,0,0.5);
}

.qrf-phone-screen {
  background: #0F1218;
  border-radius: 20px;
  overflow: hidden;
}

/* Title bar */

.qrf-titlebar {
  padding: 0.5rem 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--divider);
}

.qrf-titlebar-name {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-primary);
}

.qrf-titlebar-turn {
  font-size: 0.6rem;
  color: var(--text-muted);
}

/* Resource columns */

.qrf-resources-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px 8px 8px;
  gap: 2px;
  border-bottom: 1px solid var(--divider);
}

.qrf-res-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.qrf-res-name {
  font-size: 0.4rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.qrf-res-val {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

.qrf-res-bar {
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}

.qrf-res-fill {
  height: 100%;
  border-radius: 2px;
}

/* Area of Operations */

.qrf-ao {
  padding: 8px;
}

.qrf-ao-label {
  font-size: 0.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 6px;
}

.qrf-ao-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.qrf-ao-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--divider);
  border-radius: 6px;
  padding: 8px;
}

.qrf-ao-card-wide {
  grid-column: 1 / -1;
}

.qrf-ao-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  margin-bottom: 3px;
}

.qrf-ao-card-name {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.qrf-ao-badge {
  font-size: 0.35rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 1px 4px;
  border-radius: 2px;
  white-space: nowrap;
  flex-shrink: 0;
}

.qrf-ao-contested {
  color: var(--hostile);
  background: rgba(200,74,74,0.15);
  border: 1px solid rgba(200,74,74,0.3);
}

.qrf-ao-secured {
  color: var(--accent);
  background: rgba(107,143,60,0.15);
  border: 1px solid rgba(107,143,60,0.3);
}

.qrf-ao-unknown {
  color: var(--text-muted);
  background: rgba(110,115,128,0.12);
  border: 1px solid rgba(110,115,128,0.25);
}

.qrf-ao-card-terrain {
  font-size: 0.5rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.qrf-ao-card-units {
  display: flex;
  gap: 3px;
}

.qrf-ao-unit {
  font-size: 0.45rem;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(107,143,60,0.12);
  color: var(--accent-light);
  border: 1px solid rgba(107,143,60,0.2);
}

.qrf-ao-unit-unknown {
  background: rgba(110,115,128,0.1);
  color: var(--text-muted);
  border-color: rgba(110,115,128,0.2);
}

/* Situation card */

.qrf-situation {
  padding: 8px;
  margin: 0 8px;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 8px;
  text-align: center;
}

.qrf-situation-label {
  font-size: 0.45rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.qrf-situation-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.qrf-situation-body {
  font-size: 0.6rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
}

.qrf-situation-question {
  font-size: 0.6rem;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 10px;
}

.qrf-situation-choices {
  display: flex;
  border-top: 1px solid var(--divider);
  margin: 0 -12px -8px;
}

.qrf-choice {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 12px;
  flex: 1;
  text-align: center;
}

.qrf-choice-left {
  color: var(--text-secondary);
  border-right: 1px solid var(--divider);
}

.qrf-choice-right {
  color: var(--text-secondary);
}

/* Sensor mode tabs */

.qrf-sensor-bar {
  display: flex;
  padding: 8px;
  gap: 2px;
  border-top: 1px solid var(--divider);
  margin-top: 8px;
}

.qrf-sensor-tab {
  flex: 1;
  text-align: center;
  font-size: 0.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 6px 0;
  border-radius: 4px;
}

.qrf-sensor-active {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}

/* ── About ───────────────────────────── */

.about-section {
  padding: 5rem 2rem;
  background: var(--bg-deep);
  border-top: 1px solid var(--divider);
}

.about-inner {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}

.about-inner h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.about-inner p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.about-platform {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.platform-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 0.35rem 0.75rem;
  background: rgba(107,143,60,0.12);
  color: var(--accent-light);
  border: 1px solid rgba(107,143,60,0.25);
  border-radius: 3px;
}

.platform-note {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Content Pages ───────────────────── */

.page-section {
  padding: 5rem 2rem;
  background: var(--bg);
  min-height: 60vh;
}

.page-inner {
  max-width: 680px;
  margin: 0 auto;
}

.page-inner h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--divider);
}

.page-inner h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.page-inner p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.page-inner ul {
  list-style: none;
  padding: 0;
  margin-bottom: 1rem;
}

.page-inner li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.page-inner li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 1px;
}

.page-inner strong {
  color: var(--text-primary);
  font-weight: 600;
}

.page-inner a {
  color: var(--accent-light);
  transition: color 0.15s;
}

.page-inner a:hover {
  color: var(--text-primary);
}

.page-inner em {
  color: var(--text-muted);
  font-style: italic;
}

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

.main-footer {
  background: var(--bg-deep);
  color: var(--text-muted);
  padding: 2rem 2rem 1.5rem;
  border-top: 1px solid var(--divider);
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.footer-wordmark {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-secondary);
  letter-spacing: 0.2em;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color 0.15s;
}

.footer-links a:hover {
  color: var(--text-secondary);
}

.footer-bottom {
  padding-top: 1.5rem;
  text-align: center;
}

.fdt-footer {
  display: inline-block;
  color: var(--text-muted);
  transition: color 0.15s;
}

.fdt-footer:hover {
  color: var(--text-secondary);
}

.fdt-name {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.fdt-slogan {
  font-size: 0.65rem;
  font-style: italic;
  margin-top: 0.2rem;
  opacity: 0.7;
}

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

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

  .qrf-inner {
    grid-template-columns: 1fr;
  }

  .qrf-visual {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 5rem 1.5rem 2rem;
    min-height: auto;
  }

  .hero h1 {
    font-size: 2.75rem;
  }

  .hero-tagline {
    font-size: 1rem;
  }

  .hero-stats {
    flex-wrap: wrap;
    gap: 1.5rem;
  }

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

  .screen-map {
    height: 240px;
  }

  .main-nav {
    display: none;
  }

  .footer-top {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .hero-actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .btn {
    text-align: center;
    justify-content: center;
  }

  .mockup-section {
    padding: 2rem 1rem;
  }
}
