:root {
  --bg: #E8E4DC;
  --ink: #4A4640;
  --ink-soft: #8A8478;
  --sage: #8FA683;
  --sage-deep: #5B6B4F;
  --terracotta: #E08A6F;
  --terracotta-deep: #C2603F;
  --clay: #EDE9E1;
  --shadow-dark: rgba(140, 130, 110, 0.45);
  --shadow-light: rgba(255, 255, 255, 0.9);
}

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

html {
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Fraunces', serif;
  line-height: 1.5;
}

code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  background: var(--clay);
  padding: 0.15em 0.45em;
  border-radius: 8px;
  box-shadow:
    inset 2px 2px 4px var(--shadow-dark),
    inset -2px -2px 4px var(--shadow-light);
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 5rem 1.5rem 4rem;
}

/* ---------- Hero ---------- */

.hero {
  margin-bottom: 3.5rem;
}

.eyebrow {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sage-deep);
  background: var(--clay);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  box-shadow:
    4px 4px 10px var(--shadow-dark),
    -4px -4px 10px var(--shadow-light);
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 600;
  font-optical-sizing: auto;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 1.25rem;
}

.intro {
  max-width: 36em;
  font-size: 1.05rem;
  color: var(--ink-soft);
  font-weight: 300;
  margin-bottom: 0.75rem;
}

.note {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--terracotta-deep);
  letter-spacing: 0.03em;
  background: var(--clay);
  padding: 0.5rem 1rem;
  border-radius: 14px;
  box-shadow:
    inset 3px 3px 6px var(--shadow-dark),
    inset -3px -3px 6px var(--shadow-light);
}

/* ---------- Track ---------- */

.track {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.stage {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  column-gap: 1.25rem;
  opacity: 0;
  transform: translateY(20px) scale(0.97);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.stage.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.stage__rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 1.5rem;
}

.node {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  font-weight: 500;
  flex-shrink: 0;
}

.node--done {
  background: var(--sage);
  color: var(--clay);
  box-shadow:
    5px 5px 12px var(--shadow-dark),
    -5px -5px 12px var(--shadow-light),
    inset 1px 1px 2px rgba(255, 255, 255, 0.4);
  transform: scale(0.4);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s, opacity 0.4s ease 0.15s;
}

.stage.is-visible .node--done {
  transform: scale(1);
  opacity: 1;
}

.node--live {
  width: 1.5rem;
  height: 1.5rem;
  background: var(--terracotta);
  box-shadow:
    4px 4px 10px var(--shadow-dark),
    -4px -4px 10px var(--shadow-light),
    0 0 0 0 rgba(224, 138, 111, 0.5);
  animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
  0%   { box-shadow: 4px 4px 10px var(--shadow-dark), -4px -4px 10px var(--shadow-light), 0 0 0 0 rgba(224, 138, 111, 0.45); }
  70%  { box-shadow: 4px 4px 10px var(--shadow-dark), -4px -4px 10px var(--shadow-light), 0 0 0 14px rgba(224, 138, 111, 0); }
  100% { box-shadow: 4px 4px 10px var(--shadow-dark), -4px -4px 10px var(--shadow-light), 0 0 0 0 rgba(224, 138, 111, 0); }
}

.line {
  flex: 1;
  width: 6px;
  margin: 0.5rem 0;
  min-height: 1.5rem;
  border-radius: 999px;
  background: var(--clay);
  box-shadow:
    inset 2px 2px 4px var(--shadow-dark),
    inset -2px -2px 4px var(--shadow-light);
  position: relative;
  overflow: hidden;
}

.line--solid::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: var(--sage);
  border-radius: 999px;
  transition: height 0.6s ease 0.2s;
}

.stage.is-visible .line--solid::after {
  height: 100%;
}

.stage__body {
  background: var(--clay);
  border-radius: 24px;
  padding: 1.5rem 1.75rem;
  box-shadow:
    8px 8px 18px var(--shadow-dark),
    -8px -8px 18px var(--shadow-light);
}

.stage__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.stage__name {
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.stage__status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
}

.status--done {
  color: var(--sage-deep);
  background: var(--bg);
  box-shadow:
    inset 2px 2px 4px var(--shadow-dark),
    inset -2px -2px 4px var(--shadow-light);
}

.status--live {
  color: var(--terracotta-deep);
  background: var(--bg);
  box-shadow:
    inset 2px 2px 4px var(--shadow-dark),
    inset -2px -2px 4px var(--shadow-light);
}

.stage__desc {
  font-size: 0.95rem;
  color: var(--ink-soft);
  font-weight: 300;
  margin-bottom: 0.5rem;
}

.stage__meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--ink-soft);
  opacity: 0.8;
}

/* ---------- Footer ---------- */

.footer {
  margin-top: 1rem;
  padding: 1.25rem 1.75rem;
  background: var(--clay);
  border-radius: 20px;
  box-shadow:
    inset 3px 3px 6px var(--shadow-dark),
    inset -3px -3px 6px var(--shadow-light);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}

.back {
  color: var(--sage-deep);
  text-decoration: none;
  font-weight: 500;
}

.back:hover {
  color: var(--terracotta-deep);
}

/* ---------- Responsive ---------- */

@media (max-width: 480px) {
  .page {
    padding: 3rem 1.25rem 3rem;
  }

  .stage {
    grid-template-columns: 2.75rem 1fr;
    column-gap: 0.85rem;
  }

  .stage__body {
    padding: 1.25rem 1.25rem;
    border-radius: 18px;
  }

  .node {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 0.95rem;
  }

  .stage__top {
    flex-direction: column;
    gap: 0.4rem;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .node--live {
    animation: none;
  }

  .stage,
  .node--done,
  .line--solid::after {
    transition: none;
    opacity: 1;
    transform: none;
  }

  .line--solid::after {
    height: 100%;
  }
}

/* ---------- Focus ---------- */

a:focus-visible {
  outline: 2px solid var(--sage-deep);
  outline-offset: 4px;
}