/* 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 or an icon. */
a[target="_blank"]:not(.skip-link):not(.btn):not(:has(img)):not(:has(picture)):not(:has(svg))::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;
  }
}

/* ── July personal homepage ────────────────── */

body.july-home {
  min-height: 100vh;
  padding-bottom: 1rem;
  background-color: var(--bg);
  background-image: linear-gradient(135deg, var(--home-wash-blue) 0%, var(--home-wash-neutral) 50%, var(--home-wash-warm) 100%);
  background-attachment: fixed;
  color: var(--body-text);
  font-family: var(--font-body);
  line-height: 1.55;
}

body.july-home.home-page {
  font-family: system-ui, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 18px;
  line-height: 1.65;
}

.july-home .july-shell {
  width: min(640px, calc(100% - 32px));
  margin: 0 auto;
  padding: 4.5rem 0 1rem;
}

.july-home .july-hero {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: center;
  gap: 2rem;
  margin-bottom: 3.25rem;
}

.july-home .july-portrait {
  margin: 0;
}

.july-home .july-portrait img {
  display: block;
  width: 120px;
  height: 180px;
  border-radius: 10px;
  object-fit: cover;
}

.july-home .july-hero h1 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(2rem, 7vw, 2.65rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.july-home.home-page .july-hero h1 {
  font-family: inherit;
  font-size: 2em;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0;
}

.july-home .july-role {
  margin: 0.85rem 0 0;
  font-size: 1.05rem;
}

.july-home.home-page .july-role {
  font-size: 1em;
  line-height: 1.65;
}

.july-home .july-focus {
  max-width: 42ch;
  margin: 0.8rem 0 0;
  color: var(--muted);
}

.july-home .july-cta {
  display: inline-block;
  margin-top: 0.8rem;
}

.july-home .july-page-header {
  margin-bottom: 2rem;
}

.july-home .july-back-link {
  display: inline-block;
  margin-bottom: 1.25rem;
}

.july-home .july-page-header h1 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 5vw, 2.35rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.july-home.contact-page .july-page-header h1 {
  font-family: system-ui, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 36px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: normal;
}

.july-home .july-page-header p {
  max-width: 42ch;
  margin: 0.8rem 0 0;
  color: var(--muted);
}

.july-home .july-section {
  margin-bottom: 2.5rem;
}

.july-home .july-section h2 {
  margin: 0 0 0.8rem;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.55rem;
  font-weight: 600;
}

.july-home.home-page .july-section h2 {
  font-family: inherit;
  font-size: 1.4em;
  font-weight: 400;
  line-height: 1.2143;
}

.july-home .july-section ul {
  margin: 0;
  padding-left: 1.35rem;
}

.july-home .july-section li + li {
  margin-top: 0.4rem;
}

.july-home.home-page .july-section li + li {
  margin-top: 0;
}

.july-home .july-section .july-contact-links {
  display: grid;
  gap: 0.55rem;
  padding-left: 0;
  list-style: none;
}

.july-home .july-contact-links li {
  display: flex;
  align-items: center;
  min-height: 1.5rem;
  gap: 0.65rem;
}

.july-home .july-contact-links li + li {
  margin-top: 0;
}

.july-home .july-contact-icon {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.july-home .july-contact-links a[href^="mailto:"]::after {
  content: " ↗";
  font-size: 0.8em;
  opacity: 0.7;
}

.july-home .july-link-arrow {
  font-size: 0.8em;
  opacity: 0.7;
}

.july-home .july-channel,
.july-home .july-documents {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.july-home.contact-page .july-section {
  margin-bottom: 1.5rem;
}

.july-home .july-peace {
  margin: 2.5rem 0;
  text-align: center;
}

.july-home .july-footer {
  margin-top: 3rem;
  padding: 1.4rem 0 0;
  border-top: 1px solid var(--border);
}

.july-home .july-footer ul {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  gap: 0.65rem;
  list-style: none;
}

.july-home .july-footer-separator {
  color: var(--muted);
}

.july-home .july-footer a {
  text-decoration: none;
}

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

.july-home .july-footer a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

@media (max-width: 560px) {
  .july-home .july-shell {
    padding-top: 2rem;
  }

  .july-home .july-hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2.7rem;
  }

  .july-home .july-portrait img {
    width: 120px;
    height: 160px;
  }
}
