/*
 * Shared styles for the Bikn legal site.
 *
 * Scope note: CLAUDE.md's "light background only, never dark mode" rule is a
 * product decision about the crisis app — older, low-vision, and panicked
 * users read dark-on-light better mid-incident. It doesn't govern this site,
 * which is reference reading on a desktop or phone at rest, so dark mode is
 * honored here. The palette is neutral slate with the app's own primary blue
 * (#2E6BE6) as the single accent, so the two still read as one brand.
 */

:root {
  --bg: #ffffff;
  --bg-subtle: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-muted: #475569;
  --accent: #2e6be6;
  --accent-hover: #1e4fb0;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);

  --measure: 68ch;
  --pad-x: clamp(1.25rem, 5vw, 2rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --bg-subtle: #0f172a;
    --surface: #111c30;
    --border: #1e293b;
    --border-strong: #334155;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --accent: #7aa5f5;
    --accent-hover: #a8c4f8;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Keyboard users get a visible focus ring everywhere, not just on links. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

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

/* Skip link — visually hidden until focused. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  color: var(--text);
  padding: 0.75rem 1rem;
  z-index: 10;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
}

.skip-link:focus {
  left: var(--pad-x);
  top: 0.75rem;
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}

.site-header__inner,
.site-footer__inner,
.page {
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-block: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: 0.875rem;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  color: var(--text);
}

.brand svg {
  display: block;
  flex: none;
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.9375rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
}

.site-nav a:hover {
  color: var(--accent);
}

/* Marks the page you're already on, for orientation. */
.site-nav a[aria-current='page'] {
  color: var(--accent);
  font-weight: 600;
}

/* ---------- Page body ---------- */

.page {
  padding-block: clamp(2.5rem, 8vw, 4rem) clamp(3rem, 9vw, 5rem);
}

h1 {
  font-size: clamp(1.875rem, 5vw, 2.5rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0;
  font-weight: 700;
}

h2 {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 3rem 0 1rem;
  font-weight: 650;
}

.effective-date {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin: 0.75rem 0 0;
}

.lede {
  color: var(--text-muted);
  font-size: 1.125rem;
  margin: 1.25rem 0 0;
}

p {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
}

.page > p:first-of-type,
h2 + p {
  margin-top: 0;
}

/* Sits under the h1 as a rule, not a heavy divider. */
.rule {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0 0;
}

/* ---------- Landing page cards ---------- */

.card-grid {
  display: grid;
  gap: 1rem;
  margin-top: 2.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 40rem) {
  .card-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.card {
  display: block;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  color: var(--text);
}

@media (prefers-reduced-motion: reduce) {
  .card {
    transition: none;
  }
  .card:hover {
    transform: none;
  }
}

.card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.1875rem;
}

.card p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.card__cue {
  display: inline-block;
  margin-top: 0.875rem;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9375rem;
}

/* ---------- Pending-value marker ---------- */

/*
 * Deliberately loud. This marks a legal value that is not yet confirmed —
 * see public-site/README.md. A fabricated address would be worse than a
 * visible gap, and a quiet one would ship unnoticed.
 */
.pending {
  background: #fef3c7;
  color: #713f12;
  border: 1px dashed #b45309;
  border-radius: 6px;
  padding: 0.0625rem 0.375rem;
  font-size: 0.9375rem;
  font-weight: 600;
}

@media (prefers-color-scheme: dark) {
  .pending {
    background: #3b2f0b;
    color: #fde68a;
    border-color: #a16207;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-block: 1.75rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.site-footer p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.site-footer nav {
  display: flex;
  gap: 1.25rem;
}

.site-footer a {
  text-decoration: none;
  font-weight: 500;
}

.site-footer a:hover {
  text-decoration: underline;
}
