:root {
  color-scheme: dark;
  --page: #000;
  --surface: #050505;
  --surface-strong: #0a0908;
  --surface-soft: #100a06;
  --text: #f2dcc0;
  --muted: #b69b82;
  --accent: #ff6f00;
  --accent-hover: #ff8a2e;
  --accent-ink: #170900;
  --line: rgba(255, 111, 0, 0.34);
  --line-strong: rgba(255, 111, 0, 0.86);
  --shade: rgba(255, 111, 0, 0.08);
  --error: #ff9a72;
  --success: #9bd7ae;
  --warning: #ffd18b;
  --unknown: #b8b2aa;
  --mono: "SFMono-Regular", "Menlo", "Monaco", "Consolas", "Liberation Mono", "Courier New", monospace;
}

html[data-theme="light"] {
  color-scheme: light;
  --page: #ece9df;
  --surface: #f3f0e8;
  --surface-strong: #f8f5ee;
  --surface-soft: #fff9ee;
  --text: #35190f;
  --muted: #745b4f;
  --accent: #e55f00;
  --accent-hover: #c94f00;
  --accent-ink: #fff8ed;
  --line: rgba(229, 95, 0, 0.34);
  --line-strong: rgba(229, 95, 0, 0.8);
  --shade: rgba(53, 25, 15, 0.07);
  --error: #a72f19;
  --success: #25643f;
  --warning: #8a5310;
  --unknown: #6f665f;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page);
}

body {
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  background: radial-gradient(circle at 50% 28%, transparent 48%, var(--shade) 120%), var(--page);
  color: var(--text);
  font-family: var(--mono);
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

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

a {
  color: var(--accent);
}

button:focus-visible,
input:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.scanlines {
  position: fixed;
  z-index: 50;
  inset: 0;
  pointer-events: none;
  opacity: 0.13;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.08) 0, rgba(255, 255, 255, 0.08) 1px, transparent 1px, transparent 5px);
}

html[data-theme="light"] .scanlines {
  opacity: 0.07;
  background: repeating-linear-gradient(0deg, rgba(53, 25, 15, 0.18) 0, rgba(53, 25, 15, 0.18) 1px, transparent 1px, transparent 5px);
}

.terminal-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1640px, calc(100% - 36px));
  min-height: calc(100svh - 36px);
  margin: 18px auto;
  overflow: clip;
  border: 2px solid var(--accent);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: inset 0 0 34px rgba(255, 111, 0, 0.035), 0 0 32px rgba(255, 111, 0, 0.04);
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 22px;
  min-height: 72px;
  padding: 10px 32px;
  border-bottom: 1px dotted var(--line-strong);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(14px);
}

.brand-lockup {
  display: grid;
  justify-self: start;
  gap: 4px;
  color: var(--text);
  line-height: 1.1;
  text-decoration: none;
}

.brand-lockup span {
  font-size: clamp(14px, 1.35vw, 19px);
}

.brand-lockup small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.03em;
}

.site-nav,
.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-nav a,
.quiet-button,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.site-nav a:hover,
.quiet-button:hover,
.theme-toggle:hover {
  border-color: var(--line);
  color: var(--accent);
}

.header-actions {
  justify-self: end;
}

.header-actions form {
  margin: 0;
}

.beta-chip {
  justify-self: end;
  padding: 7px 10px;
  border: 1px solid var(--line);
  color: var(--accent);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
  align-items: center;
  gap: clamp(48px, 6vw, 110px);
  width: min(1240px, calc(100% - 72px));
  min-height: min(690px, calc(100svh - 150px));
  margin: 0 auto;
  padding: clamp(54px, 7vw, 105px) 0;
}

.hero-copy {
  min-width: 0;
}

.hero h1,
.login-copy h1,
.assessment-heading h1,
.error-view h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(50px, 6vw, 92px);
  font-weight: 500;
  line-height: 0.92;
  letter-spacing: -0.065em;
}

.hero h1 {
  max-width: 12.5ch;
}

.hero-dynamic-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.24em;
  color: var(--accent);
}

.hero-word-slot {
  display: inline-flex;
  align-items: baseline;
  width: 8.3ch;
  white-space: nowrap;
}

.hero-typing-cursor {
  display: inline-block;
  width: 0.075em;
  height: 0.76em;
  margin-left: 0.06em;
  background: currentColor;
  transform: translateY(0.04em);
  animation: cursor-blink 900ms steps(1, end) infinite;
}

.hero-word-slot.is-typing .hero-typing-cursor {
  opacity: 1;
  animation: none;
}

@keyframes cursor-blink {
  0%, 48% { opacity: 1; }
  49%, 100% { opacity: 0; }
}

.hero-description {
  max-width: 58ch;
  margin: 30px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 1.45vw, 20px);
  line-height: 1.55;
}

.hero-description strong {
  color: var(--accent);
}

.assessment-form,
.login-card,
.loader-panel {
  padding: 24px;
  border: 1px solid var(--line-strong);
  background: var(--surface-strong);
}

.assessment-form > label,
.login-card > label {
  display: block;
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
}

.product-entry,
.input-frame {
  display: grid;
  border: 2px solid var(--accent);
  background: var(--surface);
}

#website-url,
#password {
  width: 100%;
  min-width: 0;
  min-height: 58px;
  padding: 0 14px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  caret-color: var(--accent);
  font-size: 16px;
}

#website-url::placeholder,
#password::placeholder {
  color: var(--muted);
  opacity: 0.72;
}

.assessment-submit {
  display: grid;
  justify-items: start;
  gap: 4px;
  min-height: 68px;
  padding: 14px 16px;
  border: 0;
  border-top: 1px solid var(--line-strong);
  background: var(--accent);
  color: var(--accent-ink);
  text-align: left;
  cursor: pointer;
}

.assessment-submit span {
  font-size: 14px;
  font-weight: 700;
}

.assessment-submit small {
  opacity: 0.78;
  font-size: 11px;
}

.assessment-submit:hover,
.primary-button:hover {
  background: var(--accent-hover);
}

.assessment-submit:disabled {
  cursor: wait;
  opacity: 0.72;
}

.field-helper,
.field-error {
  min-height: 18px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.field-error {
  color: var(--error);
}

.criteria-preview {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(40px, 7vw, 110px);
  width: min(1240px, calc(100% - 72px));
  margin: 0 auto 74px;
  padding: 50px 0 10px;
  border-top: 1px dotted var(--line-strong);
}

.criteria-preview h2,
.method-note h2 {
  max-width: 14ch;
  margin: 0;
  font-size: clamp(28px, 3.5vw, 48px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.045em;
}

.criteria-preview ol {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.criteria-preview li {
  display: grid;
  grid-template-columns: 48px 0.75fr 1.25fr;
  align-items: baseline;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px dotted var(--line);
}

.criteria-preview li > span {
  color: var(--accent);
  font-size: 11px;
}

.criteria-preview li > strong {
  font-size: 14px;
}

.criteria-preview li > small {
  color: var(--muted);
  line-height: 1.45;
}

.login-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 480px);
  align-items: center;
  gap: clamp(50px, 9vw, 150px);
  width: min(1100px, calc(100% - 72px));
  min-height: calc(100svh - 190px);
  margin: auto;
  padding: 72px 0;
}

.login-copy h1 {
  max-width: 9ch;
  font-size: clamp(46px, 5vw, 76px);
}

.login-copy > p:last-child {
  max-width: 48ch;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.login-card .primary-button {
  width: 100%;
  margin-top: 18px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 18px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.secondary-button {
  background: transparent;
  color: var(--accent);
}

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

.assessment-view {
  flex: 1;
  width: min(1180px, calc(100% - 72px));
  margin: 0 auto;
  padding: clamp(58px, 7vw, 100px) 0 80px;
}

.assessment-heading {
  min-width: 0;
}

.assessment-heading h1 {
  max-width: 14ch;
  font-size: clamp(42px, 5vw, 74px);
}

.assessment-heading > a {
  display: block;
  max-width: 100%;
  margin-top: 22px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loading-view {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  align-items: start;
  gap: clamp(50px, 8vw, 120px);
}

.loader-panel {
  position: relative;
  min-height: 460px;
  overflow: hidden;
}

.scan-orbit {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  margin-bottom: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  animation: orbit-turn 2.2s linear infinite;
}

.scan-orbit::before,
.scan-orbit::after,
.scan-orbit span {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.scan-orbit::before {
  width: 62px;
  height: 62px;
  border: 1px dotted var(--line-strong);
}

.scan-orbit::after {
  width: 12px;
  height: 12px;
  transform: translateY(-44px);
  background: var(--accent);
  box-shadow: 0 0 18px var(--accent);
}

.scan-orbit span {
  width: 10px;
  height: 10px;
  background: var(--accent);
}

@keyframes orbit-turn {
  to { transform: rotate(360deg); }
}

.loader-status {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 14px;
}

.loader-status p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.loader-status strong {
  color: var(--accent);
  font-size: 24px;
  font-weight: 500;
}

progress {
  display: block;
  width: 100%;
  height: 8px;
  border: 0;
  border-radius: 0;
  background: var(--shade);
}

progress::-webkit-progress-bar {
  background: var(--shade);
}

progress::-webkit-progress-value {
  background: var(--accent);
  transition: width 300ms ease;
}

progress::-moz-progress-bar {
  background: var(--accent);
}

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

.stage-list li {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  border-bottom: 1px dotted var(--line);
  color: var(--muted);
  font-size: 12px;
}

.stage-marker {
  width: 8px;
  height: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.stage-list li[data-state="active"] {
  color: var(--accent);
}

.stage-list li[data-state="active"] .stage-marker {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.stage-list li[data-state="complete"] {
  color: var(--success);
}

.stage-list li[data-state="complete"] .stage-marker {
  border-color: var(--success);
  background: var(--success);
}

.loader-note {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.result-view {
  width: min(1240px, calc(100% - 72px));
}

.result-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 36px 70px;
  align-items: end;
  padding-bottom: 58px;
  border-bottom: 1px dotted var(--line-strong);
}

.overall-score {
  display: grid;
  grid-template-columns: auto auto;
  justify-items: end;
  align-items: baseline;
  min-width: 190px;
  color: var(--accent);
}

.overall-score > span {
  grid-column: 1 / -1;
  margin-bottom: 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.overall-score strong {
  font-size: clamp(72px, 9vw, 132px);
  font-weight: 500;
  line-height: 0.75;
  letter-spacing: -0.08em;
}

.overall-score small {
  font-size: 18px;
}

.verdict {
  grid-column: 1 / -1;
  max-width: 62ch;
  margin: 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 23px);
  line-height: 1.5;
}

.criteria-results {
  display: grid;
  gap: 18px;
  padding: 58px 0;
}

.criterion-card {
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.criterion-card > header {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: start;
  gap: 22px;
  padding: 24px;
  border-bottom: 1px dotted var(--line);
}

.criterion-index {
  color: var(--accent);
  font-size: 11px;
}

.criterion-card header p {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.criterion-card h2 {
  margin: 0;
  font-size: clamp(22px, 2.3vw, 32px);
  font-weight: 500;
  letter-spacing: -0.035em;
}

.criterion-score {
  display: flex;
  align-items: baseline;
  color: var(--accent);
}

.criterion-score strong {
  font-size: 36px;
  font-weight: 500;
  line-height: 1;
}

.criterion-score span {
  color: var(--muted);
  font-size: 11px;
}

.criterion-body {
  display: grid;
  grid-template-columns: 125px minmax(0, 1fr);
  gap: 20px 28px;
  padding: 24px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid currentColor;
  color: var(--warning);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.criterion-card[data-status="ready"] .status-badge {
  color: var(--success);
}

.criterion-card[data-status="not_ready"] .status-badge {
  color: var(--error);
}

.criterion-card[data-status="unknown"] .status-badge {
  color: var(--unknown);
}

.criterion-summary {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

.criterion-body details,
.recommendation {
  grid-column: 2;
}

details {
  border-top: 1px dotted var(--line);
}

summary {
  padding: 15px 0;
  color: var(--accent);
  font-size: 11px;
  cursor: pointer;
}

.evidence-list {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.evidence-list li {
  display: grid;
  grid-template-columns: 124px 1fr;
  gap: 14px;
  padding: 12px;
  background: var(--shade);
}

.evidence-strength {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.evidence-list a {
  font-size: 11px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.evidence-list p,
.empty-evidence {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.recommendation {
  padding: 15px 16px;
  border-left: 2px solid var(--accent);
  background: var(--shade);
}

.recommendation > p {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.recommendation ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  font-size: 11px;
  line-height: 1.55;
}

.method-note {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(40px, 7vw, 110px);
  padding: 50px 0;
  border-top: 1px dotted var(--line-strong);
  border-bottom: 1px dotted var(--line-strong);
}

.method-note > p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.result-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 32px;
}

.error-view {
  display: grid;
  align-content: center;
  min-height: calc(100svh - 210px);
}

.error-view h1 {
  max-width: 11ch;
  font-size: clamp(48px, 6vw, 84px);
}

.error-view > p:not(.eyebrow) {
  max-width: 64ch;
  color: var(--muted);
  line-height: 1.6;
}

.error-view .primary-button {
  justify-self: start;
  margin-top: 20px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 16px 32px;
  border-top: 1px dotted var(--line-strong);
  color: var(--muted);
  font-size: 11px;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 960px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .site-nav {
    display: none;
  }

  .hero,
  .login-view,
  .loading-view {
    grid-template-columns: 1fr;
  }

  .hero {
    gap: 52px;
    min-height: auto;
  }

  .criteria-preview,
  .method-note {
    grid-template-columns: 1fr;
  }

  .login-view {
    gap: 48px;
  }
}

@media (max-width: 680px) {
  .terminal-shell {
    width: calc(100% - 16px);
    min-height: calc(100svh - 16px);
    margin: 8px;
    border-radius: 12px;
  }

  .site-header,
  .site-footer {
    padding-inline: 16px;
  }

  .theme-toggle {
    display: none;
  }

  .quiet-button {
    padding-inline: 8px;
  }

  .hero,
  .criteria-preview,
  .login-view,
  .assessment-view,
  .result-view {
    width: calc(100% - 32px);
  }

  .hero {
    padding: 52px 0;
  }

  .hero h1,
  .login-copy h1,
  .assessment-heading h1,
  .error-view h1 {
    font-size: clamp(42px, 13vw, 62px);
  }

  .login-copy h1 {
    max-width: none;
    overflow-wrap: anywhere;
    font-size: clamp(36px, 11vw, 50px);
  }

  .hero-word-slot {
    width: 7.8ch;
  }

  .assessment-form,
  .login-card,
  .loader-panel {
    padding: 18px;
  }

  .criteria-preview {
    margin-bottom: 52px;
  }

  .criteria-preview li {
    grid-template-columns: 36px 1fr;
  }

  .criteria-preview li small {
    grid-column: 2;
  }

  .login-view {
    padding: 48px 0;
  }

  .assessment-view {
    padding: 48px 0;
  }

  .loader-panel {
    min-height: 420px;
  }

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

  .overall-score {
    justify-self: start;
    justify-items: start;
  }

  .criterion-card > header {
    grid-template-columns: 30px 1fr;
    gap: 14px;
    padding: 18px;
  }

  .criterion-score {
    grid-column: 2;
  }

  .criterion-body {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .status-badge {
    justify-self: start;
  }

  .criterion-body details,
  .recommendation {
    grid-column: 1;
  }

  .evidence-list li {
    grid-template-columns: 1fr;
  }

  .result-actions {
    flex-direction: column;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@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;
  }
}

@media print {
  :root,
  html[data-theme="dark"] {
    color-scheme: light;
    --page: #fff;
    --surface: #fff;
    --surface-strong: #fff;
    --text: #1b120d;
    --muted: #5f5149;
    --accent: #bf4f00;
    --line: #d6b39a;
    --line-strong: #bf4f00;
    --shade: #f8eee7;
  }

  body {
    background: #fff;
  }

  .terminal-shell {
    width: 100%;
    margin: 0;
    border: 0;
  }

  .site-header,
  .site-footer,
  .scanlines,
  .result-actions {
    display: none;
  }

  .assessment-view,
  .result-view {
    width: 100%;
    padding: 0;
  }

  .criterion-card {
    break-inside: avoid;
  }

  details {
    display: block;
  }

  details > * {
    display: block;
  }
}
