@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400;1,700&family=Jost:wght@200;300;400;500;600&display=swap');

:root {
  --ink: #06020f;
  --deep: #0d0520;
  --mid: #130930;
  --surface: #1a1040;
  --violet: #7c3aed;
  --violet-glow: rgba(124,58,237,0.15);
  --violet-border: rgba(124,58,237,0.25);
  --lilac: #c4b5fd;
  --gold: #f0cc6a;
  --gold-dim: rgba(240,204,106,0.12);
  --pink: #f472b6;
  --text: #ddd6fe;
  --text-muted: #6d5aaa;
  --white: #f8f4ff;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Jost', sans-serif;
  background: var(--ink);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

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

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(124,58,237,0.12) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 90% 60%, rgba(244,114,182,0.06) 0%, transparent 50%);
  z-index: 1;
  pointer-events: none;
}

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

/* ── HERO ── */
.hero {
  padding: 72px 0 60px;
  text-align: center;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(124,58,237,0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.hero-kicker {
  font-family: 'Jost', sans-serif;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: var(--violet);
  opacity: 0.8;
  margin-bottom: 24px;
}

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(5rem, 14vw, 11rem);
  font-weight: 900;
  font-style: italic;
  line-height: 0.85;
  letter-spacing: -4px;
  color: var(--white);
}

.hero h1 .sub {
  display: block;
  font-size: 0.3em;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 8px;
  color: var(--lilac);
  text-transform: uppercase;
  margin-top: 14px;
  font-family: 'Jost', sans-serif;
}

.hero-desc {
  max-width: 620px;
  margin: 32px auto 0;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-muted);
  font-weight: 300;
}

/* ── Hubble classification strip ── */
.hubble-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 60px 0;
  border: 1px solid var(--violet-border);
  border-radius: 6px;
  overflow: hidden;
}

.hub-type {
  flex: 1;
  text-align: center;
  padding: 18px 10px;
  border-right: 1px solid var(--violet-border);
  background: var(--deep);
  transition: background 0.2s;
  cursor: default;
}

.hub-type:last-child { border-right: none; }
.hub-type:hover { background: var(--violet-glow); }

.hub-sym {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.5rem;
  color: var(--gold);
  display: block;
  margin-bottom: 4px;
}

.hub-label {
  font-size: 0.68rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Data mosaic ── */
.mosaic {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto auto;
  gap: 12px;
  margin-bottom: 70px;
}

.mosaic-cell {
  background: var(--deep);
  border: 1px solid var(--violet-border);
  border-radius: 6px;
  padding: 22px 18px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.mosaic-cell:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(124,58,237,0.15);
}

.mosaic-cell.wide { grid-column: span 2; }

.mosaic-cell .m-label {
  font-size: 0.6rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--violet);
  opacity: 0.7;
  margin-bottom: 8px;
  font-weight: 500;
}

.mosaic-cell .m-value {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: var(--gold);
  line-height: 1.1;
}

.mosaic-cell .m-unit {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Section ── */
.section {
  margin-bottom: 60px;
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

.section-label {
  font-size: 0.62rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--violet);
  opacity: 0.6;
  margin-bottom: 10px;
  font-weight: 500;
}

.section h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 24px;
  border-bottom: 1px solid var(--violet-border);
  padding-bottom: 12px;
}

p {
  font-size: 0.96rem;
  line-height: 1.85;
  color: var(--text-muted);
  font-weight: 300;
  margin-bottom: 14px;
}

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

/* ── Type cards ── */
.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.type-card {
  background: var(--deep);
  border: 1px solid var(--violet-border);
  border-radius: 8px;
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s;
}

.type-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--violet), var(--pink));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
}

.type-card:hover { border-color: rgba(124,58,237,0.5); }
.type-card:hover::after { transform: scaleX(1); }

.type-icon { font-size: 2rem; margin-bottom: 10px; display: block; }

.type-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.type-card p { font-size: 0.82rem; margin: 0; line-height: 1.6; }

/* ── Notable galaxies ── */
.galaxy-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 20px;
}

@media (max-width: 600px) {
  .galaxy-list { grid-template-columns: 1fr; }
  .mosaic { grid-template-columns: 1fr 1fr; }
  .mosaic-cell.wide { grid-column: span 2; }
  .hubble-strip { flex-wrap: wrap; }
}

.gal-card {
  display: flex;
  gap: 16px;
  background: var(--deep);
  border: 1px solid var(--violet-border);
  border-radius: 8px;
  padding: 18px;
  align-items: flex-start;
  transition: background 0.2s;
}

.gal-card:hover { background: var(--violet-glow); }

.gal-indicator {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
}

.gal-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem;
  font-style: italic;
  color: var(--gold);
  margin-bottom: 4px;
}

.gal-card .gal-type {
  font-size: 0.65rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--violet);
  margin-bottom: 6px;
}

.gal-card p { font-size: 0.8rem; margin: 0; line-height: 1.5; }

/* ── Cosmic web section ── */
.web-callout {
  background: linear-gradient(135deg, var(--mid), var(--surface));
  border: 1px solid rgba(196,181,253,0.2);
  border-radius: 12px;
  padding: 32px;
  margin-top: 20px;
  position: relative;
  overflow: hidden;
}

.web-callout::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(124,58,237,0.12) 0%, transparent 70%);
}

.web-callout h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: var(--lilac);
  margin-bottom: 14px;
}

.web-callout p { margin: 0 0 12px; }
.web-callout p:last-child { margin: 0; }

/* ── Scale boxes ── */
.scale-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0;
  border: 1px solid var(--violet-border);
  border-radius: 6px;
  overflow: hidden;
  margin-top: 20px;
}

.scale-step {
  padding: 18px 16px;
  border-right: 1px solid var(--violet-border);
  background: var(--deep);
  position: relative;
}

.scale-step:last-child { border-right: none; }

.scale-step::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--violet), var(--gold));
}

.scale-step .s-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 4px;
}

.scale-step .s-size {
  font-size: 0.7rem;
  color: var(--gold);
  font-weight: 500;
  margin-bottom: 6px;
}

.scale-step .s-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── JWST highlight ── */
.jwst-bar {
  background: var(--gold-dim);
  border: 1px solid rgba(240,204,106,0.3);
  border-radius: 8px;
  padding: 24px 28px;
  margin-top: 20px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.jwst-icon { font-size: 2rem; flex-shrink: 0; margin-top: 2px; }

.jwst-bar h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.jwst-bar p { margin: 0; font-size: 0.85rem; }

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

.footer-band span {
  font-size: 0.62rem;
  letter-spacing: 2px;
  color: var(--text-muted);
  text-transform: uppercase;
}
