/* Architected Intelligence: site styles (see style_guide.md) */
:root {
  --gold: #e8a020;
  --gold-light: #f5c95a;
  --gold-pale: #fff3dc;
  --sand: #fad38a;
  --text: #1a1a1a;
  --body: #4a4a4a;
  --muted: #888888;
  --surface: #f7f6f3;
  --white: #ffffff;
  --border: #e0ddd6;
  --font-serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-sans: "DM Sans", system-ui, sans-serif;
  --space-section: clamp(4rem, 10vw, 7rem);
  --space-block: clamp(2rem, 5vw, 3.5rem);
  --max-read: 38rem;
  --max-wide: 72rem;
  /* Subpage reading column (chapter digests + hub) */
  --subpage-measure: 42rem;
  --subpage-measure-wide: 48rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--body);
  background: var(--surface);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
  background: var(--surface);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--text);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.75rem;
  padding: 0.5rem 1rem;
  background: var(--gold);
  color: var(--text);
  z-index: 100;
}

.skip-link:focus {
  left: 0.75rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 246, 243, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 0.5px solid var(--border);
}

.site-header__inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 1rem clamp(1.25rem, 4vw, 2rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-logo {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
}

.site-logo:hover {
  color: var(--text);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  justify-content: flex-end;
}

.site-nav a {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--gold);
}

.site-nav a:hover {
  color: var(--text);
}

/* Typography */
h1,
h2,
.section-label {
  font-family: var(--font-serif);
  color: var(--text);
  font-weight: 600;
}

h1 {
  font-size: clamp(2.75rem, 7vw, 4.25rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
}

h2 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.1;
  margin: 0 0 var(--space-block);
}

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.75rem;
  font-family: var(--font-sans);
}

.lead {
  font-size: 1.125rem;
  line-height: 1.7;
  max-width: var(--max-read);
  margin: 0;
}

/* Hero */
.hero {
  padding: var(--space-section) clamp(1.25rem, 4vw, 2rem);
  background: var(--white);
}

.hero__grid {
  max-width: var(--max-wide);
  margin: 0 auto;
  display: grid;
  gap: clamp(2.5rem, 6vw, 4rem);
  align-items: center;
}

@media (min-width: 900px) {
  .hero__grid {
    grid-template-columns: 1fr minmax(220px, 340px);
  }
}

.hero__byline {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.hero__subtitle {
  font-family: var(--font-sans);
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  line-height: 1.55;
  color: var(--gold);
  font-weight: 500;
  max-width: 32rem;
  margin: 0 0 1.75rem;
}

.hero__book-cta {
  margin: 0.25rem 0 0;
}

.hero__book-cta-link {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--gold);
  border-bottom: 1.5px solid rgba(232, 160, 32, 0.45);
  transition: color 0.2s, border-color 0.2s;
}

.hero__book-cta-link:hover {
  color: var(--text);
  border-color: var(--text);
}

.hero__cover-link {
  display: block;
  width: fit-content;
  margin: 0 auto;
  border-radius: 4px;
  outline-offset: 4px;
}

.hero__cover-link:focus-visible {
  outline: 2px solid var(--gold);
}

.hero__cover {
  border-radius: 4px;
  box-shadow:
    0 2px 0 var(--border),
    0 24px 48px rgba(26, 26, 26, 0.08);
  vertical-align: middle;
}

/* Bands */
.band {
  padding: var(--space-section) clamp(1.25rem, 4vw, 2rem);
}

.band--surface {
  background: var(--surface);
}

.band--white {
  background: var(--white);
}

.band__inner {
  max-width: var(--max-wide);
  margin: 0 auto;
}

/* Framework strip */
.framework-strip {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-top: 2.5rem;
}

.framework-chip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  background: var(--white);
  border: 0.5px solid var(--border);
  border-radius: 2px;
  text-decoration: none;
  color: var(--body);
  font-size: 0.9375rem;
  font-weight: 500;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.framework-chip:hover {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold);
  color: var(--text);
}

.framework-chip__num {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--white);
  background: var(--gold);
  border-radius: 50%;
  font-family: var(--font-sans);
}

/* Component sections */
.component {
  padding: var(--space-section) clamp(1.25rem, 4vw, 2rem);
  border-top: 0.5px solid var(--border);
}

.component:nth-of-type(even) {
  background: var(--white);
}

.component:nth-of-type(odd) {
  background: var(--surface);
}

.component__inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  display: grid;
  gap: clamp(1.5rem, 4vw, 2.5rem);
}

@media (min-width: 768px) {
  .component__inner {
    grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
    align-items: start;
  }
}

.component__visual {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.component__title-block h2 {
  margin-bottom: 0.5rem;
}

.component__hook {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  color: var(--gold);
  margin: 0 0 1.25rem;
  line-height: 1.5;
}

.component__body p {
  margin: 0 0 1rem;
  max-width: 48rem;
}

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

/* Framework component icons: outline (intent / people / signal) + gold (systems) */
.component-icon {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  display: block;
}

.component-icon__stroke {
  fill: none;
  stroke: var(--text);
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.component-icon__gold {
  fill: var(--gold);
}

.component-icon__gold-mid {
  fill: var(--gold-light);
}

.component-icon__gold-soft {
  fill: var(--gold-pale);
}

.component-icon__knob {
  fill: var(--text);
  stroke: none;
}

/* Cards */
.card-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 2rem;
}

.card {
  padding: 1.5rem 1.5rem 1.65rem;
  background: var(--white);
  border: 0.5px solid var(--border);
  border-radius: 2px;
}

.card--featured {
  border: 1.5px solid var(--gold);
}

.card h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--text);
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

.card p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* CTA */
.cta {
  text-align: center;
  padding: var(--space-section) clamp(1.25rem, 4vw, 2rem);
  background: linear-gradient(180deg, var(--gold-pale) 0%, var(--surface) 100%);
  border-top: 0.5px solid var(--border);
}

.cta h2 {
  margin-bottom: 1rem;
}

.cta p {
  max-width: 28rem;
  margin: 0 auto 1.75rem;
}

.cta__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  max-width: 24rem;
  margin: 0 auto;
}

.cta__actions > .btn:not(.btn--ghost) {
  text-align: center;
}

.cta__actions-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.cta__actions-row .btn {
  flex: 1 1 10rem;
  min-width: min(100%, 10rem);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.75rem;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--white);
  background: var(--gold);
  border: 1.5px solid var(--gold);
  border-radius: 2px;
  transition:
    background 0.2s,
    color 0.2s;
}

.btn:hover {
  background: var(--text);
  border-color: var(--text);
  color: var(--white);
}

.btn--ghost {
  background: transparent;
  color: var(--gold);
}

.btn--ghost:hover {
  background: var(--white);
  color: var(--text);
  border-color: var(--border);
}

/* Footer */
.site-footer {
  flex-shrink: 0;
  padding: 2.5rem clamp(1.25rem, 4vw, 2rem);
  background: var(--white);
  border-top: 0.5px solid var(--border);
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Chapter digest + hub: full-bleed white band, centered reading measure (no side “bars”) */
.digest-page,
.chapters-hub {
  width: 100%;
  max-width: none;
  margin: 0;
  padding-top: clamp(1.75rem, 4vw, 2.75rem);
  padding-bottom: clamp(2.75rem, 7vw, 4.5rem);
  padding-inline: clamp(1.25rem, 6vw, 4rem);
  background: var(--white);
  box-sizing: border-box;
}

.digest-page > .breadcrumb,
.digest-page > .digest-meta,
.digest-page > h1,
.digest-page > section,
.digest-page > p.digest-nav-bottom {
  max-width: var(--subpage-measure);
  margin-left: auto;
  margin-right: auto;
}

.digest-page > h1 {
  margin-bottom: 0.5rem;
}

.breadcrumb {
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.breadcrumb a {
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.digest-meta {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 0.25rem;
}

.digest-section {
  margin-top: 2.25rem;
  padding-bottom: 0.25rem;
}

.digest-section + .digest-section {
  border-top: 0.5px solid var(--border);
  padding-top: 2rem;
  margin-top: 2rem;
}

.digest-heading {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  margin: 0 0 1rem;
}

.digest-bullets,
.principle-list {
  margin: 0;
  padding-left: 1.25rem;
}

.digest-bullets li,
.principle-list li {
  margin-bottom: 0.65rem;
}

.digest-bullets li:last-child,
.principle-list li:last-child {
  margin-bottom: 0;
}

.digest-teaser {
  margin-top: 2.5rem;
  padding: 1.5rem 1.5rem 1.65rem;
  background: var(--gold-pale);
  border: 1.5px solid var(--gold);
  border-radius: 4px;
}

.digest-teaser h2 {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  margin: 0 0 0.75rem;
}

.digest-teaser p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
}

.digest-nav-bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 0.5px solid var(--border);
  font-size: 0.9375rem;
}

/* In-page links from framework sections to digests */
.chapter-digest-list {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  border-top: 0.5px solid var(--border);
  padding-top: 1.25rem;
}

.chapter-digest-list li {
  margin-bottom: 0.5rem;
}

.chapter-digest-list li:last-child {
  margin-bottom: 0;
}

.chapter-digest-list a {
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.chapter-digest-list a:hover {
  text-decoration: underline;
}

.chapter-digest-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.65rem;
}

/* Chapters hub */
.chapters-hub > h1,
.chapters-hub > .chapters-hub__lead,
.chapters-hub > section.chapters-hub__group {
  max-width: var(--subpage-measure-wide);
  margin-left: auto;
  margin-right: auto;
}

.chapters-hub h1 {
  margin-bottom: 0.5rem;
}

.chapters-hub__lead {
  margin: 0 0 2.5rem;
}

.chapters-hub__group {
  margin-bottom: 2.75rem;
}

.chapters-hub__group:last-of-type {
  margin-bottom: 0;
}

.chapters-hub__group h2 {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.75rem;
  border-bottom: 0.5px solid var(--border);
  padding-bottom: 0.5rem;
}

.chapters-hub__links {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 0.5px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  background: var(--surface);
}

.chapters-hub__links li {
  border-bottom: 0.5px solid var(--border);
}

.chapters-hub__links li:last-child {
  border-bottom: none;
}

.chapters-hub__links a {
  display: block;
  padding: 0.85rem 1rem 0.9rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--body);
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.chapters-hub__links a:hover {
  background: var(--white);
  color: var(--text);
}

.chapters-hub__links span {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.9375rem;
}

.chapters-hub__note {
  display: block;
  padding: 0.85rem 1rem 0.9rem;
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 520px) {
  .chapters-hub__links a {
    padding: 0.75rem 0.85rem;
  }
}
