@font-face {
  font-family: "Manrope";
  src: url("./fonts/Manrope-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}

@font-face {
  font-family: "DM Mono";
  src: url("./fonts/DMMono-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "DM Mono";
  src: url("./fonts/DMMono-Medium.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

:root {
  --paper: #f4f1e8;
  --paper-deep: #e8e2d5;
  --ink: #111111;
  --muted: #6d6a63;
  --line: rgba(17, 17, 17, 0.18);
  --red: #ff5b4d;
  --blue: #5267ff;
  --yellow: #ffd83d;
  --green: #54d69b;
  --purple: #bd78ff;
  --active: var(--blue);
  --shadow: 8px 8px 0 var(--ink);
  --radius-xl: 36px;
  --radius-lg: 28px;
  --radius-md: 18px;
  --font-display:
    "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --font-mono: "DM Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;

  background-size: 32px 32px;
  color: var(--ink);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
}

button,
a,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 12px 16px;
  transform: translateY(-160%);
  border: 2px solid var(--ink);
  background: var(--yellow);
  font-weight: 800;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 18px;
  font-weight: 800;
  transition:
    transform 240ms ease,
    background 240ms ease,
    color 240ms ease;
}

.brand:hover .brand-mark {
  transform: rotate(-10deg) scale(1.08);
  background: var(--yellow);
  color: var(--ink);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-copy strong {
  font-size: 14px;
}

.brand-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 22px;
}

.text-link {
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.text-link span {
  display: inline-block;
  transition: transform 180ms ease;
}

.text-link:hover span {
  transform: translate(3px, -3px);
}



main {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
}

.hero {
  padding: 72px 0 130px;
}

.hero-heading {
  display: grid;
  align-items: end;
  margin-bottom: 52px;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  gap: clamp(42px, 7vw, 110px);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.eyebrow > span {
  width: 24px;
  height: 8px;
  border-radius: 99px;
  background: var(--active);
}

.hero h1 {
  max-width: 960px;
  margin: 0;
  font-size: clamp(58px, 7vw, 108px);
  font-weight: 600;
  letter-spacing: -0.075em;
  line-height: 0.91;
}

.hero h1 em {
  position: relative;
  display: inline-block;
  font-weight: 400;
  white-space: nowrap;
}

.hero h1 em::after {
  position: absolute;
  z-index: -1;
  right: -0.04em;
  bottom: 0.02em;
  left: 0.02em;
  height: 0.9em;
  border-radius: 32px;
  background: var(--yellow);
  content: "";
  transform: rotate(-0.5deg);
}

.hero-description {
  max-width: 640px;
  margin: 0;
  color: #34322e;
  font-size: clamp(15px, 1.25vw, 18px);
  line-height: 1.6;
}

.hero-badges {
  display: flex;
  align-items: center;
  margin-top: 22px;
  flex-wrap: wrap;
  gap: 7px;
}

.hero-badges span {
  padding: 7px 10px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 38px;
  min-height: 58px;
  padding: 0 24px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition:
    box-shadow 180ms ease,
    transform 180ms ease,
    background 180ms ease;
}

.button-primary {
  background: var(--ink);
  color: #fff;
}

.button-primary:hover {
  transform: translate(-3px, -3px);
  box-shadow: 6px 6px 0 var(--active);
}

.button-secondary {
  background: transparent;
}

.button-secondary:hover {
  background: var(--yellow);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.36;
  transform: none;
  box-shadow: none;
}

.tiny-note {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.honesty-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 650px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.honesty-icon {
  display: grid;
  flex: 0 0 27px;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  font-weight: 800;
}

.honesty-note p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.honesty-note strong {
  color: var(--ink);
}

.hero-visual {
  position: relative;
  align-self: center;
  aspect-ratio: 1;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.33);
}

.hero-visual::before,
.hero-visual::after {
  position: absolute;
  top: 50%;
  left: 50%;
  background: var(--line);
  content: "";
  transform: translate(-50%, -50%);
}

.hero-visual::before {
  width: 100%;
  height: 1px;
}

.hero-visual::after {
  width: 1px;
  height: 100%;
}

.orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px dashed var(--ink);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.orbit-large {
  width: 78%;
  height: 78%;
  animation: orbit-spin 22s linear infinite;
}

.orbit-small {
  width: 48%;
  height: 48%;
  border-style: solid;
  opacity: 0.35;
}

.planet {
  position: absolute;
  display: block;
  width: 54px;
  height: 54px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  box-shadow: 4px 4px 0 var(--ink);
}

.planet-red {
  top: 7%;
  left: 7%;
  background: var(--red);
}

.planet-blue {
  top: 46%;
  right: -7%;
  background: var(--blue);
}

.planet-yellow {
  bottom: -2%;
  left: 30%;
  background: var(--yellow);
}

.visual-center {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: flex;
  width: 34%;
  aspect-ratio: 1;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  transform: translate(-50%, -50%);
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 7px 7px 0 var(--ink);
}

.visual-center span,
.visual-center small {
  font-family: var(--font-mono);
  font-size: 9px;
}

.visual-center strong {
  font-size: clamp(38px, 4vw, 64px);
  line-height: 1;
}

.visual-label {
  position: absolute;
  z-index: 3;
  padding: 8px 12px;
  transform: rotate(var(--rotation));
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
}

.label-one {
  --rotation: -8deg;
  top: 15%;
  right: -2%;
}

.label-two {
  --rotation: 6deg;
  right: 4%;
  bottom: 12%;
}

.label-three {
  --rotation: -5deg;
  bottom: 17%;
  left: -3%;
}

@keyframes orbit-spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.checker-shell {
  display: grid;
  overflow: hidden;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 720px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow);
}

.checker-sidebar {
  display: flex;
  padding: 30px;
  border-right: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  flex-direction: column;
}

.progress-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 14px;
}

.progress-heading strong {
  font-size: 18px;
}

.progress-track {
  overflow: hidden;
  height: 8px;
  margin: 15px 0 35px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 99px;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--active);
  transition:
    width 350ms ease,
    background 350ms ease;
}

.step-list {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
  flex-direction: column;
  gap: 6px;
}

.step-list button {
  display: grid;
  width: 100%;
  min-height: 48px;
  padding: 0 10px;
  align-items: center;
  grid-template-columns: 29px 1fr auto;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  text-align: left;
  transition:
    background 180ms ease,
    color 180ms ease;
}

.step-list button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.step-list button:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.step-list button.is-active {
  background: var(--active);
  color: var(--ink);
}

.step-number,
.step-status {
  font-family: var(--font-mono);
  font-size: 9px;
}

.step-title {
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: white;
}

.step-status {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.reset-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: auto;
  padding: 14px 4px 0;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 16px;
}

.reset-button:hover {
  color: white;
}

.step-card {
  display: flex;
  min-width: 0;
  padding: clamp(32px, 6vw, 80px);
  flex-direction: column;
}

.step-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.step-kicker::before {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--active);
  content: "";
}

.step-card h3 {
  max-width: 800px;
  margin: 20px 0 14px;
  font-size: clamp(38px, 5vw, 68px);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 1;
}

.step-intro {
  max-width: 700px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.step-body {
  display: flex;
  flex: 1;
  margin-top: 36px;
  flex-direction: column;
}

.step-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 42px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.step-footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-message {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 16px;
}

.preparation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.check-option {
  position: relative;
}

.check-option input {
  position: absolute;
  opacity: 0;
}

.check-option label {
  display: flex;
  min-height: 90px;
  padding: 18px;
  align-items: flex-start;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition:
    border 180ms ease,
    transform 180ms ease,
    background 180ms ease;
}

.check-option label:hover {
  transform: translateY(-2px);
  border-color: var(--ink);
}

.custom-check {
  display: grid;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 7px;
  font-size: 13px;
}

.check-option input:checked + label {
  border-color: var(--ink);
  background: color-mix(in srgb, var(--active) 18%, white);
}

.check-option input:checked + label .custom-check {
  background: var(--ink);
  color: white;
}

.check-option input:focus-visible + label {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.check-text strong,
.check-text span {
  display: block;
}

.check-text strong {
  margin-bottom: 5px;
  font-size: 13px;
}

.check-text span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.test-stage {
  overflow: hidden;
  padding: 28px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
}

.test-stage-dark {
  background: #000;
  color: #fff;
}

.test-stage-light {
  background: #fff;
  color: #000;
}

.stage-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
  opacity: 0.7;
  font-family: var(--font-mono);
  font-size: 9px;
}

.patch-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(46px, 1fr));
  gap: 10px;
}

.patch-choice {
  position: relative;
  display: flex;
  min-width: 0;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  flex-direction: column;
  gap: 7px;
}

.patch-choice span:first-child {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--patch-color);
}

.patch-choice span:last-child {
  color: currentColor;
  font-family: var(--font-mono);
  font-size: 9px;
}

.patch-choice.is-selected {
  border-color: var(--active);
  outline: 2px solid var(--active);
  outline-offset: 3px;
}

.answer-row {
  display: flex;
  margin-top: 18px;
  flex-wrap: wrap;
  gap: 9px;
}

.answer-chip {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  transition:
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.answer-chip:hover {
  transform: translateY(-2px);
}

.answer-chip.is-selected {
  background: var(--ink);
  color: white;
}

.test-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.test-tip::before {
  display: grid;
  flex: 0 0 21px;
  width: 21px;
  height: 21px;
  place-items: center;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--ink);
  content: "!";
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
}

.gamma-stage {
  padding: 18px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  background: #1b1b1b;
}

#gammaCanvas {
  display: block;
  width: 100%;
  height: 260px;
  border-radius: 14px;
}

.gamma-controls {
  display: grid;
  align-items: center;
  margin-top: 20px;
  grid-template-columns: auto 1fr auto;
  gap: 15px;
  color: white;
}

.gamma-controls label,
.gamma-value {
  font-family: var(--font-mono);
  font-size: 10px;
}

.gamma-value {
  min-width: 58px;
  text-align: right;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--yellow);
}

.gradient-stack {
  display: grid;
  gap: 12px;
}

.gradient-test {
  position: relative;
  overflow: hidden;
  height: 88px;
  border: 2px solid var(--ink);
  border-radius: 16px;
}

.gradient-test::after {
  position: absolute;
  right: 12px;
  bottom: 10px;
  padding: 4px 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.83);
  color: #111;
  content: attr(data-label);
  font-family: var(--font-mono);
  font-size: 8px;
}

.gradient-gray {
  background: linear-gradient(90deg, #000, #fff);
}

.gradient-rgb {
  background: linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
}

.gradient-dark {
  background: linear-gradient(
    90deg,
    #000,
    #111b2b,
    #243862,
    #4265a4,
    #7f9ae0,
    #e4eaff
  );
}

.color-separation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.color-family {
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: white;
}

.color-family-title {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 8px;
}

.color-family-patches {
  display: grid;
  height: 95px;
  grid-template-columns: repeat(5, 1fr);
}

.color-family-patches span {
  background: var(--color);
}

.uniformity-preview {
  display: grid;
  min-height: 220px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  background: #808080;
}

.uniformity-preview button {
  padding: 16px 22px;
  border: 2px solid white;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.uniformity-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  background: #808080;
}

.uniformity-overlay[hidden] {
  display: none;
}

.uniformity-instructions {
  display: flex;
  width: min(90%, 430px);
  padding: 24px;
  align-items: center;
  border: 2px solid #fff;
  border-radius: 22px;
  background: rgba(0, 0, 0, 0.78);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.24);
  color: white;
  text-align: center;
  flex-direction: column;
  gap: 8px;
}

.uniformity-instructions span {
  font-size: 12px;
  opacity: 0.75;
}

.uniformity-instructions button {
  margin-top: 12px;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: white;
  color: black;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.result-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 32px;
}

.score-orbit {
  position: relative;
  display: grid;
  width: 250px;
  height: 250px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: conic-gradient(var(--active) var(--score), var(--paper-deep) 0);
}

.score-orbit::before {
  position: absolute;
  width: 76%;
  height: 76%;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  content: "";
}

.score-number {
  position: relative;
  display: flex;
  align-items: center;
  flex-direction: column;
}

.score-number strong {
  font-size: 70px;
  letter-spacing: -0.08em;
  line-height: 1;
}

.score-number span {
  font-family: var(--font-mono);
  font-size: 9px;
}

.result-copy h4 {
  margin: 0 0 8px;
  font-size: 26px;
  letter-spacing: -0.035em;
}

.result-copy > p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.recommendations {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.recommendations li {
  display: flex;
  padding: 13px 15px;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.52);
  font-size: 14px;
  line-height: 1.5;
}

.recommendations li::before {
  display: grid;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: var(--yellow);
  content: "→";
  font-size: 10px;
  font-weight: 800;
}

.about-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 120px;
  padding: 27px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 10px;
}

.about-strip p {
  margin: 0;
}

.about-strip a {
  font-weight: 500;
  text-decoration: none;
}

.site-footer {
  display: grid;
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
  padding: 78px 0 35px;
  grid-template-columns: 1fr auto;
  border-top: 2px solid var(--ink);
}

.footer-title {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-cta {
  font-size: clamp(46px, 6vw, 88px);
  font-weight: 600;
  letter-spacing: -0.065em;
  line-height: 1;
  text-decoration: none;
}

.footer-cta span {
  display: inline-block;
  transition: transform 200ms ease;
}

.footer-cta:hover span {
  transform: translateX(10px);
}

.footer-meta {
  align-self: end;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: right;
}

.footer-meta p {
  margin: 6px 0 0;
}

.confetti-layer {
  position: fixed;
  z-index: 120;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.confetti-piece {
  position: absolute;
  top: -30px;
  width: 11px;
  height: 20px;
  animation: confetti-fall var(--duration) cubic-bezier(0.18, 0.65, 0.35, 1)
    forwards;
  animation-delay: var(--delay);
  background: var(--confetti-color);
}

@keyframes confetti-fall {
  to {
    transform: translate(var(--drift), 110vh) rotate(920deg);
  }
}

.toast {
  position: fixed;
  z-index: 130;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100% - 44px));
  padding: 13px 17px;
  transform: translateY(200%);
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--yellow);
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 16px;
  font-weight: 800;
  transition: transform 240ms ease;
}

.toast.is-visible {
  transform: translateY(0);
}

@media (max-width: 1050px) {
  .hero-heading {
    align-items: start;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.72fr);
    gap: 42px;
  }

  .checker-shell {
    grid-template-columns: 245px minmax(0, 1fr);
  }

  .checker-sidebar {
    padding: 24px 18px;
  }

  .result-layout {
    grid-template-columns: 200px minmax(0, 1fr);
  }

  .score-orbit {
    width: 200px;
    height: 200px;
  }
}

@media (max-width: 760px) {
  :root {
    --shadow: 5px 5px 0 var(--ink);
    --radius-xl: 24px;
  }

  .text-link,
  .brand-copy small {
    display: none;
  }

  .site-header,
  main,
  .site-footer {
    width: min(100% - 28px, 1440px);
  }

  .site-header {
    padding: 18px 0;
  }

  .brand-copy strong {
    max-width: 140px;
    font-size: 11px;
  }



  .hero {
    min-height: auto;
    padding: 52px 0 96px;
  }

  .hero-heading {
    display: block;
    margin-bottom: 34px;
  }

  .hero h1 {
    font-size: clamp(51px, 15vw, 76px);
  }

  .hero-side {
    margin-top: 28px;
  }

  .hero-description {
    font-size: 16px;
  }

  .checker-shell {
    display: block;
    min-height: 0;
  }

  .checker-sidebar {
    display: block;
    border-right: 0;
    border-bottom: 2px solid var(--ink);
  }

  .step-list {
    overflow-x: auto;
    padding-bottom: 8px;
    flex-direction: row;
    scrollbar-width: thin;
  }

  .step-list li {
    flex: 0 0 48px;
  }

  .step-list button {
    display: grid;
    width: 48px;
    min-height: 44px;
    padding: 0;
    place-items: center;
    grid-template-columns: 1fr;
  }

  .step-list .step-title,
  .step-list .step-status {
    display: none;
  }

  .reset-button {
    margin-top: 13px;
  }

  .step-card {
    padding: 30px 20px;
  }

  .step-card h3 {
    font-size: clamp(36px, 11vw, 52px);
  }

  .preparation-grid,
  .color-separation-grid {
    grid-template-columns: 1fr;
  }

  .patch-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .test-stage {
    padding: 18px;
  }

  #gammaCanvas {
    height: 210px;
  }

  .gamma-controls {
    grid-template-columns: 1fr auto;
  }

  .gamma-controls label {
    grid-column: 1 / -1;
  }

  .step-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .step-footer-right {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .step-footer .button {
    width: 100%;
    gap: 15px;
  }

  .result-layout {
    grid-template-columns: 1fr;
  }

  .score-orbit {
    width: 210px;
    height: 210px;
    justify-self: center;
  }

  .about-strip {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }

  .site-footer {
    display: block;
  }

  .footer-cta {
    font-size: clamp(43px, 13vw, 65px);
  }

  .footer-meta {
    margin-top: 68px;
    text-align: left;
  }
}

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

/* The whole app lives inside one viewport-height TV. */
:root {
  --paper: #151719;
  --paper-deep: #303638;
  --ink: #edf1ed;
  --muted: #a2aaa7;
  --line: #363d3e;
  --radius-lg: 12px;
  --radius-md: 10px;
}
html {
  height: 100%;
  overflow: hidden;
}
body {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  padding: clamp(8px, 1.8vw, 24px);
  background: #090a0b;
}
.tv-device {
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 12px 12px 0;
  border: 1px solid #4c4f50;
  border-radius: 26px;
  background: linear-gradient(135deg, #36393a, #1b1d1e 40%, #292c2d);
  box-shadow: inset 0 1px 0 #ffffff26;
}
.tv-display {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border: 2px solid #050607;
  border-radius: 16px;
  background: #111315;
}
.tv-interface {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
main.checker-shell {
  width: 100%;
  margin: 0;
  flex: 1;
  min-height: 0;
  grid-template-columns: 225px minmax(0, 1fr);
  border: 0;
  border-radius: 0;
  background: #151719;
  box-shadow: none;
}
.checker-sidebar {
  min-height: 0;
  overflow-y: auto;
  padding: 26px 18px;
  border-right: 1px solid var(--line);
  background: #101315;
  color: #dce2dd;
}
.progress-heading {
  font-size: 9px;
  color: #99a39e;
}
.progress-heading strong {
  font-size: 12px;
  color: #e2e9e3;
}
.progress-track {
  height: 3px;
  margin: 14px 0 24px;
  border: 0;
  background: #343d3a;
}
.step-list {
  gap: 6px;
}
.step-list button {
  min-height: 44px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  grid-template-columns: 24px 1fr 15px;
}
.step-list button.is-active {
  border-color: #62746b;
  background: #29332e;
  color: #f2f6f1;
}
.step-title {
  font-size: 11px;
  color: inherit;
  font-weight: 500;
}
.step-status {
  width: 14px;
  height: 14px;
  font-size: 8px;
}
.reset-button {
  margin-top: 26px;
  font-size: 11px;
}
.step-card {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #596360 #171a1b;
  padding: clamp(22px, 4vw, 56px);
}
.step-kicker {
  flex-shrink: 0;
  font-size: 10px;
  color: #9aa7a1;
}
.step-kicker::before {
  width: 5px;
  height: 5px;
}
.step-card h3 {
  flex-shrink: 0;
  font-size: clamp(28px, 3.5vw, 48px);
  line-height: 1.1;
  margin: 18px 0 14px;
  letter-spacing: -0.045em;
}
.step-intro {
  flex-shrink: 0;
  font-size: 13px;
  line-height: 1.7;
}
.step-body {
  flex: 1 0 auto;
  margin-top: 26px;
}
.step-footer {
  flex-shrink: 0;
  margin-top: 28px;
  padding-top: 20px;
}
.footer-message {
  font-size: 10px;
  line-height: 1.6;
  max-width: 240px;
}
.button {
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid #58625d;
  border-radius: 8px;
  font-size: 12px;
  gap: 24px;
}
.button-primary {
  background: #d7e7d9;
  color: #17251b;
  border-color: #d7e7d9;
}
.button-primary:hover {
  transform: none;
  box-shadow: none;
  background: #eff8ef;
}
.button-secondary {
  background: #242b28;
  color: #e0e8e0;
}
.button-secondary:hover {
  background: #3a443d;
}
.check-option label {
  padding: 18px;
  min-height: 100px;
  background: #1c211f;
  border-color: #3b453f;
}
.check-option label:hover {
  transform: none;
  border-color: #869c8c;
}
.custom-check {
  width: 20px;
  height: 20px;
  flex-basis: 20px;
  border: 1px solid #7a8c80;
  color: transparent;
}
.check-option input:checked + label {
  border-color: #839d89;
  background: #28352c;
}
.check-option input:checked + label .custom-check {
  background: #c9dfce;
  color: #173321;
}
.check-text span {
  font-size: 11px;
  line-height: 1.55;
}
.answer-chip {
  border-color: #56665b;
  border-radius: 8px;
  color: #d6dfd7;
}
.answer-chip:hover {
  transform: none;
  background: #2b352e;
}
.answer-chip.is-selected {
  background: #d7e7d9;
  color: #17251b;
}
.test-stage,
.gamma-stage,
.gradient-test,
.color-family,
.uniformity-preview {
  border: 1px solid #525c56;
}
.color-family {
  background: #1c211f;
}
.test-tip {
  font-size: 11px;
}
.test-tip::before {
  background: #344237;
  color: #d3dfd3;
}
.recommendations li {
  background: #1c211f;
  font-size: 12px;
}
.recommendations li::before {
  background: #344237;
  color: #d3dfd3;
}
.score-orbit,
.score-orbit::before {
  border: 0;
}
.result-copy > p {
  font-size: 13px;
}
.tv-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 24px;
  border-top: 1px solid var(--line);
  background: #101315;
  color: #8d9892;
  font-size: 10px;
}
.tv-footer a {
  color: #aebbaf;
  text-decoration: none;
}
.tv-chin {
  flex-shrink: 0;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}
.tv-wordmark {
  font-size: 7px;
  color: #b4bbb7;
  letter-spacing: 0.24em;
}
.tv-wordmark b {
  margin-left: 10px;
  font-size: 6px;
  font-weight: 400;
  color: #7b837e;
}
.speaker-grille {
  width: 85px;
  height: 8px;
  background: repeating-linear-gradient(
    90deg,
    #0c0e0d 0 2px,
    transparent 2px 4px
  );
}
.power-indicator {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #9daaa1;
  font-size: 14px;
}
.power-indicator i {
  width: 4px;
  height: 4px;
  background: #bfd5c3;
  border-radius: 50%;
}
.tv-welcome {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 30px;
  background: radial-gradient(ellipse at center, #19221c, #0d110f 75%);
  text-align: center;
}
.tv-welcome[hidden] {
  display: none;
}
.welcome-content {
  max-width: 650px;
  margin: auto;
}
.welcome-logo {
  position: relative;
  display: grid;
  place-items: center;
  width: 82px;
  height: 68px;
  margin: 0 auto 32px;
  border: 2px solid #a5c2ad;
  border-radius: 16px;
  color: #d1e6d6;
  box-shadow: 0 0 28px #bbefc414;
}
.welcome-logo span {
  font-family: var(--font-mono);
  font-size: 27px;
  letter-spacing: -0.08em;
}
.welcome-logo i {
  position: absolute;
  bottom: -9px;
  width: 24px;
  height: 7px;
  border-bottom: 2px solid #a5c2ad;
}
.welcome-eyebrow {
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: #8da996;
}
.tv-welcome h1 {
  margin: 0;
  font-size: clamp(36px, 5.5vw, 76px);
  letter-spacing: -0.06em;
  font-weight: 600;
  line-height: 1.12;
  color: #dfede2;
}
.tv-welcome h1 > span {
  display: block;
  margin-top: 15px;
  font-size: clamp(12px, 1.4vw, 17px);
  font-weight: 400;
  color: #90a696;
  letter-spacing: 0.02em;
}
.welcome-description {
  margin: 24px 0 30px;
  color: #a2b4a7;
  font-size: 13px;
  line-height: 1.8;
}
.welcome-actions {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 22px;
}
.welcome-actions .button {
  min-height: 50px;
  padding: 0 28px;
}
.welcome-link {
  font-size: 12px;
  color: #a8bdaf;
  text-decoration: none;
}
.welcome-link:hover {
  color: #eef8ef;
}
.welcome-link > span {
  margin-left: 8px;
}
.welcome-bottom {
  flex-shrink: 0;
  margin-top: 28px;
  font-family: var(--font-mono);
  color: #687e6f;
  font-size: 9px;
  letter-spacing: 0.14em;
}
.uniformity-overlay {
  position: absolute;
}
.confetti-layer {
  position: absolute;
}
.toast {
  position: absolute;
  background: #d7e7d9;
  color: #17251b;
  border: 1px solid #7f9788;
  border-radius: 8px;
  font-size: 12px;
  box-shadow: none;
}
@media (max-width: 1050px) {
  main.checker-shell {
    grid-template-columns: 195px minmax(0, 1fr);
  }
  .result-layout {
    grid-template-columns: 170px minmax(0, 1fr);
  }
  .score-orbit {
    width: 170px;
    height: 170px;
  }
  .score-number strong {
    font-size: 54px;
  }
}
@media (max-width: 760px) {
  body {
    padding: 6px;
  }
  .tv-device {
    padding: 6px 6px 0;
    border-radius: 17px;
  }
  .tv-display {
    border-radius: 10px;
  }
  main.checker-shell {
    display: flex;
    flex-direction: column;
  }
  .checker-sidebar {
    flex: 0 0 auto;
    overflow: hidden;
    padding: 12px 12px 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .progress-track {
    margin: 8px 0 10px;
  }
  .step-list {
    flex-direction: row;
    gap: 5px;
    padding-bottom: 4px;
    overflow-x: auto;
  }
  .step-list li {
    flex: 0 0 35px;
  }
  .step-list button {
    width: 35px;
    min-height: 32px;
    padding: 0;
    grid-template-columns: 1fr;
  }
  .reset-button {
    margin-top: 7px;
    padding-top: 7px;
    font-size: 9px;
  }
  .step-card {
    flex: 1;
    padding: 22px 16px;
  }
  .step-card h3 {
    font-size: clamp(26px, 7vw, 36px);
    margin-top: 13px;
  }
  .step-intro {
    font-size: 12px;
  }
  .step-body {
    margin-top: 22px;
  }
  .check-option label {
    min-height: 86px;
    padding: 14px;
  }
  .color-separation-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .color-family-title {
    padding: 8px;
    font-size: 7px;
  }
  .patch-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .test-stage {
    padding: 14px;
  }
  .stage-label {
    font-size: 8px;
    gap: 10px;
  }
  .step-footer-right {
    gap: 8px;
  }
  .step-footer .button {
    gap: 8px;
    padding: 0 12px;
    font-size: 11px;
  }
  .footer-message {
    max-width: none;
  }
  .result-layout {
    grid-template-columns: 1fr;
  }
  .score-orbit {
    width: 190px;
    height: 190px;
  }
  .tv-footer {
    padding: 9px 12px;
    font-size: 8px;
    gap: 6px;
  }
  .copyright {
    display: none;
  }
  .tv-chin {
    height: 26px;
    padding: 0 10px;
  }
  .tv-wordmark b,
  .speaker-grille {
    display: none;
  }
  .tv-welcome {
    padding: 24px 16px;
  }
  .welcome-logo {
    margin-bottom: 26px;
    width: 68px;
    height: 56px;
  }
  .welcome-description {
    font-size: 12px;
    margin: 20px 0 25px;
  }
  .welcome-link {
    font-size: 11px;
  }
  .welcome-bottom {
    font-size: 7px;
  }
}
@media (max-height: 550px) {
  .tv-welcome {
    padding: 18px;
  }
  .welcome-logo {
    width: 50px;
    height: 40px;
    margin-bottom: 18px;
  }
  .welcome-logo span {
    font-size: 19px;
  }
  .welcome-eyebrow {
    margin-bottom: 9px;
  }
  .tv-welcome h1 {
    font-size: 34px;
  }
  .tv-welcome h1 > span {
    margin-top: 8px;
    font-size: 12px;
  }
  .welcome-description {
    margin: 12px 0 16px;
    font-size: 11px;
  }
  .welcome-actions {
    gap: 12px;
  }
  .welcome-actions .button {
    min-height: 40px;
  }
  .welcome-bottom {
    margin-top: 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tv-startup {
    display: none;
  }
}

/* Adaptive step cards: use the actual TV and card height, without page zoom. */
.tv-display {
  container-type: size;
}

.step-card {
  container-type: size;
  padding: clamp(12px, 3cqh, 32px) clamp(14px, 3vw, 40px);
}

.step-card h3 {
  margin: clamp(8px, 2cqh, 16px) 0 clamp(8px, 1.6cqh, 12px);
  font-size: clamp(24px, min(3.2vw, 6cqh), 44px);
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.step-intro {
  font-size: clamp(12px, 1.8cqh, 13px);
  line-height: 1.5;
}

.step-body {
  flex: 1 0 auto;
  margin-top: clamp(12px, 2.6cqh, 24px);
}

.step-footer {
  gap: 12px;
  margin-top: clamp(12px, 2.6cqh, 24px);
  padding-top: clamp(10px, 2cqh, 18px);
}

.step-footer-right {
  flex-shrink: 0;
}

.step-footer .button {
  min-height: 44px;
  gap: 12px;
}

.preparation-grid,
.color-separation-grid,
.gradient-stack {
  gap: clamp(8px, 1.6cqh, 12px);
}

.check-option label {
  min-height: clamp(68px, 13cqh, 100px);
  padding: clamp(10px, 2cqh, 18px);
  gap: 10px;
}

.check-text {
  min-width: 0;
}

.check-text span {
  line-height: 1.4;
}

.test-stage,
.gamma-stage {
  padding: clamp(12px, 2.5cqh, 24px);
}

.stage-label {
  gap: 10px;
  margin-bottom: clamp(10px, 2cqh, 16px);
}

.patch-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(8px, 1.5cqh, 12px);
}

.patch-choice span:first-child {
  /* Keep all twelve patches visible instead of growing with the card width. */
  height: clamp(32px, 9cqh, 84px);
  aspect-ratio: auto;
}

#gammaCanvas {
  height: clamp(100px, 30cqh, 260px);
}

.gamma-controls {
  margin-top: 12px;
  gap: 10px;
}

.gradient-test {
  height: clamp(38px, 10cqh, 88px);
}

.color-family-patches {
  height: clamp(36px, 10cqh, 95px);
}

.uniformity-preview {
  min-height: clamp(100px, 29cqh, 220px);
}

.answer-row {
  margin-top: 12px;
  gap: 8px;
}

.answer-chip {
  min-height: 44px;
  padding: 8px 12px;
}

.test-tip {
  margin-top: 12px;
  line-height: 1.4;
}

.result-layout {
  grid-template-columns: clamp(120px, 28cqh, 200px) minmax(0, 1fr);
  gap: clamp(16px, 3vw, 28px);
}

.score-orbit {
  width: clamp(120px, 28cqh, 200px);
  height: auto;
  aspect-ratio: 1;
}

.score-number strong {
  font-size: clamp(42px, 9cqh, 64px);
}

.result-copy h4 {
  font-size: clamp(20px, 3.8cqh, 26px);
}

.result-copy > p {
  margin-bottom: 12px;
}

.recommendations {
  gap: 8px;
}

.recommendations li {
  padding: 10px 12px;
}

/* A shorter sidebar leaves room for every step on laptop screens. */
@media (min-width: 761px) and (max-height: 650px) {
  .checker-sidebar {
    padding: 16px 12px;
  }

  .progress-track {
    margin-bottom: 14px;
  }

  .step-list {
    gap: 3px;
  }

  .step-list button {
    min-height: 36px;
  }

  .reset-button {
    margin-top: 14px;
  }
}

@media (max-width: 760px) {
  .checker-sidebar {
    position: relative;
    padding: 10px 12px 6px;
  }

  .progress-heading {
    padding-right: 85px;
  }

  .reset-button {
    position: absolute;
    top: 7px;
    right: 12px;
    width: auto;
    margin: 0;
    padding: 3px 0;
    gap: 8px;
    border: 0;
  }

  .progress-track {
    margin: 7px 0;
  }

  .step-card h3 {
    font-size: clamp(24px, min(6.5vw, 5.5cqh), 36px);
  }

  .preparation-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .color-separation-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .patch-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .patch-choice span:first-child {
    height: clamp(32px, 7cqh, 60px);
  }

  .step-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .step-footer-right {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .step-footer .button {
    width: 100%;
  }

  .result-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .score-orbit {
    justify-self: center;
  }
}

@media (max-width: 440px) {
  .preparation-grid {
    grid-template-columns: 1fr;
  }

  .check-option label {
    min-height: 0;
  }

  .color-family-title {
    flex-wrap: wrap;
    gap: 4px;
  }
}


/* Readable casing labels and a tactile restart control. */
.tv-chin {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  height: auto;
  min-height: 44px;
  gap: 12px 24px;
  padding: 10px 20px;
}

.tv-chin .tv-wordmark {
  min-width: 0;
  color: #d3d8d4;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

.tv-chin-credit,
.tv-chin-hardware {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tv-chin-credit {
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 12px;
  line-height: 1.5;
}

.tv-chin-credit a {
  color: #e2e8df;
  font-weight: 600;
  text-decoration: none;
  text-underline-offset: 3px;
}

.tv-chin-credit a:hover {
  text-decoration: underline;
}

.tv-chin .copyright {
  display: inline;
  color: #c0c8c2;
  white-space: nowrap;
}

.tv-chin-hardware {
  gap: 20px;
}

.checker-sidebar .reset-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 40px;
  padding: 10px 16px;
  border: 1px solid #69776b;
  border-radius: 8px;
  background: linear-gradient(180deg, #3b473f, #29342d);
  box-shadow: inset 0 1px 0 #ffffff1f, 0 2px 3px #00000030;
  color: #edf2e9;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  transition: background 180ms ease-in-out, border-color 180ms ease-in-out,
    box-shadow 180ms ease-in-out;
}

.checker-sidebar .reset-button:hover {
  border-color: #a4b4a4;
  background: linear-gradient(180deg, #48574c, #354239);
}

.checker-sidebar .reset-button:active {
  background: #27322b;
  box-shadow: inset 0 2px 4px #00000040;
}

.checker-sidebar .reset-button:focus-visible,
.tv-chin-credit a:focus-visible {
  outline: 2px solid #d7e7d9;
  outline-offset: 3px;
}

@media (max-width: 760px) {
  .tv-chin {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 12px;
    padding: 8px 12px;
  }

  .tv-chin .tv-wordmark,
  .tv-chin-credit {
    font-size: 11px;
  }

  .tv-chin-credit {
    grid-column: 1;
  }

  .tv-chin-hardware {
    grid-column: 2;
    grid-row: 1 / 3;
  }

  .tv-chin .speaker-grille {
    display: none;
  }
}


/* Keep the restart control after the final step in the mobile row. */
.step-navigation {
  display: contents;
}

@media (max-width: 760px) {
  .progress-heading {
    padding-right: 0;
  }

  .step-navigation {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    overflow-x: auto;
    padding: 2px 0 4px;
  }

  .step-navigation .step-list {
    flex: 0 0 auto;
    overflow: visible;
    padding-bottom: 0;
  }

  .checker-sidebar .step-navigation .reset-button {
    position: static;
    flex: 0 0 auto;
    width: auto;
    min-height: 32px;
    margin: 0;
    padding: 6px 10px;
    font-size: 10px;
    white-space: nowrap;
  }
}

/* Readability: clear UI copy, brighter contrast, and stable minimum sizes. */
:root {
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial,
    sans-serif;
  --ink: #f1f4f1;
  --muted: #c0c9c3;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}

.tv-welcome h1,
.step-card h3,
.result-copy h4,
.welcome-logo span {
  font-family: var(--font-display);
}

.tv-welcome h1 {
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.tv-welcome h1 > span {
  color: var(--muted);
  font-family: var(--font-body);
  font-size: clamp(16px, 1.4vw, 18px);
  line-height: 1.5;
}

.welcome-description,
.step-intro,
.result-copy > p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.welcome-eyebrow,
.welcome-bottom,
.step-kicker {
  color: #c3d4c8;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.08em;
}

.welcome-link {
  color: #d4e2d7;
  font-size: 15px;
  line-height: 1.5;
}

.progress-heading {
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.03em;
}

.progress-heading strong {
  color: var(--ink);
  font-size: 15px;
}

.step-list button {
  color: #c6d0c9;
}

.step-list button:disabled {
  color: #a6b2aa;
  opacity: 1;
}

.step-title {
  font-size: 13px;
  font-weight: 500;
}

.step-number {
  font-size: 13px;
  font-weight: 500;
}

.step-status {
  font-size: 10px;
}

.step-card h3 {
  font-size: clamp(28px, min(3.2vw, 6cqh), 44px);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.check-text strong {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
}

.check-text span,
.test-tip,
.footer-message,
.recommendations li {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
}

.footer-message {
  max-width: 30ch;
}

.button,
.step-footer .button,
.answer-chip,
.uniformity-preview button,
.uniformity-instructions button {
  padding-top: 10px;
  padding-bottom: 10px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
}

.button:disabled {
  background: #303b34;
  border-color: #65746a;
  color: #c0ccc3;
  opacity: 1;
}

.checker-sidebar .reset-button {
  font-family: var(--font-body);
  font-size: 14px;
}

.stage-label {
  flex-wrap: wrap;
  color: inherit;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  opacity: 1;
}

.patch-choice span:last-child {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

.gamma-controls label {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
}

.gamma-value {
  font-size: 13px;
  line-height: 1.5;
}

.gradient-test::after {
  background: #f3f5f3;
  color: #111;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}

.color-family-title {
  flex-wrap: wrap;
  gap: 4px 8px;
  color: #d9e2dc;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.uniformity-instructions strong {
  font-size: 18px;
  line-height: 1.4;
}

.uniformity-instructions span {
  color: #e2e8e4;
  font-size: 15px;
  line-height: 1.6;
  opacity: 1;
}

.score-number strong {
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.score-number span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.04em;
}

.toast {
  font-size: 14px;
  line-height: 1.5;
}

.tv-chin .tv-wordmark,
.tv-chin-credit {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
}

.tv-chin .tv-wordmark,
.tv-chin .copyright {
  color: #d0d8d2;
}

@media (max-width: 760px) {
  .step-card h3 {
    font-size: clamp(28px, 6.5vw, 36px);
  }

  .checker-sidebar .step-navigation .reset-button {
    font-size: 13px;
  }

  .footer-message {
    max-width: none;
  }

  .tv-chin .tv-wordmark,
  .tv-chin-credit {
    font-size: 12px;
  }
}


/* Analog power control: keep the original compact chin layout. */
.power-indicator i {
  flex: 0 0 4px;
  background: #65e28b;
  box-shadow: inset 0 1px 1px #ffffff70, 0 0 5px #65e28b90;
  transition: background 220ms ease-in-out, box-shadow 220ms ease-in-out;
}

.is-powered-off .power-indicator i {
  background: #ef6259;
  box-shadow: inset 0 1px 1px #ffffff70, 0 0 5px #ef625990;
}

.power-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid #161c18;
  border-radius: 50%;
  background: linear-gradient(145deg, #58635b, #303a33 65%, #252d28);
  color: #d8e0da;
  font-size: 14px;
  line-height: 1;
  box-shadow: inset 0 1px 1px #ffffff38, inset 0 -1px 1px #00000060,
    0 1px 0 #101612, 0 2px 3px #00000060;
  text-shadow: 0 1px 1px #00000080;
  cursor: pointer;
  transition: box-shadow 160ms ease-in-out, transform 160ms ease-in-out;
}

.power-button:hover {
  background: linear-gradient(145deg, #657168, #3a463d 65%, #2c362f);
}

.power-button:active {
  transform: translateY(1px);
  box-shadow: inset 0 1px 3px #00000080, 0 1px 0 #ffffff15;
}

.power-button:focus-visible {
  outline: 2px solid #d7e7d9;
  outline-offset: 3px;
}

/* The picture collapses with the beam, rather than being covered by shutters. */
.tv-display::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 40;
  background: #050706;
  opacity: 0;
  pointer-events: none;
}

.is-powered-off .tv-display::after {
  opacity: 1;
  pointer-events: auto;
}

.is-opening .tv-display,
.is-closing .tv-display {
  background: #050706;
}

.is-opening .tv-display::after,
.is-closing .tv-display::after {
  opacity: 0;
}

.tv-startup {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: transparent;
  pointer-events: none;
  overflow: hidden;
}

.tv-startup[hidden] {
  display: none;
}

.crt-light {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 2px;
  margin-top: -1px;
  background: #fffdf5;
  border-radius: 50%;
  box-shadow: 0 0 4px #fff, 0 0 12px #fff7dcaa, 0 0 24px #fff7dc55;
  transform-origin: center;
  opacity: 0;
}

.is-opening .tv-interface,
.is-opening .tv-welcome {
  transform-origin: center;
  animation: crt-picture-on 1100ms linear both;
}

.is-closing .tv-interface,
.is-closing .tv-welcome {
  transform-origin: center;
  animation: crt-picture-off 720ms linear both;
}

.is-opening .crt-light {
  animation: crt-beam-on 1100ms linear both;
}

.is-closing .crt-light {
  animation: crt-beam-off 720ms linear both;
}

@keyframes crt-picture-off {
  0% {
    transform: scale(1, 1);
    opacity: 1;
    filter: brightness(1);
    animation-timing-function: cubic-bezier(0.55, 0, 0.9, 0.35);
  }
  44% {
    transform: scale(1, 0.004);
    opacity: 1;
    filter: brightness(2);
  }
  48%, 100% {
    transform: scale(1, 0.004);
    opacity: 0;
    filter: brightness(2);
  }
}

@keyframes crt-beam-off {
  0%, 28% {
    transform: scaleX(1);
    opacity: 0;
  }
  44%, 56% {
    transform: scaleX(1);
    opacity: 1;
    animation-timing-function: cubic-bezier(0.65, 0, 0.85, 0.3);
  }
  78% {
    transform: scaleX(0.006);
    opacity: 1;
  }
  88% {
    transform: scaleX(0.004);
    opacity: 0.65;
  }
  100% {
    transform: scaleX(0.002);
    opacity: 0;
  }
}

@keyframes crt-picture-on {
  0%, 30% {
    transform: scale(1, 0.004);
    opacity: 0;
    filter: brightness(1);
  }
  34% {
    transform: scale(1, 0.004);
    opacity: 1;
    filter: brightness(1);
    animation-timing-function: cubic-bezier(0.16, 0.8, 0.3, 1);
  }
  76% {
    transform: scale(1, 1);
    opacity: 1;
    filter: brightness(1);
    animation-timing-function: ease-out;
  }
  100% {
    transform: scale(1, 1);
    opacity: 1;
    filter: brightness(1);
  }
}

/* Keep snow opacity consistent when the startup animation finishes. */
@keyframes crt-static-on {
  0%, 30% {
    transform: scale(1, 0.004);
    opacity: 0;
    filter: brightness(1);
  }
  34% {
    transform: scale(1, 0.004);
    opacity: 0.82;
    filter: brightness(1);
    animation-timing-function: cubic-bezier(0.16, 0.8, 0.3, 1);
  }
  76% {
    transform: scale(1, 1);
    opacity: 0.82;
    filter: brightness(1);
    animation-timing-function: ease-out;
  }
  100% {
    transform: scale(1, 1);
    opacity: 0.82;
    filter: brightness(1);
  }
}

@keyframes crt-beam-on {
  0%, 8% {
    transform: scaleX(0.004);
    opacity: 0;
  }
  13% {
    transform: scaleX(0.006);
    opacity: 1;
    animation-timing-function: cubic-bezier(0.2, 0.7, 0.3, 1);
  }
  30%, 34% {
    transform: scaleX(1);
    opacity: 1;
  }
  52%, 100% {
    transform: scaleX(1);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .power-indicator i,
  .power-button {
    transition: none;
  }

  .is-opening .tv-interface,
  .is-opening .tv-welcome,
  .is-closing .tv-interface,
  .is-closing .tv-welcome,
  .crt-light {
    animation: none;
  }

  .tv-startup {
    display: none;
  }
}

/* DVD-era screensaver, contained within the TV glass. */
.tv-screensaver {
  position: absolute;
  inset: 0;
  z-index: 35;
  overflow: hidden;
  background: #050706;
  cursor: default;
  touch-action: none;
}

.tv-screensaver[hidden] {
  display: none;
}

.screensaver-logo {
  --saver-color: #c4efbf;
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(260px, 72%);
  padding: 12px 6px;
  color: var(--saver-color);
  text-align: center;
  text-shadow: 0 0 16px color-mix(in srgb, var(--saver-color) 35%, transparent);
  user-select: none;
  will-change: transform;
}

.screensaver-monogram {
  position: relative;
  font-family: "DM Mono", monospace;
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.08em;
}

.screensaver-monogram > span {
  display: inline-block;
  margin-left: 8px;
  font-size: 10px;
  vertical-align: middle;
}

.screensaver-logo > strong {
  margin-top: 8px;
  font-family: "Manrope", sans-serif;
  font-size: clamp(17px, 2.5vw, 23px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.04em;
}

.screensaver-credit {
  margin-top: 7px;
  font-family: "DM Mono", monospace;
  font-size: clamp(9px, 1.3vw, 11px);
  line-height: 1.5;
}

.screensaver-hint {
  position: absolute;
  right: 12px;
  bottom: 14px;
  left: 12px;
  color: #849189;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  line-height: 1.5;
  letter-spacing: 0.08em;
  text-align: center;
  pointer-events: none;
}


/* No-signal snow sits behind the picture, never over a test pattern. */
.tv-static {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  image-rendering: pixelated;
  opacity: 0.82;
}

.tv-interface {
  position: relative;
  z-index: 1;
}

main.checker-shell {
  background: transparent;
}

.checker-sidebar {
  background: rgba(12, 14, 15, 0.90);
  border-color: rgba(255, 255, 255, 0.18);
}

.step-card {
  margin: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(13, 16, 15, 0.94);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.28);
}

.tv-welcome {
  background: transparent;
}

.welcome-content {
  width: 100%;
  padding: clamp(24px, 4vw, 48px);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 16px;
  background: rgba(12, 15, 14, 0.94);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35);
}

.welcome-bottom {
  padding: 9px 14px;
  border-radius: 5px;
  background: rgba(12, 15, 14, 0.88);
  color: #d0d8d2;
}

.is-opening .tv-static {
  transform-origin: center;
  animation: crt-static-on 1100ms linear both;
}

.is-closing .tv-static {
  transform-origin: center;
  animation: crt-picture-off 720ms linear both;
}

@media (max-width: 760px) {
  .step-card {
    margin: 8px;
    border-radius: 9px;
  }

  .tv-welcome {
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .is-opening .tv-static,
  .is-closing .tv-static {
    animation: none;
  }
}


/* The welcome and checker are separate views, sharing the same TV snow. */
.tv-interface[hidden] {
  display: none;
}


/* A compact pedestal beneath the casing, kept inside the viewport. */
:root {
  --tv-stand-height: clamp(34px, 5.5vh, 54px);
}

.tv-device {
  position: relative;
  z-index: 1;
  height: calc(100% - var(--tv-stand-height));
}

.tv-stand {
  position: relative;
  width: clamp(150px, 25vw, 340px);
  height: var(--tv-stand-height);
  margin: 0 auto;
  pointer-events: none;
}

.tv-stand-neck {
  position: absolute;
  top: -3px;
  bottom: 10px;
  left: 34%;
  width: 32%;
  border: 1px solid #414546;
  border-top: 0;
  border-radius: 0 0 9px 9px;
  background: linear-gradient(
    90deg,
    #17191a 0%,
    #35393a 18%,
    #292c2d 48%,
    #1c1f20 82%,
    #111314 100%
  );
  box-shadow: inset 0 10px 10px -7px #000c;
}

.tv-stand-base {
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  height: 15px;
  border: 1px solid #444849;
  border-bottom: 3px solid #111314;
  border-radius: 50% 50% 7px 7px / 55% 55% 5px 5px;
  background: linear-gradient(180deg, #444849, #2c3031 45%, #1a1d1e);
  box-shadow:
    inset 0 1px 0 #ffffff1c,
    0 5px 8px -3px #000b;
}

@media (max-width: 760px), (max-height: 550px) {
  :root {
    --tv-stand-height: 30px;
  }

  .tv-stand {
    width: clamp(120px, 34vw, 220px);
  }

  .tv-stand-base {
    height: 12px;
  }
}

/* Casing labels: shallow engraving with a fine lower bevel. */
.tv-chin .tv-wordmark,
.tv-chin .copyright {
  color: #a5aeaa;
  text-shadow:
    0 -0.5px 0 rgba(0, 0, 0, 0.75),
    0 0.5px 0 rgba(255, 255, 255, 0.16);
}

/* Satin-metal maker's mark with a restrained, rounded reflection. */
.tv-chin-credit a {
  color: #c9cecb;
  font-weight: 600;
  letter-spacing: 0.025em;
  text-decoration: none;
  text-shadow: 0 0.7px 0.8px rgba(0, 0, 0, 0.3);
}

@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .tv-chin-credit a {
    background-image: linear-gradient(
      180deg,
      #929a96 0%,
      #d3d8d5 22%,
      #eef0ee 38%,
      #b1bab5 57%,
      #8b9590 72%,
      #c6cdc9 100%
    );
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
  }
}

.tv-chin-credit a:hover {
  text-decoration: none;
  text-shadow: 0 0.7px 0.8px rgba(0, 0, 0, 0.18);
}

/* Broadcast colour bars: crisp accents around neutral test surfaces. */
:root {
  --broadcast-white: #e9e7dd;
  --broadcast-yellow: #e8cf65;
  --broadcast-cyan: #70cbd0;
  --broadcast-green: #89b987;
  --broadcast-magenta: #c88ab9;
  --broadcast-red: #dc827a;
  --broadcast-blue: #829ada;
  --broadcast-bars: linear-gradient(
    to right,
    var(--broadcast-white) 0% 14.2857%,
    var(--broadcast-yellow) 14.2857% 28.5714%,
    var(--broadcast-cyan) 28.5714% 42.8571%,
    var(--broadcast-green) 42.8571% 57.1429%,
    var(--broadcast-magenta) 57.1429% 71.4286%,
    var(--broadcast-red) 71.4286% 85.7143%,
    var(--broadcast-blue) 85.7143% 100%
  );
  --muted: #c5c8cd;
}

.welcome-content {
  background:
    var(--broadcast-bars) top / 100% 7px no-repeat,
    radial-gradient(ellipse at top left, #70cbd00c, transparent 60%),
    radial-gradient(ellipse at bottom right, #c88ab90c, transparent 60%),
    rgba(14, 16, 20, 0.96);
  border-color: #a6b2c23d;
}

.welcome-logo {
  overflow: hidden;
  border-color: #b4bec9;
  color: var(--broadcast-white);
  background:
    var(--broadcast-bars) bottom / 100% 13px no-repeat,
    linear-gradient(145deg, #2d343c, #161b22);
  box-shadow: inset 0 1px 0 #ffffff1a, 0 6px 20px #00000038;
}

.welcome-logo span {
  transform: translateY(-4px);
}

.welcome-logo i {
  bottom: 0;
  height: 13px;
  width: 100%;
  border: 0;
  background: linear-gradient(transparent, #00000022);
}

.welcome-eyebrow,
.progress-heading strong {
  color: var(--broadcast-yellow);
}

.tv-welcome h1 {
  color: #f3f0e7;
}

.welcome-link {
  color: var(--broadcast-cyan);
}

.welcome-link:hover {
  color: #b7edf0;
}

.welcome-bottom {
  color: #c9cdd4;
  background: rgba(15, 18, 24, 0.92);
  border: 1px solid #829ada30;
}

.checker-sidebar {
  background: rgba(14, 17, 22, 0.94);
  border-color: #829ada30;
}

.progress-track {
  height: 5px;
  background: #303641;
}

.progress-track span {
  background: var(--broadcast-bars);
}

.step-list li:nth-child(1) { --channel: var(--broadcast-white); }
.step-list li:nth-child(2) { --channel: var(--broadcast-yellow); }
.step-list li:nth-child(3) { --channel: var(--broadcast-cyan); }
.step-list li:nth-child(4) { --channel: var(--broadcast-green); }
.step-list li:nth-child(5) { --channel: var(--broadcast-magenta); }
.step-list li:nth-child(6) { --channel: var(--broadcast-red); }
.step-list li:nth-child(7) { --channel: var(--broadcast-blue); }
.step-list li:nth-child(8) { --channel: var(--broadcast-white); }

.step-list .step-number {
  color: var(--channel);
}

.step-list button.is-active {
  border-color: var(--channel);
  background: #252c36;
  background: color-mix(in srgb, var(--channel) 12%, #171b22);
  box-shadow: inset 3px 0 0 var(--channel);
  color: #f5f3ed;
}

.step-list button:not(:disabled):hover {
  background: #272d36;
  border-color: var(--channel);
}

.step-card {
  background:
    var(--broadcast-bars) top / 100% 4px no-repeat,
    rgba(16, 18, 22, 0.96);
  border-color: #a6b2c23d;
}

.step-kicker {
  color: var(--broadcast-cyan);
}

.step-kicker::before {
  background: var(--broadcast-yellow);
}

.button-primary {
  background: var(--broadcast-yellow);
  border-color: #f2dc8c;
  color: #262115;
  box-shadow: inset 0 1px 0 #ffffff38, 0 3px 10px #00000020;
}

.button-primary:hover {
  background: #f1db84;
  border-color: #f5e4a7;
  box-shadow: inset 0 1px 0 #ffffff38, 0 3px 10px #00000020;
}

.button-secondary {
  background: #242b34;
  border-color: #63758c;
  color: #e4e9f1;
}

.button-secondary:hover {
  background: #303b49;
}

.check-option label {
  background: #1d222a;
  border-color: #414b59;
}

.check-option label:hover,
.check-option input:checked + label {
  border-color: var(--broadcast-cyan);
}

.check-option input:checked + label {
  background: #243438;
}

.check-option input:checked + label .custom-check {
  background: var(--broadcast-cyan);
  color: #13272b;
}

.answer-chip {
  border-color: #647185;
  color: #e0e6ee;
}

.answer-chip:hover {
  background: #28343d;
}

.answer-chip.is-selected {
  background: var(--broadcast-cyan);
  border-color: var(--broadcast-cyan);
  color: #16292c;
}

:focus-visible {
  outline-color: var(--broadcast-cyan);
}


/* Home navigation follows the sidebar layout on each screen size. */
.home-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  padding: 8px;
  border: 1px solid #829ada40;
  border-radius: 8px;
  background: rgba(130, 154, 218, 0.08);
  color: #e5eaf2;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease;
}

.home-button svg {
  width: 18px;
  height: 18px;
}

.home-button:hover {
  border-color: #829ada80;
  background: rgba(130, 154, 218, 0.18);
}

.home-button:focus-visible {
  outline: 2px solid var(--broadcast-cyan);
  outline-offset: 3px;
}

.home-button-desktop {
  align-self: flex-start;
  margin-bottom: 16px;
}

.home-button-mobile {
  display: none;
}

@media (max-width: 760px) {
  .home-button-desktop {
    display: none;
  }

  .home-button-mobile {
    display: inline-flex;
    width: 34px;
    height: 34px;
  }
}

/* Legal links are part of the casing note; the reader stays inside the TV. */
.legal-links {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 10px;
  white-space: nowrap;
}
.legal-links button {
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: #d3d8d4;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 180ms ease;
}
.legal-links button:hover { color: #ffe08c; }
.legal-screen {
  position: absolute;
  inset: 0;
  z-index: 30;
  overflow: hidden;
  background: #000;
  color: #f5cf69;
  opacity: 0;
  transition: opacity 600ms ease-in-out;
}
.legal-screen[hidden] { display: none; }
.legal-screen.is-visible { opacity: 1; }
.legal-toolbar {
  position: absolute;
  inset: 20px 24px auto;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.legal-toolbar button {
  padding: 9px 12px;
  border: 1px solid #f5cf692e;
  border-radius: 999px;
  background: #000;
  color: #c0b38e;
  font: 600 12px var(--font-display);
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease;
}
.legal-toolbar button:hover,
.legal-toolbar button[aria-pressed="true"] {
  border-color: #f5cf6980;
  color: #f5cf69;
}
.legal-tabs { display: flex; gap: 8px; }
.legal-perspective {
  position: absolute;
  inset: 70px 0 50px;
  display: flex;
  justify-content: center;
  perspective: 850px;
  overflow: hidden;
}
.legal-scroll {
  width: min(76%, 760px);
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: thin;
  scrollbar-color: #776338 #000;
  transform: rotateX(18deg);
  transform-origin: center top;
  padding: clamp(50px, 12vh, 130px) 24px 90px;
  scroll-padding-top: 30px;
}
.legal-copy {
  font-family: var(--font-display);
  font-size: clamp(16px, 1.6vw, 22px);
  font-weight: 600;
  line-height: 1.85;
  letter-spacing: 0.015em;
}
.legal-screen.is-entering .legal-copy {
  animation: legal-crawl-arrival 2200ms cubic-bezier(0.22, 0.61, 0.36, 1) 550ms both;
}
.legal-copy .legal-eyebrow {
  margin: 0 0 16px;
  font-size: 12px;
  letter-spacing: 0.3em;
  text-align: center;
}
.legal-copy h2 {
  margin: 0;
  color: #ffda78;
  font-size: clamp(30px, 4vw, 52px);
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}
.legal-copy .legal-lead {
  margin: 18px 0 48px;
  text-align: center;
}
.legal-copy h3 {
  margin: 32px 0 8px;
  color: #ffda78;
  font-size: 1.12em;
  font-weight: 800;
}
.legal-copy section p { margin: 0; }
.legal-hint {
  position: absolute;
  inset: auto 15px 16px;
  margin: 0;
  color: #9b8a60;
  font: 10px var(--font-mono);
  letter-spacing: 0.15em;
  text-align: center;
  pointer-events: none;
}


.legal-links button:focus-visible,
.legal-toolbar button:focus-visible,
.legal-scroll:focus-visible {
  outline: 2px solid #ffe08c;
  outline-offset: 4px;
}
@keyframes legal-crawl-arrival {
  from { opacity: 0; transform: translateY(65vh); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 760px) {
  .legal-links { margin-left: 6px; gap: 6px; }
  .legal-toolbar { inset: 12px 12px auto; gap: 6px; }
  .legal-toolbar button { padding: 8px 10px; font-size: 11px; }
  .legal-tabs { gap: 5px; }
  .legal-perspective { inset: 60px 0 42px; perspective: 700px; }
  .legal-scroll {
    width: 94%;
    padding: 9vh 14px 70px;
    transform: rotateX(12deg);
  }
  .legal-copy { font-size: 16px; line-height: 1.8; }

  .legal-hint span {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .legal-screen { transition: none; }
  .legal-screen.is-entering .legal-copy { animation: none; }
  .legal-scroll { transform: none; }
}
