/* ===================================================================
   Parallax — shared stylesheet
   Dark cosmic theme, system fonts, zero external requests.
   =================================================================== */

:root {
  /* Color system */
  --bg-void:      #070714;
  --bg-deep:      #0d0d20;
  --bg-surface:   #15152a;
  --bg-elevated:  #1e1e38;

  --text-bright:  #f7f7fb;
  --text-body:    #c8c8d8;
  --text-muted:   #868699;
  --text-dim:     #565670;

  --brand:        #ffcc80;
  --brand-glow:   rgba(255, 204, 128, 0.13);
  --accent-cool:  #7ac7ff;
  --accent-pink:  #ff9fb8;

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-soft:   rgba(255, 255, 255, 0.10);
  --border-bright: rgba(255, 255, 255, 0.18);

  /* Typography */
  --font-sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "URW Palladio L", P052, Georgia, serif;
  --font-mono:  ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Spacing */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 6rem;
  --s-10: 8rem;

  /* Layout */
  --max-w: 68rem;
  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 22px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===================================================================
   Reset & base
   =================================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: clamp(15.5px, 0.6vw + 0.6rem, 17.5px);
  line-height: 1.6;
  color: var(--text-body);
  background: var(--bg-void);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Starfield — CSS-only, zero requests */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255,255,255,0.85), transparent 2px),
    radial-gradient(1px 1px at 87% 38%, rgba(255,255,255,0.55), transparent 2px),
    radial-gradient(1px 1px at 40% 78%, rgba(255,255,255,0.65), transparent 2px),
    radial-gradient(1px 1px at 72% 88%, rgba(255,255,255,0.40), transparent 2px),
    radial-gradient(1.4px 1.4px at 22% 60%, rgba(255,220,180,0.35), transparent 2px),
    radial-gradient(1px 1px at 62% 14%, rgba(180,220,255,0.40), transparent 2px),
    radial-gradient(1px 1px at 8% 92%, rgba(255,255,255,0.45), transparent 2px),
    radial-gradient(1px 1px at 95% 72%, rgba(200,200,255,0.35), transparent 2px);
  background-repeat: repeat;
  background-size: 420px 420px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.85;
}

/* Warm ambient glow */
body::after {
  content: "";
  position: fixed;
  top: -15%;
  right: -20%;
  width: 70vw;
  height: 70vw;
  max-width: 1200px;
  max-height: 1200px;
  background: radial-gradient(circle, var(--brand-glow), transparent 65%);
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}

main, header, footer, .site-header, .site-footer { position: relative; z-index: 1; }

/* Typography */
h1, h2, h3 { color: var(--text-bright); font-family: var(--font-serif); font-weight: 500; letter-spacing: -0.015em; line-height: 1.15; }
h1 { font-size: clamp(2.2rem, 4vw + 0.5rem, 4rem); }
h2 { font-size: clamp(1.6rem, 2vw + 0.7rem, 2.5rem); margin-bottom: var(--s-5); }
h3 { font-size: clamp(1.15rem, 0.8vw + 0.8rem, 1.4rem); margin-bottom: var(--s-3); }

p { margin-bottom: var(--s-4); }
p:last-child { margin-bottom: 0; }

a { color: var(--accent-cool); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--brand); }

strong { color: var(--text-bright); font-weight: 600; }

/* Layout helpers */
.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 var(--s-5); }
.narrow { max-width: 42rem; }

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--brand);
  padding: var(--s-1) var(--s-3);
  border: 1px solid var(--border-soft);
  border-radius: 100px;
  margin-bottom: var(--s-4);
}

/* ===================================================================
   Header & footer
   =================================================================== */

.site-header {
  padding: var(--s-5) 0;
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(8px);
  background: rgba(7, 7, 20, 0.6);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
}
.logo {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--text-bright);
  letter-spacing: -0.01em;
}
.logo-mark {
  width: 28px; height: 28px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffe0b3, #ff9933 55%, #994d1a 100%);
  box-shadow: 0 0 20px var(--brand-glow);
  flex-shrink: 0;
}
.nav { display: flex; gap: var(--s-5); font-size: 0.92rem; }
.nav a { color: var(--text-muted); }
.nav a:hover { color: var(--text-bright); }

.site-footer {
  margin-top: var(--s-10);
  padding: var(--s-7) 0 var(--s-6);
  border-top: 1px solid var(--border-subtle);
  color: var(--text-dim);
  font-size: 0.88rem;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-5);
  justify-content: space-between;
  align-items: center;
}
.site-footer nav { display: flex; gap: var(--s-5); flex-wrap: wrap; }
.site-footer a { color: var(--text-muted); }

/* ===================================================================
   Hero
   =================================================================== */

.hero {
  padding: var(--s-9) 0 var(--s-7);
  text-align: center;
}
.hero p.lede {
  max-width: 40rem;
  margin: var(--s-5) auto 0;
  font-size: 1.15rem;
  color: var(--text-muted);
}
.hero h1 em { font-style: italic; color: var(--brand); font-family: var(--font-serif); }

/* ===================================================================
   Forms
   =================================================================== */

.field-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  justify-content: center;
  align-items: end;
  margin-top: var(--s-6);
}
label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: var(--s-2);
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
}
input[type="date"], input[type="number"], input[type="text"], input[type="email"], select, textarea {
  font-family: var(--font-sans);
  font-size: 1rem;
  padding: var(--s-3) var(--s-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  color: var(--text-bright);
  outline: none;
  transition: all 0.2s var(--ease);
  color-scheme: dark;
  min-width: 0;
  width: 100%;
  max-width: 22rem;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

button, .btn {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  padding: var(--s-3) var(--s-5);
  background: var(--brand);
  color: #1a1a2e;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
  white-space: nowrap;
}
button:hover, .btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px var(--brand-glow); color: #1a1a2e; }
button:active, .btn:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-bright);
  color: var(--text-bright);
}
.btn-ghost:hover { background: var(--bg-surface); box-shadow: none; color: var(--text-bright); }

/* ===================================================================
   Section primitives
   =================================================================== */

section { padding: var(--s-8) 0; }
section.tight { padding: var(--s-6) 0; }

.section-head { text-align: center; margin-bottom: var(--s-7); }
.section-head p { color: var(--text-muted); max-width: 36rem; margin: var(--s-3) auto 0; }

/* ===================================================================
   Card grids
   =================================================================== */

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: var(--s-5);
}
.tool-card {
  display: block;
  padding: var(--s-6);
  background: linear-gradient(180deg, var(--bg-surface), var(--bg-deep));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  transition: all 0.25s var(--ease);
  color: var(--text-body);
  position: relative;
  overflow: hidden;
}
.tool-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.tool-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-2px);
  color: var(--text-body);
}
.tool-card:hover::before { opacity: 1; }
.tool-card .tool-icon {
  width: 44px; height: 44px; border-radius: 50%;
  margin-bottom: var(--s-4);
}
.tool-card h3 { color: var(--text-bright); margin-bottom: var(--s-2); }
.tool-card p { font-size: 0.92rem; color: var(--text-muted); margin: 0; }

/* ===================================================================
   Planet cards (Age on Other Planets + Cosmic Birthday)
   =================================================================== */

.planet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: var(--s-5);
  margin-top: var(--s-6);
}

.planet-card {
  padding: var(--s-6);
  background: linear-gradient(180deg, var(--bg-surface), var(--bg-deep));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  text-align: left;
  min-height: 14rem;
  position: relative;
  overflow: hidden;
}
.planet-card .planet-head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-2);
}
.planet-card .planet-name {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--text-bright);
}
.planet-card .age-big {
  font-family: var(--font-serif);
  font-size: 2.6rem;
  color: var(--brand);
  font-weight: 500;
  line-height: 1;
}
.planet-card .age-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: var(--s-1);
}
.planet-card .next-bday {
  margin-top: var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px solid var(--border-subtle);
  font-size: 0.88rem;
  color: var(--text-muted);
}
.planet-card .next-bday strong {
  display: block;
  color: var(--text-body);
  font-weight: 400;
  margin-top: var(--s-1);
}
.planet-card .fact {
  font-size: 0.82rem;
  color: var(--text-dim);
  font-style: italic;
  line-height: 1.5;
}

/* CSS-drawn planets */
.planet {
  width: 60px; height: 60px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  box-shadow: inset -6px -6px 14px rgba(0,0,0,0.45);
}
.planet.sm { width: 36px; height: 36px; box-shadow: inset -4px -4px 8px rgba(0,0,0,0.4); }
.planet.mercury  { background: radial-gradient(circle at 35% 30%, #d0cabf 0%, #8c8276 60%, #3a342c 100%); }
.planet.venus    { background: radial-gradient(circle at 35% 30%, #ffe2a8 0%, #d4a762 55%, #6e4520 100%); }
.planet.earth    { background: radial-gradient(circle at 35% 30%, #a8d4ff 0%, #2f74c4 50%, #0d1f4c 100%); }
.planet.earth::after { content:""; position:absolute; inset:0; border-radius:50%; background: radial-gradient(ellipse 40% 20% at 45% 55%, rgba(120,200,120,0.55), transparent 70%), radial-gradient(ellipse 30% 15% at 25% 35%, rgba(100,180,100,0.45), transparent 70%); }
.planet.mars     { background: radial-gradient(circle at 35% 30%, #ffaa80 0%, #c24e2e 55%, #4a1c10 100%); }
.planet.jupiter  { background: linear-gradient(180deg, #e8c79b 0%, #b88555 12%, #d9a472 22%, #8b5a37 34%, #dcb088 45%, #a67043 58%, #d4a372 70%, #8f5d38 82%, #c99068 100%); box-shadow: inset -6px -6px 16px rgba(0,0,0,0.45); }
.planet.saturn   { background: radial-gradient(circle at 35% 30%, #f4e4be 0%, #c7a76c 55%, #5a4422 100%); position: relative; }
.planet.saturn::after {
  content: ""; position: absolute;
  top: 50%; left: -35%; width: 170%; height: 18%;
  background: linear-gradient(90deg, transparent 0%, #c7a76c 25%, #e8d4a4 50%, #c7a76c 75%, transparent 100%);
  transform: translateY(-50%) rotate(-18deg);
  border-radius: 50%;
  opacity: 0.85;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.4);
}
.planet.uranus   { background: radial-gradient(circle at 35% 30%, #d5f4f2 0%, #7cc7c5 55%, #2a5957 100%); }
.planet.neptune  { background: radial-gradient(circle at 35% 30%, #7ba8e8 0%, #2e5aa8 55%, #0f1d47 100%); }
.planet.pluto    { background: radial-gradient(circle at 35% 30%, #d4b894 0%, #8a6b4a 55%, #3b2a1a 100%); }

/* ===================================================================
   Result card (single hero result block)
   =================================================================== */

.result-card {
  padding: var(--s-6);
  background: linear-gradient(180deg, var(--bg-surface), var(--bg-deep));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  margin-top: var(--s-6);
  text-align: center;
}
.result-card .big-number {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 6vw, 5rem);
  color: var(--brand);
  line-height: 1;
  margin: var(--s-3) 0;
}
.result-card .sub { color: var(--text-muted); font-size: 0.95rem; }

/* ===================================================================
   Life in Weeks grid
   =================================================================== */

.weeks-wrap { margin-top: var(--s-6); }
.weeks-legend {
  display: flex;
  gap: var(--s-5);
  flex-wrap: wrap;
  margin-bottom: var(--s-4);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.weeks-legend span { display: inline-flex; align-items: center; gap: var(--s-2); }
.legend-box { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
.legend-lived { background: var(--brand); }
.legend-remaining { background: var(--border-soft); }

.weeks-grid {
  display: grid;
  grid-template-columns: repeat(52, minmax(0, 1fr));
  gap: 2px;
  padding: var(--s-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}
.weeks-grid .week {
  aspect-ratio: 1 / 1;
  background: var(--border-soft);
  border-radius: 1px;
}
.weeks-grid .week.lived { background: var(--brand); opacity: 0.9; }
.weeks-grid .week.current { background: var(--accent-cool); box-shadow: 0 0 8px var(--accent-cool); }

/* ===================================================================
   Time Dust breakdown
   =================================================================== */

.dust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: var(--s-4);
  margin-top: var(--s-6);
}
.dust-card {
  padding: var(--s-5);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}
.dust-card h4 {
  font-family: var(--font-serif);
  color: var(--text-bright);
  font-size: 1.1rem;
  margin-bottom: var(--s-2);
}
.dust-card .years {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  color: var(--brand);
  line-height: 1;
  margin-bottom: var(--s-2);
}
.dust-card .sub { color: var(--text-muted); font-size: 0.85rem; }

.slider-row {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  margin-bottom: var(--s-3);
}
.slider-row label { flex: 0 0 8rem; margin: 0; }
.slider-row input[type="range"] { flex: 1; }
.slider-row .val { flex: 0 0 4rem; text-align: right; color: var(--brand); font-family: var(--font-mono); font-size: 0.9rem; }

input[type="range"] { accent-color: var(--brand); }

/* ===================================================================
   Content pages (About, Privacy, Terms)
   =================================================================== */

.prose { max-width: 42rem; margin: 0 auto; }
.prose h2 { margin-top: var(--s-7); margin-bottom: var(--s-3); }
.prose h2:first-child { margin-top: 0; }
.prose ul, .prose ol { margin: var(--s-3) 0 var(--s-4) var(--s-5); color: var(--text-body); }
.prose li { margin-bottom: var(--s-2); }

/* ===================================================================
   Ad slots
   =================================================================== */

.ad-slot {
  margin: var(--s-7) auto;
  padding: var(--s-4);
  min-height: 120px;
  max-width: 728px;
  background: var(--bg-deep);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-align: center;
}
/* Production: hide the placeholder label — live ads will fill it */
.ad-slot.live { border: none; padding: 0; background: transparent; min-height: 0; }

/* ===================================================================
   Utilities
   =================================================================== */

.muted { color: var(--text-muted); }
.dim   { color: var(--text-dim); }
.brand { color: var(--brand); }
.center { text-align: center; }
.mt-4 { margin-top: var(--s-4); }
.mt-5 { margin-top: var(--s-5); }
.mt-6 { margin-top: var(--s-6); }
.mb-0 { margin-bottom: 0; }

.hidden { display: none !important; }

/* Fade-in animation */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeUp 0.5s var(--ease) both; }
.fade-in.d1 { animation-delay: 0.05s; }
.fade-in.d2 { animation-delay: 0.12s; }
.fade-in.d3 { animation-delay: 0.2s; }

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ===================================================================
   Responsive
   =================================================================== */

@media (max-width: 640px) {
  .nav { gap: var(--s-4); font-size: 0.85rem; }
  .site-header { padding: var(--s-4) 0; }
  .hero { padding: var(--s-7) 0 var(--s-5); }
  section { padding: var(--s-6) 0; }
  .weeks-grid { padding: var(--s-3); gap: 1px; }
}
