/* ============================================================
   DragonTrace — Regional Threat Intelligence Platform
   Main Stylesheet
   ============================================================ */

:root {
  --bg-primary:    #050a0f;
  --bg-secondary:  #0a1520;
  --bg-card:       #0d1a26;
  --bg-card-hover: #101f30;

  --red:           #c41e3a;
  --red-dim:       rgba(196, 30, 58, 0.15);
  --red-border:    rgba(196, 30, 58, 0.25);

  --amber:         #f5a623;
  --amber-dim:     rgba(245, 166, 35, 0.15);

  --text-primary:  #e0e6ed;
  --text-secondary: #7a92a8;
  --text-muted:    #4a6070;

  --border:        rgba(255,255,255,0.06);
  --border-strong: rgba(255,255,255,0.1);

  --font-sans:     'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:     'JetBrains Mono', 'Fira Code', monospace;

  --radius:        8px;
  --radius-lg:     12px;
  --radius-xl:     16px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ── Utility ─────────────────────────────────────────────── */
.mono { font-family: var(--font-mono); }

/* ── Background Effects ──────────────────────────────────── */
.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(196,30,58,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(196,30,58,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
}

.bg-glow {
  position: fixed;
  top: -30%;
  right: -20%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(196,30,58,0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── All content above background ────────────────────────── */
nav, section, footer { position: relative; z-index: 1; }

/* ── Navigation ──────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: rgba(5, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-icon {
  width: 32px;
  height: 32px;
}

.brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.brand-accent { color: var(--red); }

.nav-links {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}

.nav-links a {
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover {
  color: var(--text-primary);
  background: var(--border);
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--red-border);
  border-radius: 20px;
  font-size: 0.7rem;
  color: var(--red);
  letter-spacing: 0.1em;
  flex-shrink: 0;
}

/* ── Status Dots ─────────────────────────────────────────── */
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot.active {
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
  animation: pulse-green 2s infinite;
}

.status-dot.pending {
  background: var(--amber);
  box-shadow: 0 0 6px var(--amber);
}

.status-dot.small {
  width: 5px;
  height: 5px;
}

@keyframes pulse-green {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 8rem 2rem 4rem;
}

.hero-content { display: flex; flex-direction: column; gap: 1.5rem; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--red-border);
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--red);
  font-weight: 500;
  letter-spacing: 0.02em;
  width: fit-content;
  background: var(--red-dim);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(196,30,58,0.4); }
  50%       { opacity: 0.8; box-shadow: 0 0 0 4px rgba(196,30,58,0); }
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.gradient-text {
  background: linear-gradient(135deg, var(--red) 0%, var(--amber) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 480px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--red);
  color: #fff;
}

.btn-primary:hover {
  background: #a01830;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(196,30,58,0.35);
}

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

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

/* ── Metrics Bar ─────────────────────────────────────────── */
.metrics-bar {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  overflow: hidden;
  flex-wrap: wrap;
}

.metric-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0.75rem 1.25rem;
  flex: 1;
  min-width: 120px;
}

.metric-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.metric-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.metric-value.threat-elevated {
  color: var(--amber);
}

.metric-divider {
  width: 1px;
  height: 40px;
  background: var(--border-strong);
  flex-shrink: 0;
}

/* ── Hero Visual ─────────────────────────────────────────── */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.globe-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.globe-svg {
  width: 380px;
  height: 380px;
  filter: drop-shadow(0 0 40px rgba(196,30,58,0.15));
  animation: globe-rotate 20s linear infinite;
}

@keyframes globe-rotate {
  0%   { filter: drop-shadow(0 0 30px rgba(196,30,58,0.1)); }
  50%  { filter: drop-shadow(0 0 50px rgba(196,30,58,0.2)); }
  100% { filter: drop-shadow(0 0 30px rgba(196,30,58,0.1)); }
}

.ping-node {
  animation: ping-pulse 2s ease-in-out infinite;
}

@keyframes ping-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.ping-ring {
  animation: ping-expand 2s ease-out infinite;
}

@keyframes ping-expand {
  0%   { r: 4px; opacity: 0.8; }
  100% { r: 14px; opacity: 0; }
}

.globe-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── Sections ────────────────────────────────────────────── */
.section {
  padding: 6rem 0;
}

.section-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-tag {
  font-size: 0.72rem;
  color: var(--red);
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.section-title {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.section-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
}

/* ── Projects Grid ───────────────────────────────────────── */
.projects-section { background: linear-gradient(180deg, transparent 0%, rgba(10,21,32,0.5) 50%, transparent 100%); }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  gap: 1.25rem;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.project-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--red-border);
  transform: translateY(-3px);
  box-shadow: 0 20px 48px rgba(0,0,0,0.4), 0 0 0 1px var(--red-border);
}

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

.project-card--coming-soon {
  opacity: 0.55;
  cursor: default;
}

.project-card--coming-soon:hover {
  transform: none;
  border-color: var(--border);
  box-shadow: none;
}

.project-card--coming-soon::before { display: none; }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-icon svg {
  width: 22px;
  height: 22px;
}

.gfw-icon {
  background: rgba(196,30,58,0.12);
  color: var(--red);
}

.geo-icon {
  background: rgba(245,166,35,0.12);
  color: var(--amber);
}

.soon-icon {
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
}

.card-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.card-title {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.card-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 0.25rem;
}

.tag {
  padding: 0.2rem 0.65rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  border: 1px solid var(--border);
  letter-spacing: 0.02em;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.card-url {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.card-arrow {
  width: 18px;
  height: 18px;
  color: var(--red);
  transition: transform 0.2s;
}

.project-card:hover .card-arrow {
  transform: translateX(3px);
}

/* ── Capabilities ────────────────────────────────────────── */
.capabilities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.capability-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.2s, transform 0.2s;
}

.capability-item:hover {
  border-color: var(--red-border);
  transform: translateY(-2px);
}

.cap-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--red-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
}

.cap-icon svg { width: 18px; height: 18px; }

.capability-item h4 {
  font-size: 0.95rem;
  font-weight: 600;
}

.capability-item p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── About Section ───────────────────────────────────────── */
.about-section { background: linear-gradient(180deg, transparent 0%, rgba(10,21,32,0.4) 100%); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}

.about-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.about-content .section-title { text-align: left; }

.about-content p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

.about-highlights {
  display: flex;
  gap: 2rem;
  margin-top: 1rem;
}

.highlight-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.highlight-num {
  font-size: 2rem;
  font-weight: 700;
  color: var(--red);
  line-height: 1;
  letter-spacing: -0.03em;
}

.highlight-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Terminal Widget ─────────────────────────────────────── */
.terminal-window {
  background: #060d14;
  border: 1px solid rgba(196,30,58,0.2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6), 0 0 0 1px var(--border);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.terminal-dot.red    { background: #ff5f57; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green  { background: #28c940; }

.terminal-title {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

.terminal-body {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
  min-height: 200px;
}

.terminal-line { display: flex; gap: 0.5rem; }

.t-prompt { color: var(--red); user-select: none; }
.t-cmd    { color: var(--text-primary); }
.t-output { color: var(--text-secondary); padding-left: 1.1rem; }

.t-green  { color: #22c55e; }
.t-yellow { color: var(--amber); }
.t-red    { color: var(--red); }

.t-cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--red);
  animation: blink 1s step-end infinite;
  vertical-align: middle;
  margin-top: 1px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── Footer ──────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem 2rem;
  display: flex;
  gap: 4rem;
  justify-content: space-between;
  flex-wrap: wrap;
}

.footer-tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

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

.footer-col h5 {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-col a {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.footer-col a:hover { color: var(--text-primary); }

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-copy   { font-size: 0.75rem; color: var(--text-muted); }
.footer-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: #22c55e;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 7rem;
    text-align: center;
  }

  .hero-subtitle { margin: 0 auto; }
  .hero-badge    { margin: 0 auto; }
  .hero-actions  { justify-content: center; }

  .hero-visual { display: none; }

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

  .nav-links { display: none; }
}

@media (max-width: 600px) {
  .metrics-bar { flex-direction: column; }
  .metric-divider { width: 100%; height: 1px; }
  .metric-item { min-width: unset; }

  .footer-links { flex-direction: column; gap: 1.5rem; }
  .footer-container { flex-direction: column; gap: 2rem; }

  .about-highlights { flex-wrap: wrap; }
}
