:root {
  color-scheme: dark;
  --background: #171412;
  --museum: #171412;
  --surface: #1c1917;
  --surface-raised: #24201d;
  --text-primary: #f5f5f4;
  --text-secondary: #c7c2bd;
  --text-tertiary: #8f8881;
  --primary: #a8a29e;
  --primary-hover: #c7c2bd;
  --primary-active: #e7e5e4;
  --border-subtle: #302b27;
  --border-medium: #47413c;
  --border-strong: #78716c;
  --success: #84cc16;
  --warning: #eab308;
  --error: #ef4444;
  --success-surface: #1f2b17;
  --warning-surface: #2e2814;
  --error-surface: #31181a;
  --info-surface: #292521;
  --focus-ring: 0 0 0 2px #171412, 0 0 0 4px #a8a29e;
  --shell: 1280px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--text-primary);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

button,
textarea { font: inherit; }

button { cursor: pointer; }

::selection {
  background: var(--primary);
  color: var(--background);
}

.shell {
  width: min(calc(100% - 64px), var(--shell));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 100;
  padding: 12px 18px;
  border: 1px solid var(--text-primary);
  background: var(--text-primary);
  color: var(--background);
  font-size: 13px;
  font-weight: 600;
}

.skip-link:focus { top: 12px; }

.overline,
.caption,
.helper,
.status-block,
.catalog,
.principle-index,
.site-footer,
.warning-note,
.button-primary,
.button-secondary {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

.overline {
  margin: 0;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.accent { color: var(--primary); }

.site-header { border-bottom: 1px solid var(--border-subtle); }

.header-inner {
  min-height: 120px;
  padding: 30px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 36px;
}

.brand-title,
.accession strong {
  display: block;
  margin-top: 6px;
  font-family: "Libre Baskerville", Georgia, "Times New Roman", serif;
}

.brand-title {
  font-size: 22px;
  line-height: 1.4;
}

.accession { text-align: right; }

.accession strong {
  font-size: 15px;
  font-weight: 700;
}

.hero {
  padding: 120px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.65fr);
  gap: 96px;
  align-items: end;
}

.hero h1 {
  max-width: 12ch;
  margin: 24px 0 30px;
  font-family: "Libre Baskerville", Georgia, "Times New Roman", serif;
  font-size: clamp(48px, 6vw, 78px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 700;
}

.lede {
  max-width: 680px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 20px;
  line-height: 1.75;
}

.context-note {
  padding-top: 24px;
  border-top: 1px solid var(--border-strong);
}

.context-note p:last-child {
  max-width: 380px;
  margin: 20px 0 0;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.7;
}

.section {
  padding: 120px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
}

.analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(280px, 0.75fr);
  gap: 36px;
  align-items: start;
}

.panel,
.catalog,
.result-card {
  border: 1px solid var(--border-medium);
  background: var(--surface);
}

.panel-header {
  min-height: 132px;
  padding: 30px 36px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 36px;
  border-bottom: 1px solid var(--border-medium);
}

.panel-header h2,
.result-header h2,
.principles h2 {
  margin: 0;
  font-family: "Libre Baskerville", Georgia, "Times New Roman", serif;
}

.panel-header h2 {
  margin-top: 9px;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.35;
  font-weight: 400;
  letter-spacing: -0.015em;
}

.caption {
  color: var(--text-tertiary);
  font-size: 13px;
  line-height: 1.6;
}

textarea {
  display: block;
  width: 100%;
  min-height: 360px;
  resize: vertical;
  padding: 36px;
  border: 0;
  border-bottom: 1px solid var(--border-medium);
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 17px;
  line-height: 1.8;
}

textarea::placeholder { color: var(--text-tertiary); }

textarea:focus-visible {
  box-shadow: inset 0 0 0 1px var(--primary);
}

.panel-footer {
  padding: 24px 36px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
}

.helper {
  max-width: 620px;
  margin: 0;
  color: var(--text-tertiary);
  font-size: 13px;
  line-height: 1.6;
}

.button-primary,
.button-secondary {
  border-radius: 0;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
}

.button-primary {
  background: var(--primary);
  color: var(--background);
  border: 1px solid var(--primary);
}

.button-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.button-primary:active {
  background: var(--primary-active);
  border-color: var(--primary-active);
}

.button-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.button-primary:focus-visible,
.button-secondary:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.form-error {
  padding: 14px 36px;
  border-top: 1px solid var(--error);
  background: var(--error-surface);
  color: #fca5a5;
  font-size: 13px;
}

.catalog {
  padding: 30px 30px 0;
}

.catalog dl { margin: 30px 0 0; }

.catalog dl div {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--border-subtle);
}

.catalog dl div:last-child {
  border-bottom: 1px solid var(--border-subtle);
}

.catalog dt {
  color: var(--text-tertiary);
  font-size: 13px;
}

.catalog dd {
  margin: 0;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
}

[hidden] { display: none !important; }

.result-header {
  padding: 36px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 48px;
  border-bottom: 1px solid var(--border-medium);
}

.result-header h2 {
  margin-top: 10px;
  max-width: 760px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.status-block {
  min-width: 210px;
  padding: 16px 18px;
  border: 1px solid var(--border-medium);
  background: var(--surface-raised);
}

.status-block strong {
  display: block;
  margin-top: 9px;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-block[data-verdict="HIGH RISK"] {
  border-color: #7f1d1d;
  background: var(--error-surface);
}
.status-block[data-verdict="HIGH RISK"] strong { color: #fca5a5; }

.status-block[data-verdict="SUSPICIOUS"] {
  border-color: #854d0e;
  background: var(--warning-surface);
}
.status-block[data-verdict="SUSPICIOUS"] strong { color: #fde047; }

.status-block[data-verdict="LOW RISK"] {
  border-color: #3f6212;
  background: var(--success-surface);
}
.status-block[data-verdict="LOW RISK"] strong { color: #bef264; }

.status-block[data-verdict="INSUFFICIENT EVIDENCE"] {
  border-color: var(--border-strong);
  background: var(--info-surface);
}
.status-block[data-verdict="INSUFFICIENT EVIDENCE"] strong {
  color: var(--text-secondary);
}

.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.7fr);
}

.artifact-column {
  padding: 36px;
  border-right: 1px solid var(--border-medium);
}

.artifact-topline {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.artifact-topline h3,
.findings-column h3,
.protective h4 {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 600;
}

.artifact-text {
  min-height: 220px;
  margin: 0;
  padding: 30px;
  border: 1px solid var(--border-medium);
  background: var(--surface-raised);
  color: var(--text-primary);
  font-family: "Libre Baskerville", Georgia, "Times New Roman", serif;
  font-size: clamp(20px, 2.2vw, 30px);
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  quotes: none;
}

.artifact-text mark {
  padding: 0 2px;
  background: rgba(168, 162, 158, 0.2);
  color: var(--text-primary);
  border-bottom: 1px solid var(--primary);
}

.findings-column {
  padding: 36px 30px;
}

.finding-list { margin-top: 22px; }

.finding-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--border-subtle);
}

.finding-index {
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 600;
}

.finding-item strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.finding-item p {
  margin: 5px 0 0;
  color: var(--text-tertiary);
  font-size: 13px;
  line-height: 1.6;
}

.finding-empty {
  margin: 22px 0 0;
  color: var(--text-tertiary);
  font-size: 15px;
}

.protective {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--border-medium);
}

.protective h4 { color: #bef264; }

.curatorial {
  padding: 36px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 48px;
  border-top: 1px solid var(--border-medium);
}

.curatorial > div > p:last-child {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.8;
}

.warning-note {
  color: #fca5a5;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.button-secondary {
  margin-top: 24px;
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--border-medium);
}

.button-secondary:hover {
  background: var(--surface);
  color: var(--text-primary);
}

.button-secondary:active { background: var(--surface-raised); }

.principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border-medium);
  border-bottom: 1px solid var(--border-medium);
}

.principles article {
  min-height: 330px;
  padding: 36px;
  border-right: 1px solid var(--border-medium);
}

.principles article:last-child { border-right: 0; }

.principle-index {
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 600;
}

.principles h2 {
  margin-top: 64px;
  font-size: 22px;
  line-height: 1.4;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.principles p {
  max-width: 390px;
  margin: 18px 0 0;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.7;
}

.site-footer { border-top: 1px solid var(--border-subtle); }

.footer-inner {
  min-height: 108px;
  padding: 30px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(23, 20, 18, 0.94);
}

.loading-box {
  width: min(calc(100% - 48px), 360px);
  padding: 30px;
  border: 1px solid var(--border-medium);
  background: var(--surface);
}

.loading-box p {
  margin: 16px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.loading-line {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--border-medium);
  position: relative;
  overflow: hidden;
}

.loading-line::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 36%;
  background: var(--primary);
  animation: loading 1s ease-in-out infinite alternate;
}

@keyframes loading {
  from { transform: translateX(-100%); }
  to { transform: translateX(280%); }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 980px) {
  .hero-grid,
  .analysis-grid,
  .result-grid,
  .curatorial,
  .principles {
    grid-template-columns: 1fr;
  }

  .hero { padding: 96px 0; }

  .artifact-column {
    border-right: 0;
    border-bottom: 1px solid var(--border-medium);
  }

  .principles article {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border-medium);
  }

  .principles article:last-child { border-bottom: 0; }
}

@media (max-width: 680px) {
  .shell { width: min(calc(100% - 32px), var(--shell)); }

  .header-inner,
  .footer-inner,
  .panel-header,
  .panel-footer,
  .result-header,
  .artifact-topline,
  .section-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .accession { text-align: left; }

  .hero,
  .section {
    padding: 72px 0;
  }

  .hero h1 {
    font-size: clamp(42px, 13vw, 62px);
  }

  .lede { font-size: 18px; }

  .panel-header,
  textarea,
  .panel-footer,
  .result-header,
  .artifact-column,
  .findings-column,
  .curatorial,
  .principles article {
    padding-left: 22px;
    padding-right: 22px;
  }

  textarea { min-height: 300px; }

  .panel-footer { align-items: stretch; }

  .button-primary,
  .button-secondary { width: 100%; }

  .status-block {
    min-width: 0;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .loading-line::after { animation: none; }
}


/*
 * Compatibility aliases retained for the original frontend regression suite.
 * They do not reintroduce the previous visual system.
 */
.artifact-frame {
  background: transparent;
}
