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

:root {
  --sky-deep: #03001e;
  --sky-mid: #0a0a3a;
  --sky-blue: #0d2b6e;
  --stratosphere: #1a4a8a;
  --troposphere: #2a6fc0;
  --cloud: #b8d4f5;
  --accent-gold: #f0c040;
  --accent-cyan: #40e0d0;
  --text-main: #ddeeff;
  --text-muted: #8ab0cc;
  --card-bg: rgba(10, 30, 80, 0.55);
  --card-border: rgba(64, 160, 255, 0.2);
  --layer-glow: rgba(64, 160, 255, 0.08);
}

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

body {
  font-family: 'Crimson Pro', Georgia, serif;
  background: var(--sky-deep);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Stars canvas ── */
#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ── Atmosphere gradient layers ── */
.atmo-gradient {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 120% 60% at 50% 100%, #1a5fb4 0%, transparent 55%),
    radial-gradient(ellipse 80% 40% at 50% 110%, #0d3a78 0%, transparent 50%),
    linear-gradient(to top, #03001e 0%, #06012b 40%, #000010 100%);
  pointer-events: none;
}

/* ── Layout ── */
.wrap {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 100px 0 60px;
}

.hero-eyebrow {
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 18px;
  opacity: 0;
  animation: fadeUp 0.8s 0.2s forwards;
}

.hero h1 {
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 300;
  font-style: italic;
  letter-spacing: -0.02em;
  line-height: 1.05;
  background: linear-gradient(135deg, #ffffff 20%, #7fb8ff 60%, #40e0d0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0;
  animation: fadeUp 0.9s 0.4s forwards;
}

.hero-sub {
  margin-top: 20px;
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
  opacity: 0;
  animation: fadeUp 0.9s 0.6s forwards;
}

/* ── Layers visualization ── */
.layers-section {
  margin: 60px 0 50px;
  opacity: 0;
  animation: fadeUp 1s 0.9s forwards;
}

.layers-title {
  font-family: 'Space Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 24px;
}

.layers-bar {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  position: relative;
}

.layer-item {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 16px 22px;
  cursor: pointer;
  transition: filter 0.25s;
  border-bottom: 1px solid rgba(64,160,255,0.12);
  position: relative;
  overflow: hidden;
}
.layer-item:last-child { border-bottom: none; }

.layer-item::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s;
}
.layer-item:hover::before { opacity: 1; }

.layer-name {
  font-family: 'Space Mono', monospace;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.layer-desc { font-size: 0.93rem; color: var(--text-muted); line-height: 1.5; }
.layer-alt {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent-gold);
  white-space: nowrap;
  text-align: right;
}

/* Individual layer colors */
.layer-exo   { background: rgba(0,0,8,0.9); }
.layer-exo::before { background: rgba(20,40,80,0.5); }
.layer-thermo { background: rgba(5,5,30,0.85); }
.layer-thermo::before { background: rgba(30,50,100,0.5); }
.layer-meso  { background: rgba(8,15,55,0.8); }
.layer-meso::before { background: rgba(40,70,130,0.5); }
.layer-strato { background: rgba(12,30,80,0.75); }
.layer-strato::before { background: rgba(50,90,160,0.5); }
.layer-tropo { background: rgba(20,60,130,0.7); }
.layer-tropo::before { background: rgba(70,120,200,0.5); }

/* ── Cards grid ── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
  margin-top: 50px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 28px 26px;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  opacity: 0;
  animation: fadeUp 0.7s forwards;
  transition: transform 0.3s, box-shadow 0.3s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,60,180,0.3);
}
.card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  opacity: 0.6;
}

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

.card h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.card p, .card li {
  font-size: 0.97rem;
  line-height: 1.75;
  color: var(--text-muted);
}

.card ul { padding-left: 1.2em; }
.card li { margin-bottom: 5px; }

/* ── Composition table ── */
.table-section {
  margin-top: 50px;
  opacity: 0;
  animation: fadeUp 0.8s 1.2s forwards;
}

.section-header {
  font-family: 'Space Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 20px;
}

.section-title {
  font-size: 1.9rem;
  font-weight: 300;
  font-style: italic;
  color: #fff;
  margin-bottom: 24px;
  line-height: 1.2;
}

.comp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}
.comp-table th {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--card-border);
}
.comp-table td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(64,160,255,0.08);
  color: var(--text-muted);
  vertical-align: middle;
}
.comp-table tr:hover td { background: rgba(64,160,255,0.06); }

.bar-wrap {
  width: 140px;
  height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--troposphere));
  transition: width 1.2s cubic-bezier(0.4,0,0.2,1);
}

/* ── Fact band ── */
.fact-band {
  margin: 50px 0;
  padding: 30px 32px;
  background: linear-gradient(135deg, rgba(15,40,100,0.7), rgba(5,20,60,0.7));
  border-radius: 16px;
  border-left: 3px solid var(--accent-gold);
  backdrop-filter: blur(8px);
  opacity: 0;
  animation: fadeUp 0.8s 1.5s forwards;
}
.fact-band p {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-muted);
}
.fact-band strong { color: var(--accent-gold); font-style: italic; }

/* ── Footer ── */
footer {
  margin-top: 80px;
  padding-top: 24px;
  border-top: 1px solid var(--card-border);
  text-align: center;
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  opacity: 0.6;
}

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card:nth-child(1) { animation-delay: 1.0s; }
.card:nth-child(2) { animation-delay: 1.15s; }
.card:nth-child(3) { animation-delay: 1.3s; }
.card:nth-child(4) { animation-delay: 1.45s; }
.card:nth-child(5) { animation-delay: 1.6s; }
.card:nth-child(6) { animation-delay: 1.75s; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .layer-item { grid-template-columns: 100px 1fr; }
  .layer-alt  { display: none; }
  .comp-table .bar-wrap { width: 80px; }
}
