/* Metric Trails. Identity: manual "identidad MET" (Anto, June 2025). */
:root {
  color-scheme: light;
  --paper: #F4F3F3;
  --ink: #1D1C1B;
  --ink-soft: #4A5257;
  --stone: #303F47;
  --stone-2: #596970;
  --rule: #D9DCDD;
  --contour: #CDD2D4;
  --index: #8C989D;
  --live: #303F47;
  --focus: #096ED3;
  --display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --text: "DM Sans", "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #1D1C1B;
    --ink: #F4F3F3;
    --ink-soft: #AEB6BA;
    --rule: #34393C;
    --contour: #2F3639;
    --index: #4F5D63;
    --live: #F4F3F3;
    --focus: #85BBE0;
  }
}
*, *::before, *::after { box-sizing: inherit; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-optical-sizing: auto;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: var(--stone-2); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---- hero -------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 92svh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.hero canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block; cursor: crosshair; touch-action: pan-y;
}
.hero .veil {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 70% 62% at 0% 100%, var(--paper) 0%, var(--paper) 34%, transparent 70%);
}
.topnav {
  position: relative;
  display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 0.4rem 1.5rem;
  padding: 1.25rem var(--gutter) 0;
  font-family: var(--display); font-size: 0.95rem; font-weight: 500;
}
.topnav a {
  text-decoration: none; padding: 0.2rem 0;
  background: color-mix(in srgb, var(--paper) 80%, transparent);
}
.topnav a:hover { text-decoration: underline; }
.hero-mark {
  position: relative;
  padding: 0 var(--gutter) clamp(2rem, 7vw, 4.5rem);
  pointer-events: none;
}
.hero-mark h1 { margin: 0; }
.hero-mark img { width: min(36rem, 86vw); border-radius: 0.6rem; }

/* ---- sections ---------------------------------------------------------- */
main.sections { padding: 0 var(--gutter); }
.band {
  display: grid;
  grid-template-columns: minmax(10rem, 15rem) minmax(0, 40rem);
  gap: 0.75rem clamp(1.5rem, 5vw, 5rem);
  padding: clamp(2.75rem, 7vw, 5rem) 0;
  border-top: 1px solid var(--rule);
}
.band:first-child { border-top: 0; }
.band > h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.35rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.band > .body > :first-child { margin-top: 0; }
.band p { margin: 0 0 1rem; }
.lede { font-size: 1.25rem; line-height: 1.5; }
@media (max-width: 760px) {
  .band { grid-template-columns: 1fr; }
}

/* discrepancy sources */
.sources { margin: 1.5rem 0; padding: 0; }
.sources div { padding: 0.9rem 0; border-top: 1px solid var(--rule); }
.sources div:last-child { border-bottom: 1px solid var(--rule); }
.sources dt { font-family: var(--display); font-weight: 600; }
.sources dd { margin: 0.15rem 0 0; color: var(--ink-soft); }

/* standards */
.standards {
  list-style: none; margin: 1.75rem 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem;
}
.standards li { display: flex; flex-direction: column; gap: 0.6rem; }
.standards img { width: min(9rem, 100%); border-radius: 0.35rem; }
.standards strong { font-family: var(--display); font-weight: 600; font-size: 1.15rem; display: block; }
.standards span { color: var(--ink-soft); font-size: 0.95rem; line-height: 1.45; }
@media (max-width: 520px) {
  .standards { grid-template-columns: 1fr; }
  .standards li { flex-direction: row; align-items: center; gap: 1rem; }
  .standards img { width: 5.5rem; }
}

/* papers */
.papers { list-style: none; margin: 0; padding: 0; }
.papers li {
  display: grid; grid-template-columns: 3.25rem minmax(0, 1fr); gap: 0 1rem;
  padding: 0.95rem 0; border-top: 1px solid var(--rule);
}
.papers li:last-child { border-bottom: 1px solid var(--rule); }
.papers .year { font-family: var(--display); font-weight: 500; color: var(--stone-2); font-variant-numeric: tabular-nums; }
.papers .title { font-weight: 600; display: block; line-height: 1.4; }
.papers .meta { display: block; color: var(--ink-soft); font-size: 0.93rem; line-height: 1.45; margin-top: 0.2rem; }

/* button */
.button {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--display); font-weight: 600; font-size: 1rem;
  color: #F4F3F3; background: var(--stone);
  padding: 0.8rem 1.25rem; border-radius: 0.5rem; text-decoration: none;
  border: 0; cursor: pointer;
}
.button:hover { background: #3B4C55; }
@media (prefers-color-scheme: dark) {
  .button { background: #F4F3F3; color: #1D1C1B; }
  .button:hover { background: #FFFFFF; }
}

/* team */
.team { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.5rem; }
.team .name { font-family: var(--display); font-weight: 600; font-size: 1.15rem; display: block; }
.team .role { display: block; }
.team .aff { display: block; color: var(--ink-soft); font-size: 0.95rem; }
.team .links { display: flex; gap: 1.25rem; margin-top: 0.35rem; font-size: 0.95rem; }

/* co-authors */
.coauthors { list-style: none; margin: 0; padding: 0; columns: 3 11rem; column-gap: 2rem; }
.coauthors li { padding: 0.15rem 0; break-inside: avoid; }

/* footer */
.site-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem 2rem;
  padding: 2rem var(--gutter) 2.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--display); font-size: 0.95rem;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.site-footer small { color: var(--ink-soft); font-size: 0.9rem; }

/* ---- audit page -------------------------------------------------------- */
.page-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.25rem var(--gutter);
  border-bottom: 1px solid var(--rule);
  font-family: var(--display);
}
.page-head .home { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; font-weight: 600; }
.page-head .home img { width: 2rem; height: 2rem; }
.audit { padding: clamp(2rem, 6vw, 4rem) var(--gutter) 3rem; max-width: 62rem; }
.audit h1 { font-family: var(--display); font-weight: 500; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.1; margin: 0 0 1rem; letter-spacing: -0.02em; }
.audit .intro { max-width: 40rem; }
.drop {
  margin: 2rem 0;
  border: 1.5px dashed var(--stone-2);
  border-radius: 0.75rem;
  padding: clamp(1.5rem, 5vw, 2.5rem);
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem;
}
.drop.over { border-style: solid; background: color-mix(in srgb, var(--stone-2) 10%, transparent); }
.drop p { margin: 0; color: var(--ink-soft); }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.error { color: #B3261E; font-weight: 600; }
@media (prefers-color-scheme: dark) { .error { color: #F2B8B5; } }

.report h2 { font-family: var(--display); font-weight: 500; font-size: 1.35rem; margin: 2.75rem 0 0.75rem; }
.verdict {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.5rem; align-items: center;
  padding: 1.5rem 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
}
.verdict img { width: 7.5rem; border-radius: 0.35rem; }
.verdict .level { font-family: var(--display); font-weight: 600; font-size: 2.25rem; line-height: 1; display: block; margin-bottom: 0.5rem; }
.verdict p { margin: 0.25rem 0 0; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 0.55rem 0.75rem 0.55rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-family: var(--display); font-weight: 600; }
td.num, th.num { text-align: right; padding-right: 0; padding-left: 0.75rem; white-space: nowrap; }
td.na { color: var(--ink-soft); }
code { font-family: var(--display); font-size: 0.92em; }
.notes { padding-left: 1.2rem; }
.method { color: var(--ink-soft); font-size: 0.95rem; max-width: 46rem; margin-top: 2.5rem; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

/* ---- account, consent dialog, legal ------------------------------------ */
.button.secondary { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--stone-2); }
.button.secondary:hover { background: color-mix(in srgb, var(--stone-2) 12%, transparent); }
.button:disabled { opacity: 0.45; cursor: not-allowed; }
.account { display: flex; align-items: center; gap: 1rem; font-size: 0.95rem; }
.account form { margin: 0; }
.linklike { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--stone-2); text-underline-offset: 0.18em; }
.drop #run { margin-left: auto; }
dialog.consent {
  width: min(40rem, calc(100vw - 2rem)); max-height: calc(100svh - 2rem);
  border: 0; border-radius: 0.75rem; padding: clamp(1.25rem, 4vw, 2rem);
  background: var(--paper); color: var(--ink);
  display: none; flex-direction: column; gap: 1rem;
}
dialog.consent[open] { display: flex; }
dialog.consent::backdrop { background: rgb(29 28 27 / 0.55); }
dialog.consent h2 { font-family: var(--display); font-weight: 500; font-size: 1.35rem; margin: 0; }
.consent-box {
  overflow-y: auto; max-height: 45svh; padding: 1rem 1.1rem;
  border: 1px solid var(--rule); border-radius: 0.5rem; font-size: 0.95rem; line-height: 1.55;
}
.consent-box h3, .legal h3 { font-family: var(--display); font-weight: 600; font-size: 1rem; margin: 1.25rem 0 0.25rem; }
.consent-box p, .consent-box ul { margin: 0 0 0.75rem; }
.accept { display: flex; gap: 0.6rem; align-items: center; font-weight: 600; }
.accept input { width: 1.15rem; height: 1.15rem; accent-color: var(--stone); }
.consent-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.legal { max-width: 44rem; }
.legal h2 { font-family: var(--display); font-weight: 500; font-size: 1.35rem; margin: 2rem 0 0.5rem; }
[hidden] { display: none !important; }
