:root {
  color-scheme: light;
  --paper: #f2f0e7;
  --paper-deep: #e9e7dc;
  --ink: #173b31;
  --ink-soft: #355c50;
  --muted: #718278;
  --line: #d6d9cc;
  --signal: #ef8057;
  --signal-dark: #bd5635;
  --panel: #173b31;
  --panel-light: #214b3e;
  --panel-muted: #aac1b4;
  --white: #f7f6ef;
  --display: Georgia, 'Times New Roman', serif;
  --sans: 'Avenir Next', Avenir, 'Segoe UI', sans-serif;
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background-color: var(--paper);
  background-image: radial-gradient(#9eab9f 0.55px, transparent 0.55px);
  background-size: 19px 19px;
  background-position: 9px 8px;
}

button { font: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--signal); outline-offset: 4px; }

.site-frame {
  width: min(1280px, calc(100% - 80px));
  margin-inline: auto;
}

.masthead {
  height: 82px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.055em;
  text-decoration: none;
}

.wordmark-mark { width: 34px; height: 34px; overflow: visible; }
.wordmark-mark path { fill: none; stroke: var(--signal-dark); stroke-width: 2.2; stroke-linecap: round; }
.wordmark-mark circle { fill: var(--signal-dark); }
.wordmark-light { font-weight: 400; color: var(--ink-soft); }
.masthead-tools { display: flex; align-items: center; gap: 28px; }
.topline-note, .panel-kicker, .eyebrow, .stamp-heading, .stamp-foot, .test-number,
.stage-label, .phase-item, .progress-text, .result-label small, .footer-live, .footer-index {
  font-size: 10px;
  letter-spacing: 0.13em;
  font-weight: 700;
}

.topline-note { color: var(--muted); }
.language-button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 8px 12px;
  min-width: 52px;
  cursor: pointer;
  font-size: 12px;
  transition: background 160ms ease, border-color 160ms ease;
}
.language-button:hover { background: var(--paper-deep); border-color: #aab7aa; }

.intro {
  display: grid;
  grid-template-columns: 1fr 285px;
  align-items: end;
  gap: 56px;
  padding: clamp(42px, 7vw, 82px) 0 48px;
}

.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 20px; color: var(--signal-dark); }
.eyebrow-rule { display: inline-block; width: 23px; height: 1px; background: var(--signal-dark); }
h1 {
  max-width: 760px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(46px, 6vw, 78px);
  line-height: 0.99;
  letter-spacing: -0.055em;
  font-weight: 400;
}
.intro-description { max-width: 440px; margin: 22px 0 0; color: #536b5f; font-size: 15px; line-height: 1.65; }

.server-stamp {
  position: relative;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
  padding: 15px 0 18px;
  align-self: end;
}
.stamp-heading { display: flex; align-items: center; gap: 9px; color: var(--muted); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #59886b; box-shadow: 0 0 0 3px #d9e2d6; }
.server-stamp strong { display: block; margin: 18px 0 22px; font-family: var(--display); font-size: 25px; line-height: 1.15; font-weight: 400; letter-spacing: -0.025em; overflow-wrap: anywhere; }
.stamp-foot { color: var(--muted); font-size: 9px; }

.test-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.8fr); align-items: stretch; }
.instrument-panel {
  position: relative;
  overflow: hidden;
  min-height: 435px;
  padding: 27px 34px 26px;
  color: var(--white);
  background-color: var(--panel);
  background-image: linear-gradient(90deg, transparent 49.94%, rgba(206, 227, 210, 0.06) 50%, transparent 50.06%), linear-gradient(0deg, transparent 49.94%, rgba(206, 227, 210, 0.05) 50%, transparent 50.06%);
  background-size: 64px 64px;
}
.instrument-panel::after {
  content: '';
  position: absolute;
  width: 340px;
  height: 340px;
  left: -200px;
  bottom: -265px;
  border: 1px solid rgba(235, 244, 230, 0.14);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(235, 244, 230, 0.035), 0 0 0 62px rgba(235, 244, 230, 0.025);
  pointer-events: none;
}
.panel-topline { position: relative; z-index: 1; display: flex; justify-content: space-between; color: var(--panel-muted); }
.panel-kicker { margin: 0; }
.test-number { color: #7f9c8e; }

.instrument-body { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(200px, 0.9fr) minmax(220px, 1fr); align-items: center; gap: 32px; padding: 34px 0 30px; }
.meter { position: relative; width: min(100%, 250px); aspect-ratio: 1; margin: 0 auto; }
.meter svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.meter-track, .meter-arc { fill: none; stroke-width: 1.4; }
.meter-track { stroke: rgba(213, 235, 219, 0.2); }
.meter-arc { stroke: var(--signal); stroke-width: 2.4; stroke-linecap: round; transition: stroke-dashoffset 300ms ease-out; }
.meter-tick { fill: none; stroke: rgba(222, 235, 223, 0.28); stroke-width: 0.8; stroke-dasharray: 1 5; }
.meter-readout { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-top: 2px; }
.speed-value { font-family: var(--display); font-size: clamp(48px, 5vw, 66px); line-height: 1; letter-spacing: -0.065em; font-weight: 400; font-variant-numeric: tabular-nums; }
.speed-unit { margin-top: 10px; color: var(--panel-muted); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }

.measurement-copy { padding: 0 5px; }
.stage-label { margin: 0 0 12px; color: var(--signal); }
.stage-copy { min-height: 52px; max-width: 300px; margin: 0; color: #d0ddd4; font-family: var(--display); font-size: 20px; line-height: 1.28; }
.phase-list { margin-top: 25px; border-top: 1px solid rgba(226, 240, 228, 0.18); }
.phase-item { display: grid; grid-template-columns: 32px 1fr 12px; align-items: center; padding: 11px 0; color: #a6bbae; border-bottom: 1px solid rgba(226, 240, 228, 0.12); letter-spacing: 0.05em; font-size: 11px; font-weight: 500; transition: color 180ms ease; }
.phase-item > span:first-child { color: #789589; font-size: 9px; }
.phase-item i { width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.phase-item.is-active { color: var(--white); }
.phase-item.is-active i { background: var(--signal); box-shadow: 0 0 0 3px rgba(239, 128, 87, 0.18); }
.phase-item.is-complete { color: #cad8cd; }
.phase-item.is-complete i { border: 1px solid #83aa8b; background: #83aa8b; }

.instrument-footer { position: relative; z-index: 1; display: grid; grid-template-columns: auto minmax(80px, 1fr) 82px; align-items: center; gap: 18px; padding-top: 20px; border-top: 1px solid rgba(226, 240, 228, 0.18); }
.run-button { display: inline-flex; align-items: center; justify-content: center; gap: 14px; min-height: 46px; padding: 0 17px; border: 0; background: var(--signal); color: #2b251f; cursor: pointer; font-size: 12px; font-weight: 700; transition: background 160ms ease, transform 160ms ease; }
.run-button:hover { background: #f39570; transform: translateY(-1px); }
.run-button:disabled { cursor: progress; opacity: 0.8; transform: none; }
.run-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.progress-track { height: 2px; background: rgba(232, 242, 231, 0.2); }
.progress-track span { display: block; width: 0; height: 100%; background: var(--signal); transition: width 180ms linear; }
.progress-text { color: #a6bbae; text-align: right; font-size: 9px; letter-spacing: 0.08em; }

.results-panel { display: flex; flex-direction: column; min-height: 435px; padding: 29px 30px 24px; background: rgba(248, 247, 239, 0.9); border: 1px solid #d9dbcf; border-left: 0; }
.results-heading { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 18px; }
.results-heading .panel-kicker { color: var(--signal-dark); }
.results-heading h2 { margin: 0; font-family: var(--display); font-size: 24px; font-weight: 400; letter-spacing: -0.04em; }
.result-row { display: grid; grid-template-columns: minmax(88px, 1fr) auto; gap: 4px 12px; align-items: baseline; padding: 19px 0 17px; border-top: 1px solid var(--line); transition: opacity 180ms ease; }
.result-row.is-measuring { background: linear-gradient(90deg, rgba(239, 128, 87, 0.09), transparent 70%); }
.result-label { display: flex; flex-direction: column; gap: 5px; }
.result-label > span { font-size: 14px; font-weight: 650; }
.result-label small { color: var(--muted); font-size: 8px; letter-spacing: 0.105em; }
.result-row strong { font-family: var(--display); font-size: 31px; font-weight: 400; letter-spacing: -0.05em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.result-row strong small { padding-left: 4px; color: var(--muted); font-family: var(--sans); font-size: 10px; font-weight: 600; letter-spacing: 0; }
.result-detail { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }
.results-bottom { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-top: auto; padding-top: 15px; border-top: 1px solid var(--line); }
.results-bottom p { max-width: 205px; margin: 0; color: #60766a; font-size: 10px; line-height: 1.5; }
.copy-button { padding: 7px 0; border: 0; border-bottom: 1px solid #93a497; background: transparent; color: var(--ink); cursor: pointer; font-size: 10px; font-weight: 650; white-space: nowrap; }
.copy-button:disabled { color: #a5afa6; cursor: default; }

.page-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; min-height: 75px; color: #60766a; }
.page-footer p { display: flex; align-items: center; gap: 18px; margin: 0; font-size: 11px; }
.footer-index { color: var(--signal-dark); font-size: 9px; }
.footer-live { display: flex; align-items: center; gap: 8px; color: #74877b; font-size: 8px; }
.footer-live i { width: 6px; height: 6px; border-radius: 50%; background: #698f72; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 900px) {
  .site-frame { width: min(100% - 48px, 760px); }
  .intro { grid-template-columns: 1fr 230px; gap: 32px; }
  .test-layout { grid-template-columns: minmax(0, 1fr); }
  .results-panel { min-height: 0; border-left: 1px solid #d9dbcf; border-top: 0; }
  .results-heading { padding-bottom: 12px; }
  .result-row { grid-template-columns: minmax(140px, 1fr) auto minmax(90px, .7fr); align-items: center; }
  .result-detail { grid-column: 3; grid-row: 1; text-align: right; }
  .results-bottom { margin-top: 8px; }
}

@media (max-width: 620px) {
  .site-frame { width: calc(100% - 36px); }
  .masthead { height: 68px; }
  .topline-note { display: none; }
  .masthead-tools { gap: 0; }
  .intro { grid-template-columns: 1fr; gap: 30px; padding: 42px 0 32px; }
  .eyebrow { margin-bottom: 16px; font-size: 9px; }
  h1 { font-size: clamp(46px, 13vw, 66px); }
  .intro-description { margin-top: 17px; font-size: 14px; }
  .server-stamp { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 0 12px; padding: 12px 0; }
  .stamp-heading { grid-column: 1; grid-row: 1; }
  .server-stamp strong { grid-column: 1; grid-row: 2; margin: 8px 0 0; font-size: 20px; }
  .stamp-foot { grid-column: 2; grid-row: 1 / span 2; justify-self: end; text-align: right; }
  .instrument-panel { min-height: 0; padding: 23px 21px 20px; }
  .instrument-body { grid-template-columns: 1fr; gap: 14px; padding: 22px 0 23px; }
  .meter { width: min(64vw, 220px); }
  .measurement-copy { width: 100%; padding: 0; }
  .stage-copy { min-height: auto; max-width: 100%; font-size: 18px; }
  .phase-list { margin-top: 17px; }
  .phase-item { padding: 9px 0; }
  .instrument-footer { grid-template-columns: 1fr auto; gap: 12px; padding-top: 16px; }
  .run-button { width: 100%; min-height: 48px; }
  .progress-track { grid-column: 1; grid-row: 2; }
  .progress-text { grid-column: 2; grid-row: 2; }
  .results-panel { padding: 22px 21px 19px; }
  .results-heading { align-items: start; }
  .results-heading h2 { font-size: 22px; }
  .result-row { grid-template-columns: 1fr auto; gap: 5px 10px; padding: 15px 0 13px; }
  .result-detail { grid-column: 1 / -1; grid-row: auto; text-align: left; }
  .result-row strong { font-size: 29px; }
  .results-bottom { align-items: center; }
  .page-footer { align-items: start; flex-direction: column; justify-content: center; gap: 10px; padding: 17px 0 20px; }
  .page-footer p { gap: 12px; font-size: 10px; }
}

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