/*
 * Sign Slide Deck — shared site stylesheet.
 * Link it from every page:  <link rel="stylesheet" href="ssd-site.css">
 *
 * Page skeleton:
 *   <header class="site-header"> .brand (.brand-mark + .brand-name), nav.site-nav
 *   <section class="hero">       .eyebrow, h1, .lede, .meta
 *   <main class="page">          .layout > nav.toc + article.content
 *   <footer class="site-footer">
 *
 * Content pieces: .card, .callout (+ .callout--info/--warn), .pill, .btn (+ .btn--ghost),
 * .grid-2, .icon-list, .muted, .small.
 *
 * Colors come from the app icon: navy #0B1026 → #1F3A68, sign red #D62828.
 */

/* ---------- Tokens ---------- */
:root {
  --navy-900: #0b1026;
  --navy-700: #1f3a68;
  --red-600: #d62828;
  --red-500: #e63946;

  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef1f8;
  --text: #141a2e;
  --text-muted: #55607a;
  --border: #dde2ee;
  --accent: var(--red-600);
  --accent-text: #ffffff;
  --link: #1f4fa8;
  --info-bg: #e8f0ff;
  --info-border: #b8ccf5;
  --warn-bg: #fff4e5;
  --warn-border: #f3c98b;

  --hero-from: var(--navy-900);
  --hero-to: var(--navy-700);
  --hero-text: #ffffff;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(11, 16, 38, 0.06), 0 8px 24px rgba(11, 16, 38, 0.06);
  --max: 1080px;
  --gutter: 16px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Bebas Neue", "Oswald", "Arial Narrow", var(--font);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0e1f;
    --surface: #121834;
    --surface-2: #19213f;
    --text: #e8ebf5;
    --text-muted: #a3acc5;
    --border: #262f52;
    --link: #8fb3ff;
    --info-bg: #142449;
    --info-border: #2b4580;
    --warn-bg: #3a2a12;
    --warn-border: #7a5520;
    --hero-from: #070a18;
    --hero-to: #1a305a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0a0e1f;
  --surface: #121834;
  --surface-2: #19213f;
  --text: #e8ebf5;
  --text-muted: #a3acc5;
  --border: #262f52;
  --link: #8fb3ff;
  --info-bg: #142449;
  --info-border: #2b4580;
  --warn-bg: #3a2a12;
  --warn-border: #7a5520;
  --hero-from: #070a18;
  --hero-to: #1a305a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 var(--font);
  overflow-x: hidden;
}

img, svg { max-width: 100%; height: auto; }

a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, .btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
h2 { font-size: 1.45rem; scroll-margin-top: 88px; }
h3 { font-size: 1.1rem; }
p, ul, ol { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; }
li + li { margin-top: 0.35em; }

.skip-link {
  position: absolute; left: -9999px; top: 8px;
  background: var(--accent); color: var(--accent-text);
  padding: 8px 14px; border-radius: var(--radius-sm); z-index: 100;
}
.skip-link:focus { left: 8px; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; min-height: 64px;
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark {
  width: 36px; height: 36px; flex: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
  display: grid; place-items: center; box-shadow: var(--shadow);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-name { font-weight: 700; letter-spacing: 0.2px; }

.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a {
  color: var(--text-muted); text-decoration: none; font-size: 0.95rem;
  padding: 6px 10px; border-radius: var(--radius-sm);
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1200px 300px at 85% -20%, rgba(214, 40, 40, 0.35), transparent 60%),
    linear-gradient(135deg, var(--hero-from), var(--hero-to));
  color: var(--hero-text);
  padding: 56px 0 64px;
}
.eyebrow {
  display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: #ffd5d5;
  background: rgba(214, 40, 40, 0.25); border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 4px 10px; border-radius: 999px; margin-bottom: 16px;
}
.hero h1 {
  font-family: var(--font-display); font-weight: 400; letter-spacing: 1px;
  font-size: clamp(2.4rem, 7vw, 4rem); margin-bottom: 12px;
}
.lede { font-size: 1.15rem; max-width: 46rem; color: rgba(255, 255, 255, 0.88); margin: 0; }
.meta { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.85rem; padding: 5px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.2); color: inherit;
}

/* ---------- Layout ---------- */
.page { padding: 40px 0 64px; }
.layout { display: grid; grid-template-columns: 1fr; gap: 32px; }
@media (min-width: 900px) {
  .layout { grid-template-columns: 240px minmax(0, 1fr); align-items: start; }
}

.toc {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 18px 14px; box-shadow: var(--shadow);
}
@media (min-width: 900px) { .toc { position: sticky; top: 88px; } }
.toc-title {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--text-muted); margin: 0 0 10px;
}
.toc ol { list-style: none; padding: 0; margin: 0; counter-reset: toc; }
.toc li { margin: 0; }
.toc a {
  display: block; text-decoration: none; color: var(--text); font-size: 0.95rem;
  padding: 6px 8px; border-radius: var(--radius-sm);
}
.toc a::before {
  counter-increment: toc; content: counter(toc, decimal-leading-zero);
  color: var(--accent); font-weight: 700; font-size: 0.8rem; margin-right: 10px;
}
.toc a:hover { background: var(--surface-2); }

.content { min-width: 0; display: grid; gap: 20px; }

/* ---------- Cards & callouts ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.card > :last-child { margin-bottom: 0; }
.card h2 { display: flex; align-items: center; gap: 12px; }
.card-icon {
  width: 36px; height: 36px; flex: none; border-radius: 10px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent);
}
.card-icon svg { width: 20px; height: 20px; }

.callout {
  border-radius: var(--radius-sm); padding: 14px 16px; margin: 0 0 1em;
  border: 1px solid var(--border); background: var(--surface-2);
}
.callout > :last-child { margin-bottom: 0; }
.callout--info { background: var(--info-bg); border-color: var(--info-border); }
.callout--warn { background: var(--warn-bg); border-color: var(--warn-border); }

.grid-2 { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.icon-list { list-style: none; padding: 0; }
.icon-list li { position: relative; padding-left: 28px; }
.icon-list li::before {
  content: ""; position: absolute; left: 4px; top: 0.6em;
  width: 10px; height: 10px; border-radius: 3px; background: var(--accent);
}
.icon-list--check li::before {
  background: none; width: 14px; height: 8px; top: 0.45em; left: 2px; border-radius: 0;
  border-left: 2.5px solid #2e9d5b; border-bottom: 2.5px solid #2e9d5b; transform: rotate(-45deg);
}
.icon-list--cross li::before {
  background: none; content: "\00d7"; color: var(--text-muted);
  font-weight: 700; font-size: 1.2rem; line-height: 1; top: 0.15em; left: 3px; width: auto; height: auto;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  padding: 10px 18px; border-radius: 999px; border: 1px solid transparent;
  background: var(--accent); color: var(--accent-text);
  font-weight: 600; text-decoration: none;
}
.btn:hover { background: var(--red-500); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { background: var(--surface-2); }

/* ---------- Text helpers ---------- */
.muted { color: var(--text-muted); }
.small { font-size: 0.9rem; }
code, kbd {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.9em;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px;
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0 40px; color: var(--text-muted); font-size: 0.9rem; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
.site-footer a { color: var(--text-muted); }

/* ---------- Print ---------- */
@media print {
  .site-header, .toc, .skip-link { display: none; }
  .hero { background: none; color: #000; padding: 0 0 16px; }
  .lede, .eyebrow { color: #333; background: none; border: 0; padding: 0; }
  .pill { border-color: #999; }
  .card { box-shadow: none; break-inside: avoid; }
  .layout { grid-template-columns: 1fr; }
  body { background: #fff; color: #000; }
}

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