/* ---- Tokens ---- */
:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --text: #111827;
  --text-2: #4b5563;
  --text-3: #9ca3af;
  --accent: #1a3a5c;
  --accent-hover: #245080;
  --border: rgba(26, 58, 92, 0.15);
  --border-light: rgba(26, 58, 92, 0.06);
}

/* ---- Base ---- */
* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

main {
  display: block;
}

a:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- Layout ---- */
.article-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ---- Header ---- */
.article-header {
  padding: 80px 0 48px;
}

.back-link {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-3);
  text-decoration: none;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 40px;
  border-bottom: 1px solid transparent;
}

.back-link:hover,
.back-link:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.article-title {
  font-size: 2.15rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
  margin-bottom: 20px;
}

.article-meta {
  font-size: 0.82rem;
  color: var(--text-3);
  letter-spacing: 0.02em;
  margin-top: 4px;
}

.article-lede {
  font-size: 1.25rem;
  font-style: italic;
  color: var(--text);
  line-height: 1.54;
  margin-top: 32px;
  padding-bottom: 44px;
  border-bottom: 1px solid var(--border);
}

/* ---- Article body ---- */
.article-body {
  padding: 46px 0 76px;
}

.article-body p {
  margin-bottom: 1.4em;
  color: var(--text-2);
  line-height: 1.74;
}

.material-page .article-header {
  padding-bottom: 42px;
  border-bottom: 1px solid var(--border);
}

.material-page .article-meta {
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.material-page .article-body p {
  color: var(--text);
}

.material-section {
  padding: 36px 0;
  border-bottom: 1px solid var(--border-light);
}

.material-section:first-child {
  padding-top: 0;
}

.material-section h2 {
  margin-top: 0;
}

.material-page .article-body > h2 {
  margin: 3rem 0 1rem;
  color: var(--text);
  font-size: 1.24rem;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.28;
  text-transform: none;
}

.material-page .article-body > h2:first-child {
  margin-top: 0;
}

.material-boundary {
  margin: 0.35rem 0;
  padding: 26px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.material-boundary h2,
.material-referrer h2 {
  color: var(--text);
}

.material-boundary p:last-child,
.material-referrer p:last-child {
  margin-bottom: 0;
}

.material-referrer {
  padding-top: 40px;
}

.material-callout {
  margin: 20px 0 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--border);
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.65;
}

.material-callout p {
  color: var(--text);
  margin-bottom: 0;
}

.plain-list {
  margin: 0 0 1.4em 1.15rem;
  color: var(--text);
}

.plain-list li {
  margin: 0.45rem 0;
  line-height: 1.62;
  padding-left: 0.15rem;
}

.material-secondary-link {
  margin: 34px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.6;
}

.material-secondary-link a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
}

.material-secondary-link a:hover,
.material-secondary-link a:focus-visible {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}

.material-secondary-link a:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

.material-domain-group {
  padding: 52px 0 20px;
  border-bottom: 1px solid var(--border);
}

.material-domain-group > h2 {
  margin: 0 0 16px;
  color: var(--text);
  font-size: 1.22rem;
  letter-spacing: 0;
  line-height: 1.28;
  text-transform: none;
}

.domain-group-intro {
  max-width: 60ch;
  margin: 0 0 30px;
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.68;
}

.domain-proof {
  padding: 30px 0 32px;
  border-top: 1px solid var(--border);
}

.domain-proof h3 {
  margin: 0 0 18px;
  color: var(--text);
  font-size: 1.32rem;
  font-weight: 650;
  line-height: 1.25;
}

.domain-proof dl {
  margin: 0;
}

.domain-proof dl div {
  display: grid;
  grid-template-columns: minmax(150px, 0.35fr) minmax(0, 1fr);
  gap: 18px;
  padding: 15px 0;
  border-top: 1px solid var(--border-light);
}

.domain-proof dt {
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.35;
  text-transform: uppercase;
}

.domain-proof dd {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.62;
}

.domain-proof dl div:last-child {
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.domain-proof dl div:last-child dt {
  color: var(--text-3);
}

.domain-proof dl div:last-child dd {
  color: var(--text-2);
}

.domain-proof .example-signal {
  background: var(--border-light);
  margin: 2px 0;
  padding: 14px 16px;
  border-top: 0;
}

.contact-inline {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
}

.contact-inline:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}

.article-body strong {
  color: var(--text);
  font-weight: 600;
}

.article-body h2 {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 60px 0 22px;
}

.article-body h2:first-child {
  margin-top: 0;
}

/* ---- Scope grid ---- */
.scope-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0 32px;
}

.scope-box {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
}

.scope-box .scope-label {
  font-weight: 600;
  color: var(--text);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.scope-box ul {
  list-style: none;
  margin: 0;
}

.scope-box li {
  padding: 6px 0;
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.5;
  padding-left: 16px;
  position: relative;
}

.scope-box li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 13px;
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
}

/* ---- Axioms ---- */
.axioms {
  list-style: none;
  counter-reset: axiom;
  margin: 20px 0 32px;
}

.axioms li {
  counter-increment: axiom;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.95rem;
  color: var(--text-2);
  line-height: 1.55;
}

.axioms li:first-child {
  border-top: 1px solid var(--border-light);
}

.axioms li::before {
  content: counter(axiom);
  display: inline-block;
  width: 24px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
}

/* ---- Failure modes ---- */
.failures {
  list-style: none;
  margin: 20px 0 32px;
}

.failures li {
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.95rem;
  color: var(--text-2);
  line-height: 1.55;
}

.failures li:first-child {
  border-top: 1px solid var(--border-light);
}

.failures li strong {
  color: var(--text);
}

/* ---- Pullquote ---- */
.pullquote {
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--accent);
  margin: 56px 0;
  padding: 28px 0 28px 24px;
  background: var(--border-light);
  border-left: 1px solid var(--border);
  border-radius: 0;
}

/* ---- Footer ---- */
.article-footer {
  padding: 32px 0 64px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.article-footer a {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.article-footer a:hover,
.article-footer a:focus-visible {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}

.article-footer .author {
  font-size: 0.78rem;
  color: var(--text-3);
  letter-spacing: 0.04em;
}

/* ---- Responsive ---- */
@media (max-width: 680px) {
  html { font-size: 16px; }

  .article-header { padding: 60px 0 40px; }

  .article-title {
    font-size: 1.78rem;
  }

  .article-lede {
    font-size: 1.14rem;
    padding-bottom: 38px;
  }

  .scope-grid {
    grid-template-columns: 1fr;
  }

  .pullquote {
    margin-left: 0;
  }

  .phase {
    margin-left: 0;
    padding: 0 0 40px 20px;
  }

  .phase-number::before {
    left: -25px;
  }

  .material-domain-group {
    padding-top: 38px;
  }

  .material-section {
    padding: 30px 0;
  }

  .material-page .article-body > h2 {
    margin-top: 2.45rem;
  }

  .domain-proof dl div {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .domain-proof .example-signal {
    padding: 14px;
  }
}

/* ---- Domain comparison (where-intelligence-should-live) ---- */
.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
  margin: 2.25rem 0 3rem;
}

.comparison-column {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}

.comparison-column h3 {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.comparison-column ul {
  padding-left: 1.1rem;
  margin: 0;
}

.comparison-column li {
  margin-bottom: 0.8rem;
  color: var(--text-2);
  line-height: 1.6;
}

.domain-index {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.75rem;
  margin: 2rem 0 2.75rem;
}

.domain-index a {
  display: inline-block;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-2);
  text-decoration: none;
  border-radius: 4px;
}

.domain-index a:hover {
  color: var(--text);
  border-color: var(--text);
}

.domain-list {
  margin: 2.5rem 0 3.5rem;
}

.domain-block {
  padding: 2rem 0;
  border-top: 1px solid var(--border-light);
}

.domain-block:last-child {
  border-bottom: 1px solid var(--border-light);
}

.domain-block h3 {
  margin: 0 0 0.65rem;
  font-size: 1.45rem;
  line-height: 1.2;
  color: var(--text);
}

.domain-summary {
  font-size: 1.08rem;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 1.1rem;
}

.domain-block p {
  margin-bottom: 0.85rem;
}

.domain-block p:last-child {
  margin-bottom: 0;
}

.domain-block strong {
  font-weight: 600;
}

.domain-note {
  color: var(--text-3);
  font-size: 0.95rem;
  border-left: 2px solid var(--border);
  padding-left: 1rem;
  margin-top: 1.25rem;
}

@media (max-width: 720px) {
  .comparison-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .domain-index {
    gap: 0.45rem;
  }

  .domain-index a {
    font-size: 0.82rem;
  }

  .domain-block {
    padding: 1.7rem 0;
  }
}

/* ---- Phase blocks (how-the-work-starts) ---- */
.phase {
  margin: 0 0 0 16px;
  padding: 0 0 56px 32px;
  border-left: 1px solid var(--border);
  position: relative;
}
.phase:first-of-type {
  margin-top: 32px;
}
.phase:last-of-type {
  padding-bottom: 0;
  margin-bottom: 48px;
}
.phase-number {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
  position: relative;
}
.phase-number::before {
  content: '';
  position: absolute;
  left: -37px;
  top: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--accent);
}
.phase-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.3;
}
.phase-body {
  font-size: 0.95rem;
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 0;
}
/* ---- Print ---- */
@media print {
  :root {
    --bg: #fff; --surface: #fff; --text: #111;
    --text-2: #444; --text-3: #888; --accent: #1a3a5c;
    --border: #ddd; --border-light: #eee;
  }
  html { font-size: 10.5pt; }
  .back-link { display: none; }
  .article-footer { display: none; }
  a { color: inherit; text-decoration: none; }
}
