/* ============================================================
   On This Day — stylesheet
   ============================================================ */

:root {
  --bg: #0a0a0c; --bg2: #101014; --bg3: #16161c;
  --border: #2a2a38; --accent: #00e5b4; --accent2: #7b61ff;
  --gold: #d4af37;
  --text: #e8e8f0; --muted: #7070a0;
  --mono: 'Share Tech Mono', monospace;
  --display: 'Syne', sans-serif;
  --body: 'DM Sans', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-weight: 300;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.4;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--gold); }

/* --- NAV ---------------------------------------------------- */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 3rem;
  background: rgba(10,10,12,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-family: var(--mono);
  font-size: 1.05rem;
  color: var(--accent);
  letter-spacing: 0.05em;
}
.nav-logo span { color: var(--muted); }
.nav-links { display: flex; gap: 2.5rem; list-style: none; }
.nav-links a {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); }
@media (max-width: 600px) { .nav-links { display: none; } }

/* --- PICKER HERO -------------------------------------------- */
.picker-hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10rem 3rem 5rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}
.picker-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,229,180,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,180,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 100% at 20% 50%, black, transparent);
  pointer-events: none;
}
.picker-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}
.picker-title {
  font-family: var(--display);
  font-size: clamp(2.6rem, 7vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.95;
}
.picker-title em { color: var(--accent); font-style: normal; }
.picker-sub {
  max-width: 580px;
  color: var(--muted);
  margin-top: 2rem;
  font-size: 1.02rem;
  line-height: 1.7;
}
.picker-form {
  display: flex;
  gap: 0.8rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
  align-items: center;
}
#date-input {
  font-family: var(--mono);
  font-size: 1rem;
  background: var(--bg2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.85rem 1.2rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  color-scheme: dark;
  min-width: 200px;
}
#date-input:focus {
  outline: none;
  border-color: var(--accent);
}
.btn-primary, .btn-ghost {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.85rem 1.8rem;
  border: 1px solid;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}
.btn-primary:hover { background: transparent; color: var(--accent); }
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.picker-note {
  margin-top: 2rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  max-width: 580px;
}

/* --- RESULTS PANE ------------------------------------------- */
.results-pane {
  padding: 6rem 3rem 4rem;
  max-width: 820px;
  margin: 0 auto;
}
.results-pane.hidden { display: none; }

.day-page {
  background: transparent;
}
.day-header {
  border-bottom: 2px solid var(--border);
  padding-bottom: 2rem;
  margin-bottom: 2.5rem;
}
.day-eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.day-headline {
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.0;
}
.day-dateline {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.8rem;
  letter-spacing: 0.1em;
}

.day-section {
  margin-bottom: 2.8rem;
  padding-bottom: 2rem;
  border-bottom: 1px dashed var(--border);
}
.day-section:last-of-type { border-bottom: none; }
.day-section.empty { display: none; }
.day-section h2 {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 1.2rem;
  position: relative;
  padding-left: 1rem;
}
.day-section h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.45em;
  bottom: 0.45em;
  width: 2px;
  background: var(--accent);
}

/* data pairs (music / movies) */
.data-pairs { display: grid; gap: 0.7rem; }
.pair {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1rem;
  align-items: baseline;
}
.pair.hidden { display: none; }
.pair dt {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.pair dd {
  font-size: 1.02rem;
  color: var(--text);
}

.section-note {
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  font-style: italic;
}
.section-note:empty { display: none; }

.section-intro {
  font-size: 0.92rem;
  color: var(--muted);
  margin-bottom: 1rem;
  margin-top: -0.4rem;
}

/* bullet lists (games / sports / news) */
.bullet-list { list-style: none; }
.bullet-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.6rem;
  font-size: 1.02rem;
  color: var(--text);
}
.bullet-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--mono);
}
.bullet-list li.highlight {
  color: var(--gold);
}
.bullet-list li.highlight::before { color: var(--gold); }

/* chart blocks (sub-sections within music and films) */
.chart-block {
  margin-bottom: 1.4rem;
}
.chart-block.hidden { display: none; }
.chart-block h3 {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
  font-weight: 400;
}
.chart-block .bullet-list li {
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

/* births */
.births-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.5rem 1.5rem;
}
.births-list li {
  font-size: 0.98rem;
  color: var(--text);
  padding: 0.3rem 0;
}
.births-list li .born-year {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  margin-right: 0.5rem;
}
.births-list li .born-desc {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

/* the scene paragraph */
.scene-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  padding: 1.6rem 1.8rem;
  margin-top: 1rem;
}
.scene-section h2::before { background: var(--gold); }
.scene-body {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text);
  font-family: var(--body);
}

/* footer / actions */
.day-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  align-items: center;
}
.day-credits {
  flex-basis: 100%;
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.06em;
}

/* --- LOADING ------------------------------------------------ */
.loading {
  position: fixed;
  inset: 0;
  background: rgba(10,10,12,0.92);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}
.loading.hidden { display: none; }
.loading-inner { text-align: center; max-width: 420px; padding: 2rem; }
.loading-bars {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}
.loading-bars span {
  width: 6px;
  height: 36px;
  background: var(--accent);
  display: block;
  animation: bar 1.1s ease-in-out infinite;
}
.loading-bars span:nth-child(2) { animation-delay: 0.15s; }
.loading-bars span:nth-child(3) { animation-delay: 0.3s; }
.loading-bars span:nth-child(4) { animation-delay: 0.45s; }
@keyframes bar {
  0%, 100% { transform: scaleY(0.3); opacity: 0.4; }
  50%      { transform: scaleY(1.0); opacity: 1; }
}
.loading-text {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}
.loading-sub {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

/* --- ERROR -------------------------------------------------- */
.error-box {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg2);
  border: 1px solid #ff4d6d;
  border-left-width: 3px;
  color: var(--text);
  padding: 1rem 1.5rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  max-width: 520px;
  z-index: 300;
}
.error-box.hidden { display: none; }

/* --- SITE FOOTER -------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-logo { font-family: var(--mono); font-size: 0.85rem; color: var(--accent); }
.footer-note { font-family: var(--mono); font-size: 0.65rem; color: var(--muted); letter-spacing: 0.1em; }

/* --- PRINT STYLES ------------------------------------------- */
@media print {
  body { background: white; color: black; }
  body::before { display: none; }
  nav, .picker-hero, .loading, .error-box, .site-footer, .no-print {
    display: none !important;
  }
  .results-pane { padding: 0; max-width: none; }
  .day-page { color: black; }
  .day-headline, .day-section h2 { color: black; }
  .day-eyebrow, .day-dateline { color: #555; }
  .pair dt { color: #555; }
  .pair dd { color: black; }
  .day-section { border-bottom-color: #ccc; page-break-inside: avoid; }
  .day-section h2::before { background: black; }
  .scene-section {
    background: #f7f5f0;
    border-color: #999;
    border-left-color: #d4af37;
  }
  .scene-body, .bullet-list li, .births-list li { color: black; }
  .bullet-list li::before { color: black; }
  .bullet-list li.highlight { color: #8a6d00; font-weight: 500; }
  .bullet-list li.highlight::before { color: #8a6d00; }
  .chart-block h3 { color: #555; }
  .births-list li .born-year { color: #444; }
  .births-list li .born-desc { color: #666; }
  .section-note { color: #666; }
  .day-credits { color: #888; }
}

/* --- utility ------------------------------------------------ */
.hidden { display: none !important; }
