/* ---------------------------------------------------------
   Juan Yerbita — landing page
   Tokens: white / light-grey ground, graphite type, deep navy
   as the structural "authority" color, discreet gold as the
   single accent, muted olive-green as a quiet support tone.
   Fraunces (display) + Work Sans (body) + IBM Plex Mono
   (data / labels / eyebrows).
--------------------------------------------------------- */

:root {
  --paper: #ffffff;
  --paper-2: #eeeeee;
  --ink: #2b2f37;
  --ink-soft: #5b5f68;
  --ink-faint: #8b8e95;
  --rule: rgba(43, 47, 55, 0.15);
  --rule-soft: rgba(43, 47, 55, 0.08);
  --surface: #ffffff;

  --navy: #0f2340;
  --navy-2: #17335a;
  --on-navy: #ffffff;
  --on-navy-soft: #ffffff;

  --accent: #a9843f;
  --accent-strong: #8a692c;
  --accent-2: #6b7a4e;
  --on-accent: #ffffff;

  --font-display: "Fraunces", "Iowan Old Style", "Georgia", serif;
  --font-body: "Work Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", Menlo, monospace;

  --wrap: 1120px;
  --radius: 3px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #11151b;
    --paper-2: #171c24;
    --ink: #e8e6dd;
    --ink-soft: #b1aea3;
    --ink-faint: #7c7a72;
    --rule: rgba(232, 230, 221, 0.15);
    --rule-soft: rgba(232, 230, 221, 0.08);
    --surface: #161b22;

    --navy: #142944;
    --navy-2: #1e3a5f;
    --on-navy: #ffffff;
    --on-navy-soft: #ffffff;

    --accent: #cba35c;
    --accent-strong: #e2ba76;
    --accent-2: #8b9a68;
    --on-accent: #14171b;
  }
}

:root[data-theme="dark"] {
  --paper: #11151b;
  --paper-2: #171c24;
  --ink: #e8e6dd;
  --ink-soft: #b1aea3;
  --ink-faint: #7c7a72;
  --rule: rgba(232, 230, 221, 0.15);
  --rule-soft: rgba(232, 230, 221, 0.08);
  --surface: #161b22;

  --navy: #142944;
  --navy-2: #1e3a5f;
  --on-navy: #ffffff;
  --on-navy-soft: #ffffff;

  --accent: #cba35c;
  --accent-strong: #e2ba76;
  --accent-2: #8b9a68;
  --on-accent: #14171b;
}

* { box-sizing: border-box; }

html { color-scheme: light dark; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: no-preference) {
  a, .btn { transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease; }
}

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

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 28px;
}

a { color: inherit; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-strong);
  margin: 0 0 14px;
}

.eyebrow-inverse { color: var(--accent); }

/* Thin gold hairline — the one decorative accent on the page */
.hairline {
  height: 3px;
  background: var(--accent);
}

/* ---------- Header ---------- */

.site-header {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  padding-bottom: 20px;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 29px;
  text-decoration: none;
  letter-spacing: -0.01em;
  color: var(--on-navy);
}

.wordmark .dot { color: var(--accent); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.site-nav a {
  text-decoration: none;
  color: var(--on-navy-soft);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover { color: var(--on-navy); border-color: rgba(255, 255, 255, 0.45); }

.nav-cta {
  color: var(--on-accent) !important;
  background: var(--accent);
  padding: 8px 16px !important;
  border-radius: var(--radius);
  border: none !important;
}

.nav-cta:hover { background: var(--accent-strong); }

@media (max-width: 720px) {
  .site-nav { gap: 14px; font-size: 12px; }
  .site-nav a:not(.nav-cta) { display: none; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15.5px;
  text-decoration: none;
  padding: 13px 24px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
}

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

.btn-primary:hover { background: var(--accent-strong); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  border-color: var(--rule);
  color: var(--ink);
}

.btn-ghost:hover { border-color: var(--ink-faint); }

/* ---------- Hero ---------- */

.hero { padding: 76px 0 88px; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 64px;
  align-items: center;
}

.hero-title {
  font-size: clamp(34px, 4.6vw, 54px);
  margin-bottom: 22px;
}

.hero-title em { font-style: italic; color: var(--accent-strong); }

.hero-lead {
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 46ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.hero-factual {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--rule-soft);
  max-width: 52ch;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-faint);
}

.book-cover {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 28px 54px -22px rgba(15, 35, 64, 0.45);
}

.book-cover img {
  width: 100%;
  height: auto;
  display: block;
}

.book-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
  border: 1px solid rgba(15, 35, 64, 0.12);
  pointer-events: none;
}

.book-cover-sm {
  max-width: 220px;
  margin: 0 auto 28px;
}

@media (min-width: 861px) {
  .book-cover-sm { margin: 0; }
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-cover { max-width: 320px; }
}

/* ---------- Sections ---------- */

.section { padding: 84px 0; }

.section-tinted { background: var(--paper-2); }

.section-dark {
  /* The deep-navy structural block — same authority color as the
     header, tuned per theme via the --navy tokens. */
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%);
  color: var(--on-navy);
}

.text-inverse { color: var(--on-navy); }
.text-inverse-soft { color: var(--on-navy-soft); }

.section-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 56px;
}

.section-head h2 {
  font-size: clamp(24px, 3vw, 32px);
}

@media (max-width: 860px) {
  .section-grid { grid-template-columns: 1fr; gap: 24px; }
}

.section-body p { color: var(--ink-soft); max-width: 62ch; }
.section-dark .section-body p { max-width: 62ch; }

.section-body h3 {
  font-size: 17px;
  margin-top: 30px;
  margin-bottom: 10px;
}
.section-body h3:first-child { margin-top: 0; }

/* ---------- FAQ ---------- */

.section-body details {
  max-width: 62ch;
  border-bottom: 1px solid var(--rule-soft);
  padding: 16px 0;
}
.section-body details:first-of-type { border-top: 1px solid var(--rule-soft); }

.section-body summary {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16.5px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}
.section-body summary::-webkit-details-marker { display: none; }

.section-body summary::before {
  content: "+";
  display: inline-block;
  width: 1.1em;
  color: var(--accent);
  font-family: var(--font-mono);
}
.section-body details[open] summary::before { content: "–"; }

.section-body details p {
  margin-top: 12px;
  padding-left: 1.1em;
}

.pull-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 20px;
  line-height: 1.5;
  color: var(--ink);
  border-left: 2px solid var(--accent);
  padding-left: 22px;
  margin: 0 0 28px;
}

/* ---------- Cast ---------- */

.family-banner {
  margin-top: 40px;
  text-align: center;
}

.family-banner img {
  max-width: 460px;
  width: 100%;
  margin: 0 auto;
  border-radius: 8px;
  border: 1px solid var(--rule-soft);
}

.family-banner-caption {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-faint);
  margin-top: 14px;
}

.cast-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 44px;
}

@media (max-width: 900px) {
  .cast-grid { grid-template-columns: repeat(2, 1fr); }
}

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

.cast-card {
  background: var(--surface);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  padding: 26px;
}

.cast-protagonist { border-left: 3px solid var(--accent); }

.cast-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 16px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  position: relative;
}

.cast-avatar img { width: 100%; height: 100%; object-fit: cover; }

.cast-avatar.avatar-fallback img { display: none; }

.cast-avatar.avatar-fallback::after {
  content: attr(data-fallback);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink-soft);
}

.cast-card h3 {
  font-size: 18px;
  margin-bottom: 10px;
}

.cast-role {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;
  color: var(--ink-faint);
}

.cast-card p { color: var(--ink-soft); font-size: 15px; }

.cast-motto {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-strong);
  margin-top: 14px;
}

/* ---------- Pillars ---------- */

.pillars {
  display: grid;
  gap: 34px;
}

.pillar {
  padding-bottom: 30px;
  border-bottom: 1px solid var(--rule-soft);
}

.pillar:last-child { border-bottom: none; padding-bottom: 0; }

.pillar-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-2);
  display: block;
  margin-bottom: 8px;
}

.pillar h3 { font-size: 19px; margin-bottom: 8px; }
.pillar p { color: var(--ink-soft); font-size: 15px; max-width: 42ch; }

/* ---------- Download panel ---------- */

.download-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
  align-items: start;
  max-width: 880px;
  margin: 0 auto;
}

@media (max-width: 760px) {
  .download-layout { grid-template-columns: 1fr; }
}

.download-panel {
  background: var(--surface);
  border: 1px solid var(--rule-soft);
  border-radius: 8px;
  padding: 48px;
}

@media (max-width: 620px) {
  .download-panel { padding: 32px 24px; }
}

.download-head { margin-bottom: 34px; }

.download-lead { color: var(--ink-soft); }

.lead-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.field { display: flex; flex-direction: column; gap: 6px; }

.field label,
.field-group-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.field input {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 15.5px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.field input::placeholder { color: var(--ink-faint); opacity: 1; }

.field input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.field input[aria-invalid="true"] { border-color: #b3402f; }

.field-error {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #b3402f;
  min-height: 1em;
}

.phone-row {
  display: grid;
  grid-template-columns: 0.55fr 0.7fr 1fr;
  gap: 12px;
}

.phone-row .field { min-width: 0; }

@media (max-width: 480px) {
  .phone-row { grid-template-columns: 1fr; }
}

.btn-submit { justify-content: center; margin-top: 6px; }

.download-success {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.download-success-copy {
  font-family: var(--font-display);
  font-size: 19px;
  font-style: italic;
}

.link-reset {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-faint);
  text-decoration: underline;
  cursor: pointer;
}

.link-reset:hover { color: var(--ink-soft); }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 3px solid var(--navy);
  background: var(--paper-2);
  padding: 22px 0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ink-soft);
}

.footer-name {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--ink);
  margin: 0;
}

.footer-detail { margin: 0; }
.footer-detail a { text-decoration: none; }
.footer-detail a:hover { text-decoration: underline; }

.footer-sep { color: var(--ink-faint); }

/* [hidden] must win over the component's own display rules */
.lead-form[hidden],
.download-success[hidden] { display: none; }

@media (max-width: 560px) {
  .footer-inner { flex-direction: column; gap: 4px; align-items: flex-start; }
  .footer-sep { display: none; }
}
