/*
 * Enacted Identity System (identity.css)
 * Ratified August 29, 2026 — Governed by DESIGN_HANDOFF.md & ENACTED_SUBSCRIPTION_BUILD_SPEC.md
 * Zero Token Drift against reference artboards.
 * Self-hosted Source Serif 4 (SIL Open Font License) — Zero runtime Google Fonts.
 */

@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('../fonts/SourceSerif4-Variable.woff2') format('woff2');
}

:root {
  /* Ratified Palette Tokens */
  --ink: #0b2732;
  --slate: #527a83;
  --mint: #9cd0ca;
  --tide: #8fbfd6;
  --ghost: #88a1a6;
  --struck: #a05252;
  --paper: #f7f4ee;
  --border: #d8d2c6;
  --card: #fbfaf6;
  --white: #ffffff;
  --text-dark: #2c3e44;
  --pill-bg: #e7f2f0;
  --pill-text: #2f6058;

  /* State Tokens (light only) */
  --state-md: #46968b;
  --state-dc: #23507c;
  --state-va: #8c5f17;
  --coverage-max: 1460px;

  /* Typography */
  --font-serif: 'Source Serif 4', Charter, Georgia, serif;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Shadows */
  --shadow-card: 0 1px 3px rgba(11, 39, 50, 0.06);
  --shadow-elevated: 0 2px 6px rgba(11, 39, 50, 0.08);

  /* Radii */
  --radius-ui: 0px;
  --radius-bubble: 16px;
}

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

body {
  margin: 0;
  padding: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--slate);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--ink);
}

/* Base Layout Container (max-width 760px to match artboard reference canvas) */
.page-container {
  width: 100%;
  max-width: 760px;
  min-height: 100vh;
  margin: 0 auto;
  background-color: var(--paper);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.page-container--coverage {
  max-width: var(--coverage-max);
}

/* Nav Component */
.enacted-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 48px;
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}

.nav-brand-text {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 13px;
  color: var(--slate);
}

/* Nav links (Oct 16): hover never changes font weight, so no word changes width and nothing shifts.
   Hover or keyboard focus draws a thin mint rule under the word, like the spine in the Enacted mark;
   pressing turns it ink; the current page keeps a solid ink rule and the semibold label. */
.nav-links a {
  position: relative;
  color: var(--slate);
  font-weight: 400;
  padding: 4px 0;
  transition: color 0.18s ease;
}

.nav-links a:not(.nav-btn-signin)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--mint);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.24s cubic-bezier(0.2, 0.7, 0.2, 1), background-color 0.12s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--ink);
}

.nav-links a:not(.nav-btn-signin):hover::after,
.nav-links a:not(.nav-btn-signin):focus-visible::after {
  transform: scaleX(1);
}

.nav-links a:not(.nav-btn-signin):active::after {
  background: var(--ink);
}

.nav-links a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.nav-links a.active {
  color: var(--ink);
  font-weight: 600;
}

.nav-links a.active::after {
  transform: scaleX(1);
  background: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  .nav-links a,
  .nav-links a::after {
    transition: none;
  }
}

.nav-btn-signin {
  border: 1.5px solid var(--ink);
  color: var(--ink) !important;
  padding: 6px 14px;
  font-weight: 600 !important;
  display: inline-block;
}

.nav-btn-signin:hover {
  background-color: var(--ink);
  color: var(--paper) !important;
}

/* Eyebrow Label */
.eyebrow {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ghost);
}

/* Hero Section */
.hero-section {
  padding: 60px 48px 40px;
  display: flex;
  gap: 36px;
  align-items: flex-start;
}

.hero-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hero-title {
  font-size: 40px;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.hero-desc {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-dark);
  max-width: 400px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  padding-top: 6px;
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-block;
  text-align: center;
}

.btn-primary:hover {
  background: #163e4f;
  color: var(--paper);
}

.btn-secondary {
  border: 1.5px solid var(--ink);
  color: var(--ink);
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  background: transparent;
  cursor: pointer;
  display: inline-block;
  text-align: center;
}

.btn-secondary:hover {
  background: rgba(11, 39, 50, 0.05);
}

/* Pilcrow Rig Container */
.pilcrow-container {
  width: 220px;
  height: 260px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pilcrow-svg-host {
  /* R-10: the rig is the character only (artboard chrome stripped at generate time) and the
     animator fits its viewBox to the character bounds, so the host is near-square, not portrait. */
  width: 200px;
  height: 200px;
}

.speech-bubble {
  position: absolute;
  top: -10px;
  right: -10px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-bubble);
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-dark);
  box-shadow: var(--shadow-card);
  max-width: 170px;
  line-height: 1.4;
  z-index: 10;
}

/* How It Works Strip */
.how-it-works-strip {
  padding: 10px 48px 34px;
  display: flex;
  gap: 18px;
}

.how-col {
  flex: 1;
  padding-top: 12px;
}

.how-col:nth-child(1) { border-top: 2px solid var(--ink); }
.how-col:nth-child(2) { border-top: 2px solid var(--mint); }
.how-col:nth-child(3) { border-top: 2px solid var(--slate); }

.how-desc {
  font-size: 13.5px;
  line-height: 1.5;
  margin-top: 6px;
  color: var(--text-dark);
}

/* Record Card Component */
.record-card {
  border: 1px solid var(--border);
  background: var(--card);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
}

.record-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.record-card-tags {
  display: flex;
  align-items: center;
  gap: 8px;
}

.record-card-jurisdiction {
  font-size: 12px;
  color: var(--ghost);
}

.record-card-date {
  font-size: 12px;
  color: var(--ghost);
}

.record-card-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

.record-card-title a {
  color: var(--ink);
}

.record-card-chronology {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-dark);
}

.record-card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.action-btn {
  border: 1px solid var(--border);
  padding: 6px 12px;
  font-size: 12px;
  color: var(--slate);
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.action-btn.active, .action-btn-primary {
  border: 1.5px solid var(--ink);
  color: var(--ink);
  font-weight: 600;
}

.action-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
}

/* Status Pill Component (Geometric Sun Glyphs + Label) */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  background: var(--pill-bg);
  color: var(--pill-text);
  border-radius: var(--radius-ui);
}

.status-pill.pending,
.status-pill.proposed,
.status-pill.recorded {
  background: #f0f2f2;
  color: var(--slate);
}

.status-pill.repealed {
  background: #f7eaea;
  color: var(--struck);
}

.status-pill.sunsets {
  background: #fff8e8;
  color: #8c6218;
}

.status-pill.withdrawn {
  background: #eef0f1;
  color: var(--slate);
  border: 1px solid var(--border);
}

/* Coverage Strip */
.coverage-strip {
  margin: 0 48px 30px;
  border: 1px solid var(--border);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card);
}

.coverage-strip-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.coverage-strip-desc {
  font-size: 12.5px;
  color: var(--slate);
  margin-top: 3px;
}

/* Tier Strip */
.tier-strip {
  padding: 0 48px 30px;
  display: flex;
  gap: 14px;
}

.tier-card {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--card);
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.tier-card.elevated {
  border: 2px solid var(--ink);
  background: var(--white);
  box-shadow: var(--shadow-elevated);
}

.tier-name {
  font-size: 19px;
  font-weight: 600;
  margin-top: 4px;
  color: var(--ink);
}

.tier-desc {
  font-size: 12.5px;
  color: var(--text-dark);
  line-height: 1.55;
  margin-top: 6px;
}

/* Persona Grid & Card */
.persona-grid {
  padding: 20px 40px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.persona-card {
  border: 1px solid var(--border);
  background: var(--white);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.persona-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.persona-follow {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-dark);
}

.persona-sample {
  border-left: 3px solid var(--mint);
  padding: 8px 10px;
  background: var(--card);
  font-size: 12px;
  line-height: 1.45;
}

.persona-sample-header {
  font-weight: 600;
}

.persona-fits {
  font-size: 11.5px;
  color: var(--slate);
  margin-top: auto;
}

/* Event Toggle Row Component */
.event-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.checkbox-box {
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--ink);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.checkbox-box.checked {
  background: var(--ink);
}

/* Request Coverage Block */
.request-coverage-block {
  margin: 16px 40px 0;
  border: 1px dashed var(--ghost);
  background: var(--card);
  padding: 14px 18px;
  display: flex;
  gap: 14px;
  align-items: center;
}

/* Detail & Diff Surfaces */
.diff-view {
  border-left: 3px solid var(--mint);
  background: var(--card);
  padding: 14px 18px;
  font-size: 14.5px;
  line-height: 1.8;
  margin: 16px 0;
  overflow-x: auto;
}

.diff-del {
  color: var(--struck);
  text-decoration: line-through;
}

.diff-ins {
  border-bottom: 2.5px solid var(--slate);
  font-weight: 600;
}

/* Footer Component */
.enacted-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 18px 48px 22px;
  font-size: 11.5px;
  color: var(--ghost);
  line-height: 1.6;
}

.footer-links {
  margin-top: 6px;
}

.footer-links a {
  color: var(--ghost);
}

.footer-links a:hover {
  color: var(--ink);
}

/* Responsive Mobile Layout (390px Viewport) */
@media (max-width: 768px) {
  .page-container {
    border: none;
  }
  .enacted-nav {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }
  .nav-brand {
    width: 100%;
    margin-bottom: 4px;
  }
  .nav-links {
    width: 100%;
    gap: 12px;
    font-size: 12px;
    flex-wrap: wrap;
  }
  .hero-section {
    padding: 32px 20px 24px;
    flex-direction: column;
    gap: 24px;
  }
  .hero-title {
    font-size: 30px;
  }
  .pilcrow-container {
    width: 100%;
    height: 200px;
  }
  .how-it-works-strip {
    padding: 10px 20px 24px;
    flex-direction: column;
    gap: 16px;
  }
  .coverage-strip {
    margin: 0 20px 20px;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  .tier-strip {
    padding: 0 20px 20px;
    flex-direction: column;
  }
  .persona-grid {
    padding: 14px 20px 0;
    grid-template-columns: 1fr;
  }
  .request-coverage-block {
    margin: 16px 20px 0;
    flex-direction: column;
    align-items: stretch;
  }
  .enacted-footer {
    padding: 16px 20px 24px;
  }
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 16px;
  z-index: 1000;
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  border-radius: 4px;
}
.skip-link:focus {
  top: 16px;
}

@media only screen and (max-width: 480px) {
  .record-header-row {
    flex-direction: column !important;
    gap: 14px !important;
  }
}

.record-jurisdiction-outline svg {
  width: 100%;
  height: 100%;
  max-width: 100px;
  max-height: 65px;
}
.record-jurisdiction-outline svg path,
.record-jurisdiction-outline path {
  vector-effect: non-scaling-stroke;
}

/* Coverage Map-First (Slice M2) */
.m2-root {
  container-type: inline-size;
  width: 100%;
}
.m2-root button { font: inherit; }
.m2-cty { vector-effect: non-scaling-stroke; }
.m2-move { transition: transform 650ms cubic-bezier(.45,0,.2,1); }
.m2-move text { transition: font-size 650ms cubic-bezier(.45,0,.2,1); }
.m2-focus { transition: fill-opacity 250ms ease, stroke-width 250ms ease; }
.m2-base { transition: filter 400ms ease, opacity 400ms ease; }
.m2-row:hover { background: #efece4; }
.m2-row:focus-visible, .m2-btn:focus-visible, .m2-tab:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .m2-move, .m2-move text, .m2-focus, .m2-base { transition: none !important; }
}
@container (max-width: 1099px) {
  .m2-right { flex-basis: 100% !important; }
  .m2-right-inner { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@container (max-width: 699px) {
  .m2-wrap { padding: 16px !important; }
  .m2-centre { order: 1; flex-basis: 100% !important; }
  .m2-left { order: 2; flex-basis: 100% !important; }
  .m2-right { order: 3; }
  .m2-right-inner { grid-template-columns: minmax(0, 1fr) !important; }
  .m2-title { font-size: 34px !important; }
  .m2-list { max-height: 380px !important; }
  .m2-crumbs { display: none !important; }
}
@media (max-width: 1099px) {
  .m2-right { flex-basis: 100% !important; }
  .m2-right-inner { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 699px) {
  .m2-wrap { padding: 16px !important; }
  .m2-centre { order: 1; flex-basis: 100% !important; }
  .m2-left { order: 2; flex-basis: 100% !important; }
  .m2-right { order: 3; }
  .m2-right-inner { grid-template-columns: minmax(0, 1fr) !important; }
  .m2-title { font-size: 34px !important; }
  .m2-list { max-height: 380px !important; }
  .m2-crumbs { display: none !important; }
}


