:root {
  --bg: #0a0e14;
  --bg-card: #111721;
  --bg-card-hover: #161e2b;
  --text: #c5d0e0;
  --text-dim: #6b7a90;
  --text-bright: #e8edf4;
  --accent: #e8a838;
  --accent-dim: #8a6a22;
  --accent-glow: rgba(232, 168, 56, 0.15);
  --accent-glow-strong: rgba(232, 168, 56, 0.3);
  --border: #1a2333;
  --border-hover: #2a3a50;
  --green: #3dd968;
  --mono: 'JetBrains Mono', monospace;
  --sans: 'Inter', sans-serif;
}

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

html { scroll-behavior: smooth; }

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

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23n)'/%3E%3C/svg%3E");
}

.scanline {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99;
  background: linear-gradient(transparent 50%, rgba(232, 168, 56, 0.015) 50%);
  background-size: 100% 3px;
}

/* Scroll progress */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  z-index: 200;
  box-shadow: 0 0 8px var(--accent-glow);
  transition: width 0.1s ease-out;
}

/* Nav */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 2rem;
  z-index: 50;
  background: rgba(10, 14, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

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

.nav-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2s ease-in-out infinite;
}

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

.nav-callsign {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--text-bright);
}

.nav-links {
  display: flex;
  gap: 1.8rem;
}

.nav-links a {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.nav-links a:hover { color: var(--accent); }
.nav-links a:hover::after { width: 100%; }
.nav-links a.active { color: var(--accent); }
.nav-links a.active::after { width: 100%; }

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 6rem 2rem 4rem;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Radar */
.radar {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 600px; height: 600px;
  opacity: 0.12;
}

.radar-ring {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid var(--accent);
  border-radius: 50%;
}

.radar-ring.r1 { width: 120px; height: 120px; }
.radar-ring.r2 { width: 300px; height: 300px; }
.radar-ring.r3 { width: 600px; height: 600px; }

.radar-sweep {
  position: absolute;
  top: 50%; left: 50%;
  width: 300px; height: 2px;
  transform-origin: left center;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius: 1px;
  animation: radarSweep 6s linear infinite;
}

@keyframes radarSweep {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.radar-blip {
  position: absolute;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent);
  opacity: 0;
  animation: blip 6s linear infinite;
  top: 50%; left: 50%;
  margin-top: -3px; margin-left: -3px;
}

@keyframes blip {
  0%, 90%, 100% { opacity: 0; transform: translate(0, 0); }
  10% { opacity: 0.8; transform: translate(-180px, -80px); }
  30% { opacity: 0.3; }
  50% { opacity: 0; }
  55% { opacity: 0.8; transform: translate(150px, 100px); }
  70% { opacity: 0.3; }
  85% { opacity: 0; }
}

.horizon {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 45%;
  background: linear-gradient(180deg, transparent, rgba(232, 168, 56, 0.04) 60%, rgba(232, 168, 56, 0.08));
}

.stars {
  position: absolute;
  inset: 0;
}

.star {
  position: absolute;
  width: 2px; height: 2px;
  background: var(--text-dim);
  border-radius: 50%;
  opacity: 0;
  animation: twinkle 4s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0; }
  50% { opacity: 0.6; }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
  text-align: center;
}

.hero-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeIn 0.8s ease 0.3s forwards;
}

.hero-title {
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(1.8rem, 5vw, 3rem);
  line-height: 1.15;
  color: var(--text-bright);
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
  opacity: 0;
  animation: fadeIn 0.8s ease 0.5s forwards;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-dim);
  max-width: 540px;
  margin: 0 auto 2rem;
  line-height: 1.7;
  min-height: 5rem;
  opacity: 0;
  animation: fadeIn 0.4s ease 0.7s forwards;
}

.hero-sub::after {
  content: '▌';
  color: var(--accent);
  animation: blink 0.8s step-end infinite;
  margin-left: 2px;
}

.hero-sub.done::after {
  content: '';
}

@keyframes blink {
  50% { opacity: 0; }
}

@keyframes fadeIn {
  to { opacity: 1; }
}

.hero-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  opacity: 0;
  animation: fadeIn 0.8s ease 1.5s forwards;
}

.meta-tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-dim);
  transition: all 0.25s;
}

.meta-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  transform: translateY(-1px);
}

/* Sections */
.section {
  max-width: 800px;
  margin: 0 auto;
  padding: 5rem 2rem;
}

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

.section-num {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.15em;
}

.section-title {
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-bright);
  margin: 0.5rem 0 0.3rem;
  letter-spacing: -0.01em;
}

.section-desc {
  font-size: 0.95rem;
  color: var(--text-dim);
}

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

.instrument-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.8rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.instrument-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.3s ease;
}

.instrument-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, var(--accent-glow), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.instrument-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-dim);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--accent-glow);
}

.instrument-card:hover::before { transform: scaleY(1); }
.instrument-card:hover::after { opacity: 1; }

.card-icon {
  width: 32px; height: 32px;
  color: var(--accent);
  margin-bottom: 1rem;
  opacity: 0.7;
  transition: all 0.3s;
}

.card-icon svg { width: 100%; height: 100%; }

.instrument-card:hover .card-icon {
  opacity: 1;
  transform: scale(1.1);
  filter: drop-shadow(0 0 6px var(--accent-glow-strong));
}

.instrument-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 0.6rem;
  transition: color 0.3s;
}

.instrument-card:hover h3 { color: var(--accent); }

.instrument-card p {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.65;
}

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

.log-entry {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.8rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.log-entry:hover {
  border-color: var(--accent-dim);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.log-stamp {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 0.8rem;
  padding: 0.2rem 0.5rem;
  background: var(--accent-glow);
  border-radius: 2px;
  display: inline-block;
  transition: all 0.3s;
}

.log-entry:hover .log-stamp {
  background: var(--accent-glow-strong);
  box-shadow: 0 0 8px var(--accent-glow);
  transform: scale(1.05);
}

.log-entry h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 0.6rem;
  transition: color 0.3s;
}

.log-entry:hover h3 { color: var(--accent); }

.log-entry p {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.65;
  margin-bottom: 0.8rem;
}

.log-link {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  transition: all 0.2s;
  position: relative;
}

.log-link::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.log-link:hover { opacity: 0.8; }
.log-link:hover::after { width: 100%; }

/* Frequency */
.freq-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.freq-item {
  display: grid;
  grid-template-columns: 110px 100px 60px 1fr;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: all 0.25s;
  cursor: default;
}

.freq-item:hover {
  border-color: var(--accent-dim);
  background: var(--bg-card-hover);
  transform: translateX(4px);
}

.freq-channel {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 400;
}

.freq-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--text-bright);
}

.freq-signal {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 20px;
}

.freq-bar {
  width: 3px;
  background: var(--accent);
  border-radius: 1px;
  opacity: 0.3;
  transition: opacity 0.3s;
}

.freq-item:hover .freq-bar { opacity: 0.8; }

@keyframes signalPulse {
  0%, 100% { height: 30%; }
  50% { height: 100%; }
}

.freq-desc {
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* Footer */
.footer {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
  text-align: center;
}

.footer-line {
  height: 1px;
  background: var(--border);
  margin-bottom: 2rem;
}

.footer-text {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.footer-status { color: var(--green); }

.footer-sep { opacity: 0.4; }

.footer-link {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}

.footer-link:hover { opacity: 0.7; }

.footer-time { color: var(--text-dim); }

/* Responsive */
@media (max-width: 640px) {
  .nav-links { display: none; }
  .instrument-grid, .logbook-grid { grid-template-columns: 1fr; }
  .freq-item {
    grid-template-columns: 80px 1fr;
    gap: 0.5rem;
  }
  .freq-signal { display: none; }
  .freq-desc { grid-column: 1 / -1; padding-left: 0; }
  .section { padding: 3.5rem 1.2rem; }
  .hero { padding: 5rem 1.2rem 3rem; }
  .radar { width: 400px; height: 400px; }
  .radar-ring.r3 { width: 400px; height: 400px; }
  .radar-ring.r2 { width: 200px; height: 200px; }
  .radar-sweep { width: 200px; }
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}