/* ============================================================
   Project Jail Cell — brand + layout
   The palette is the What Happens Now production palette, reused
   exactly for brand consistency between the org and its program.
   Every text/background pair is at least WCAG AA. Light is the
   default; dark follows the system preference.
   ============================================================ */

:root {
  color-scheme: light;
  --c-paper: #F4F6F4;
  --c-card: #FFFFFF;
  --c-ink: #1B2A26;
  --c-mute: #56645F;
  --c-line: #D7DEDA;
  --c-amber: #E39A2B;
  --c-amber-ink: #4A2E03;
  --c-amber-soft: #FBEFD8;
  --c-amber-soft-ink: #4A2E03;
  --c-teal: #2E6F62;
  --c-teal-ink: #2E6F62;
  --c-teal-soft: #E4EFEB;
  --c-red: #B4413B;
  --c-red-ink: #9A3530;
  --c-red-soft: #F7E7E5;
  --c-focus: #1B2A26;
  --font-sans: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --c-paper: #121C19;
    --c-card: #1B2A26;
    --c-ink: #E8EEEA;
    --c-mute: #A7B5B0;
    --c-line: #2F403B;
    --c-amber: #E39A2B;
    --c-amber-ink: #2A1A02;
    --c-amber-soft: #33270F;
    --c-amber-soft-ink: #F5C77E;
    --c-teal: #2E6F62;
    --c-teal-ink: #7FC4B3;
    --c-teal-soft: #1E3A33;
    --c-red: #E0776F;
    --c-red-ink: #F2A49E;
    --c-red-soft: #3A1F1D;
    --c-focus: #F5C77E;
  }
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  background: var(--c-paper);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--c-paper);
  color: var(--c-ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Reduced motion: honor the preference, no animation. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* Focus: a solid ring, offset so it reads on any surface. */
:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Skip link: hidden until focused. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--c-card);
  color: var(--c-ink);
  padding: 0.75rem 1.1rem;
  border-radius: 0 0 10px 0;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

/* Typography. Sentence case is set in the markup, not here. */
h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 1.2rem + 3vw, 2.875rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.0625rem; }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--c-teal-ink);
  text-underline-offset: 2px;
}
a:hover { color: var(--c-teal); }

/* Layout */
.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section { padding: 3.25rem 0; }
.section + .section { border-top: 1px solid var(--c-line); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
@media (max-width: 760px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--c-paper);
  border-bottom: 1px solid var(--c-line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  /* Also carries .container; keep the horizontal inset here because this
     rule comes later in the cascade and would otherwise drop it. */
  padding: 0.8rem 1.25rem;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  color: var(--c-ink);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark:hover { color: var(--c-ink); }
.wordmark .mark { width: 30px; height: 30px; flex-shrink: 0; }

/* Nav */
.site-nav ul {
  display: flex;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: block;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  color: var(--c-ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}
.site-nav a:hover { background: var(--c-card); color: var(--c-ink); }
.site-nav a[aria-current="page"] {
  background: var(--c-card);
  font-weight: 700;
}

/* Hamburger (mobile) */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: 10px;
  cursor: pointer;
  color: var(--c-ink);
}
.nav-toggle svg { width: 22px; height: 22px; pointer-events: none; }

@media (max-width: 880px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    background: var(--c-paper);
    border-bottom: 1px solid var(--c-line);
    padding: 0.5rem 1.25rem 1rem;
  }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0.2rem; }
  .site-nav a { padding: 0.7rem 0.75rem; font-size: 1rem; }
}

/* Buttons. Amber is the "do this now" color; it carries the only
   strong action on the page. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.15s ease, background 0.15s ease;
}
.btn-primary {
  background: var(--c-amber);
  color: var(--c-amber-ink);
  border-color: var(--c-amber);
}
.btn-primary:hover { filter: brightness(1.06); color: var(--c-amber-ink); }
.btn-secondary {
  background: transparent;
  color: var(--c-ink);
  border-color: var(--c-line);
}
.btn-secondary:hover { background: var(--c-card); color: var(--c-ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }

/* Cards and callouts */
.card {
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: 16px;
  padding: 1.75rem;
}
.card h3 { margin-top: 0; }

.callout {
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
}
.callout-amber { background: var(--c-amber-soft); color: var(--c-amber-soft-ink); }
.callout-teal { background: var(--c-teal-soft); color: var(--c-teal-ink); }
.callout-red { background: var(--c-red-soft); color: var(--c-red-ink); }

/* Hero */
.hero { padding: 4.25rem 0 3.25rem; }
.hero .lead {
  font-size: 1.25rem;
  line-height: 1.55;
  color: var(--c-mute);
  max-width: 62ch;
  margin-bottom: 1.25rem;
}
.hero .cred { color: var(--c-mute); max-width: 62ch; }
.hero h1 { max-width: 24ch; }

/* Stats */
.stat .num {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat .label { color: var(--c-mute); }

/* The "lines we don't cross" list: a drawn check, calm teal. */
.lines-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}
.lines-list li {
  position: relative;
  padding-left: 1.9rem;
}
.lines-list li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.5em;
  width: 0.62em;
  height: 0.32em;
  border-left: 0.16em solid var(--c-teal);
  border-bottom: 0.16em solid var(--c-teal);
  transform: rotate(-45deg);
}

/* Program block (What Happens Now) */
.program {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: start;
}
.program .mark { width: 64px; height: 64px; }
@media (max-width: 560px) {
  .program { grid-template-columns: 1fr; }
  .program .mark { width: 52px; height: 52px; }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--c-line);
  margin-top: 2rem;
  padding: 2.75rem 0 3rem;
  color: var(--c-mute);
  font-size: 0.95rem;
}
.site-footer a { color: var(--c-teal-ink); }
.site-footer a:hover { color: var(--c-teal); }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-grid h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-ink);
  margin-bottom: 0.6rem;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 0.4rem; }
.footer-legal {
  border-top: 1px solid var(--c-line);
  padding-top: 1.25rem;
  font-size: 0.9rem;
}
@media (max-width: 700px) {
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* Print: force light, drop the chrome. */
@media print {
  .site-header, .site-footer, .skip-link, .nav-toggle, .btn-row { display: none !important; }
  html, body { background: #fff !important; color: #111 !important; }
  .card, .callout { border-color: #ccc; }
  a { color: #111; }
}
