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

:root {
  --ice-void:   #020810;
  --ice-deep:   #060f1e;
  --ice-navy:   #0d1f3c;
  --ice-blue:   #1a3a6e;
  --glacier:    #3a7aaa;
  --meltwater:  #60b8e8;
  --frost:      #c8e8f8;
  --crystal:    #eaf5ff;
  --snow:       #f5fbff;
  --ice-cyan:   #40d8f8;
  --crack:      rgba(100,200,255,0.15);
  --card-bg:    rgba(10,28,60,0.6);
  --card-border:rgba(96,184,232,0.2);
  --text-main:  #e0f2ff;
  --text-muted: #6a9cc0;
}

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

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

/* ── Hexagonal crystal background ── */
.crystal-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.crystal-bg::before {
  content: '';
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(ellipse 70% 50% at 15% 20%,  rgba(26,58,110,0.55) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 85% 75%,  rgba(64,216,248,0.08) 0%, transparent 55%),
    radial-gradient(ellipse 90% 60% at 50% 100%, rgba(10,28,60,0.9)    0%, transparent 65%),
    linear-gradient(160deg, #020c1a 0%, #04101e 40%, #020810 100%);
}
.crystal-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(60deg,  transparent 0, transparent 38px, rgba(64,216,248,0.025) 38px, rgba(64,216,248,0.025) 39px),
    repeating-linear-gradient(120deg, transparent 0, transparent 38px, rgba(96,184,232,0.02)  38px, rgba(96,184,232,0.02)  39px),
    repeating-linear-gradient(0deg,   transparent 0, transparent 38px, rgba(64,216,248,0.015) 38px, rgba(64,216,248,0.015) 39px);
}

/* ── SVG Ice canvas ── */
#ice-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
}

/* ── Layout ── */
.wrap {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 28px 100px;
}

/* ── HERO ── */
.hero {
  padding: 100px 0 70px;
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 40px;
  align-items: end;
  opacity: 0;
  animation: iceReveal 1.2s 0.1s cubic-bezier(0.16,1,0.3,1) forwards;
}

@keyframes iceReveal {
  from { opacity: 0; transform: translateY(30px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.hero-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 300;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ice-cyan);
  margin-bottom: 22px;
}

.hero h1 {
  font-size: clamp(4rem, 10vw, 8.5rem);
  font-weight: 300;
  font-style: italic;
  line-height: 0.85;
  letter-spacing: -0.04em;
  color: var(--snow);
  position: relative;
}
.hero h1 span {
  display: block;
  font-style: normal;
  font-weight: 600;
  font-size: 45%;
  letter-spacing: 0.06em;
  color: var(--meltwater);
  margin-bottom: 6px;
}

.hero-desc {
  margin-top: 26px;
  font-size: 1.12rem;
  line-height: 1.85;
  color: var(--text-muted);
  font-style: italic;
  max-width: 580px;
}

.hero-meter {
  text-align: right;
  padding-bottom: 8px;
}
.meter-big {
  font-family: 'JetBrains Mono', monospace;
  font-size: 3.2rem;
  font-weight: 700;
  color: var(--ice-cyan);
  line-height: 1;
  letter-spacing: -0.04em;
}
.meter-unit {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 300;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
  text-align: right;
}

/* ── Divider ── */
.ice-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ice-cyan), var(--glacier), transparent);
  opacity: 0.35;
  margin: 60px 0;
}

/* ── Section headers ── */
.sec-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ice-cyan);
  margin-bottom: 10px;
}
.sec-title {
  font-size: 2.4rem;
  font-weight: 300;
  font-style: italic;
  color: var(--snow);
  margin-bottom: 32px;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

/* ── Glacier types: horizontal scroll panels ── */
.types-section { margin: 0 0 70px; opacity: 0; animation: rise 0.8s 0.8s forwards; }

.types-scroll {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 2px;
  background: var(--crack);
  border-radius: 16px;
  overflow: hidden;
}

.type-cell {
  background: var(--card-bg);
  padding: 28px 24px;
  backdrop-filter: blur(14px);
  transition: background 0.3s, transform 0.3s;
  position: relative;
  overflow: hidden;
}
.type-cell::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--ice-cyan), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.type-cell:hover { background: rgba(26,58,110,0.7); transform: translateY(-2px); }
.type-cell:hover::before { opacity: 1; }

.type-icon { font-size: 2rem; margin-bottom: 14px; display: block; }
.type-cell h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--frost);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}
.type-cell p { font-size: 0.93rem; line-height: 1.75; color: var(--text-muted); }
.type-tag {
  margin-top: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--glacier);
  letter-spacing: 0.1em;
}

/* ── Ice core timeline ── */
.timeline-section { margin: 0 0 70px; opacity: 0; animation: rise 0.8s 1s forwards; }

.core-timeline {
  position: relative;
  padding-left: 0;
}
.core-timeline::before {
  content: '';
  position: absolute;
  left: 80px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--ice-cyan), transparent);
}

.core-event {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 28px;
  margin-bottom: 36px;
  align-items: start;
}
.core-year {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ice-cyan);
  text-align: right;
  padding-right: 20px;
  padding-top: 3px;
  position: relative;
}
.core-year::after {
  content: '';
  position: absolute;
  right: -6px; top: 8px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--ice-cyan);
  box-shadow: 0 0 12px var(--ice-cyan);
}
.core-body h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--frost);
  margin-bottom: 6px;
}
.core-body p { font-size: 0.92rem; line-height: 1.72; color: var(--text-muted); }

/* ── Data table ── */
.data-section { margin: 0 0 70px; opacity: 0; animation: rise 0.8s 1.2s forwards; }

.cryo-table {
  width: 100%;
  border-collapse: collapse;
}
.cryo-table th {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ice-cyan);
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--crack);
}
.cryo-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(64,216,248,0.06);
  font-size: 0.93rem;
  color: var(--text-muted);
  vertical-align: middle;
}
.cryo-table tr:hover td { background: rgba(64,216,248,0.05); }
.cryo-table td:first-child { color: var(--frost); font-style: italic; }
.cryo-table .num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  color: var(--meltwater);
}

/* ── Cryosphere map: colored badges ── */
.cryo-section { margin: 0 0 70px; opacity: 0; animation: rise 0.8s 1.4s forwards; }

.cryo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.cryo-badge {
  padding: 20px 22px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  transition: border-color 0.3s, transform 0.3s;
}
.cryo-badge:hover { border-color: rgba(64,216,248,0.5); transform: translateY(-3px); }
.cryo-badge-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.cryo-badge-name { font-size: 0.98rem; font-weight: 600; color: var(--frost); }
.cryo-badge-vol  {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--ice-cyan);
}
.cryo-badge p { font-size: 0.87rem; line-height: 1.65; color: var(--text-muted); }

/* ── Alert: ice loss ── */
.alert-section {
  margin: 0 0 70px;
  padding: 32px 34px;
  background: rgba(26,58,110,0.25);
  border: 1px solid rgba(64,216,248,0.2);
  border-radius: 16px;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 22px;
  align-items: center;
  opacity: 0;
  animation: rise 0.8s 1.6s forwards;
}
.alert-icon { font-size: 2.4rem; }
.alert-text p { font-size: 1rem; line-height: 1.8; color: var(--text-muted); }
.alert-text strong { color: var(--ice-cyan); font-style: italic; }

/* ── Cards grid ── */
.cards-section { margin: 0 0 70px; opacity: 0; animation: rise 0.8s 1.8s forwards; }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.info-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 26px 24px;
  backdrop-filter: blur(12px);
  transition: transform 0.3s, box-shadow 0.3s;
}
.info-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 36px rgba(0,80,160,0.3);
}
.info-card-icon { font-size: 1.8rem; margin-bottom: 14px; display: block; }
.info-card h3 { font-size: 1.2rem; font-weight: 600; color: var(--frost); margin-bottom: 10px; }
.info-card p, .info-card li { font-size: 0.93rem; line-height: 1.75; color: var(--text-muted); }
.info-card ul { padding-left: 1.1em; }
.info-card li { margin-bottom: 4px; }

/* ── Footer ── */
footer {
  margin-top: 80px;
  padding-top: 22px;
  border-top: 1px solid var(--crack);
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  font-weight: 300;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.55;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}

/* ── Scroll progress ── */
#progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--ice-blue), var(--ice-cyan));
  z-index: 9999;
  transition: width 0.12s linear;
}

@media (max-width: 680px) {
  .hero { grid-template-columns: 1fr; }
  .hero-meter { text-align: left; }
  .core-timeline::before { left: 55px; }
  .core-event { grid-template-columns: 55px 1fr; gap: 18px; }
}
