/* ==========================================================================
   NQ6N.com — Modern Amateur Radio & Engineering Stylesheet
   Author: Matthew Murphy (NQ6N)
   Target: Cloudflare Pages / Workers
   ========================================================================== */

:root {
  --bg-primary: #070a10;
  --bg-surface: #0e1422;
  --bg-surface-elevated: #151d30;
  --bg-card: #0f172a;
  --border-subtle: #1e293b;
  --border-highlight: #334155;

  --accent-cyan: #38bdf8;
  --accent-cyan-dim: rgba(56, 189, 248, 0.15);
  --accent-amber: #f59e0b;
  --accent-amber-dim: rgba(245, 158, 11, 0.15);
  --accent-green: #10b981;
  --accent-green-dim: rgba(16, 185, 129, 0.15);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

/* Base Reset & Intrinsic Box Model */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Subtle RF Coordinate Background Grid */
.rf-grid-overlay {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

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

.bold {
  font-weight: 700;
}

/* Header & Telemetry Bar */
.site-header {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding-block: 16px;
  padding-inline: 24px;
}

.header-inner {
  max-inline-size: 1100px;
  margin-inline: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.callsign-badge {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-amber);
  letter-spacing: 1.5px;
}

.callsign {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 12px;
  line-height: 1.1;
}

.btn-cw-play {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-highlight);
  color: var(--accent-cyan);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cw-play:hover {
  background: var(--accent-cyan-dim);
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
}

.btn-cw-play.active {
  background: var(--accent-amber);
  color: #000;
  border-color: var(--accent-amber);
}

.cw-sound-label {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  font-weight: 700;
}

.operator-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.divider {
  color: var(--border-highlight);
}

.station-telemetry {
  display: flex;
  gap: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding-block: 8px;
  padding-inline: 16px;
  border-radius: var(--radius-md);
}

.telemetry-item {
  display: flex;
  flex-direction: column;
}

.telemetry-label {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.telemetry-val {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.telemetry-val.highlight {
  color: var(--accent-cyan);
}

/* Main Container Layout */
.main-container {
  position: relative;
  z-index: 1;
  max-inline-size: 1100px;
  margin-inline: auto;
  padding-inline: 24px;
  padding-block: 36px 48px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  flex: 1;
}

/* Hero Section */
.hero-card {
  background: linear-gradient(145deg, #0e1626, #090f1a);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.hero-content h2 {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 12px;
}

.lead-text {
  font-size: 1.05rem;
  color: #cbd5e1;
  max-inline-size: 820px;
  line-height: 1.6;
}

/* Licensure Timeline Ribbon */
.license-journey {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-block-start: 16px;
  border-top: 1px solid var(--border-subtle);
}

.journey-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.timeline-steps {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.step {
  display: flex;
  align-items: baseline;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding-block: 4px;
  padding-inline: 10px;
  border-radius: var(--radius-sm);
}

.step-call {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
}

.step-label {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.step.current {
  background: var(--accent-cyan-dim);
  border-color: var(--accent-cyan);
}

.step.current .step-call {
  color: var(--accent-cyan);
}

.step.current .step-label {
  color: #bae6fd;
}

.step-arrow {
  color: var(--border-highlight);
  font-size: 0.8rem;
}

/* Section Header Typography */
.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
  margin-inline-start: 12px;
}

/* 4 Pillars Grid */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.pillar-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.pillar-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-highlight);
}

.card-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.pillar-card h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.pillar-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

.pillar-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.pillar-tags li {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  background: var(--bg-surface-elevated);
  color: #94a3b8;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Projects & Research Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.project-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

.project-card.highlight-card {
  background: linear-gradient(145deg, #0e1c2e, #0c1524);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 4px 20px rgba(56, 189, 248, 0.08);
}

.project-badge {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-cyan);
  background: var(--accent-cyan-dim);
  padding: 2px 8px;
  border-radius: 4px;
  align-self: flex-start;
  letter-spacing: 0.5px;
}

.project-badge.code {
  color: var(--accent-amber);
  background: var(--accent-amber-dim);
}

.project-card h4 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.project-card p {
  font-size: 0.9rem;
  color: #cbd5e1;
  line-height: 1.55;
}

.lab-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  font-size: 0.78rem;
  color: #94a3b8;
  font-family: var(--font-mono);
}

.project-actions {
  margin-top: auto;
  padding-top: 8px;
}

.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--accent-cyan);
  color: #070e17;
}

.btn-primary:hover {
  background: #7dd3fc;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.4);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: #e2e8f0;
  border: 1px solid var(--border-highlight);
}

.btn-secondary:hover {
  background: var(--border-highlight);
  color: #fff;
}

/* Station & Location Grid */
.station-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.station-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.station-card h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.station-details {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px 12px;
  font-size: 0.88rem;
}

.station-details dt {
  color: var(--text-dim);
  font-weight: 500;
}

.station-details dd {
  color: var(--text-main);
}

.grid-map-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.grid-visual {
  height: 120px;
  background: #090e1a;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.grid-crosshair {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(56, 189, 248, 0.15) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(56, 189, 248, 0.15) 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: center center;
}

.grid-ping {
  width: 14px;
  height: 14px;
  background: var(--accent-cyan);
  border-radius: 50%;
  position: relative;
  box-shadow: 0 0 12px var(--accent-cyan);
}

.grid-ping::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 2px solid var(--accent-cyan);
  border-radius: 50%;
  animation: radar-ping 2s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}

@keyframes radar-ping {
  0% { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(2.4); opacity: 0; }
}

.grid-overlay-tag {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(14, 20, 34, 0.8);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-highlight);
}

.grid-metrics {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Site Footer */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  padding-block: 20px;
  padding-inline: 24px;
  margin-top: auto;
}

.footer-inner {
  max-inline-size: 1100px;
  margin-inline: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: var(--accent-cyan);
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .site-header {
    padding-inline: 16px;
  }
  .station-telemetry {
    width: 100%;
    justify-content: space-between;
  }
  .hero-card {
    padding: 20px;
  }
  .lab-features {
    grid-template-columns: 1fr;
  }
}
