/* Home and 404 surfaces.
   Self-contained: no framework, colors and type come from tokens.css.
   The visual language matches agentic-diagnostics.html and /articles/. */

@import url("tokens.css");

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--body-text);
  line-height: 1.65;
  min-height: 100vh;
}

.shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  font-weight: 600;
  border-radius: 0 0 4px 0;
  transform: translateY(-120%);
  transition: transform 0.2s ease;
  z-index: 100;
}

.skip-link:focus {
  transform: translateY(0);
}

/* External link indicator, excluding links that wrap media. */
a[target="_blank"]:not(.skip-link):not(.btn):not(:has(img)):not(:has(picture))::after {
  content: " ↗";
  font-size: 0.8em;
  opacity: 0.7;
}

/* ── Hero ──────────────────────────────────── */

.hero {
  display: grid;
  grid-template-columns: 1fr 176px;
  column-gap: 2.25rem;
  align-items: start;
  margin-bottom: 3.25rem;
}

.hero-body {
  min-width: 0;
}

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 1rem;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4.5vw, 2.375rem);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.18;
  letter-spacing: -0.015em;
  margin-bottom: 1rem;
}

.deck {
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--body-text);
  max-width: 40ch;
}

.portrait {
  margin: 0;
}

.portrait img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}

/* ── Call to action ────────────────────────── */

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.75rem 0 0.85rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 0.7rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--accent);
  transition: background 0.15s, color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fff;
  box-shadow: 0 4px 12px rgba(31, 77, 122, 0.18);
}

.btn--ghost {
  background: var(--surface);
  color: var(--accent);
}

.btn--ghost:hover {
  background: var(--accent-pale);
  color: var(--accent-dark);
}

.cta-note {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--muted);
}

/* ── Sections ──────────────────────────────── */

.block {
  margin-bottom: 3rem;
}

.section-label {
  font-family: var(--font-display);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.facts {
  list-style: none;
}

.facts li {
  position: relative;
  padding: 0 0 0 1.15rem;
  margin-bottom: 0.7rem;
  max-width: 62ch;
}

.facts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-soft);
}

.facts li:last-child {
  margin-bottom: 0;
}

.facts .lead-fact {
  font-weight: 600;
  color: var(--ink);
}

.facts .lead-fact::before {
  background: var(--accent);
}

.highlight {
  font-weight: 600;
  color: var(--ink);
}

/* ── Article cards ─────────────────────────── */

.cards {
  list-style: none;
  display: grid;
  gap: 0.25rem;
}

.card {
  display: block;
  padding: 0.9rem 1rem;
  margin-left: -1rem;
  border-radius: 6px;
  transition: background 0.15s;
}

.card:hover {
  background: rgba(31, 77, 122, 0.05);
  text-decoration: none;
}

.card-title {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.35;
  color: var(--accent);
  margin-bottom: 0.3rem;
}

.card:hover .card-title {
  color: var(--accent-dark);
}

.card-desc {
  display: block;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--muted);
}

.more {
  margin-top: 1.1rem;
  font-size: 0.875rem;
  color: var(--muted);
}

/* ── Footer ────────────────────────────────── */

footer {
  margin-top: 3.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.75rem;
}

.footer-grid h2 {
  font-family: var(--font-display);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 0.7rem;
}

.footer-grid ul {
  list-style: none;
}

.footer-grid li {
  margin-bottom: 0.45rem;
  font-size: 0.9375rem;
}

.footer-grid li:last-child {
  margin-bottom: 0;
}

.footer-note {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
}

/* ── 404 ───────────────────────────────────── */

.not-found__illustration {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5rem 0 2rem;
}

.not-found p {
  max-width: 60ch;
  margin-bottom: 0.75rem;
}

/* ── Responsive ────────────────────────────── */

@media (max-width: 620px) {
  .shell {
    padding: 2rem 1.125rem 3rem;
  }

  .hero {
    grid-template-columns: 1fr;
    row-gap: 1.5rem;
  }

  .portrait {
    grid-row: 1;
    width: 148px;
  }

  .deck {
    max-width: none;
  }

  .cta-row .btn {
    flex: 1 1 100%;
    justify-content: center;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .card,
  .skip-link {
    transition: none;
  }

  .btn:hover {
    transform: none;
  }
}

/* ── Print ─────────────────────────────────── */

@media print {
  body {
    background: #fff;
    color: #000;
  }

  .skip-link,
  .cta-row {
    display: none;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    word-break: break-all;
  }
}
