/* ══════════════════════════════════════════════════
   Herald — Signal Intelligence
   Dark theme, radar-inspired, network discovery tool
   ══════════════════════════════════════════════════ */

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

/* ── Custom Properties ──────────────────────────── */
:root {
  --bg:          #080c14;
  --bg-surface:  #0f1520;
  --bg-card:     #111926;
  --text:        #e2e8f0;
  --text-muted:  #8494a7;
  --cyan:        #38bdf8;
  --cyan-dim:    rgba(56, 189, 248, 0.12);
  --cyan-glow:   rgba(56, 189, 248, 0.25);
  --amber:       #f59e0b;
  --amber-dim:   rgba(245, 158, 11, 0.10);
  --border:      rgba(56, 189, 248, 0.08);
  --border-card: rgba(56, 189, 248, 0.12);
  --radius:      14px;
  --radius-lg:   22px;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Karla', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ── Typography ─────────────────────────────────── */
h1, h2, h3 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.section-title {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  text-align: center;
  margin-bottom: 1.2rem;
  background: linear-gradient(135deg, var(--text) 60%, var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

code {
  background: var(--cyan-dim);
  color: var(--cyan);
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 0.88em;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

/* ── Radar Background ───────────────────────────── */
.radar-bg {
  position: fixed;
  top: -20vh;
  right: -10vw;
  width: 70vw;
  height: 70vw;
  max-width: 800px;
  max-height: 800px;
  pointer-events: none;
  z-index: 0;
}

.radar-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(56, 189, 248, 0.06);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.radar-ring-1 { width: 40%; height: 40%; }
.radar-ring-2 { width: 70%; height: 70%; }
.radar-ring-3 { width: 100%; height: 100%; }

.radar-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  background: var(--cyan);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 20px var(--cyan-glow), 0 0 60px var(--cyan-dim);
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; box-shadow: 0 0 20px var(--cyan-glow), 0 0 60px var(--cyan-dim); }
  50%      { opacity: 1;   box-shadow: 0 0 30px var(--cyan-glow), 0 0 100px var(--cyan-dim); }
}

/* ── Nav ────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 0;
  transition: background 0.3s, backdrop-filter 0.3s, padding 0.3s;
}

.nav--scrolled {
  background: rgba(8, 12, 20, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
}

.nav-icon {
  border-radius: 8px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.2s;
}

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

.nav-appstore,
.nav-github {
  color: var(--text-muted);
  transition: color 0.2s;
}

.nav-appstore:hover,
.nav-github:hover {
  color: var(--cyan);
}

/* ── Buttons ────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 14px 30px;
  border-radius: 100px;
  font-family: 'Karla', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.25s ease;
  border: none;
  cursor: pointer;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--cyan);
  color: #080c14;
}

.btn-primary:hover {
  background: #5dcbfb;
  box-shadow: 0 4px 24px var(--cyan-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--cyan);
  border: 1.5px solid rgba(56, 189, 248, 0.3);
  padding: 12.5px 28.5px;
}

.btn-ghost:hover {
  border-color: var(--cyan);
  background: var(--cyan-dim);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  padding: 12.5px 28.5px;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ── Hero ───────────────────────────────────────── */
.hero {
  padding: 140px 0 100px;
  position: relative;
  z-index: 1;
}

.hero-content {
  display: flex;
  align-items: center;
  gap: 80px;
}

.hero-text {
  flex: 1;
  min-width: 0;
}

.app-badge {
  margin-bottom: 28px;
}

.app-badge-icon {
  border-radius: 18px;
  box-shadow: 0 4px 24px rgba(56, 189, 248, 0.15);
}

h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.4rem);
  margin-bottom: 20px;
  background: linear-gradient(135deg, #ffffff 40%, var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 36px;
  max-width: 480px;
}

.cta-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.cta-row-center {
  justify-content: center;
}

/* Phone */
.hero-phone {
  flex-shrink: 0;
  width: 300px;
  position: relative;
}

.phone-frame {
  position: relative;
}

.phone-glow {
  position: absolute;
  inset: -30px;
  background: radial-gradient(ellipse at center, var(--cyan-glow) 0%, transparent 70%);
  border-radius: 50%;
  z-index: -1;
  opacity: 0.5;
  animation: phone-glow 4s ease-in-out infinite alternate;
}

@keyframes phone-glow {
  0%   { opacity: 0.3; transform: scale(0.95); }
  100% { opacity: 0.6; transform: scale(1.05); }
}

.phone-screenshot {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.1),
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(56, 189, 248, 0.08);
}

/* ── Features ───────────────────────────────────── */
.features {
  padding: 100px 0;
  position: relative;
  z-index: 1;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 52px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  padding: 30px;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

.feature-card:hover {
  border-color: rgba(56, 189, 248, 0.25);
  box-shadow: 0 8px 32px rgba(56, 189, 248, 0.08);
  transform: translateY(-2px);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--cyan-dim);
  color: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.feature-icon--thread {
  background: rgba(168, 85, 247, 0.12);
  color: #a855f7;
}

.feature-icon--matter {
  background: var(--amber-dim);
  color: var(--amber);
}

.feature-icon--detail {
  background: rgba(34, 197, 94, 0.10);
  color: #22c55e;
}

.feature-icon--search {
  background: rgba(244, 114, 182, 0.10);
  color: #f472b6;
}

.feature-icon--export {
  background: rgba(99, 102, 241, 0.10);
  color: #818cf8;
}

.feature-card h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
  color: var(--text);
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.93rem;
  line-height: 1.65;
}

/* ── Screenshots ────────────────────────────────── */
.screenshots {
  padding: 100px 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.screenshots-track {
  display: flex;
  gap: 28px;
  margin-top: 52px;
  justify-content: center;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 12px;

  /* Hide scrollbar but keep functionality */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.screenshots-track::-webkit-scrollbar {
  display: none;
}

.screenshot-item {
  flex-shrink: 0;
  scroll-snap-align: center;
  text-align: center;
}

.screenshot-item img {
  width: 230px;
  height: auto;
  border-radius: var(--radius);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.08),
    0 12px 40px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s, box-shadow 0.3s;
}

.screenshot-item img:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.15),
    0 20px 50px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(56, 189, 248, 0.06);
}

.screenshot-label {
  display: block;
  margin-top: 14px;
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}

/* ── Tech ───────────────────────────────────────── */
.tech {
  padding: 100px 0;
  text-align: center;
  position: relative;
  z-index: 1;
}

.tech-intro {
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 36px;
  font-size: 1.02rem;
  line-height: 1.75;
}

.tech-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.pill {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  padding: 8px 20px;
  border-radius: 100px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: border-color 0.2s, color 0.2s;
}

.pill:hover {
  border-color: rgba(56, 189, 248, 0.3);
  color: var(--cyan);
}

/* ── Open Source ─────────────────────────────────── */
.open-source {
  padding: 100px 0;
  background: var(--bg-surface);
  text-align: center;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.open-source-desc {
  color: var(--text-muted);
  margin-bottom: 28px;
  font-size: 1.05rem;
}

/* ── Footer ─────────────────────────────────────── */
.footer {
  padding: 36px 0;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

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

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
}

.footer-icon {
  border-radius: 6px;
}

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

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.2s;
}

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

/* ── Scroll Reveal ──────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 900px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 120px 0 60px;
  }

  .hero-content {
    flex-direction: column;
    text-align: center;
    gap: 48px;
  }

  .app-badge {
    display: flex;
    justify-content: center;
  }

  .tagline {
    margin-left: auto;
    margin-right: auto;
  }

  .cta-row {
    justify-content: center;
  }

  .hero-phone {
    width: 250px;
  }

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

  .screenshots-track {
    justify-content: flex-start;
    padding-left: 28px;
    padding-right: 28px;
  }

  .screenshot-item img {
    width: 190px;
  }

  .footer-content {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .radar-bg {
    top: -10vh;
    right: -30vw;
    width: 100vw;
    max-width: 500px;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 110px 0 48px;
  }

  .hero-phone {
    width: 220px;
  }

  .screenshot-item img {
    width: 160px;
  }

  .tagline {
    font-size: 1.02rem;
  }

  .nav-links a:not(.nav-github) {
    display: none;
  }
}
