@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;0,700;1,300;1,400&family=DM+Mono:wght@300;400;500&display=swap');

:root {
  --night: #030812;
  --deep-sky: #070f1f;
  --horizon: #0c1a30;
  --ice: #a0e4f5;
  --ice-dim: rgba(160,228,245,0.1);
  --ice-border: rgba(160,228,245,0.2);
  --tail-blue: #4ab8d4;
  --tail-cyan: #00e5ff;
  --nucleus: #f0f8ff;
  --dust-yellow: #e8c97a;
  --dust-dim: rgba(232,201,122,0.12);
  --text-bright: #e2f2ff;
  --text-mid: #7aa8c4;
  --text-dim: #3a6080;
}

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

body {
  font-family: 'Cormorant Garamond', serif;
  background: var(--night);
  color: var(--text-mid);
  min-height: 100vh;
  overflow-x: hidden;
}

#sky-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ── Vertical glow band on right ── */
body::after {
  content: '';
  position: fixed;
  top: 0;
  right: 0;
  width: 40%;
  height: 100vh;
  background: radial-gradient(ellipse at 100% 30%, rgba(0,229,255,0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

.wrap {
  position: relative;
  z-index: 2;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 28px 80px;
}

/* ── HERO ── */
.hero {
  padding: 70px 0 50px;
  border-bottom: 1px solid var(--ice-border);
  margin-bottom: 60px;
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 40px;
  align-items: end;
}

.hero-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 4px;
  color: var(--tail-cyan);
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(4rem, 11vw, 8rem);
  font-weight: 300;
  font-style: italic;
  line-height: 0.9;
  color: var(--nucleus);
  letter-spacing: -2px;
}

.hero h1 em {
  font-style: normal;
  font-weight: 700;
  color: var(--ice);
  display: block;
}

.hero-desc {
  font-size: 1.1rem;
  font-style: italic;
  line-height: 1.7;
  color: var(--text-mid);
  margin-top: 18px;
  font-weight: 300;
}

/* ── Comet illustration ── */
.comet-illus {
  position: relative;
  width: 220px;
  height: 180px;
}

/* ── Key facts row ── */
.facts-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: 60px;
  border-top: 1px solid var(--ice-border);
  border-left: 1px solid var(--ice-border);
}

.fact-box {
  padding: 20px 18px;
  border-bottom: 1px solid var(--ice-border);
  border-right: 1px solid var(--ice-border);
  transition: background 0.2s;
}

.fact-box:hover {
  background: var(--ice-dim);
}

.fact-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--tail-cyan);
  opacity: 0.7;
  margin-bottom: 8px;
}

.fact-value {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--nucleus);
  line-height: 1.1;
}

.fact-unit {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 300;
}

/* ── Section ── */
.section {
  margin-bottom: 56px;
  opacity: 0;
  transform: translateX(-16px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.section.visible { opacity: 1; transform: none; }

.section-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ice-border);
}

.section-num {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  color: var(--tail-cyan);
  opacity: 0.55;
}

.section h2 {
  font-size: 1.8rem;
  font-weight: 300;
  font-style: italic;
  color: var(--text-bright);
  letter-spacing: 0.5px;
}

p {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text-mid);
  font-weight: 300;
  margin-bottom: 16px;
}

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

/* ── Anatomy diagram boxes ── */
.anatomy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

@media (max-width: 600px) {
  .anatomy-grid { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
  .comet-illus { display: none; }
}

.anatomy-part {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 18px;
  border: 1px solid var(--ice-border);
  background: var(--deep-sky);
  border-radius: 4px;
  transition: border-color 0.2s;
}

.anatomy-part:hover {
  border-color: rgba(160,228,245,0.4);
}

.part-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}

.anatomy-part h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--nucleus);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.anatomy-part p {
  font-size: 0.82rem;
  margin: 0;
  line-height: 1.5;
}

/* ── Famous comets table ── */
.comets-list {
  margin-top: 20px;
  border: 1px solid var(--ice-border);
  border-radius: 4px;
  overflow: hidden;
}

.comet-row {
  display: grid;
  grid-template-columns: 180px 90px 1fr;
  gap: 0;
  border-bottom: 1px solid var(--ice-border);
  padding: 14px 18px;
  transition: background 0.15s;
  align-items: center;
}

.comet-row:last-child { border-bottom: none; }
.comet-row:hover { background: var(--ice-dim); }

.comet-row.header {
  background: var(--horizon);
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 3px;
  color: var(--tail-cyan);
  text-transform: uppercase;
  padding: 12px 18px;
}

.comet-name {
  font-weight: 600;
  color: var(--nucleus);
  font-size: 0.9rem;
  font-style: italic;
}

.comet-period {
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  color: var(--tail-cyan);
}

.comet-desc {
  font-size: 0.82rem;
  color: var(--text-mid);
  line-height: 1.4;
}

/* ── Orbit diagram container ── */
.orbit-section {
  background: var(--deep-sky);
  border: 1px solid var(--ice-border);
  border-radius: 8px;
  padding: 30px;
  margin-top: 20px;
  text-align: center;
}

#orbit-canvas {
  display: block;
  margin: 0 auto;
}

/* ── Quote ── */
.cometquote {
  margin: 28px 0;
  padding: 20px 28px;
  border-left: 2px solid var(--ice);
  background: var(--ice-dim);
}

.cometquote p {
  font-size: 1.1rem;
  font-style: italic;
  color: var(--nucleus);
  font-weight: 300;
  margin: 0 0 8px;
}

.cometquote cite {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  color: var(--tail-cyan);
  font-style: normal;
  letter-spacing: 1px;
}

/* ── Footer ── */
.footer-band {
  margin-top: 70px;
  border-top: 1px solid var(--ice-border);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-band span {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
}
