/* ------------------------------------------------------------------ *
 * Two brand skins on one system.
 *   default            -> Integrity Monitor (platform): ink blue, institutional
 *   [data-brand="ri"]  -> Reputation Index (product):   teal, as in the app
 * Only the accent family changes; ground, type and layout stay shared.
 * ------------------------------------------------------------------ */

:root {
  --bg: #f7f7f5;
  --bg-raised: #ffffff;
  --bg-sunken: #eeefec;
  --text: #1a1e22;
  --muted: #646c74;
  --accent: #1b3f66;
  --accent-contrast: #ffffff;
  --accent-soft: #e6edf5;
  --accent-line: #c6d6e6;
  --ai: #6d4bd6;
  --ai-soft: #efeaff;
  --ai-border: #d9cffb;
  --law: #8a8578;
  --law-soft: #f1f0ec;
  --law-border: #d7d4cb;
  --misleading: #b4460f;
  --misleading-soft: #fdf0e6;
  --border: #e0e2df;
  --shadow: 0 1px 2px rgba(20, 30, 45, .06), 0 10px 28px rgba(20, 30, 45, .07);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light dark;
}

:root[data-brand="ri"] {
  --accent: #0e7c66;
  --accent-soft: #e3f2ee;
  --accent-line: #b9ded4;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121517;
    --bg-raised: #191d20;
    --bg-sunken: #0e1113;
    --text: #e5e8ea;
    --muted: #99a2aa;
    --accent: #7fb3e0;
    --accent-contrast: #0b1722;
    --accent-soft: #17293b;
    --accent-line: #2b4257;
    --ai: #a892ff;
    --ai-soft: #241d3d;
    --ai-border: #3a2f63;
    --law: #b3afa4;
    --law-soft: #201f1b;
    --law-border: #3a3833;
    --misleading: #ffab5e;
    --misleading-soft: #3a2b16;
    --border: #2a2f33;
    --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 10px 28px rgba(0, 0, 0, .38);
  }
  :root[data-brand="ri"] {
    --accent: #35a38b;
    --accent-soft: #1c3630;
    --accent-line: #2d5449;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--accent); }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 5.5vw, 3.4rem); margin: 0 0 .5em; }
h2 { font-size: clamp(1.55rem, 3.4vw, 2.2rem); margin: 0 0 .6em; }
h3 { font-size: 1.15rem; margin: 0 0 .4em; }
p { margin: 0 0 1em; }
code, .rule-id { font-family: var(--mono); font-size: .85em; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; gap: 18px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; font-size: 1.02rem; }
.brand img { width: 30px; height: 30px; border-radius: 7px; }
.site-nav { margin-left: auto; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.site-nav a { color: var(--muted); text-decoration: none; font-size: .92rem; }
.site-nav a:hover { color: var(--text); }
/* Language switch — segmented EN | IT control */
.lang-switch {
  display: inline-flex; align-items: stretch; gap: 2px;
  border: 1px solid var(--border); border-radius: 999px; padding: 2px;
  background: var(--bg-raised); line-height: 1;
}
.lang-opt {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; padding: 5px 11px; border-radius: 999px;
  font-size: .82rem; font-weight: 700; letter-spacing: .03em;
  text-decoration: none; color: var(--muted); background: transparent;
  transition: background-color .15s ease, color .15s ease;
}
.lang-opt:hover { color: var(--text); background: var(--accent-soft); }
.lang-opt.is-active {
  background: var(--accent); color: var(--accent-contrast); cursor: default;
}
.lang-opt.is-active:hover { background: var(--accent); color: var(--accent-contrast); }
.lang-switch .sep { display: none; }

/* Hero */
.hero { padding: 84px 0 56px; }
.hero .kicker {
  display: inline-block; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin-bottom: 14px;
}
.hero p.sub { font-size: 1.22rem; color: var(--muted); max-width: 46em; }
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; margin: 28px 0 10px; }
.btn {
  display: inline-block; text-decoration: none; border-radius: 10px; padding: 12px 22px;
  font-weight: 600; font-size: 1rem; border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: var(--accent-contrast); }
.btn-secondary { border-color: var(--border); color: var(--text); background: var(--bg-raised); }
.btn:hover { filter: brightness(1.06); }
.hero-note { font-size: .85rem; color: var(--muted); }

.countdown {
  display: inline-flex; align-items: baseline; gap: 10px; margin-top: 26px;
  background: var(--misleading-soft); border: 1px solid color-mix(in srgb, var(--misleading) 35%, transparent);
  border-radius: 12px; padding: 12px 18px;
}
.countdown strong { font-size: 1.5rem; font-family: var(--serif); color: var(--misleading); }
.countdown span { color: var(--text); font-size: .95rem; }

/* Sections */
section { padding: 64px 0; border-top: 1px solid var(--border); }
.section-kicker {
  font-size: .78rem; letter-spacing: .13em; text-transform: uppercase; font-weight: 700;
  color: var(--accent); margin-bottom: 8px;
}
.lede { font-size: 1.12rem; color: var(--muted); max-width: 48em; }

/* Enforcement wall */
.case-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 28px; }
.case-card {
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px;
}
.case-card .claim { font-family: var(--serif); font-size: 1.12rem; font-weight: 600; }
.case-card .authority { color: var(--muted); font-size: .88rem; }
.case-card .outcome { color: var(--misleading); font-weight: 700; margin-top: auto; padding-top: 8px; }

/* Deadline */
.bans { display: grid; gap: 12px; margin-top: 24px; }
.ban {
  background: var(--bg-raised); border: 1px solid var(--border); border-left: 4px solid var(--misleading);
  border-radius: 10px; padding: 14px 18px;
}
.ban strong { font-family: var(--serif); }

/* Product capabilities */
.cap-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 28px; }
.cap {
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: 14px; padding: 20px;
}
.cap h3 { color: var(--accent); }
.cap p { margin: 0; color: var(--muted); font-size: .95rem; }

/* Pipeline */
.pipeline-scroller { overflow-x: auto; margin-top: 28px; padding-bottom: 8px; }
.pipeline { display: flex; align-items: stretch; gap: 0; min-width: 760px; }
.stage { flex: 1; display: flex; flex-direction: column; gap: 4px; border-radius: 12px; padding: 16px; border: 1px solid var(--border); background: var(--bg-raised); }
.stage .stage-name { font-weight: 700; font-size: .98rem; }
.stage .stage-desc { font-size: .82rem; color: var(--muted); }
.stage.model { background: var(--ai-soft); border-color: var(--ai-border); }
.stage.model .stage-name { color: var(--ai); }
.stage.det { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.stage.det .stage-name { color: var(--accent); }
.pipe-arrow { align-self: center; padding: 0 8px; color: var(--muted); font-size: 1.2rem; }
.legend { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 14px; font-size: .85rem; color: var(--muted); }
.legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.dot.violet { background: var(--ai); }
.dot.green { background: var(--accent); }
.dot.beige { background: var(--law); }

/* Statute / mandate panel */
.mandate {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px;
}
.mandate .panel { border-radius: 14px; padding: 20px; border: 1px solid var(--border); background: var(--bg-raised); }
.mandate .panel.law-panel { background: var(--law-soft); border-color: var(--law-border); }
.mandate .panel h3 { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.mandate blockquote { margin: 0; font-family: var(--serif); font-size: 1.05rem; }
.mandate .cite { display: block; margin-top: 10px; font-size: .82rem; color: var(--muted); }

/* Abstention */
.abstain-card {
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: 16px;
  padding: 26px; margin-top: 26px; box-shadow: var(--shadow);
}
.abstain-card .verdict { font-family: var(--serif); font-size: 1.6rem; color: var(--accent); }

/* Caveat / honesty boxes */
.caveat {
  border: 1px dashed color-mix(in srgb, var(--muted) 55%, transparent); border-radius: 12px;
  padding: 16px 20px; margin-top: 24px; font-size: .92rem; color: var(--muted); background: var(--bg-raised);
}
.caveat strong { color: var(--text); }

/* Stats */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 28px; }
.stat { background: var(--bg-raised); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.stat .num { font-family: var(--serif); font-size: 2rem; color: var(--accent); font-weight: 700; }
.stat .lbl { color: var(--muted); font-size: .9rem; }

/* Trust list */
.trust-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 28px; }
.trust { border-left: 3px solid var(--accent); padding: 4px 0 4px 18px; }
.trust p { margin: 0; color: var(--muted); font-size: .95rem; }

.limits { background: var(--law-soft); border: 1px solid var(--law-border); border-radius: 16px; padding: 26px; margin-top: 36px; }
.limits ul { margin: 12px 0 0; padding-left: 20px; }
.limits li { margin-bottom: 10px; }

/* Audience */
.aud-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 28px; }
.aud { background: var(--bg-raised); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.aud p { color: var(--muted); font-size: .95rem; margin: 0; }

/* Vision / pillars */
.pillar-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 14px; margin-top: 28px; }
.pillar { background: var(--bg-raised); border: 1px solid var(--border); border-top: 4px solid var(--accent); border-radius: 12px; padding: 18px; }
.pillar h3 { font-size: 1rem; }
.pillar p { font-size: .86rem; color: var(--muted); margin: 0; }

.roadmap { display: grid; gap: 0; margin-top: 32px; }
.milestone { display: grid; grid-template-columns: 130px 1fr; gap: 18px; padding: 14px 0; border-top: 1px solid var(--border); }
.milestone .when { font-weight: 700; color: var(--accent); font-size: .92rem; }
.milestone .what { color: var(--muted); font-size: .95rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 56px 0 40px; background: var(--bg-raised); }
.site-footer .cta-row { margin-top: 20px; }
.disclaimer {
  margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--border);
  font-size: .84rem; color: var(--muted);
}
.disclaimer .tagline { font-weight: 700; color: var(--law); text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; }

@media (max-width: 720px) {
  .hero { padding: 56px 0 40px; }
  section { padding: 48px 0; }
  .mandate { grid-template-columns: 1fr; }
  .milestone { grid-template-columns: 1fr; gap: 4px; }
  .site-nav > a { display: none; }
  .lang-opt { min-width: 34px; padding: 5px 9px; }
}

/* ================================================================== *
 * Integrity Monitor shell — header, footer, and platform-page blocks
 * ================================================================== */

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-contrast);
  padding: 10px 16px; border-radius: 0 0 8px 0; text-decoration: none;
}
.skip-link:focus { left: 0; }

/* Brand lockup */
.brand { gap: 11px; }
.brand-mark { width: 30px; height: 30px; color: var(--accent); flex: none; }
.brand-word { font-family: var(--serif); font-size: 1.12rem; letter-spacing: -.01em; font-weight: 400; }
.brand-word strong { font-weight: 700; }

.site-header .wrap { height: 66px; }
.nav-link { color: var(--muted); text-decoration: none; font-size: .92rem; }
.nav-link:hover { color: var(--text); }
.nav-link.is-active { color: var(--text); font-weight: 600; }

/* Page furniture */
.breadcrumb { font-size: .85rem; color: var(--muted); padding-top: 26px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); text-decoration: underline; }
.breadcrumb .sep { padding: 0 7px; opacity: .6; }

.page-head { padding: 64px 0 8px; }
.page-head h1 { max-width: 18em; }
.page-head .lede { font-size: 1.2rem; }

section.alt { background: var(--bg-sunken); }

/* Two-column prose + aside */
.split { display: grid; grid-template-columns: 1.35fr 1fr; gap: 40px; align-items: start; margin-top: 28px; }
.split .aside {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: 14px; padding: 22px; box-shadow: var(--shadow);
  position: sticky; top: 88px;
}
.split .aside h3 { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.split .aside ul { margin: 10px 0 0; padding-left: 18px; font-size: .92rem; color: var(--muted); }
.split .aside li { margin-bottom: 8px; }

/* Product cards with availability status */
.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 18px; margin-top: 30px; }
.product {
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: 16px;
  padding: 24px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow);
}
.product.is-live { border-color: var(--accent-line); }
.product h3 { font-size: 1.3rem; margin: 0; }
.product p { color: var(--muted); font-size: .95rem; margin: 0; }
.product .more { margin-top: auto; padding-top: 12px; font-weight: 600; text-decoration: none; }
.status {
  align-self: flex-start; font-size: .7rem; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted); background: var(--bg-sunken);
}
.status.live { background: var(--accent); color: var(--accent-contrast); border-color: transparent; }
.status.dev { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }

/* Numbered principles */
.principles { display: grid; grid-template-columns: repeat(auto-fit, minmax(212px, 1fr)); gap: 22px; margin-top: 30px; counter-reset: p; }
.principle { counter-increment: p; }
.principle h3::before {
  content: counter(p, decimal-leading-zero);
  display: block; font-family: var(--mono); font-size: .8rem; color: var(--accent);
  margin-bottom: 6px; letter-spacing: .08em;
}
.principle p { color: var(--muted); font-size: .95rem; margin: 0; }

/* Regulation entries */
.reg { border-top: 1px solid var(--border); padding: 26px 0; }
.reg:last-child { border-bottom: 1px solid var(--border); }
.reg-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; }
.reg-head h3 { margin: 0; }
.reg-when {
  font-family: var(--mono); font-size: .78rem; padding: 3px 9px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line);
}
.reg dl { display: grid; grid-template-columns: 150px 1fr; gap: 6px 18px; margin: 14px 0 0; font-size: .95rem; }
.reg dt { color: var(--muted); font-weight: 600; }
.reg dd { margin: 0; }

/* Whitepaper reading layout */
.paper { max-width: 44em; }
.paper h2 { margin-top: 2em; }
.paper h3 { margin-top: 1.6em; font-family: var(--sans); font-size: 1.02rem; letter-spacing: .01em; }
.paper p, .paper li { color: var(--text); }
.paper .meta { color: var(--muted); font-size: .9rem; }
.paper .refs { font-size: .88rem; color: var(--muted); }
.paper .refs li { margin-bottom: 9px; }
.paper blockquote {
  margin: 24px 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--accent-line);
  font-family: var(--serif); font-size: 1.12rem;
}

.download {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 8px;
  border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--accent);
  border-radius: 10px; padding: 11px 18px; text-decoration: none; font-weight: 600;
}
.download:hover { filter: brightness(.97); }

/* Footer */
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.footer-brand .brand-word { color: var(--text); }
.footer-note { color: var(--muted); font-size: .9rem; margin-top: 10px; max-width: 34em; }
.footer-h { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-family: var(--sans); margin: 0 0 10px; }
.footer-col { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .split .aside { position: static; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
  .reg dl { grid-template-columns: 1fr; gap: 2px 0; }
  .reg dd { margin-bottom: 8px; }
}

/* ================================================================== *
 * Print — used for the whitepaper PDF, and for anyone printing a page
 * ================================================================== */
@media print {
  :root {
    --bg: #ffffff; --bg-raised: #ffffff; --bg-sunken: #ffffff;
    --text: #16191c; --muted: #4a5057; --border: #ccd0d4;
    --accent: #1b3f66; --accent-soft: #eef3f8; --shadow: none;
  }
  body { font-size: 10.5pt; line-height: 1.5; }
  .site-header, .site-nav, .skip-link, .breadcrumb, .site-footer,
  .cta-row, .download, section.alt:last-of-type { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  main { padding: 0; }
  section { padding: 0; border: 0; }
  .page-head { padding: 0 0 12pt; }
  .paper { max-width: none; }
  h1 { font-size: 22pt; }
  h2 { font-size: 14pt; page-break-after: avoid; margin-top: 20pt; }
  h3 { page-break-after: avoid; }
  p, li, blockquote { page-break-inside: avoid; }
  blockquote { border-left: 2pt solid var(--accent); }
  a { color: inherit; text-decoration: none; }
  @page { margin: 18mm 16mm; }
}

/* ================================================================== *
 * Whitepaper request form (double opt-in) + flow pages
 * ================================================================== */
.gate {
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: 16px;
  padding: 28px; box-shadow: var(--shadow); max-width: 34em;
}
.gate h2 { font-size: 1.35rem; margin-bottom: .3em; }
.gate .gate-intro { color: var(--muted); font-size: .95rem; margin-bottom: 22px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: .88rem; font-weight: 600; }
.field input[type="text"], .field input[type="email"] {
  font: inherit; font-size: .96rem; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 9px; padding: 11px 13px;
}
.field input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.field input::placeholder { color: var(--muted); opacity: .75; }

.consent { display: flex; gap: 11px; align-items: flex-start; margin-bottom: 14px; font-size: .89rem; }
.consent input[type="checkbox"] { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.consent label { color: var(--muted); }
.consent label strong { color: var(--text); font-weight: 600; }

/* Honeypot — must stay reachable to bots but invisible and unfocusable for people. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.gate .btn { margin-top: 8px; border: 0; font-family: inherit; cursor: pointer; }
.gate-legal { margin-top: 18px; font-size: .8rem; color: var(--muted); line-height: 1.5; }
.gate-legal a { color: var(--muted); }

.form-error {
  display: none; margin-bottom: 20px; padding: 13px 16px; border-radius: 10px;
  background: var(--misleading-soft); border: 1px solid color-mix(in srgb, var(--misleading) 40%, transparent);
  color: var(--text); font-size: .92rem;
}
.form-error.is-visible { display: block; }

/* Flow pages (check inbox / confirmed) */
.flow { max-width: 34em; padding: 26px 0 8px; }
.flow .flow-icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line);
  font-size: 1.4rem; margin-bottom: 18px;
}
.flow ol { color: var(--muted); font-size: .95rem; padding-left: 20px; }
.flow ol li { margin-bottom: 8px; }

/* Cloudflare Turnstile widget sits between the consents and the submit button. */
.turnstile { margin: 4px 0 16px; min-height: 65px; }
.turnstile:empty { min-height: 0; }

/* Contact form additions: select and textarea share the input styling. */
.field select, .field textarea {
  font: inherit; font-size: .96rem; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 9px; padding: 11px 13px;
}
.field textarea { resize: vertical; min-height: 96px; }
.field select { appearance: none; background-image: none; cursor: pointer; }
.field select:focus-visible, .field textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
}
.gate .field textarea::placeholder { color: var(--muted); opacity: .75; }
