:root {
  --red: #b01c2e;
  --red-bright: #e2344d;
  --ink: #111216;
  --charcoal: #1c1c1c;
  --muted: #667085;
  --line: rgba(255, 255, 255, 0.14);
  --paper: #f5f7fb;
  --white: #ffffff;
  --green: #30d158;
  --amber: #ffb020;
  --shadow: 0 24px 80px rgba(7, 12, 20, 0.28);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--white);
  font-family: Inter, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(circle at 85% 8%, rgba(226, 52, 77, 0.34), transparent 32rem),
    radial-gradient(circle at 12% 18%, rgba(47, 88, 255, 0.18), transparent 28rem),
    linear-gradient(135deg, #090a0d 0%, #18191f 46%, #08090b 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, black, transparent 86%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(120deg, rgba(9,10,13,0.1), rgba(9,10,13,0.82)), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1400' height='900' viewBox='0 0 1400 900'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.08'%3E%3Cpath d='M120 720h1160M220 650h960M300 580h800M390 510h620'/%3E%3Cpath d='M240 720 540 420 720 600 960 360 1180 580'/%3E%3Ccircle cx='540' cy='420' r='10' fill='%23b01c2e' stroke='none'/%3E%3Ccircle cx='960' cy='360' r='10' fill='%23b01c2e' stroke='none'/%3E%3C/g%3E%3C/svg%3E") center/cover no-repeat;
  opacity: 0.72;
}

a { color: inherit; text-decoration: none; }

a:focus-visible, button:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.92);
  outline-offset: 4px;
  box-shadow: 0 0 0 7px rgba(226, 52, 77, 0.34);
}

.site-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.utility-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 12px 0;
  color: rgba(255,255,255,0.72);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.utility-bar a { color: var(--white); font-weight: 700; }

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 18px 0 34px;
}

.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 14px;
  background: linear-gradient(135deg, var(--red), #6f0d19);
  font-weight: 900;
  box-shadow: 0 14px 34px rgba(176, 28, 46, 0.34);
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.04rem; letter-spacing: 0.02em; }
.brand small { color: rgba(255,255,255,0.62); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.16em; }

nav { display: flex; gap: 24px; color: rgba(255,255,255,0.74); font-weight: 700; font-size: 0.92rem; }
nav a:hover { color: var(--white); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(420px, 1.12fr);
  align-items: center;
  gap: 36px;
  min-height: 650px;
  padding: 38px 0 52px;
}

.eyebrow {
  margin: 0 0 12px;
  color: #ffccd3;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 20px;
  max-width: 660px;
  font-size: clamp(3rem, 7vw, 6.7rem);
  line-height: 0.89;
  letter-spacing: -0.075em;
}

.hero-lede {
  max-width: 610px;
  color: rgba(255,255,255,0.76);
  font-size: clamp(1.05rem, 1.6vw, 1.22rem);
  line-height: 1.7;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin: 34px 0 16px; }

.button {
  border: 0;
  border-radius: 999px;
  padding: 15px 22px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}
.button:hover:not(:disabled) { transform: translateY(-2px); }
.button:disabled { cursor: not-allowed; opacity: 0.5; }
.button.primary { color: white; background: linear-gradient(135deg, var(--red-bright), var(--red)); box-shadow: 0 18px 40px rgba(176, 28, 46, 0.38); }
.button.ghost { color: white; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.18); }

.data-note { color: rgba(255,255,255,0.52); font-size: 0.88rem; }

.test-panel, .detail-card, .cta-band {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.13), rgba(255,255,255,0.075));
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.test-panel {
  overflow: hidden;
  border-radius: 34px;
  padding: 26px;
}

.panel-topline, .gauge-wrap, .phase-strip, footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.state-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  color: #151515;
  background: var(--white);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.state-pill.running { color: white; background: var(--red); }
.state-pill.done { color: #041209; background: var(--green); }
.state-pill.error { color: white; background: #d92d20; }

.edge-meta { color: rgba(255,255,255,0.58); font-size: 0.88rem; text-align: right; }

.gauge-wrap {
  align-items: center;
  justify-content: flex-start;
  margin: 24px 0;
}
.speed-gauge { position: relative; width: 230px; min-width: 230px; }
.speed-gauge svg { width: 100%; height: auto; overflow: visible; }
.gauge-track, .gauge-fill { fill: none; stroke-linecap: round; stroke-width: 18; }
.gauge-track { stroke: rgba(255,255,255,0.12); }
.gauge-fill {
  stroke: var(--red-bright);
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  filter: drop-shadow(0 0 14px rgba(226, 52, 77, .7));
  transition: stroke-dashoffset 260ms ease;
}
.gauge-center { position: absolute; inset: 52px 0 auto; display: grid; place-items: center; text-align: center; }
.gauge-center strong { font-size: 3rem; letter-spacing: -0.06em; }
.gauge-center span { color: rgba(255,255,255,0.58); font-size: 0.8rem; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; }
.gauge-scale {
  position: absolute;
  inset: auto 22px -2px;
  display: flex;
  justify-content: space-between;
  color: rgba(255,255,255,0.42);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

#phaseTitle { margin-bottom: 8px; font-size: clamp(1.55rem, 3vw, 2.35rem); letter-spacing: -0.04em; }
#phaseDescription { color: rgba(255,255,255,0.64); line-height: 1.55; }

.progress-shell { height: 10px; border-radius: 999px; background: rgba(255,255,255,0.1); overflow: hidden; }
.progress-bar { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--red), #ff7588); transition: width 180ms ease; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.metric-card {
  min-height: 132px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: 20px;
  background: rgba(6, 8, 12, 0.42);
  cursor: default;
}
.metric-card.featured { grid-column: span 2; }
.metric-card span, .metric-card small { color: rgba(255,255,255,0.57); font-weight: 800; }
.metric-card span { display: block; margin-bottom: 16px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.12em; }
.metric-card strong { display: block; font-size: clamp(2rem, 5vw, 4rem); line-height: 0.95; letter-spacing: -0.06em; }
.metric-card small { font-size: 0.82rem; }

.result-summary {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  background: rgba(176, 28, 46, 0.16);
}
.result-summary strong { display: block; margin-bottom: 8px; font-size: 1.08rem; }
.result-summary p { margin-bottom: 0; color: rgba(255,255,255,0.68); line-height: 1.55; }

.phase-strip {
  margin: 6px 0 28px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: 24px;
  background: rgba(255,255,255,0.055);
  list-style: none;
  cursor: default;
}
.phase {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 10px;
  flex: 1;
  padding: 12px;
  border-radius: 17px;
  color: rgba(255,255,255,0.55);
  font-size: 0.86rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  user-select: none;
}
.phase-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.08);
  font-size: 0.76rem;
}
.phase strong { display: block; color: inherit; }
.phase small {
  grid-column: 2;
  margin-top: 3px;
  color: rgba(255,255,255,0.42);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
}
.phase.active { color: white; background: rgba(176, 28, 46, 0.82); }
.phase.active .phase-icon { color: white; background: rgba(255,255,255,0.18); box-shadow: 0 0 0 6px rgba(255,255,255,0.08); }
.phase.active .phase-icon::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  margin-left: 44px;
  border-radius: 999px;
  background: white;
  animation: phasePulse 1s ease-in-out infinite;
}
.phase.active small { color: rgba(255,255,255,0.82); }
.phase.complete { color: rgba(255,255,255,0.9); background: rgba(48, 209, 88, 0.16); }
.phase.complete .phase-icon { color: #06150b; background: var(--green); }
.phase.complete small { color: rgba(210,255,223,0.82); }
.phase.error { color: white; background: rgba(217,45,32,0.24); }
.phase.error .phase-icon { color: white; background: #d92d20; }

@keyframes phasePulse {
  0%, 100% { transform: scale(0.7); opacity: 0.45; }
  50% { transform: scale(1); opacity: 1; }
}

.details-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 20px;
  margin-bottom: 24px;
}
.detail-card { border-radius: 28px; padding: 24px; }
.quality-card { grid-column: 1 / -1; }
.explain-card { grid-column: 1 / -1; }
.card-heading h2 { margin-bottom: 18px; font-size: clamp(1.8rem, 3vw, 2.6rem); letter-spacing: -0.05em; }

.detail-list { display: grid; gap: 10px; margin: 0 0 18px; }
.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
dt { color: rgba(255,255,255,0.58); }
dd { margin: 0; font-weight: 900; }

.split-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.split-bars h3 { color: rgba(255,255,255,0.7); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.82rem; }
.bar-list { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 82px 1fr 86px; align-items: center; gap: 10px; color: rgba(255,255,255,0.74); font-size: 0.82rem; }
.bar-track { height: 9px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,0.11); }
.bar-fill { height: 100%; width: var(--value, 0%); border-radius: inherit; background: linear-gradient(90deg, var(--red), #ff8b9a); }

.quality-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.quality-grid div { padding: 20px; border: 1px solid rgba(255,255,255,0.1); border-radius: 20px; background: rgba(6,8,12,0.34); }
.quality-grid span { display: block; margin-bottom: 8px; color: rgba(255,255,255,0.58); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.78rem; font-weight: 900; }
.quality-grid strong { font-size: 1.5rem; }
#qualityNarrative { margin-top: 18px; color: rgba(255,255,255,0.66); line-height: 1.6; }

.explain-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.explain-grid div {
  min-height: 132px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  background: rgba(6,8,12,0.32);
}
.explain-grid strong { display: block; margin-bottom: 8px; }
.explain-grid span { color: rgba(255,255,255,0.64); line-height: 1.55; }

.cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 20px 0 34px;
  padding: 28px;
  border-radius: 28px;
}
.cta-band h2 { max-width: 760px; margin-bottom: 0; font-size: clamp(1.7rem, 3vw, 2.7rem); letter-spacing: -0.055em; }

footer { padding: 22px 0 42px; color: rgba(255,255,255,0.54); font-size: 0.88rem; }

@media (max-width: 980px) {
  .hero, .details-grid { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-card.featured { grid-column: span 1; }
}

@media (max-width: 720px) {
  .utility-bar, .masthead, nav, .gauge-wrap, .phase-strip, .split-bars, .quality-grid, .cta-band, footer { flex-direction: column; align-items: flex-start; }
  nav { gap: 12px; }
  .test-panel { padding: 18px; border-radius: 24px; }
  .gauge-wrap, .split-bars, .quality-grid { display: grid; grid-template-columns: 1fr; }
  .speed-gauge { width: 100%; min-width: 0; }
  .metric-grid { grid-template-columns: 1fr; }
  .phase { width: 100%; }
  .bar-row { grid-template-columns: 68px 1fr 74px; }
  .explain-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
