/* =========================================================================
   SWSA.ai — Quiet Precision (+ two Human Signal additions)
   Design-token stylesheet. Implements the approved B4.1 design tokens.
   ========================================================================= */

/* ---- Self-hosted fonts (no third-party origins) ---- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;               /* variable */
  font-display: swap;
  src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader";          /* editorial accent — budget-gated to 400 */
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/newsreader-latin-400-normal.woff2") format("woff2");
}

/* ---- Design tokens (B4.1) ---- */
:root {
  --mineral: #F7F7F4;   /* primary page field */
  --white:   #FFFFFF;
  --ink:     #0B1424;   /* primary text (17.17:1 on mineral) */
  --navy:    #25324E;   /* structure, headings */
  --slate:   #5F6B7A;   /* secondary text (5.05:1 on mineral) */
  --sky:     #72B7E1;   /* rules/dots/large non-text accents only */
  --action:  #236F9E;   /* links, filled actions (5.10:1 on mineral) */

  --space-1: 4px;   --space-2: 8px;   --space-3: 12px;  --space-4: 16px;
  --space-6: 24px;  --space-8: 32px;  --space-12: 48px; --space-16: 64px;
  --space-24: 96px; --space-32: 128px;

  --max-wide: 1360px;
  --max-text: 720px;
  --radius: 4px;

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-serif: "Newsreader", Georgia, ui-serif, serif;
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--mineral);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;               /* 17px */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
picture { display: block; }

.wrap { width: 100%; max-width: var(--max-wide); margin-inline: auto; padding-inline: var(--space-6); }
.prose { max-width: var(--max-text); padding-block: var(--space-12); }
.prose p, .prose ul { max-width: 66ch; }

/* ---- Links ---- */
a { color: var(--action); text-decoration: underline; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

/* ---- Focus (visible, unobscured) ---- */
:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; border-radius: 2px; }

/* ---- Skip link ---- */
.skip-link {
  position: absolute; left: var(--space-4); top: -3rem;
  background: var(--navy); color: var(--white); padding: var(--space-2) var(--space-4);
  border-radius: var(--radius); text-decoration: none; z-index: 100; transition: top .15s ease;
}
.skip-link:focus { top: var(--space-4); }

/* ---- Typography ---- */
h1, h2, h3 { color: var(--navy); line-height: 1.1; margin: 0 0 var(--space-4); font-weight: 700; }
h1 { font-size: clamp(2rem, 1.4rem + 3vw, 3.25rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2rem); margin-top: var(--space-12); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 var(--space-4); }
.eyebrow { color: var(--slate); text-transform: uppercase; letter-spacing: .08em; font-size: .8125rem; font-weight: 600; margin-bottom: var(--space-2); }
.lede { font-size: 1.1875rem; color: var(--ink); }

/* ---- Buttons / CTAs ---- */
.cta {
  display: inline-block; background: var(--action); color: var(--white);
  padding: 12px 22px; border-radius: var(--radius); font-weight: 600;
  text-decoration: none; border: 2px solid var(--action);
}
.cta:hover { background: #1d5c83; border-color: #1d5c83; text-decoration: none; }
.cta-quiet { background: transparent; color: var(--action); }
.cta-quiet:hover { background: transparent; color: #1d5c83; }
.actions, .contact-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); }

/* ---- Header ---- */
.site-header { border-bottom: 1px solid #E6E6E0; background: var(--mineral); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding-block: var(--space-4); }
.brand { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--navy); font-weight: 700; text-decoration: none; font-size: 1.125rem; }
.brand-mark { width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--sky); display: inline-block; }
.brand-wordmark { height: 28px; width: auto; display: block; }
.primary-nav ul, .mobile-nav-panel ul { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-6); margin: 0; padding: 0; }
.primary-nav ul a, .mobile-nav-panel ul a { color: var(--navy); text-decoration: none; font-weight: 500; }
.primary-nav ul a[aria-current="page"], .mobile-nav-panel ul a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--sky); text-decoration-thickness: 3px; }
.header-cta { display: inline-block; background: var(--navy); color: var(--white); padding: 8px 14px; border-radius: var(--radius); text-decoration: none; font-weight: 600; }
.header-cta-quiet { background: transparent; color: var(--navy); border: 1px solid var(--navy); }
.header-actions { display: inline-flex; align-items: center; gap: var(--space-2); }

/* Mobile-first: the compact <details> menu is the default state. */
.desktop-nav { display: none; }
.mobile-nav { display: block; position: relative; }
.nav-summary { cursor: pointer; list-style: none; padding: 8px 14px; border: 1px solid var(--navy); border-radius: var(--radius); color: var(--navy); font-weight: 600; }
.nav-summary::-webkit-details-marker { display: none; }
.mobile-nav-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40;
  background: var(--white); border: 1px solid #E6E6E0; border-radius: var(--radius);
  padding: var(--space-4); min-width: 240px; box-shadow: 0 8px 24px rgba(11,20,36,.08);
}
.mobile-nav-panel ul { flex-direction: column; gap: var(--space-4); }
.mobile-nav-panel .header-actions { margin-top: var(--space-4); }

/* Full inline navigation only once it genuinely fits (content-safe breakpoint,
   verified against the widest nav content at 769/800/900/1024/1280). */
@media (min-width: 1024px) {
  .desktop-nav { display: flex; align-items: center; gap: var(--space-6); }
  .mobile-nav { display: none; }
}

/* ---- Sections ---- */
section { padding-block: var(--space-12); }
@media (min-width: 900px) { section { padding-block: var(--space-16); } }

/* Hero (asymmetric split) */
.hero { display: grid; gap: var(--space-8); }
@media (min-width: 900px) { .hero { grid-template-columns: 1fr 1fr; align-items: center; } }
/* Text-led hero: single spacious column, no empty phantom media column. */
@media (min-width: 900px) { .hero-textled { grid-template-columns: 1fr; } }
.hero-textled .hero-text { max-width: 760px; }
.hero-title { font-size: clamp(2.1rem, 1.4rem + 3.5vw, 3.5rem); }
.media-frame img { width: 100%; border-radius: var(--radius); display: block; }

/* Homepage service signal — rules + typography, not a tile or icon grid. */
.service-signal { margin-top: var(--space-8); }
.service-signal ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); }
.service-signal li { padding-top: var(--space-4); border-top: 1px solid #E6E6E0; color: var(--slate); }
.service-signal li:first-child { padding-top: 0; border-top: 0; }
.service-signal strong { color: var(--navy); }

/* Audience paths (text, not cards) */
.audience { display: grid; gap: var(--space-8); border-top: 1px solid #E6E6E0; }
@media (min-width: 720px) { .audience { grid-template-columns: 1fr 1fr; gap: var(--space-12); } }
.audience-path h2 { margin-top: 0; }
.audience-path a { font-weight: 600; }

/* Proof module */
.proof-lead { display: grid; gap: var(--space-6); }
@media (min-width: 900px) { .proof-lead { grid-template-columns: 1.1fr 1fr; align-items: center; } }
.proof-outcome { font-family: var(--font-serif); font-size: 1.375rem; color: var(--navy); }

/* Process steps (continuous rhythm, not floating tiles) */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.steps li { display: grid; gap: var(--space-1); padding-top: var(--space-4); border-top: 2px solid var(--sky); }
.step-n { color: var(--slate); font-weight: 700; }
.steps strong { color: var(--navy); }
.steps span:last-child { color: var(--slate); }

/* Scaffold notice */
.scaffold-note { background: var(--white); border-left: 4px solid var(--sky); padding: var(--space-4); border-radius: var(--radius); margin: var(--space-6) 0; }
.scaffold-note code, .prose code { background: #EDEEE9; padding: 1px 6px; border-radius: 3px; }

/* Install/proof card — responsive (fixes the 320px overflow: stacks + min-width:0) */
.install-card { display: flex; flex-direction: column; gap: var(--space-4); background: var(--white); padding: var(--space-4); border-radius: var(--radius); }
.install-card .install-card-content { min-width: 0; }
@media (min-width: 560px) { .install-card { flex-direction: row; align-items: center; } .install-card img { width: 160px; flex-shrink: 0; } }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid #E6E6E0; margin-top: var(--space-16); background: var(--white); }
.footer-inner { padding-block: var(--space-12); display: grid; gap: var(--space-6); }
.footer-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-6); margin: 0; padding: 0; }
.footer-nav a { color: var(--navy); text-decoration: none; }
.footer-brand { color: var(--navy); font-weight: 700; margin: 0; }
.footer-contact { color: var(--slate); font-size: .9375rem; }

/* ---- Slice components ---- */
.prose-wide { max-width: 900px; padding-block: var(--space-8) 0; }
.section-intro { color: var(--slate); max-width: 60ch; }

/* Breadcrumbs */
.breadcrumbs { padding-top: var(--space-6); }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; font-size: .875rem; }
.breadcrumbs li + li::before { content: "/"; color: var(--slate); margin-right: var(--space-2); }
.breadcrumbs [aria-current="page"] { color: var(--slate); }

/* Alternating band */
.band { background: var(--white); border-top: 1px solid #E6E6E0; border-bottom: 1px solid #E6E6E0; }

/* Feature list (needs, not product cards) */
.feature-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); }
@media (min-width: 720px) { .feature-list { grid-template-columns: 1fr 1fr; gap: var(--space-6); } }
.feature-list li { padding-left: var(--space-4); border-left: 3px solid var(--sky); }
.feature-list strong { color: var(--navy); }

/* Boundary / prototype notices */
.boundary-note { background: var(--mineral); border-left: 4px solid var(--sky); padding: var(--space-4); border-radius: var(--radius); }
.prototype-banner { background: var(--navy); color: var(--white); padding: var(--space-4); border-radius: var(--radius); margin-top: var(--space-6); }
.pending { display: inline-block; color: var(--slate); font-size: .875rem; font-weight: 600; }

/* Planning-principles list (statements separated by rules) */
.principle-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); }
.principle-list li { padding-top: var(--space-4); border-top: 1px solid #E6E6E0; color: var(--slate); max-width: 70ch; }
.principle-list li strong {
  color: var(--navy);
}

/* Short outcome-led list */
.outcome-list { margin: 0; padding-left: 1.1em; display: grid; gap: var(--space-2); max-width: 66ch; }

/* Related-path rail (descriptive text links, not cards) */
.related-rail ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.related-rail a { font-weight: 600; }

/* Compact FAQ */
.faq h3 { font-size: 1.15rem; margin-top: var(--space-6); }
.faq p { color: var(--slate); max-width: 66ch; }

/* Partner mark (ADT route only) — light background, clearspace >= half height.
   Aspect ratio is always preserved; the mark scales down proportionally on
   narrow screens (the ADT octagon stays >= 30px at 320px). */
.partner-mark { display: inline-block; background: var(--white); padding: clamp(24px, 6vw, 48px); border: 1px solid #E6E6E0; border-radius: var(--radius); }
.partner-mark img { display: block; width: 340px; max-width: 100%; height: auto; }
.partner-note { color: var(--slate); max-width: 62ch; margin-top: var(--space-6); }

/* Project-story media */
.story-media img { width: 100%; border-radius: var(--radius); display: block; }
.story-media { margin: var(--space-6) 0; }
.story-media-pair { display: grid; gap: var(--space-4); }
@media (min-width: 640px) { .story-media-pair { grid-template-columns: 1fr 1fr; } }
.media-caption { color: var(--slate); font-size: .8125rem; margin-top: var(--space-2); }

/* Transition (moved) page */
.moved-note { background: var(--white); border-left: 4px solid var(--sky); padding: var(--space-4); border-radius: var(--radius); margin: var(--space-6) 0; }

/* About ownership portrait — restrained, not a hero */
.owner-block { display: grid; gap: var(--space-6); align-items: start; }
@media (min-width: 640px) { .owner-block { grid-template-columns: 220px 1fr; } }
.owner-portrait { margin: 0; }
.owner-portrait img { width: 100%; max-width: 220px; border-radius: var(--radius); display: block; }
.owner-portrait figcaption { color: var(--slate); font-size: .875rem; margin-top: var(--space-2); }

/* Proof grid (Recent Work index) */
.proof-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-8); }
@media (min-width: 700px) { .proof-grid { grid-template-columns: repeat(3, 1fr); } }
.proof-card h2 { font-size: 1.25rem; margin-top: var(--space-4); }
.proof-card p { color: var(--slate); }
.proof-card .media-frame img { width: 100%; }

/* ---- Reduced motion: remove all non-essential motion ---- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
