/* ============================================
   The Trust Plane — thetrustplane.com
   ============================================ */

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

:root {
  --color-bg: #FAF9F6;
  --color-text: #1B1B2F;
  --color-text-light: #4A4A5A;
  --color-accent: #B8926A;
  --color-accent-hover: #9A7A56;
  --color-rule: #E0DCD6;
  --color-card-bg: #FFFFFF;
  --color-card-border: #EBE7E1;
  --color-footer-bg: #1B1B2F;
  --color-footer-text: #C8C8D0;
  --font-serif: 'Source Serif 4', 'Georgia', serif;
  --font-sans: 'Inter', -apple-system, sans-serif;
  --max-width-reading: 720px;
  --max-width-content: 1080px;
  --max-width-wide: 1200px;
}

html {
  font-size: 17px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--color-accent-hover); }

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--color-text);
  line-height: 1.25;
  font-weight: 600;
}

h1 { font-size: 2.8rem; letter-spacing: -0.02em; }
h2 { font-size: 1.8rem; letter-spacing: -0.01em; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; }

p { margin-bottom: 1.25rem; }

blockquote {
  border-left: 3px solid var(--color-accent);
  padding: 0.5rem 0 0.5rem 1.5rem;
  margin: 2rem 0;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--color-text-light);
  font-style: italic;
}

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

hr {
  border: none;
  border-top: 1px solid var(--color-rule);
  margin: 3rem 0;
}

/* --- Navigation --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-rule);
}

.nav-inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-mark {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--color-accent);
}

.nav-logo:hover { color: var(--color-accent); }

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--color-text-light);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.nav-links a:hover { color: var(--color-accent); }
.nav-links a.active { color: var(--color-text); border-bottom: 2px solid var(--color-accent); padding-bottom: 2px; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  margin: 5px 0;
  transition: 0.3s;
}

/* --- Layout --- */
.container { max-width: var(--max-width-content); margin: 0 auto; padding: 0 2rem; }
.container--reading { max-width: var(--max-width-reading); margin: 0 auto; padding: 0 2rem; }
.container--wide { max-width: var(--max-width-wide); margin: 0 auto; padding: 0 2rem; }

.section { padding: 5rem 0; }
.section--sm { padding: 3rem 0; }
.section--hero { padding: 6rem 0 5rem; }
.section--alt { background: var(--color-card-bg); border-top: 1px solid var(--color-rule); border-bottom: 1px solid var(--color-rule); }

/* --- Hero --- */
.hero { max-width: var(--max-width-reading); }

.hero h1 {
  margin-bottom: 1.5rem;
}

.hero .lead {
  font-size: 1.15rem;
  color: var(--color-text-light);
  line-height: 1.75;
  margin-bottom: 2rem;
}

.hero-with-cover {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: center;
  max-width: none;
}

.hero-with-cover .hero { max-width: none; }

.hero-with-cover .hero-cover {
  max-width: 220px;
  border-radius: 4px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 3px;
  transition: all 0.2s;
  cursor: pointer;
}

.btn--primary {
  background: var(--color-text);
  color: var(--color-bg);
  border: 2px solid var(--color-text);
}

.btn--primary:hover {
  background: transparent;
  color: var(--color-text);
}

.btn--secondary {
  background: transparent;
  color: var(--color-text);
  border: 2px solid var(--color-rule);
}

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

.btn-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

/* --- Section Label --- */
.section-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 1rem;
}

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

.doctrine-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: 4px;
  padding: 1.75rem;
  transition: border-color 0.2s;
}

.doctrine-card:hover { border-color: var(--color-accent); }

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

.doctrine-card p {
  font-size: 0.95rem;
  color: var(--color-text-light);
  margin-bottom: 0;
  line-height: 1.6;
}

/* --- Loop Diagram --- */
.loop-diagram {
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: 6px;
  padding: 1.25rem 1.5rem 2rem;
  margin: 2rem 0;
  text-align: center;
}

.loop-svg {
  max-width: 580px;
  width: 100%;
  height: auto;
  margin: 0 auto;
  display: block;
}

.loop-note {
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: var(--color-text-light);
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}

/* --- Doctrine Loop (side-by-side) --- */
.doctrine-loop {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  margin-top: 2rem;
}

.doctrine-loop-visual {
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: 6px;
  padding: 1rem 0.5rem;
}

.doctrine-loop-visual .loop-svg {
  max-width: 100%;
}

.doctrine-loop-text p {
  font-size: 0.95rem;
  color: var(--color-text-light);
  margin-bottom: 0.6rem;
  line-height: 1.7;
}

/* --- Principles List --- */
.principles-list {
  list-style: none;
  counter-reset: principle;
}

.principles-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 3rem;
}

.principles-list li {
  counter-increment: principle;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--color-rule);
}

.principles-list li h3 {
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

.principles-list li h3::before {
  content: counter(principle) ".";
  display: inline-block;
  width: 1.75rem;
  color: var(--color-accent);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
}

.principles-list li p {
  margin-left: 1.75rem;
  color: var(--color-text-light);
  font-size: 0.9rem;
  margin-bottom: 0;
  line-height: 1.5;
}

/* --- TOC (Book Page) --- */
.toc {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 3rem;
  list-style: none;
  margin: 2rem 0;
  padding: 0;
  counter-reset: toc-chapter;
}

.toc li {
  counter-increment: toc-chapter;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--color-rule);
}

.toc li::before {
  content: counter(toc-chapter) ". ";
  color: var(--color-accent);
  font-weight: 600;
}

.toc li.toc-backmatter {
  counter-increment: none;
  font-style: italic;
  color: var(--color-text-light);
}

.toc li.toc-backmatter::before {
  content: none;
}

/* --- Field Notes Index --- */
.field-note-card {
  padding: 2rem 0;
  border-bottom: 1px solid var(--color-rule);
}

.field-note-card:first-child { padding-top: 0; }
.field-note-card:last-child { border-bottom: none; }

.field-note-card .date {
  font-size: 0.8rem;
  color: var(--color-accent);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.field-note-card h2 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.field-note-card h2 a { color: var(--color-text); }
.field-note-card h2 a:hover { color: var(--color-accent); }

.field-note-card .excerpt {
  color: var(--color-text-light);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.field-note-card .read-more {
  font-size: 0.88rem;
  font-weight: 600;
}

/* --- Article --- */
.article-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-rule);
}

.article-header .date {
  font-size: 0.8rem;
  color: var(--color-accent);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.article-header h1 {
  font-size: 2.2rem;
  margin-bottom: 1rem;
}

.article-header .subtitle {
  font-size: 1.15rem;
  color: var(--color-text-light);
  font-family: var(--font-serif);
  font-style: italic;
}

.article-body p {
  font-size: 1.02rem;
  line-height: 1.8;
}

.article-body h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

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

.article-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-rule);
}

/* --- Email Capture --- */
.email-capture {
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: 6px;
  padding: 2.5rem;
  margin: 2rem 0;
  text-align: center;
}

.email-capture h3 {
  margin-bottom: 0.75rem;
}

.email-capture p {
  color: var(--color-text-light);
  font-size: 0.95rem;
  max-width: 480px;
  margin: 0 auto 1.5rem;
}

.email-form {
  display: flex;
  gap: 0.75rem;
  max-width: 420px;
  margin: 0 auto;
}

.email-form input[type="email"] {
  flex: 1;
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  border: 1px solid var(--color-rule);
  border-radius: 3px;
  background: var(--color-bg);
  font-family: var(--font-sans);
  color: var(--color-text);
}

.email-form input[type="email"]:focus {
  outline: none;
  border-color: var(--color-accent);
}

.email-form button {
  padding: 0.7rem 1.5rem;
  background: var(--color-text);
  color: var(--color-bg);
  border: none;
  border-radius: 3px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background 0.2s;
}

.email-form button:hover { background: var(--color-accent-hover); }

/* --- Speaking Topics --- */
.speaking-topics {
  list-style: none;
}

.speaking-topics li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-rule);
  font-family: var(--font-serif);
  font-size: 1.05rem;
}

.speaking-topics li:last-child { border-bottom: none; }

/* --- Book Cover --- */
.book-cover {
  max-width: 280px;
  border-radius: 4px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.book-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3rem;
  align-items: start;
}

.book-hero-text h1 { font-size: 2.4rem; margin-bottom: 0.5rem; }
.book-hero-text .subtitle {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--color-text-light);
  margin-bottom: 1.5rem;
}

/* --- Footer --- */
.footer {
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  padding: 3rem 0;
  margin-top: 4rem;
}

.footer-inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-left {
  font-size: 0.82rem;
  line-height: 1.6;
}

.footer-left .tm {
  font-size: 0.78rem;
  opacity: 0.7;
}

.footer-mark {
  width: 24px;
  height: 24px;
  margin-bottom: 0.75rem;
  color: var(--color-accent);
  opacity: 0.6;
}

.footer-right {
  display: flex;
  gap: 1.5rem;
}

.footer-right a {
  color: var(--color-footer-text);
  font-size: 0.85rem;
}

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

/* --- Responsive --- */
@media (max-width: 768px) {
  html { font-size: 16px; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }

  .section { padding: 3.5rem 0; }
  .section--hero { padding: 4rem 0 3.5rem; }

  .nav-links { display: none; }
  .nav-toggle { display: block; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-rule);
    padding: 1rem 2rem;
    gap: 1rem;
  }

  .doctrine-grid { grid-template-columns: 1fr; }
  .doctrine-loop { grid-template-columns: 1fr; }
  .principles-list { grid-template-columns: 1fr; }
  .toc { grid-template-columns: 1fr; }

  .loop-steps {
    flex-direction: column;
    gap: 0.5rem;
  }

  .loop-steps .arrow {
    transform: rotate(90deg);
  }

  .hero-with-cover {
    grid-template-columns: 1fr;
  }

  .hero-with-cover .hero-cover {
    display: none;
  }

  .book-hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .book-cover {
    margin: 0 auto 2rem;
  }

  .email-form {
    flex-direction: column;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .container, .container--reading, .container--wide {
    padding: 0 1.25rem;
  }

  h1 { font-size: 1.7rem; }
  .article-header h1 { font-size: 1.8rem; }
}
