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

:root {
  --bg:        #faf9f7;
  --bg-alt:    #f0ede8;
  --border:    #ddd8d0;
  --ink:       #1a1814;
  --ink-muted: #6b6560;
  --accent:    #7a5f00;
  --accent-lt: #c9a227;
  --link:      #8a6a00;
  --max-w:     720px;
  --font-body: 'Georgia', 'Times New Roman', serif;
  --font-ui:   system-ui, -apple-system, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.75;
  animation: fadeIn 2.2s ease-in;
}

/* ── Layout ── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Nav ── */
nav {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

nav .container {
  max-width: 100%;
  padding-left: 2rem;
  padding-right: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  padding-bottom: 1rem;
  gap: 1.5rem;
  flex-wrap: nowrap;
}

.nav-brand {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 1.2rem;
  list-style: none;
  flex-wrap: nowrap;
}

.nav-links a {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 0.15s;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active { color: var(--accent); }

.nav-links a.active { border-bottom: 1px solid var(--accent); }

/* ── Hero ── */
.hero {
  padding: 5rem 0 3.5rem;
  border-bottom: 1px solid var(--border);
}

.hero-eyebrow {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: normal;
  line-height: 1.2;
  margin-bottom: 1.2rem;
  color: var(--ink);
}

.hero-lead {
  font-size: 1.15rem;
  color: var(--ink-muted);
  max-width: 600px;
  margin-bottom: 2rem;
}

/* ── Page Header (inner pages) ── */
.page-header {
  padding: 3.5rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

.page-header h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: normal;
  margin-bottom: 0.6rem;
}

.page-header p {
  color: var(--ink-muted);
  font-size: 1.05rem;
}

/* ── Prose ── */
.prose { padding: 3rem 0; }

.prose h2 {
  font-size: 1.4rem;
  font-weight: normal;
  margin: 2.8rem 0 0.8rem;
  color: var(--accent);
}

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

.prose h3 {
  font-size: 1.1rem;
  font-weight: bold;
  margin: 2rem 0 0.5rem;
}

.prose p { margin-bottom: 1.2rem; }

.prose ul, .prose ol {
  padding-left: 1.4rem;
  margin-bottom: 1.2rem;
}

.prose li { margin-bottom: 0.35rem; }

.prose blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.5rem 0 0.5rem 1.2rem;
  margin: 1.8rem 0;
  color: var(--ink-muted);
  font-style: italic;
}

.prose blockquote cite {
  display: block;
  font-size: 0.875rem;
  font-style: normal;
  margin-top: 0.4rem;
  color: var(--accent);
}

a { color: var(--link); }
a:hover { color: var(--accent); }

/* ── Cards ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
  margin: 2rem 0;
}

.card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.4rem;
}

.card h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.card p {
  font-size: 0.9rem;
  color: var(--ink-muted);
  margin: 0;
}

/* ── Concept Sections ── */
.concept {
  padding: 2.2rem 0;
  border-bottom: 1px solid var(--border);
}

.concept:last-child { border-bottom: none; }

.concept-tag {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-lt);
  margin-bottom: 0.5rem;
}

.concept h2 {
  font-size: 1.35rem;
  font-weight: normal;
  margin-bottom: 0.8rem;
  color: var(--ink);
}

/* ── FAQ ── */
.faq-item {
  padding: 1.8rem 0;
  border-bottom: 1px solid var(--border);
}

.faq-item:last-child { border-bottom: none; }

.faq-item h3 {
  font-size: 1.05rem;
  margin-bottom: 0.7rem;
}

.faq-item p {
  color: var(--ink-muted);
  margin: 0;
}

/* ── Book Cards ── */
.book-list {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  margin: 2rem 0;
}

.book-card {
  display: flex;
  gap: 1.4rem;
  align-items: stretch;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.4rem;
}

.book-cover {
  flex-shrink: 0;
  width: 200px;
  height: 280px;
  background: var(--border);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid var(--border);
  box-shadow: 2px 3px 8px rgba(0,0,0,0.12);
}

.book-cover-placeholder {
  width: 72px;
  height: 100px;
  background: var(--accent);
  border-radius: 3px;
  flex-shrink: 0;
  opacity: 0.15;
}

.book-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-bottom: 1.4rem;
}


.book-info h3 {
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.book-author {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--accent-lt);
  margin-bottom: 0.5rem;
}

.book-desc {
  font-size: 0.9rem;
  color: var(--ink-muted);
  margin-bottom: 0.8rem;
  line-height: 1.5;
}

.book-tag {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--border);
  color: var(--ink-muted);
  border-radius: 20px;
  padding: 0.2rem 0.6rem;
  margin-right: 0.3rem;
  margin-bottom: 0.6rem;
}

.book-tag.primary {
  background: var(--accent-lt);
  color: #fff;
}

.btn-affiliate {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 700;
  background: var(--accent-lt);
  color: #1a1814;
  text-decoration: none;
  padding: 0.45rem 1rem;
  border-radius: 4px;
  border: 1px solid #b8920a;
  transition: background 0.15s, color 0.15s;
  margin-top: 0.4rem;
}

.btn-affiliate:hover { background: #e0b830; color: #1a1814; border-color: #e0b830; }

.btn-listen {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  background: transparent;
  color: var(--accent-lt);
  text-decoration: none;
  padding: 0.45rem 1rem;
  border-radius: 4px;
  border: 1px solid var(--accent-lt);
  transition: background 0.15s, color 0.15s;
  margin-top: 0.4rem;
}

.btn-listen:hover { background: var(--accent-lt); color: #1a1814; }

.btn-kindle {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  background: #fef9ec;
  color: var(--accent);
  text-decoration: none;
  padding: 0.45rem 1rem;
  border-radius: 4px;
  border: 1px solid var(--accent-lt);
  transition: background 0.15s, color 0.15s;
  margin-top: 0.4rem;
}
.btn-kindle:hover { background: var(--accent-lt); color: #1a1814; }

.btn-cd {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  background: transparent;
  color: var(--ink-muted);
  text-decoration: none;
  padding: 0.45rem 1rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  transition: background 0.15s, color 0.15s;
  margin-top: 0.4rem;
}
.btn-cd:hover { background: var(--bg-alt); color: var(--ink); border-color: var(--ink-muted); }

.btn-hardcover {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 0.45rem 1rem;
  border-radius: 4px;
  border: 1px solid #5a4400;
  transition: background 0.15s, color 0.15s;
  margin-top: 0.4rem;
}
.btn-hardcover:hover { background: #5a4400; color: #fff; border-color: #3a2c00; }

.book-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-top: auto; }

.affiliate-note {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--ink-muted);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.8rem 1rem;
  margin-bottom: 2rem;
}

/* ── Link Cards (Websites & Videos) ── */
.link-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin: 0 0 2rem;
}

.link-card {
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.1rem 1.3rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.link-card:hover {
  border-color: var(--accent);
  background: var(--bg);
  color: inherit;
}

.link-card-icon {
  font-size: 1.3rem;
  color: var(--accent-lt);
  flex-shrink: 0;
  margin-top: 0.15rem;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.link-card-icon img {
  width: 20px;
  height: 20px;
  border-radius: 3px;
}

.link-card--video .link-card-icon {
  color: #c0392b;
}

.link-card-body h3 {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
  color: var(--ink);
}

.link-card:hover .link-card-body h3 {
  color: var(--accent);
}

.link-card-url {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--accent-lt);
  margin-bottom: 0.35rem;
}

.link-card--video .link-card-url {
  color: #c0392b;
  opacity: 0.8;
}

.link-card-desc {
  font-size: 0.88rem;
  color: var(--ink-muted);
  margin: 0;
  line-height: 1.5;
}

/* ── CTA ── */
.cta-section {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 3rem 0;
  text-align: center;
}

.cta-section h2 {
  font-size: 1.4rem;
  font-weight: normal;
  margin-bottom: 0.6rem;
}

.cta-section p {
  color: var(--ink-muted);
  margin-bottom: 1.5rem;
}

.btn {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.65rem 1.5rem;
  border-radius: 4px;
  transition: all 0.15s;
  margin: 0.3rem;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: var(--accent-lt); color: #fff; }

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-secondary:hover { background: var(--accent); color: #fff; }

/* ── Nav highlight ── */
.intro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin: 2.5rem 0;
}

.intro-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.2rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.intro-card:hover {
  border-color: var(--accent);
  background: var(--bg-alt);
  color: inherit;
}

.intro-card-icon {
  font-size: 1.5rem;
  margin-bottom: 0.6rem;
}

.intro-card h3 {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--accent);
}

.intro-card p {
  font-size: 0.83rem;
  color: var(--ink-muted);
  margin: 0;
  line-height: 1.4;
}

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 2rem;
}

footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

footer p {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--ink-muted);
}

footer a {
  color: var(--ink-muted);
  text-decoration: none;
}

footer a:hover { color: var(--accent); }

/* ── Diagrams ── */
.diagram {
  margin: 2rem 0 1.5rem;
  padding: 0;
}
.diagram svg {
  width: 100%;
  display: block;
  margin: 0 auto;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.diagram figcaption {
  text-align: center;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-top: 0.75rem;
  font-style: italic;
}

/* ── Responsive ── */
@media (max-width: 520px) {
  .book-card { flex-direction: column; }
  .book-cover-placeholder { width: 100%; height: 60px; border-radius: 3px 3px 0 0; }
  .book-cover { width: 100%; height: 220px; border-radius: 3px 3px 0 0; }
  .book-cover img { object-position: center center; }
  .book-actions > a { flex: 1 1 calc(50% - 4px); min-height: 44px; text-align: center; display: flex; align-items: center; justify-content: center; }
}

/* ── Back-to-top ── */
#back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--accent-lt);
  color: var(--accent-lt);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, background 0.15s;
  z-index: 100;
}
#back-to-top.visible { opacity: 1; pointer-events: auto; }
#back-to-top:hover { background: var(--accent-lt); color: #fff; }

/* ── Hamburger ── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 100;
  flex-shrink: 0;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: all 0.25s ease;
}

.hamburger.open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
}
.hamburger.open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 0.5rem 0;
    z-index: 99;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    flex-wrap: nowrap;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
    white-space: normal;
  }

  .nav-links li:last-child a {
    border-bottom: none;
  }

  nav {
    position: relative;
  }

  nav .container {
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* ── Page fade-in ── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Concept Sections (new pattern, mirrors .concept) ── */
.concept-section {
  padding: 2.2rem 0;
  border-bottom: 1px solid var(--border);
}

.concept-section:last-child { border-bottom: none; }

.section-label {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-lt);
  margin-bottom: 0.5rem;
}

.concept-section h2 {
  font-size: 1.35rem;
  font-weight: normal;
  margin-bottom: 0.8rem;
  color: var(--ink);
}

.concept-section p { margin-bottom: 1rem; }

.concept-list {
  padding-left: 1.4rem;
  margin: 1.2rem 0;
}

.concept-list li {
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.65;
  margin-bottom: 0.5rem;
}

/* ── Page subtitle ── */
.page-subtitle {
  color: var(--ink-muted);
  font-size: 1rem;
  max-width: 600px;
  line-height: 1.65;
}

/* ── Four Competing Positions grid ── */
.positions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
  margin: 2rem 0;
}

.position-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.4rem;
  background: var(--bg-alt);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.position-card:hover {
  border-color: var(--accent-lt);
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}

.position-highlight {
  border-color: var(--accent);
  background: var(--bg);
}

.position-symbol {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.position-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.position-fundamental {
  font-size: 0.82rem;
  color: var(--ink-muted);
  margin-bottom: 0.5rem;
}

.position-claim {
  font-size: 0.88rem;
  color: var(--ink);
  line-height: 1.55;
  margin-bottom: 0.8rem;
}

.position-faces {
  font-size: 0.82rem;
  color: var(--ink-muted);
  font-style: italic;
  border-top: 1px solid var(--border);
  padding-top: 0.7rem;
  margin-bottom: 0;
}

.position-faces span {
  color: var(--ink);
  font-style: normal;
}

.position-idealist .position-faces {
  color: var(--accent);
}

.diagram-caption {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--ink-muted);
  text-align: center;
  font-style: italic;
  margin-top: 0.5rem;
}

@media (max-width: 580px) {
  .positions-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Inline blockquote ── */
.inline-quote {
  border-left: 3px solid var(--accent);
  padding: 0.5rem 0 0.5rem 1.2rem;
  margin: 1.8rem 0;
  color: var(--ink-muted);
  font-style: italic;
}

.inline-quote p {
  font-style: italic;
  color: var(--ink-muted);
  margin-bottom: 0.3rem;
  line-height: 1.6;
}

.inline-quote cite {
  display: block;
  font-size: 0.875rem;
  font-style: normal;
  margin-top: 0.4rem;
  color: var(--accent);
}

/* ── Core thesis pull quote (home.html) ── */
.core-thesis {
  border-left: 3px solid var(--accent);
  padding: 0.5rem 0 0.5rem 1.2rem;
  margin: 2.5rem 0;
  color: var(--ink-muted);
  font-style: italic;
}

.core-thesis p {
  font-style: italic;
  color: var(--ink);
  line-height: 1.65;
  margin-bottom: 0.5rem;
}

.core-thesis cite {
  display: block;
  font-size: 0.875rem;
  font-style: normal;
  margin-top: 0.4rem;
  color: var(--accent);
  font-family: var(--font-ui);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
