:root {
  --bg: #0d0b09;
  --deep: #050403;
  --rock: #15120e;
  --rock-2: #1d1913;
  --edge: #2e281e;
  --text: #ece5d8;
  --muted: #a89e8c;
  --ember: #f4a938;
  --crystal: #6fd6c5;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Torch position; cave.js moves it with the pointer */
  --mx: 50%;
  --my: 16%;
}

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

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

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

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--sans);
}

.glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(520px circle at var(--mx) var(--my), rgba(244, 169, 56, 0.17), transparent 70%),
    radial-gradient(1100px 520px at 50% -8%, rgba(244, 169, 56, 0.09), transparent 70%);
}

.rock {
  display: block;
  width: 100%;
  fill: var(--deep);
}

.ceiling {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  height: clamp(44px, 8vw, 92px);
}

.wrap {
  position: relative;
  z-index: 2;
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Hero */

.hero {
  padding: clamp(92px, 15vw, 164px) 0 26px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font: 500 0.85rem/1 var(--mono);
}

.eyebrow b {
  color: var(--ember);
  font-weight: 500;
}

h1 {
  margin: 0;
  font: 700 clamp(2.4rem, 9vw, 4.6rem)/1.02 var(--mono);
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

h1 span {
  color: var(--ember);
}

.lede {
  max-width: 44ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(1.02rem, 2.2vw, 1.2rem);
}

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

.jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.jump a {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: rgba(21, 18, 14, 0.72);
  color: var(--text);
  font: 500 0.82rem/1 var(--mono);
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.jump a:hover,
.jump a:focus-visible {
  border-color: var(--ember);
  color: var(--ember);
}

/* Sections */

section {
  padding: 30px 0 6px;
  scroll-margin-top: 12px;
}

h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 16px;
  color: var(--ember);
  font: 600 0.8rem/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--edge), transparent);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 18px 18px 16px;
  border: 1px solid var(--edge);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--rock-2), var(--rock));
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.card:hover,
.card:focus-visible {
  border-color: var(--ember);
  box-shadow: 0 12px 32px -14px rgba(244, 169, 56, 0.45);
  transform: translateY(-2px);
}

a:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
}

.name {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 1.06rem;
  font-weight: 650;
  line-height: 1.3;
}

.name::after {
  content: "\2197";
  color: var(--muted);
  font: 400 0.95rem/1 var(--mono);
  transition: color 0.15s ease, transform 0.15s ease;
}

.card:hover .name::after,
.card:focus-visible .name::after {
  color: var(--ember);
  transform: translate(2px, -2px);
}

.desc {
  flex: 1;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.45;
}

.host {
  color: var(--crystal);
  font: 400 0.78rem/1.4 var(--mono);
  overflow-wrap: anywhere;
}

/* Cave floor */

.ground {
  position: relative;
  z-index: 2;
  margin-top: 48px;
}

.floor {
  height: clamp(34px, 6vw, 68px);
  transform: scaleY(-1);
  /* Hide the hairline seam between the rock and the footer */
  margin-bottom: -1px;
}

footer {
  padding: 6px 20px 30px;
  background: var(--deep);
  color: var(--muted);
  font: 0.8rem/1.6 var(--mono);
  text-align: center;
}

footer p {
  margin: 0;
}

footer a {
  color: var(--text);
  text-decoration-color: var(--edge);
  text-underline-offset: 3px;
}

footer a:hover,
footer a:focus-visible {
  color: var(--ember);
  text-decoration-color: var(--ember);
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .jump a,
  .name::after {
    transition: none;
  }

  .card:hover,
  .card:focus-visible {
    transform: none;
  }
}
