:root {
  --bg: #0a0b0e;
  --card: #14161b;
  --card-hi: #1b1e25;
  --ink: #f2f3f6;
  --muted: #8b90a0;
  --line: #262a33;
  --red: #ff5d52;
  --amber: #ffb224;
  --blue: #5aa8ff;
  --accent: #2fd27f;
  --state: var(--red);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background:
    radial-gradient(70% 50% at 50% 0%, color-mix(in srgb, var(--state) 9%, transparent), transparent 70%),
    var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(10px, 3vw, 28px);
}

/* ---- the card ---- */
.card {
  position: relative;
  width: min(680px, 100%);
  padding: clamp(14px, 3.6vh, 26px) clamp(14px, 3.4vw, 26px) clamp(10px, 2.6vh, 20px);
  border-radius: clamp(20px, 3vw, 28px);
  background: linear-gradient(180deg, var(--card-hi), var(--card));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 0 0 1px var(--line),
    0 30px 60px -30px rgba(0, 0, 0, 0.9),
    0 50px 90px -50px color-mix(in srgb, var(--state) 40%, transparent);
  overflow: hidden;
}
:root.is-identified { --state: var(--amber); }
:root.is-monitoring { --state: var(--blue); }
:root.is-resolved { --state: var(--accent); }
.card__sheen {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 40%;
  background: linear-gradient(100deg, transparent, color-mix(in srgb, var(--accent) 12%, transparent) 50%, transparent);
  opacity: 0;
  pointer-events: none;
}

.head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: clamp(10px, 2.6vh, 18px);
  border-bottom: 1px solid var(--line);
}
.head__text { min-width: 0; }
.head h1 {
  font-size: clamp(15.5px, min(4.4vw, 4.6vh), 21px);
  line-height: 1.2;
  font-weight: 620;
  letter-spacing: -0.012em;
}
.head__dur {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}
.head__dur b { display: inline-block; font-weight: 600; color: var(--ink); }

.status {
  flex: none;
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--state) 16%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--state) 34%, transparent);
  color: color-mix(in srgb, var(--state) 86%, #ffffff);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.5s ease, color 0.5s ease, box-shadow 0.5s ease;
}
.status__roll { display: block; height: 28px; line-height: 28px; overflow: hidden; }
.status__word { display: block; }

/* ---- the steps ---- */
.steps {
  list-style: none;
  margin-top: clamp(6px, 1.6vh, 12px);
}
.step {
  --c: var(--red);
  position: relative;
  display: flex;
  gap: 12px;
  padding: clamp(4px, 1.1vh, 7px) 8px;
  margin: 0 -8px;
  border-radius: 14px;
  cursor: pointer;
  outline: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.25s ease;
}
.step:nth-child(2) { --c: var(--amber); }
.step:nth-child(3) { --c: var(--blue); }
.step:nth-child(4) { --c: var(--accent); }
.step.is-done { --c: var(--accent); }
.step.is-open { background: rgba(255, 255, 255, 0.035); }
.step:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
@media (hover: hover) {
  .step:hover { background: rgba(255, 255, 255, 0.05); }
}

.step__tile {
  position: relative;
  z-index: 1;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--c) 18%, #14161b);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 40%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: background-color 0.5s ease, box-shadow 0.5s ease;
}
.step__tile svg { width: 17px; height: 17px; overflow: visible; }
.step__tile path, .step__tile circle {
  fill: none;
  stroke: color-mix(in srgb, var(--c) 80%, #ffffff);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  transition: stroke 0.5s ease;
}

/* the rail from this tile to the next one: it stretches by itself when the note opens */
.step__rail {
  position: absolute;
  left: 22px;
  top: calc(clamp(4px, 1.1vh, 7px) + 32px);
  bottom: calc(-1 * clamp(4px, 1.1vh, 7px) - 2px);
  width: 2px;
}
.step:last-child .step__rail { display: none; }
.step__rail i {
  position: absolute;
  inset: 0;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--from, var(--red)), var(--to, var(--amber)));
  transform-origin: 50% 0;
  transform: scaleY(0);
}
.step:nth-child(2) .step__rail i { --from: var(--amber); --to: var(--blue); }
.step:nth-child(3) .step__rail i { --from: var(--blue); --to: var(--accent); }
.step__rail .step__rail-ok { background: var(--accent); box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 60%, transparent); }

.step__main { flex: 1; min-width: 0; padding-top: 5px; }
.step__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: clamp(14.5px, 1.3vw, 17px);
  line-height: 20px;
}
.step__head b { font-weight: 560; letter-spacing: -0.005em; transition: font-weight 0.3s ease; }
.step.is-open .step__head b { font-weight: 660; }
.step__head time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.step__note { height: 0; overflow: hidden; }
.step__note p {
  padding: 3px 0 5px;
  font-size: clamp(13px, 1.12vw, 14.5px);
  line-height: 1.38;
  color: #b4b8c5;
  max-width: 40ch;
}

@media (max-width: 400px) {
  .step { gap: 10px; }
  .step__note p { font-size: 12.5px; }
}
