/* ===================================================================
   davidestaub.github.io design system
   Deep-space navy, starlight text, gold / cyan / purple accents,
   Source Serif 4 for prose, IBM Plex Mono for labels & data.
   =================================================================== */

:root {
  --bg:      #04060F;
  --bg-2:    #0A0F1F;
  --card:    rgba(255, 255, 255, 0.035);
  --card-2:  rgba(255, 255, 255, 0.06);
  --line:    rgba(255, 255, 255, 0.10);
  --ink:     #F7FAFF;
  --muted:   #A8B6D0;
  --faint:   #6B7A99;
  --gold:    #F5B324;
  --cyan:    #35D6FF;
  --purple:  #A970FF;
  --blue:    #6FA8FF;
  --teal:    #35C4A8;
  --orange:  #EE642A;
  --serif:   "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --maxw:    1060px;
  --halo:    245, 179, 36;
  --halo-2:  111, 168, 255;
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.06rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* A quiet atmospheric wash behind the starfield, hue-keyed per page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(120% 55% at 50% -10%, rgba(var(--halo), 0.085) 0%, rgba(var(--halo), 0.03) 38%, transparent 68%),
    radial-gradient(90% 60% at 12% 108%, rgba(var(--halo-2), 0.05) 0%, transparent 60%),
    linear-gradient(180deg, #070B18 0%, #04060F 34%, #04060F 78%, #030409 100%);
}
.page-research { --halo: 53, 214, 255; --halo-2: 169, 112, 255; }
.page-teaching { --halo: 169, 112, 255; --halo-2: 53, 214, 255; }
.page-blog     { --halo: 53, 196, 168; --halo-2: 111, 168, 255; }

/* Starfield canvas sits behind everything */
#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

::selection { background: rgba(245, 179, 36, 0.35); }

a {
  color: var(--cyan);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.25s ease, color 0.25s ease;
}
a:hover { text-decoration-color: currentColor; }
.prose a, .lede a, .card p a, .tl-item p a { text-decoration-color: rgba(53, 214, 255, 0.35); }
.prose a:hover, .lede a:hover, .card p a:hover, .tl-item p a:hover { text-decoration-color: var(--cyan); }
.nav-name, .nav-links a, .btn, .tile, .post-card, .skip-link { text-decoration: none; }

img, video { max-width: 100%; height: auto; }

/* ---------------- skip link & focus ---------------- */

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: var(--gold);
  color: #04060F;
  font-family: var(--mono);
  font-size: 0.8rem;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 0.6rem; text-decoration: none; }

a:focus-visible, button:focus-visible, input:focus-visible, .world-chip:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------------- nav ---------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: linear-gradient(180deg, rgba(10, 15, 31, 0.82) 0%, rgba(4, 6, 15, 0.62) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 12px 30px -18px rgba(0, 0, 0, 0.65);
}

.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.8rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.12rem;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.nav-name:hover { text-decoration: none; color: var(--gold); }

.nav-links {
  display: flex;
  gap: 1.4rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}

.nav-links a { color: var(--muted); text-transform: uppercase; position: relative; padding: 0.2rem 0; transition: color 0.25s ease; }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.28s var(--ease-out);
}
.nav-links a:hover { color: var(--gold); text-decoration: none; }
.nav-links a:hover::after, .nav-links a:focus-visible::after { transform: scaleX(1); transform-origin: left center; }
.nav-links a.active { color: var(--gold); }
.nav-links a.active::after { transform: scaleX(1); }

.nav-transit { width: 120px; height: 26px; }
@media (max-width: 820px) { .nav-transit { display: none; } }

/* ---------------- layout primitives ---------------- */

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.2rem;
}

.section { padding: 4.2rem 0 1rem; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 0.7rem;
}
.eyebrow.cyan   { color: var(--cyan); }
.eyebrow.purple { color: var(--purple); }
.eyebrow.teal   { color: var(--teal); }

h1, h2, h3 { font-family: var(--serif); margin: 0 0 1rem; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 6vw, 4.3rem); font-weight: 400; line-height: 1.12; letter-spacing: -0.015em; padding-bottom: 0.1em; margin-bottom: 0.7rem; }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.3rem); font-weight: 600; line-height: 1.15; letter-spacing: -0.008em; }
h3 { font-size: 1.28rem; font-weight: 600; line-height: 1.3; }

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  h1 {
    background: linear-gradient(180deg, #FFFFFF 0%, #F7FAFF 48%, #C7D3EC 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.lede { font-size: 1.18rem; line-height: 1.65; color: var(--muted); max-width: 36rem; }

.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

/* ---------------- cards ---------------- */

.card, .tile, .demo, .census .cls, .post-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.055) 0%, rgba(255,255,255,0.032) 40%, rgba(255,255,255,0.022) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.target-card.swap { animation: cardIn 0.35s var(--ease-out); }

.target-card, .bubble .say {
  background: linear-gradient(180deg, rgba(255,255,255,0.075) 0%, rgba(255,255,255,0.05) 40%, rgba(255,255,255,0.04) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.6rem 1.7rem;
}

.card + .card { margin-top: 1.4rem; }

.card h3 { margin-top: 0; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.2rem;
}

.tile {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.4rem 1.5rem;
  color: var(--ink);
  display: block;
  position: relative;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.35s var(--ease-out);
}
.tile::after, .post-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.tile:hover {
  text-decoration: none;
  border-color: rgba(245, 179, 36, 0.5);
  background: linear-gradient(180deg, rgba(255,255,255,0.085) 0%, rgba(255,255,255,0.05) 100%);
  transform: translateY(-4px);
}
.tile:hover::after { opacity: 1; }
.tile .eyebrow { margin-bottom: 0.4rem; }
.tile p { color: var(--muted); margin: 0.4rem 0 0; font-size: 0.98rem; }

/* media + text split rows */
.split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
  align-items: center;
}
.split.flip { grid-template-columns: 0.85fr 1.15fr; }

figure { margin: 0; }
figcaption {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--faint);
  letter-spacing: 0.04em;
  margin-top: 0.55rem;
  line-height: 1.5;
  padding-left: 0.85rem;
  border-left: 2px solid rgba(245, 179, 36, 0.35);
}

.frame {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  overflow: hidden;
  background: linear-gradient(180deg, #06090F 0%, #010208 100%);
  box-shadow: 0 22px 44px -28px rgba(0, 0, 0, 0.9);
}
.split figure, .card-grid figure { position: relative; z-index: 0; }
.split figure::before, .card-grid figure::before {
  content: "";
  position: absolute;
  inset: -16% -14%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(var(--glow, 111, 168, 255), 0.11) 0%, rgba(var(--glow, 111, 168, 255), 0.04) 48%, transparent 74%);
}
.frame img, .frame video { display: block; width: 100%; }

/* ---------------- hero (home) ---------------- */

.hero {
  padding: 5.5rem 0 3.5rem;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 3rem;
  align-items: center;
}

.hero .lede { margin-top: 0.4rem; }

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

#planet-container {
  width: min(380px, 70vw);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  box-shadow:
    0 0 130px 12px rgba(111, 168, 255, 0.16),
    0 0 60px rgba(53, 214, 255, 0.10),
    0 0 28px rgba(245, 179, 36, 0.12);
}
#planet-container::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at 33% 30%, rgba(247, 250, 255, 0.10) 0%, transparent 42%);
  box-shadow:
    inset -22px -16px 48px rgba(2, 3, 10, 0.85),
    inset 10px 8px 30px rgba(111, 168, 255, 0.16);
}
#planet-container canvas { width: 100%; height: 100%; display: block; }

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.6rem;
}

.btn {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.55rem 1.05rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--card);
  position: relative;
  transition: border-color 0.2s, background 0.2s, transform 0.3s var(--ease-spring);
}
.btn::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(245, 179, 36, 0.16), 0 2px 8px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.btn:hover { text-decoration: none; border-color: var(--gold); background: var(--card-2); transform: translateY(-2px); }
.btn:hover::after { opacity: 1; }
.btn:active { transform: translateY(0) scale(0.98); transition-duration: 0.08s; }
.btn:disabled { transform: none; cursor: default; }
.btn.primary { border-color: rgba(245, 179, 36, 0.65); color: var(--gold); }

.bio-row {
  display: flex;
  gap: 1.6rem;
  align-items: flex-start;
}

.profile-pic {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(245, 179, 36, 0.4);
  flex-shrink: 0;
}

/* ---------------- footer ---------------- */

footer {
  margin-top: 5rem;
  border-top: 1px solid var(--line);
  padding: 2rem 0 2.6rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--faint);
  letter-spacing: 0.05em;
}
footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; }
footer a { color: var(--muted); }

/* ---------------- publications list ---------------- */

.pub {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  column-gap: 1.4rem;
  align-items: baseline;
  padding: 1.05rem 0;
  margin: 0;
}
.pub + .pub { border-top: 1px solid var(--line); }
.pub .where { font-family: var(--mono); font-size: 0.78rem; color: var(--faint); letter-spacing: 0.06em; }
.pub .title { display: block; font-weight: 600; font-size: 1.02rem; line-height: 1.45; margin: 0 0 0.1rem; }
.pub .authors { display: block; font-size: 0.88rem; color: var(--muted); line-height: 1.55; }
.pub .authors strong { color: var(--ink); font-weight: 600; }
@media (max-width: 820px) {
  .pub { grid-template-columns: 1fr; row-gap: 0.2rem; }
}

/* ===================================================================
   Blog / explainer components
   =================================================================== */

.post-hero {
  padding: 5.5rem 0 3rem;
  text-align: center;
  position: relative;
}
.post-hero .lede { margin: 0.6rem auto 0; }

.post-meta {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--faint);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 1.2rem;
}

.prose { max-width: 38rem; margin: 0 auto; }
.prose, .tl-item p, .card p, .lede { text-wrap: pretty; }
.prose { font-variant-numeric: oldstyle-nums; }
.prose p { margin: 1.1rem 0; }

/* guide bubbles — the "small text bubbles" narration */
.bubble {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  max-width: 34rem;
  margin: 2.2rem auto;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.bubble.visible { opacity: 1; transform: none; }

.bubble .dot {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  background: radial-gradient(circle at 35% 30%, #1B2B4D, #0A0F1F);
  border: 1px solid rgba(111, 168, 255, 0.45);
}

.bubble .say {
  border: 1px solid var(--line);
  border-radius: 4px 16px 16px 16px;
  padding: 0.75rem 1.05rem;
  font-size: 0.98rem;
  color: var(--ink);
}
.bubble .say strong { color: var(--gold); }
.bubble.gold  .dot { border-color: rgba(245, 179, 36, 0.55); }
.bubble.right { flex-direction: row-reverse; }
.bubble.right .say { border-radius: 16px 4px 16px 16px; }

/* post spine: centered headings and chapter rhythm */
.post .section > .eyebrow, .post .section > h2 { text-align: center; }
.post .section > h2 { max-width: 24ch; margin-left: auto; margin-right: auto; }
.post .chips, .post .world-chips { justify-content: center; }

.chapter { padding: clamp(5rem, 12vh, 6.5rem) 0 1rem; }
.chapter > .eyebrow::before {
  content: "";
  display: block;
  width: 2.6rem;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
  margin: 0 auto 1.1rem;
}

/* stat counter strip */
.stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  justify-content: center;
  margin: 2.6rem 0 0;
}
.stat {
  min-width: 0;
  text-align: center;
  padding: 0.2rem 2.4rem;
}
.stat + .stat { border-left: 1px solid var(--line); }
.stat .num {
  font-family: var(--mono);
  font-size: 2.3rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--gold);
  text-shadow: 0 0 14px rgba(245, 179, 36, 0.22);
}
.stat .lbl {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  margin-top: 0.45rem;
}
@media (max-width: 640px) {
  .stat + .stat { border-left: 0; }
  .stat { padding: 0.4rem 1rem; }
}

/* census cards */
.census {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.2rem;
  margin-top: 2rem;
}
.census .cls {
  text-align: center;
  padding: 1.5rem 1.1rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.census img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 6px 22px rgba(0, 0, 0, 0.55));
}
.census .share {
  font-family: var(--mono);
  font-size: 1.5rem;
  margin-top: 0.7rem;
}
.census .name {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.15rem;
}
.census p { font-size: 0.9rem; color: var(--muted); margin: 0.5rem 0 0; }
.census .cls:nth-child(1) .share { color: var(--orange); }
.census .cls:nth-child(2) .share { color: var(--blue); }
.census .cls:nth-child(3) .share { color: var(--gold); }
.census .cls:nth-child(4) .share { color: var(--teal); }

/* timeline */
.timeline {
  position: relative;
  max-width: 46rem;
  margin: 2.5rem auto 0;
  padding-left: 1.6rem;
  border-left: 1px solid transparent;
  border-image: linear-gradient(180deg, rgba(111,168,255,0.6) 0%, rgba(169,112,255,0.35) 55%, rgba(169,112,255,0) 100%) 1;
}
.tl-item {
  position: relative;
  margin-bottom: 2.6rem;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.tl-item.visible { opacity: 1; transform: none; }
.tl-item::before {
  content: "";
  position: absolute;
  left: calc(-1.6rem - 5px);
  top: 0.45rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #FFE9B8;
  box-shadow: 0 0 10px 2px rgba(245, 179, 36, 0.55), 0 0 26px 6px rgba(245, 179, 36, 0.25);
  transform: scale(0);
  transition: transform 0.45s var(--ease-spring) 0.18s;
}
.tl-item.visible::before { transform: scale(1); }
.tl-year {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--gold);
  letter-spacing: 0.1em;
}
.tl-item h3 { margin: 0.25rem 0 0.4rem; }
.tl-item p { color: var(--muted); margin: 0; max-width: 34rem; }
.tl-media {
  margin-top: 0.9rem;
  max-width: 460px;
}

/* ---------------- transit demo ---------------- */

.demo {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.5rem;
  margin: 2.2rem 0;
}

.demo canvas { display: block; width: 100%; border-radius: 10px; background: #01020A; }

.demo-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.demo-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem 2rem;
  margin-top: 1.3rem;
  align-items: center;
}

.ctl { min-width: 200px; flex: 1; }
.ctl label {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.ctl label .val { color: var(--gold); text-transform: none; letter-spacing: 0; }

input[type="range"] {
  width: 100%;
  accent-color: var(--gold);
  touch-action: none;
}
input[type="range"]:disabled { opacity: 0.45; }
@media (pointer: coarse) {
  input[type="range"] { height: 34px; }
}

.ctl.toggle {
  flex: 0;
  min-width: auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
input[type="checkbox"] { accent-color: var(--gold); width: 18px; height: 18px; }

.demo-actions { display: flex; gap: 0.8rem; margin-top: 1.2rem; flex-wrap: wrap; }
.demo-actions .btn { cursor: pointer; }

#demo-caption {
  margin-top: 1.1rem;
  min-height: 3.2em;
  font-size: 0.95rem;
  color: var(--muted);
  border-top: 1px dashed var(--line);
  padding-top: 0.9rem;
}
#demo-caption strong { color: var(--gold); }

/* spectrum figure (WASP-17b) */
.spectrum-fig svg { width: 100%; height: auto; display: block; }

/* molecule chips */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.chip {
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.chip.h2o { border-color: rgba(53, 214, 255, 0.5); color: var(--cyan); }
.chip.co2 { border-color: rgba(169, 112, 255, 0.5); color: var(--purple); }
.chip.co  { border-color: rgba(245, 179, 36, 0.5); color: var(--gold); }
.chip.so2 { border-color: rgba(238, 100, 42, 0.55); color: var(--orange); }
.chip.na  { border-color: rgba(53, 196, 168, 0.5); color: var(--teal); }

/* ---------------- scroll reveal ---------------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out);
}
.reveal.visible { opacity: 1; transform: none; }

.reveal-group > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out);
}
.reveal-group.visible > * { opacity: 1; transform: none; }
.reveal-group.visible > :nth-child(2) { transition-delay: 70ms; }
.reveal-group.visible > :nth-child(3) { transition-delay: 140ms; }
.reveal-group.visible > :nth-child(4) { transition-delay: 210ms; }

/* ---------------- planet carpet ---------------- */

.carpet-wrap {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(1, 2, 10, 0.6);
  padding: 1.4rem 1.4rem 1.1rem;
  margin-top: 2rem;
  overflow: hidden;
}

.carpet {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 2.2s cubic-bezier(0.3, 0, 0.2, 1);
}
.carpet.visible, .carpet-wrap.visible .carpet { clip-path: inset(0 0 0 0); }
.carpet img { display: block; width: 100%; }

.swipe-hint {
  display: none;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faint);
  text-align: center;
  margin-top: 0.7rem;
}
.swipe-hint::before { content: "← "; }
.swipe-hint::after { content: " →"; }

@media (max-width: 640px) {
  .carpet { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .carpet-inner { min-width: 680px; }
  .spectrum-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .spectrum-scroll svg { min-width: 640px; }
  .swipe-hint { display: block; }
}

.temp-axis {
  height: 6px;
  border-radius: 3px;
  margin-top: 0.9rem;
  background: linear-gradient(90deg, #7FB8E6, #A8C6D8, #C9B88A, #F5B324, #EE642A);
  opacity: 0.85;
}
.temp-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
  margin-top: 0.5rem;
}

.world-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.4rem;
}
.world-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  padding: 0.35rem 0.8rem 0.35rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, transform 0.25s var(--ease-spring);
}
.world-chip img { width: 22px; height: 22px; object-fit: contain; }
.world-chip:hover { border-color: rgba(245, 179, 36, 0.6); color: var(--ink); transform: translateY(-1px); }
.world-chip:active { transform: translateY(0) scale(0.96); transition-duration: 0.08s; }
.world-chip.active { border-color: var(--gold); color: var(--gold); }
.world-chip .t { color: var(--faint); font-size: 0.68rem; }

.target-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.1rem 1.2rem;
  margin-top: 1rem;
}
.tc-head { display: flex; gap: 0.9rem; align-items: center; }
.tc-head img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.6));
  flex-shrink: 0;
}
.tc-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--faint);
  letter-spacing: 0.05em;
  margin: 0.3rem 0 0;
}
.tc-fact { font-size: 0.95rem; color: var(--muted); margin: 0.8rem 0 0; }

/* ---------------- timeline animations ---------------- */

.anim-pane {
  background: #01020A;
  padding: 0.4rem;
}
.anim-pane svg { display: block; width: 100%; height: auto; }

@keyframes wobbleOrbit {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.w-star-orbit, .w-planet-orbit {
  animation: wobbleOrbit 5s linear infinite;
  transform-origin: 150px 95px;
}

@keyframes lineShift {
  0%   { transform: translateX(-9px); }
  50%  { transform: translateX(9px); }
  100% { transform: translateX(-9px); }
}
.w-line { animation: lineShift 5s ease-in-out infinite; }

@keyframes naTransit {
  0%   { transform: translateX(0); }
  100% { transform: translateX(240px); }
}
.na-planet { animation: naTransit 5s linear infinite; }

@keyframes naDeepen {
  0%, 20%  { opacity: 0.15; }
  45%, 65% { opacity: 0.95; }
  90%, 100% { opacity: 0.15; }
}
.na-line { animation: naDeepen 5s linear infinite; }

/* ---------------- reduced motion ---------------- */

@media (prefers-reduced-motion: reduce) {
  .w-star-orbit, .w-planet-orbit, .w-line, .na-planet, .na-line { animation: none; }
  .carpet { clip-path: none; transition: none; }
  .reveal, .bubble { transition: none; }
  .reveal-group > *, .tl-item { transition: none; transform: none; opacity: 1; }
  .tl-item::before { transition: none; transform: scale(1); }
  a, .nav-links a::after, .btn, .btn::after, .world-chip,
  .tile, .post-card, .tile::after, .post-card::after, .post-card .cover img { transition: none; }
  .tile:hover, .post-card:hover, .btn:hover, .world-chip:hover { transform: none; }
  .target-card.swap { animation: none; }
}

/* interactive plate labels on demo cards */
.demo { position: relative; }
.live-badge {
  position: absolute;
  top: -0.75em;
  left: 1.2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--bg);
  border: 1px solid rgba(245, 179, 36, 0.45);
  border-radius: 999px;
  padding: 0.28rem 0.8rem;
}
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px rgba(245, 179, 36, 0.9); }

/* the post's closing dip */
.post-end { text-align: center; margin: 3.5rem auto 1rem; max-width: 38rem; }
.dip-divider { width: min(420px, 80%); height: auto; display: block; margin: 0 auto 1.4rem; }

/* blog index cards */
.post-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  color: var(--ink);
  position: relative;
  transition: border-color 0.25s ease, transform 0.35s var(--ease-out);
}
.post-card:hover { text-decoration: none; border-color: rgba(245, 179, 36, 0.5); transform: translateY(-4px); }
.post-card:hover::after { opacity: 1; }
.post-card .cover { aspect-ratio: 2.6; overflow: hidden; background: #000; position: relative; }
.post-card .cover::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(4, 6, 15, 0) 50%, rgba(4, 6, 15, 0.55) 100%);
}
.post-card .cover img { width: 100%; height: 100%; object-fit: cover; opacity: 0.85; transition: transform 0.6s var(--ease-out), opacity 0.4s ease; }
.post-card:hover .cover img { transform: scale(1.03); opacity: 1; }
.post-card .body { padding: 1.3rem 1.5rem 1.5rem; }
.post-card p { color: var(--muted); margin: 0.4rem 0 0; }

/* ---------------- responsive ---------------- */

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding-top: 3.4rem; text-align: left; }
  .hero-visual { order: -1; }
  #planet-container { width: min(220px, 60vw); }
  .split, .split.flip { grid-template-columns: 1fr; }
  .demo-panels { grid-template-columns: 1fr; }
  .bio-row { flex-direction: column; }
  .nav-name { font-size: 1rem; white-space: nowrap; }
  .nav-links { gap: 0.9rem; font-size: 0.74rem; }
}
