/* ============================================================
   Search for Alien Life — shared stylesheet
   Extends UniverseTrips.com's reference-content pattern
   (see space-tourism.html) to astrobiology.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --ink: #14171c;
  --ink-soft: #4a5058;
  --paper: #fafaf8;
  --paper-dim: #f1efe9;
  --line: #dedad0;
  --card: #ffffff;

  /* per-world accents — drawn from each world's real character,
     not a decorative palette */
  --mars: #b5502a;      /* Jezero Crater red-ochre */
  --mars-dim: #f4e6df;
  --europa: #2f6f93;    /* ice-shelf blue */
  --europa-dim: #e2edf2;
  --titan: #c9862f;     /* methane-haze amber */
  --titan-dim: #f5e9d6;
  --exo: #5b4b8a;        /* deep-space violet, K2-18b */
  --exo-dim: #eae6f3;
  --accent: var(--exo);
  --accent-dim: var(--exo-dim);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: 'Newsreader', Georgia, serif; font-weight: 500; margin: 0 0 .4em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.1rem, 4.5vw, 3.1rem); line-height: 1.08; }
h1 em, h2 em, .headline em { font-style: italic; color: var(--accent); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; color: var(--ink-soft); max-width: 62ch; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ---- nav ---- */
.site-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--line);
  font-size: 0.95rem; flex-wrap: wrap; gap: 10px;
}
.site-nav .brand { font-family: 'Newsreader', serif; font-weight: 600; color: var(--ink); font-size: 1.05rem; }
.site-nav .crumb { color: var(--ink-soft); font-weight: 400; }
.site-nav ul { list-style: none; display: flex; gap: 22px; margin: 0; padding: 0; flex-wrap: wrap; }
.site-nav a { color: var(--ink-soft); }
.site-nav a:hover { color: var(--ink); text-decoration: none; }

/* ---- eyebrow / badges ---- */
.eyebrow {
  display: inline-block; font-size: 0.78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--accent); background: var(--accent-dim);
  padding: 5px 12px; border-radius: 999px; margin-bottom: 18px;
}

/* ---- hero ---- */
.hero {
  position: relative; overflow: hidden;
  padding: 64px 0 48px;
  background:
    radial-gradient(1.5px 1.5px at center, rgba(255,255,255,0.16) 1px, transparent 1.5px) 0 0/26px 26px,
    radial-gradient(ellipse at 15% 20%, rgba(181,80,42,0.16) 0%, transparent 42%),
    radial-gradient(ellipse at 85% 15%, rgba(47,111,147,0.16) 0%, transparent 42%),
    radial-gradient(ellipse at 80% 85%, rgba(201,134,47,0.14) 0%, transparent 42%),
    radial-gradient(ellipse at 20% 90%, rgba(91,75,138,0.18) 0%, transparent 42%),
    linear-gradient(160deg, #0e1015 0%, #14171c 60%, #171a21 100%);
}
.hero .signal-glow {
  position: absolute; width: 5px; height: 5px; border-radius: 50%;
  box-shadow: 0 0 10px 3px var(--c), 0 0 22px 7px color-mix(in srgb, var(--c) 55%, transparent);
  background: var(--c);
}
.hero .wrap { position: relative; z-index: 1; }
.hero .eyebrow { background: rgba(255,255,255,0.1); color: #f1eefc; }
.hero .tagline { font-style: italic; font-size: 1.05rem; margin: 0 0 14px; display: block; color: rgba(231,229,223,0.75); }
.hero h1 { color: #fdfcfa; }
.hero p.lead { font-size: 1.15rem; max-width: 68ch; color: #e7e5df; }
.hero > .wrap > p:not(.lead):not(.tagline) { color: rgba(231,229,223,0.82); }
.hero-actions { display: flex; gap: 14px; margin-top: 22px; flex-wrap: wrap; }

@media (prefers-reduced-motion: no-preference) {
  .hero .signal-glow { animation: signal-pulse 4.5s ease-in-out infinite; }
  .hero .signal-glow:nth-child(2) { animation-delay: 1.1s; }
  .hero .signal-glow:nth-child(3) { animation-delay: 2.2s; }
  .hero .signal-glow:nth-child(4) { animation-delay: 3.3s; }
  @keyframes signal-pulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
}

/* ---- evidence scale: the four worlds, positioned by how close each is to an answer ---- */
.evidence-scale { margin: 44px 0 8px; }
.scale-axis-labels {
  display: flex; justify-content: space-between;
  font-family: 'Inter', sans-serif; font-size: 0.72rem; color: rgba(231,229,223,0.55);
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 14px;
}
.scale-track-wrap { position: relative; min-height: 122px; }
.scale-track { position: absolute; top: 0; left: 0; right: 0; height: 2px; background: rgba(255,255,255,0.18); }
.scale-point {
  position: absolute; top: -7px; left: var(--pos); transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; text-align: center; width: 132px;
}
.scale-dot {
  width: 16px; height: 16px; border-radius: 50%; background: var(--c);
  border: 3px solid #14171c; box-shadow: 0 0 0 1.5px var(--c), 0 0 12px 2px color-mix(in srgb, var(--c) 60%, transparent); flex-shrink: 0;
}
.scale-label {
  margin-top: 12px; font-family: 'Inter', sans-serif; font-size: 0.82rem;
  line-height: 1.4; color: rgba(231,229,223,0.68);
}
.scale-label b { display: block; color: #fdfcfa; font-weight: 600; margin-top: 3px; }

@media (max-width: 680px) {
  .scale-axis-labels { display: none; }
  .scale-track-wrap { min-height: 0; padding-left: 10px; }
  .scale-track { left: 7px; top: 4px; bottom: 4px; right: auto; width: 2px; height: auto; }
  .scale-point {
    position: relative; top: auto; left: auto !important; transform: none;
    flex-direction: row; align-items: flex-start; text-align: left; width: auto;
    margin-bottom: 22px; padding-left: 24px;
  }
  .scale-point:last-child { margin-bottom: 0; }
  .scale-dot { position: absolute; left: -1px; top: 2px; }
  .scale-label { margin-top: 0; }
}
.btn {
  display: inline-block; padding: 11px 20px; border-radius: 6px;
  font-weight: 600; font-size: 0.95rem; border: 1px solid var(--ink);
}
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: #000; text-decoration: none; }
.btn.ghost { color: var(--ink); }
.btn.ghost:hover { background: var(--paper-dim); text-decoration: none; }

/* ---- world card grid (index page) ---- */
.section { padding: 48px 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 26px; flex-wrap: wrap; gap: 10px; }
.section-head .eyebrow { margin-bottom: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.world-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 24px; display: flex; flex-direction: column; gap: 10px;
  border-top: 3px solid var(--card-accent, var(--accent));
}
.world-card .tag { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--card-accent, var(--accent)); }
.world-card h3 { margin: 0; }
.world-card p { font-size: 0.93rem; margin: 0; }
.world-stats { display: flex; gap: 18px; margin: 8px 0; flex-wrap: wrap; }
.world-stats div { font-size: 0.8rem; }
.world-stats b { display: block; font-family: 'Newsreader', serif; font-size: 1.15rem; color: var(--ink); font-weight: 500; }
.world-card .more { font-weight: 600; font-size: 0.9rem; margin-top: auto; }

/* ---- stat row (deep-dive pages) ---- */
.stat-row { display: flex; gap: 0; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 28px 0; }
.stat-row div { flex: 1 1 140px; padding: 18px 20px; border-right: 1px solid var(--line); }
.stat-row div:last-child { border-right: none; }
.stat-row .label { display: block; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); margin-bottom: 4px; }
.stat-row .value { font-family: 'Newsreader', serif; font-size: 1.3rem; }

/* ---- panel / worth-knowing ---- */
.panel { background: var(--paper-dim); border: 1px solid var(--line); border-radius: 10px; padding: 24px 28px; margin: 20px 0; }
.panel h3 { margin-bottom: 8px; }
.panel.status { border-left: 4px solid var(--accent); }

/* ---- 3-col explainer cards ---- */
.explain-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 22px; margin: 24px 0; }
.explain-grid .tag { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); display: block; margin-bottom: 6px; }

/* ---- video ---- */
.video-frame { position: relative; padding-top: 56.25%; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); margin: 18px 0 6px; background: #000; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-caption { font-size: 0.82rem; color: var(--ink-soft); margin: 0; }

/* ---- folklore sidebar ---- */
.folklore {
  background: var(--ink); color: var(--paper);
  border-radius: 10px; padding: 26px 28px; margin: 26px 0;
}
.folklore .eyebrow { background: rgba(255,255,255,0.12); color: #f0e6ff; }
.folklore p { color: #d8d5cf; }
.folklore .fine { font-size: 0.8rem; color: #9a9690; margin-top: 10px; }

/* ---- footer note (honesty pattern from space-tourism.html) ---- */
.notice { text-align: center; padding: 26px 0 6px; color: var(--ink-soft); font-size: 0.9rem; }

footer.site-footer { border-top: 1px solid var(--line); padding: 32px 24px; margin-top: 40px; }
footer.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px; font-size: 0.88rem; color: var(--ink-soft); }
footer.site-footer ul { list-style: none; display: flex; gap: 18px; padding: 0; margin: 0; flex-wrap: wrap; }
footer.site-footer a { color: var(--ink-soft); }

/* ---- explorer badges ---- */
.badge-tray { display: flex; gap: 12px; flex-wrap: wrap; margin: 18px 0 8px; }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px; border: 1.5px solid var(--line);
  font-size: 0.88rem; font-weight: 600; color: var(--ink-soft);
}
.badge .badge-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); display: inline-block; flex-shrink: 0; }
.badge.earned { border-color: var(--badge-color, var(--accent)); color: var(--ink); background: var(--paper-dim); }
.badge.earned .badge-dot { background: var(--badge-color, var(--accent)); }
.badge.locked:hover { border-color: var(--ink-soft); text-decoration: none; }

.badge-toast {
  position: fixed; bottom: 22px; right: 22px; z-index: 999; max-width: 260px;
  background: var(--ink); color: var(--paper); padding: 14px 18px;
  border-radius: 8px; font-size: 0.88rem; line-height: 1.4;
  box-shadow: 0 10px 28px rgba(0,0,0,0.28);
  opacity: 0; transform: translateY(14px); transition: opacity .35s ease, transform .35s ease;
}
.badge-toast.show { opacity: 1; transform: translateY(0); }
.badge-toast strong { font-family: 'Newsreader', serif; font-weight: 600; font-size: 1rem; }

/* ---- hero with real mission photo ---- */
.hero-photo {
  position: relative; min-height: 380px; display: flex; align-items: flex-end;
  background-size: cover; background-position: center;
  border-bottom: 1px solid var(--line);
}
.hero-photo::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8,10,14,0.1) 0%, rgba(8,10,14,0.82) 88%);
}
.hero-photo .wrap { position: relative; z-index: 1; padding-top: 140px; padding-bottom: 34px; }
.hero-photo .eyebrow { background: rgba(255,255,255,0.16); color: #fff; }
.hero-photo h1 { color: #fff; }
.hero-photo h1 em { color: #fff; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; font-style: normal; }
.hero-photo p.lead { color: #e7e5df; }
.hero-photo .photo-credit { color: rgba(255,255,255,0.6); font-size: 0.75rem; margin-top: 8px; }

/* ---- world card thumbnail ---- */
.world-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 6px; margin-bottom: 2px; }

@media (max-width: 640px) {
  .site-nav ul { gap: 14px; font-size: 0.9rem; }
  .stat-row div { flex: 1 1 45%; }
  .badge-toast { left: 16px; right: 16px; max-width: none; bottom: 16px; }
  .hero-photo .wrap { padding-top: 100px; }
}
