/* ==========================================
   THRESHOLDS OF THE MIND — STYLESHEET
   ========================================== */

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { line-height: 1.6; -webkit-font-smoothing: antialiased; }
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { cursor: pointer; border: none; background: none; font: inherit; }
ul, ol { list-style: none; }
[hidden] { display: none !important; }

/* === TOKENS === */
:root {
  /* Colors */
  --dark:          #1c2135;
  --dark-mid:      #252b42;
  --gold:          #c8962a;
  --gold-dark:     #a67820;
  --white:         #ffffff;
  --off-white:     #f9f7f4;
  --ink:           #1c1a18;
  --muted:         #6e6560;
  --border:        #e4dfd8;

  /* Solid text colors for dark backgrounds */
  --on-dark:       #ffffff;
  --on-dark-sub:   #c8c0b4;
  --on-dark-muted: #92877c;

  /* Font families */
  --display: 'Playfair Display', Georgia, serif;
  --serif:   'Lora', Georgia, serif;
  --sans:    'Inter', system-ui, -apple-system, sans-serif;

  /* 5-size font scale — minimum 18px */
  --fs-1: 1.125rem;                    /* 18px */
  --fs-2: 1.25rem;                     /* 20px */
  --fs-3: 1.5rem;                      /* 24px */
  --fs-4: 2rem;                        /* 32px */
  --fs-5: clamp(2.75rem, 6vw, 4.5rem); /* h1 only */

  /* Layout */
  --nav-h:         68px;
  --container-max: 1100px;
  --section-pad:   5rem;
  --reveal-dur:    0.65s;
}

/* === ACCESSIBILITY === */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.skip-nav {
  position: absolute;
  top: -100%; left: 1rem;
  background: var(--gold);
  color: var(--dark);
  padding: 0.5rem 1rem;
  font-family: var(--sans);
  font-weight: 700;
  z-index: 200;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
}
.skip-nav:focus { top: 0; }

/* === BASE TYPOGRAPHY === */
body {
  font-family: var(--serif);
  font-size: var(--fs-1);
  color: var(--ink);
  background: var(--white);
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
}

h1 { font-size: var(--fs-5); font-weight: 900; }
h2 { font-size: var(--fs-4); margin-bottom: 1.5rem; }
h3 { font-size: var(--fs-3); font-weight: 700; margin-bottom: 0.75rem; }

p { margin-bottom: 1.375rem; }
p:last-child { margin-bottom: 0; }

em { font-style: italic; }

blockquote {
  font-family: var(--display);
  font-size: var(--fs-3);
  font-style: italic;
  font-weight: 400;
  color: var(--ink);
  border-left: 3px solid var(--gold);
  padding-left: 1.5rem;
  margin: 2rem 0;
  line-height: 1.5;
}

.text-link {
  color: var(--gold-dark);
  font-family: var(--sans);
  font-weight: 600;
  font-size: var(--fs-1);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.text-link:hover { color: var(--gold); }

/* === CONTAINER === */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: var(--fs-1);
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
  white-space: nowrap;
}

.btn-cta {
  background: var(--gold);
  color: var(--dark);
  padding: 1rem 2rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.btn-cta:hover {
  background: var(--gold-dark);
  color: var(--white);
  transform: translateY(-1px);
}

.btn-cta--light {
  background: var(--white);
  color: var(--dark);
}
.btn-cta--light:hover {
  background: var(--gold);
  color: var(--dark);
}

.btn-nav {
  background: var(--gold);
  color: var(--dark);
  padding: 0.625rem 1.25rem;
}
.btn-nav:hover { background: var(--gold-dark); color: var(--white); }

/* === HEADER === */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(28, 33, 53, 0.97);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid #252b42;
  z-index: 100;
}

.header-inner {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 20px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.site-logo {
  font-family: var(--display);
  font-size: var(--fs-2);
  font-weight: 700;
  font-style: italic;
  color: var(--on-dark);
  text-decoration: none;
  flex-shrink: 0;
  letter-spacing: 0.01em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-left: auto;
}

.site-nav ul {
  display: flex;
  gap: 2rem;
}

.site-nav ul a {
  font-family: var(--sans);
  font-size: var(--fs-1);
  font-weight: 500;
  color: var(--on-dark-sub);
  text-decoration: none;
}
.site-nav ul a:hover { color: var(--on-dark); }

/* === NAV TOGGLE === */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  margin-left: auto;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--on-dark);
  border-radius: 2px;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* === MOBILE MENU === */
.mobile-menu {
  background: var(--dark-mid);
  border-top: 1px solid #2e3550;
  padding: 1.5rem 20px 2rem;
}
.mobile-menu ul {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.mobile-menu ul a {
  font-family: var(--sans);
  font-size: var(--fs-1);
  font-weight: 500;
  color: var(--on-dark-sub);
  text-decoration: none;
}
.mobile-menu .btn {
  margin-top: 0.5rem;
  width: 100%;
}

/* === MAIN === */
main { padding-top: var(--nav-h); }

/* === SECTIONS === */
section { padding: var(--section-pad) 20px; }

/* === HERO === */
.section-hero {
  background: var(--dark);
  color: var(--on-dark);
  text-align: center;
  padding-top: 6.5rem;
  padding-bottom: 7rem;
}

.section-hero .container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.section-hero h1 {
  color: var(--on-dark);
  max-width: 820px;
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
}

.hero-eyebrow {
  font-family: var(--sans);
  font-size: var(--fs-1);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0 !important;
}

.hero-author {
  font-family: var(--display);
  font-size: var(--fs-2);
  font-style: italic;
  color: var(--on-dark-sub);
  margin-bottom: 1.5rem;
}

.hero-rule {
  width: 60px;
  height: 2px;
  background: var(--gold);
  border: none;
  margin: 1.5rem auto;
}

.hero-sub {
  font-family: var(--serif);
  font-size: var(--fs-2);
  color: var(--on-dark-sub);
  max-width: 640px;
  line-height: 1.7;
  font-style: italic;
  margin-bottom: 0;
}

/* === OPT-IN FORM === */
.opt-in-form {
  margin-top: 2.5rem;
  width: 100%;
  max-width: 560px;
}

.email-form { width: 100%; }

.form-row {
  display: flex;
  gap: 6px;
  background: var(--white);
  border-radius: 4px;
  padding: 6px;
  box-shadow: 0 4px 28px rgba(0, 0, 0, 0.35);
}

.form-row input[type="email"] {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  padding: 0.875rem 1rem;
  font-family: var(--sans);
  font-size: var(--fs-1);
  color: var(--ink);
  background: transparent;
}
.form-row input[type="email"]::placeholder { color: #94a3b8; }

.form-note {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--sans);
  font-size: var(--fs-1);
  color: var(--on-dark-muted);
  margin-top: 0.75rem;
  margin-bottom: 0;
  justify-content: center;
}
.form-note svg { flex-shrink: 0; }

/* === SECTION BODY === */
.section-body { background: var(--white); }
.section-alt  { background: var(--off-white); }

.section-body p,
.section-alt  p {
  line-height: 1.8;
  color: var(--ink);
}

/* === CHAPTERS LIST === */
.chapters-list {
  margin-top: 1rem;
}

.chapters-list li {
  display: flex;
  gap: 2rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.chapters-list li:first-child { border-top: 1px solid var(--border); }

.chapter-num {
  font-family: var(--display);
  font-size: var(--fs-4);
  font-weight: 900;
  color: var(--gold);
  flex-shrink: 0;
  line-height: 1;
  width: 3.5rem;
  padding-top: 0.1rem;
}

.chapter-body h3 {
  font-family: var(--display);
  font-size: var(--fs-3);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.chapter-body p {
  font-size: var(--fs-1);
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 0;
}

/* === AUTHOR SECTION === */
.author-rule {
  width: 40px;
  height: 2px;
  background: var(--gold);
  border: none;
  margin: 0 0 2rem;
}

/* === FAQ === */
.faq-list {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--white);
}

.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }

.faq-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.375rem 1.5rem;
  text-align: left;
  font-family: var(--sans);
  font-size: var(--fs-1);
  font-weight: 600;
  color: var(--ink);
}
.faq-toggle:hover { background: var(--off-white); }
.faq-toggle[aria-expanded="true"] { color: var(--gold-dark); }

.faq-icon {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  position: relative;
}
.faq-icon::before,
.faq-icon::after {
  content: '';
  position: absolute;
  background: var(--muted);
  border-radius: 2px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
.faq-icon::before { width: 10px; height: 1.5px; }
.faq-icon::after  { width: 1.5px; height: 10px; transition: transform 0.2s ease, opacity 0.2s ease; }
.faq-toggle[aria-expanded="true"] .faq-icon::after { transform: translate(-50%, -50%) rotate(90deg); opacity: 0; }

.faq-item dd {
  padding: 0 1.5rem 1.5rem;
  font-size: var(--fs-1);
  color: var(--muted);
  line-height: 1.75;
}
.faq-item dd p { margin-bottom: 0; }

/* === CTA SECTION === */
.section-cta {
  background: var(--dark);
  color: var(--on-dark);
  text-align: center;
}

.section-cta h2 {
  font-family: var(--display);
  color: var(--on-dark);
}

.cta-sub {
  font-family: var(--serif);
  font-size: var(--fs-2);
  font-style: italic;
  color: var(--on-dark-sub);
  max-width: 560px;
  margin-inline: auto;
  margin-bottom: 0;
  line-height: 1.65;
}

.section-cta .opt-in-form { margin-inline: auto; }

/* === FOOTER === */
.site-footer {
  background: #111318;
  padding: 3rem 20px;
}

.footer-inner {
  max-width: var(--container-max);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.footer-brand {
  font-family: var(--display);
  font-style: italic;
  font-size: var(--fs-2);
  color: var(--on-dark);
  margin-bottom: 0;
}

.footer-nav {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-nav a {
  font-family: var(--sans);
  font-size: var(--fs-1);
  font-weight: 500;
  color: var(--on-dark-muted);
  text-decoration: none;
}
.footer-nav a:hover { color: var(--on-dark); }

.footer-legal {
  font-family: var(--sans);
  font-size: var(--fs-1);
  color: var(--on-dark-muted);
  margin-bottom: 0;
}

.footer-disclaimer {
  font-family: var(--sans);
  font-size: var(--fs-1);
  color: var(--on-dark-muted);
  max-width: 700px;
  line-height: 1.55;
  margin-bottom: 0;
}

/* === SCROLL REVEAL === */
.html-loaded [data-reveal] {
  opacity: 0;
  transition: opacity var(--reveal-dur) ease, transform var(--reveal-dur) ease;
}
.html-loaded [data-reveal="up"]    { transform: translateY(24px); }
.html-loaded [data-reveal="left"]  { transform: translateX(-28px); }
.html-loaded [data-reveal="right"] { transform: translateX(28px); }

.html-loaded [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

.html-loaded [data-delay="1"] { transition-delay: 0.15s; }
.html-loaded [data-delay="2"] { transition-delay: 0.3s; }
.html-loaded [data-delay="3"] { transition-delay: 0.45s; }

/* === RESPONSIVE: 900px === */
@media (max-width: 900px) {
  .site-nav   { display: none; }
  .nav-toggle { display: flex; }

  .chapters-list li { gap: 1.25rem; }
  .chapter-num { width: 2.5rem; font-size: var(--fs-3); }
}

/* === RESPONSIVE: 500px === */
@media (max-width: 500px) {
  :root {
    --section-pad: 3.5rem;
    --nav-h: 60px;
  }

  .section-hero { padding-top: 4.5rem; padding-bottom: 5rem; }

  .chapters-list li { flex-direction: column; gap: 0.5rem; }
  .chapter-num { width: auto; }

  .form-row {
    flex-direction: column;
    gap: 8px;
    padding: 8px;
  }
  .form-row input[type="email"] { padding: 0.875rem 1rem; }
  .btn-cta { width: 100%; padding: 1rem; }
}
