/* =========================================================
   R.E.C.U.R.S.E. Framework — stylesheet
   ========================================================= */

/* === Custom Properties === */
:root {
  --bg:       #FAFAF8;
  --text:     #1C1C1C;
  --accent:   #2B4EAC;
  --divider:  #E8E8E5;
  --muted:    #6B6B6B;

  --font-ui:      'Inter', system-ui, -apple-system, sans-serif;
  --font-article: 'Lora', Georgia, 'Times New Roman', serif;
  --max-width:    740px;
}

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

/* === Base === */
html {
  font-size: 19px;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-article);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
  text-decoration: underline;
}

/* === Reading Progress Bar === */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background-color: var(--accent);
  z-index: 1000;
  transition: width 80ms linear;
  pointer-events: none;
}

/* === Site Header === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg);
  border-bottom: 1px solid var(--divider);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-family: var(--font-ui);
  font-size: 0.67rem;
  font-variant: small-caps;
  letter-spacing: 0.14em;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

/* === Main Content === */
.main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* === Article Header === */
.article-header {
  padding: 4.5rem 0 3rem;
  border-bottom: 1px solid var(--divider);
  margin-bottom: 3.5rem;
}

.article-title {
  font-family: var(--font-article);
  font-size: 2.5rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 0.65rem;
}

.article-subtitle {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 400;
  margin-bottom: 2.25rem;
  letter-spacing: 0.01em;
}

.article-byline {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.byline-name {
  font-family: var(--font-ui);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text);
}

.byline-name a {
  color: var(--accent);
}

.byline-role {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--muted);
}

/* === Article Body — Base Typography === */
.article-body p {
  margin-bottom: 1.5rem;
}

.article-body ul,
.article-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.article-body li {
  margin-bottom: 0.4rem;
}

/* Pivotal thesis line */
.article-crux {
  font-style: italic;
  font-size: 1.1rem;
  text-align: center;
  margin: 2.25rem 0;
  color: var(--text);
}

/* === Section Headings === */
.article-body h2 {
  font-family: var(--font-ui);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-top: 0;
  margin-bottom: 1.25rem;
}

.article-body h3 {
  font-family: var(--font-ui);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  margin-top: 2.75rem;
  margin-bottom: 0.9rem;
}

/* === Layer Titles (eyebrow + name) === */
.layer-title {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 1.5rem !important;
}

.layer-num {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

/* === Letter Labels (R, E, C, U, R, S, E) === */
.letter-label {
  color: var(--accent);
  font-weight: 700;
}

/* === Framework Diagram === */
.framework-diagram {
  margin: 2rem 0 2rem;
  text-align: center;
}

.framework-diagram img {
  max-width: 100%;
  height: auto;
  display: inline-block;
  border-radius: 4px;
}

/* === Scenario Blockquotes === */
blockquote.scenario {
  margin: 2rem 0;
  padding: 1.1rem 1.5rem;
  border-left: 3px solid var(--accent);
  background-color: rgba(43, 78, 172, 0.03);
  font-size: 0.91rem;
  line-height: 1.75;
  font-style: normal;
}

blockquote.scenario p {
  margin-bottom: 0.8rem;
}

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

/* === Input / Output Metadata === */
.io-meta {
  margin: 1.5rem 0 2.25rem;
  font-family: var(--font-ui);
  font-size: 0.76rem;
  line-height: 1.6;
  color: var(--muted);
}

.io-meta p {
  margin-bottom: 0.2rem;
}

.io-label {
  font-weight: 600;
  color: var(--text);
  margin-right: 0.45rem;
}

/* === Horizontal Rules === */
hr {
  border: none;
}

hr.section-rule {
  border-top: 1px solid var(--divider);
  margin: 3rem 0;
}

hr.layer-rule {
  border-top: 2px solid var(--divider);
  margin: 4rem 0;
}

/* === Author Note === */
.author-note {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem 4.5rem;
}

.author-note-inner {
  border-top: 1px solid var(--divider);
  padding-top: 2.5rem;
}

.author-note-label {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 1rem;
}

.author-note-inner > p {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 0.8rem;
}

.author-linkedin a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-ui);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--accent);
}

.author-linkedin a:hover {
  text-decoration: underline;
}

.author-newsletter em {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
}

/* === LinkedIn Icon === */
.linkedin-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  vertical-align: middle;
}

/* === Footer === */
.site-footer {
  border-top: 1px solid var(--divider);
  padding: 2.5rem 1.5rem 3rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--muted);
}

.footer-inner a {
  color: var(--muted);
  display: flex;
  align-items: center;
  transition: color 0.15s ease;
}

.footer-inner a:hover {
  color: var(--accent);
  text-decoration: none;
}

.footer-inner .linkedin-icon {
  width: 17px;
  height: 17px;
}

/* === Responsive — Tablet === */
@media (max-width: 768px) {
  html {
    font-size: 18px;
  }

  .article-header {
    padding: 3.5rem 0 2.5rem;
    margin-bottom: 3rem;
  }

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

  hr.layer-rule {
    margin: 3.5rem 0;
  }
}

/* === Responsive — Mobile === */
@media (max-width: 480px) {
  html {
    font-size: 17px;
  }

  .header-inner {
    padding: 0.75rem 1.25rem;
  }

  .main-content {
    padding: 0 1.25rem;
  }

  .article-header {
    padding: 2.5rem 0 2rem;
    margin-bottom: 2.25rem;
  }

  .article-title {
    font-size: 1.75rem;
    letter-spacing: -0.015em;
  }

  .article-body h2 {
    font-size: 1.15rem;
  }

  blockquote.scenario {
    padding: 1rem 1.1rem;
    font-size: 0.89rem;
  }

  .author-note {
    padding: 0 1.25rem 3rem;
  }

  hr.layer-rule {
    margin: 3rem 0;
  }

  hr.section-rule {
    margin: 2.5rem 0;
  }
}
