/* ============================================================================
   Evidence Foundry — public landing (evidencefoundry.com)
   Field Ledger skin: warm paper, ink, hairline rules, tabular readouts.
   Tokens mirror research-facility/frontend/src/styles/tokens.css — keep in sync.
   ========================================================================== */

:root {
  /* -- Paper & ink ------------------------------------------------------- */
  --paper: #f4f1ea;
  --paper-2: #efebe1;
  --panel: #fbf9f4;
  --panel-2: #ffffff;
  --ink: #1c1a17;
  --ink-2: #4b463e;
  --ink-3: #837b6d;
  --ink-4: #a89f8f;

  /* Hairlines — warm grays, never pure black */
  --rule: #ddd6c8;
  --rule-2: #cabfab;
  --rule-strong: #b7ab93;

  /* -- Accent (deep slate-teal ink) & blocking (oxblood) ----------------- */
  --accent: #1f4a52;
  --accent-ink: #16363c;
  --accent-tint: #e2ebe9;
  --accent-contrast: #f6f3ec;
  --oxblood: #7e2a24;
  --oxblood-tint: #f2e0dc;

  /* -- Status palette (chips/dots only) ---------------------------------- */
  --st-grounded: #2f6b3f;
  --st-grounded-bg: #e2ecdf;
  --st-contested: #9a6212;
  --st-contested-bg: #f4e9d3;
  --st-unsupported: #a5352b;
  --st-unsupported-bg: #f3ddd8;
  --st-declared: #3a5b86;
  --st-declared-bg: #e0e7f1;
  --st-neutral: #6b6355;
  --st-neutral-bg: #e9e4d8;

  /* -- Typography --------------------------------------------------------- */
  --font-ui: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;
  --font-prose: "Newsreader", Georgia, "Times New Roman", serif;

  --radius: 3px;
  --radius-lg: 5px;

  --shadow-1: 0 1px 0 rgba(28, 26, 23, 0.03);
  --shadow-2: 0 1px 2px rgba(28, 26, 23, 0.06), 0 4px 12px rgba(28, 26, 23, 0.05);

  --wrap: 1080px;
  --ledger-row: 29px; /* baseline ruling pitch */
}

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

html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "tnum" 1, "cv05" 1;
}

::selection {
  background: var(--accent-tint);
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 28px;
}

.mono {
  font-family: var(--font-mono);
  font-feature-settings: "tnum" 1;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.eyebrow.accent {
  color: var(--accent);
}

.muted {
  color: var(--ink-3);
}

/* ============================================================================
   Masthead
   ========================================================================== */
.masthead {
  padding-top: 30px;
}
.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}
.brand:hover {
  text-decoration: none;
}
.brand-mark {
  width: 26px;
  height: 26px;
  flex: none;
  border: 1.5px solid var(--accent);
  border-radius: 2px;
  position: relative;
  background: var(--accent-contrast);
}
.brand-mark::before {
  content: "";
  position: absolute;
  inset: 5px 5px auto 5px;
  height: 1.5px;
  background: var(--accent);
  box-shadow: 0 5px 0 var(--accent), 0 10px 0 var(--st-grounded);
}
.brand-name {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  line-height: 1.15;
}
.brand-name small {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
  margin-top: 2px;
}

.masthead-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ============================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--rule-strong);
  background: var(--panel-2);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.btn:hover {
  background: var(--paper-2);
  border-color: var(--ink-4);
  text-decoration: none;
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent-ink);
  color: var(--accent-contrast);
}
.btn.primary:hover {
  background: var(--accent-ink);
}
.btn.lg {
  font-size: 14.5px;
  padding: 12px 24px;
}

/* ============================================================================
   Hero — a ledger page
   ========================================================================== */
.hero {
  position: relative;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--ledger-row) - 1px),
    rgba(28, 26, 23, 0.035) calc(var(--ledger-row) - 1px),
    rgba(28, 26, 23, 0.035) var(--ledger-row)
  );
  border-bottom: 1px solid var(--rule-2);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 56px;
  align-items: start;
  padding-top: 84px;
  padding-bottom: 96px;
  position: relative;
}
/* classic ledger margin rule */
.hero-grid::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 4px;
  width: 1px;
  background: color-mix(in srgb, var(--oxblood) 30%, transparent);
}

.hero h1 {
  font-family: var(--font-prose);
  font-weight: 500;
  font-size: clamp(34px, 4.6vw, 54px);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 26px 0 0;
  max-width: 17ch;
}
.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero .lede {
  font-family: var(--font-prose);
  font-size: 18.5px;
  line-height: 1.62;
  color: var(--ink-2);
  max-width: 58ch;
  margin: 26px 0 0;
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 36px;
}

.loop-strip {
  margin-top: 34px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  word-spacing: 0.2em;
}
.loop-strip b {
  color: var(--accent);
  font-weight: 500;
}

/* -- Specimen claim card ------------------------------------------------ */
.specimen {
  position: relative;
  margin-top: 10px;
}
.specimen::before {
  /* the sheet beneath — stacked index cards */
  content: "";
  position: absolute;
  inset: 10px -8px -10px 8px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
}
.specimen-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--rule-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
}
.specimen-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
}
.specimen-head .spacer {
  flex: 1;
}
.specimen-claim {
  font-family: var(--font-prose);
  font-size: 19px;
  line-height: 1.42;
  padding: 18px 16px 14px;
  margin: 0;
}
.support {
  list-style: none;
  margin: 0;
  padding: 0 16px 14px;
}
.support li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--rule);
  font-size: 12.5px;
  color: var(--ink-2);
}
.support .sid {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1px 5px;
  white-space: nowrap;
}
.support .skind {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}
.support .sdesc {
  flex: 1;
  min-width: 0;
}
.support .resolves-yes {
  color: var(--st-grounded);
  font-weight: 600;
  white-space: nowrap;
}
.support .resolves-open {
  color: var(--st-declared);
  font-weight: 600;
  white-space: nowrap;
}
.specimen-foot {
  border-top: 1px solid var(--rule-strong);
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.specimen-caption {
  margin-top: 22px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
}

/* ============================================================================
   Chips & tags (claim-status vocabulary, from the app)
   ========================================================================== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 8px 2px 7px;
  border-radius: 20px;
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1.5;
}
.chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: none;
  background: currentColor;
}
.st-grounded {
  color: var(--st-grounded);
  background: var(--st-grounded-bg);
  border-color: color-mix(in srgb, var(--st-grounded) 25%, transparent);
}
.st-contested {
  color: var(--st-contested);
  background: var(--st-contested-bg);
  border-color: color-mix(in srgb, var(--st-contested) 25%, transparent);
}
.st-unsupported {
  color: var(--st-unsupported);
  background: var(--st-unsupported-bg);
  border-color: color-mix(in srgb, var(--st-unsupported) 25%, transparent);
}
.st-declared {
  color: var(--st-declared);
  background: var(--st-declared-bg);
  border-color: color-mix(in srgb, var(--st-declared) 25%, transparent);
}
.st-neutral {
  color: var(--st-neutral);
  background: var(--st-neutral-bg);
  border-color: color-mix(in srgb, var(--st-neutral) 25%, transparent);
}

.tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1px 7px;
  white-space: nowrap;
}

/* ============================================================================
   Register sections
   ========================================================================== */
.section {
  border-top: 1px solid var(--rule-2);
}
.section:first-of-type {
  border-top: none;
}
.section-grid {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 44px;
  padding-top: 64px;
  padding-bottom: 80px;
}
.section-grid > *,
.hero-grid > * {
  min-width: 0;
}
.section-label .n {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--ink-4);
}
.section-label .t {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink);
  margin-top: 8px;
}

.section h2 {
  font-family: var(--font-prose);
  font-weight: 500;
  font-size: clamp(26px, 3.2vw, 36px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0;
  max-width: 26ch;
}
.section h2 em {
  font-style: italic;
  color: var(--accent);
}
.section .body {
  font-family: var(--font-prose);
  font-size: 17px;
  line-height: 1.66;
  color: var(--ink-2);
  max-width: 66ch;
  margin: 20px 0 0;
}

/* -- Grounding cards ----------------------------------------------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 32px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  padding: 18px 18px 20px;
}
.card .card-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}
.card h3 {
  font-family: var(--font-prose);
  font-weight: 500;
  font-size: 19px;
  margin: 10px 0 8px;
}
.card p {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0;
}

/* -- Annotation (the AI rule) -------------------------------------------- */
.annotation {
  margin-top: 32px;
  border-left: 2px solid var(--oxblood);
  background: color-mix(in srgb, var(--oxblood-tint) 55%, transparent);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  padding: 16px 20px;
  max-width: 62ch;
}
.annotation p {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink);
}
.annotation p strong {
  color: var(--oxblood);
}
.annotation .who {
  display: block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* -- Ledger tables -------------------------------------------------------- */
.ledger-wrap {
  margin-top: 32px;
  background: var(--panel);
  border: 1px solid var(--rule-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  overflow-x: auto;
}
.ledger {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 560px;
}
.ledger th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
  padding: 10px 16px;
  border-bottom: 1px solid var(--rule-strong);
  white-space: nowrap;
}
.ledger td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.ledger tr:last-child td {
  border-bottom: none;
}
.ledger tr:nth-child(even) td {
  background: color-mix(in srgb, var(--paper-2) 45%, transparent);
}
.ledger .num {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-4);
  white-space: nowrap;
  width: 1%;
}
.ledger .stage {
  font-weight: 600;
  white-space: nowrap;
  width: 1%;
  padding-right: 28px;
}
.ledger .desc {
  color: var(--ink-2);
  line-height: 1.55;
}
.ledger .st {
  width: 1%;
  white-space: nowrap;
}

.ledger-caption {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}

.status-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.status-legend .lbl {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-right: 4px;
}

/* ============================================================================
   CTA band
   ========================================================================== */
.cta-band {
  background: var(--panel);
  border: 1px solid var(--rule-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  padding: clamp(32px, 5vw, 56px);
}
.cta-band h2 {
  margin-top: 18px;
}
.cta-band .body {
  max-width: 56ch;
}
.cta-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 30px;
}
.cta-contact {
  margin-top: 22px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

/* ============================================================================
   Footer
   ========================================================================== */
footer {
  border-top: 1px solid var(--rule-strong);
  margin-top: 88px;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 26px;
  padding-bottom: 48px;
}
.footer-links {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 12.5px;
}
.footer-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ============================================================================
   Motion — one restrained load reveal
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .rise {
    opacity: 0;
    transform: translateY(8px);
    animation: rise 0.55s ease forwards;
  }
  .rise.d1 { animation-delay: 0.06s; }
  .rise.d2 { animation-delay: 0.14s; }
  .rise.d3 { animation-delay: 0.22s; }
  .rise.d4 { animation-delay: 0.32s; }
  @keyframes rise {
    to {
      opacity: 1;
      transform: none;
    }
  }
}

/* ============================================================================
   Responsive
   ========================================================================== */
@media (max-width: 940px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
    padding-top: 56px;
    padding-bottom: 64px;
  }
  .section-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    padding-top: 44px;
    padding-bottom: 56px;
  }
  .section-label {
    display: flex;
    align-items: baseline;
    gap: 14px;
  }
  .section-label .t {
    margin-top: 0;
  }
}
@media (max-width: 560px) {
  .wrap {
    padding: 0 18px;
  }
  .hero-grid::before {
    display: none;
  }
  .masthead-nav .btn {
    padding: 8px 13px;
    font-size: 12.5px;
  }
}
