/* ========================================================
   Loan Lantern — stylesheet
   A field-guide aesthetic: deep teal ink, aged paper,
   mustard accent, serif display + humanist sans + mono data
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,380;0,9..144,600;0,9..144,700;1,9..144,500&family=Work+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
  --ink: #16211D;
  --ink-soft: #2B3B33;
  --paper: #F6F2E7;
  --paper-raised: #FFFDF8;
  --teal: #1B4B43;
  --teal-light: #2F6E5F;
  --mustard: #C9922E;
  --mustard-deep: #A6741F;
  --rust: #A9482D;
  --sage: #E1E7D6;
  --sand: #ECE4CC;
  --muted: #5B6B5F;
  --line: #D9CFAF;
  --radius: 3px;
  --spine-w: 236px;
  font-size: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Work Sans', sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
.container { max-width: 900px; margin: 0 auto; padding: 0 28px; }
.narrow { max-width: 680px; }

h1, h2, h3, h4 {
  font-family: 'Fraunces', serif;
  color: var(--ink);
  line-height: 1.15;
  margin: 0 0 .5em;
  font-weight: 600;
}
h1 { font-size: clamp(2.1rem, 4vw, 3.2rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 1em; color: var(--ink-soft); }
.mono { font-family: 'IBM Plex Mono', monospace; }

.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--mustard-deep);
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  width: 18px; height: 1px;
  background: var(--mustard-deep);
  display: inline-block;
}

/* ---------- Layout shell: fixed left spine + content ---------- */
.shell { display: flex; min-height: 100vh; }

.spine {
  width: var(--spine-w);
  flex-shrink: 0;
  background: var(--teal);
  color: #E9EFE9;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 30px 24px 24px;
}
.spine-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
  margin-bottom: 36px;
}
.spine-logo svg { width: 42px; height: 42px; flex-shrink: 0; }
.spine-logo-text {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.spine-logo-text em { font-style: italic; font-weight: 500; color: var(--mustard); }

.spine-nav { list-style: none; margin: 0 0 30px; padding: 0; }
.spine-nav li { margin-bottom: 2px; }
.spine-nav a {
  display: flex;
  gap: 10px;
  align-items: baseline;
  text-decoration: none;
  color: #CBDACE;
  font-size: .92rem;
  padding: 9px 10px;
  border-radius: var(--radius);
  transition: background .15s, color .15s;
}
.spine-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .68rem;
  color: #6FA391;
  flex-shrink: 0;
}
.spine-nav a:hover, .spine-nav a.active { background: rgba(255,255,255,.08); color: #fff; }
.spine-nav a.active .spine-num { color: var(--mustard); }

.spine-cta {
  display: block;
  text-align: center;
  background: var(--mustard);
  color: var(--teal);
  font-weight: 600;
  font-size: .88rem;
  padding: 12px 14px;
  border-radius: var(--radius);
  text-decoration: none;
  margin-bottom: 20px;
}
.spine-cta:hover { background: #DBA544; }

.spine-foot {
  font-size: .74rem;
  color: #7FA090;
  border-top: 1px solid rgba(255,255,255,.14);
  padding-top: 14px;
}
.spine-foot a { color: #B9CDBB; text-decoration: underline; }

.content { flex: 1; min-width: 0; }

/* ---------- Mobile top bar ---------- */
.topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  background: var(--teal);
  color: #fff;
  padding: 14px 20px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar .spine-logo { margin: 0; }
.topbar .spine-logo svg { width: 34px; height: 34px; }
.topbar .spine-logo-text { font-size: 1.15rem; }
.menu-btn {
  background: none; border: 1px solid rgba(255,255,255,.4); border-radius: var(--radius);
  width: 40px; height: 36px; display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.menu-btn span, .menu-btn::before, .menu-btn::after { display: none; }
.menu-icon { width: 18px; height: 12px; position: relative; }
.menu-icon span { position: absolute; left: 0; right: 0; height: 2px; background: #fff; }
.menu-icon span:nth-child(1) { top: 0; }
.menu-icon span:nth-child(2) { top: 5px; }
.menu-icon span:nth-child(3) { top: 10px; }

.drawer {
  display: none;
  background: var(--teal);
  padding: 6px 20px 20px;
}
.drawer.open { display: block; }
.drawer a {
  display: flex; gap: 10px; color: #CBDACE; text-decoration: none;
  padding: 10px 4px; border-bottom: 1px solid rgba(255,255,255,.08); font-size: .95rem;
}
.drawer a.cta { color: var(--mustard); font-weight: 600; }

/* ---------- Sections / generic ---------- */
.section { padding: 56px 0; }
.section-tight { padding: 32px 0; }
.hairline { border-top: 1px solid var(--line); }

.page-head { padding: 54px 0 20px; }
.page-head p.lede { font-size: 1.08rem; max-width: 620px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .92rem;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-light); }
.btn-mustard { background: var(--mustard); color: var(--teal); }
.btn-mustard:hover { background: #DBA544; }
.btn-outline { border-color: var(--teal); color: var(--teal); }
.btn-outline:hover { background: var(--teal); color: #fff; }
.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: 8px 16px; font-size: .82rem; }

/* ---------- Hero ---------- */
.hero { padding: 50px 0 20px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 44px; align-items: start; }
.hero h1 { margin-bottom: .35em; }
.hero .lead { font-size: 1.12rem; max-width: 480px; }
.hero-actions { display: flex; gap: 12px; margin: 24px 0 30px; flex-wrap: wrap; }
.quick-facts { display: flex; gap: 26px; flex-wrap: wrap; }
.quick-fact { font-size: .84rem; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.quick-fact svg { width: 17px; height: 17px; color: var(--teal); flex-shrink: 0; }

/* ---------- Cost Ladder (signature element) ---------- */
.ladder-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 22px 22px 18px;
}
.ladder-card h3 { margin-bottom: 2px; }
.ladder-sub { font-size: .82rem; color: var(--muted); margin-bottom: 18px; }
.ladder { display: flex; flex-direction: column-reverse; gap: 8px; }
.rung {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius);
  padding: 12px 14px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--sand);
}
.rung-fill {
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(90deg, var(--sage), var(--sage));
  transform-origin: left;
}
.rung.low .rung-fill { background: #CFE0C6; width: 28%; }
.rung.mid .rung-fill { background: #EAD79E; width: 58%; }
.rung.high .rung-fill { background: #E3B79F; width: 88%; }
.rung-body { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.rung-name { font-weight: 600; font-size: .92rem; }
.rung-apr { font-family: 'IBM Plex Mono', monospace; font-size: .82rem; color: var(--ink-soft); }
.ladder-caption { font-size: .74rem; color: var(--muted); margin-top: 12px; }

/* ---------- Stat strip ---------- */
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.stat { border-left: 2px solid var(--mustard); padding-left: 14px; }
.stat-num { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.9rem; color: var(--teal); }
.stat-label { font-size: .8rem; color: var(--muted); }

/* ---------- Two column ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 46px; align-items: start; }

/* ---------- Cards ---------- */
.cardset { display: grid; gap: 16px; }
.cardset.c2 { grid-template-columns: 1fr 1fr; }
.cardset.c3 { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 20px;
}
.card h4 { margin-bottom: 6px; }
.card p { font-size: .9rem; margin-bottom: 0; }
.card-icon { width: 32px; height: 32px; color: var(--teal); margin-bottom: 10px; }

/* ---------- Callouts ---------- */
.callout { border-radius: 6px; padding: 16px 18px; font-size: .9rem; }
.callout p:last-child { margin-bottom: 0; }
.callout-note { background: var(--sage); border: 1px solid #CBD9BB; }
.callout-warn { background: #F2E1D5; border: 1px solid #E3BFA3; color: #6B2E17; }
.callout-warn strong { color: var(--rust); }

/* ---------- Guide chapters ---------- */
.chapter-nav {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 16px 0 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 5;
}
.chapter-nav a {
  font-size: .8rem;
  text-decoration: none;
  color: var(--muted);
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-family: 'IBM Plex Mono', monospace;
}
.chapter-nav a:hover, .chapter-nav a.active { background: var(--teal); color: #fff; border-color: var(--teal); }

.chapter { padding: 46px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 70px; }
.chapter:last-child { border-bottom: none; }
.chapter-num {
  font-family: 'IBM Plex Mono', monospace;
  color: var(--mustard-deep);
  font-size: .8rem;
  margin-bottom: 8px;
}
.chapter-grid { display: grid; grid-template-columns: 1.3fr .9fr; gap: 40px; align-items: start; margin-top: 18px; }
.fact-panel {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px 20px;
}
.fact-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .86rem; }
.fact-row:last-child { border-bottom: none; }
.fact-row span:first-child { color: var(--muted); }
.fact-row span:last-child { font-family: 'IBM Plex Mono', monospace; font-weight: 600; }
.risk-meter { margin-top: 14px; }
.risk-meter-label { font-size: .74rem; color: var(--muted); margin-bottom: 5px; }
.risk-meter-track { height: 6px; background: var(--sand); border-radius: 4px; overflow: hidden; }
.risk-meter-fill { height: 100%; border-radius: 4px; }
.risk-low .risk-meter-fill { width: 22%; background: #6E9C63; }
.risk-mid .risk-meter-fill { width: 60%; background: var(--mustard); }
.risk-high .risk-meter-fill { width: 90%; background: var(--rust); }

.bullet-list { list-style: none; margin: 0; padding: 0; }
.bullet-list li { padding: 8px 0 8px 26px; position: relative; font-size: .93rem; color: var(--ink-soft); border-bottom: 1px dashed var(--line); }
.bullet-list li:last-child { border-bottom: none; }
.bullet-list li::before { content: "—"; position: absolute; left: 0; color: var(--mustard-deep); font-family: 'IBM Plex Mono', monospace; }

.dos-donts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dd-col h4 { display: flex; align-items: center; gap: 8px; }
.dd-col.dos h4 { color: var(--teal); }
.dd-col.donts h4 { color: var(--rust); }
.dd-col ul { list-style: none; margin: 0; padding: 0; }
.dd-col li { font-size: .89rem; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--ink-soft); }

/* ---------- Calculator ---------- */
.calc-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 22px;
}
.calc-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.field label { display: block; font-size: .76rem; color: var(--muted); margin-bottom: 5px; font-family: 'IBM Plex Mono', monospace; text-transform: uppercase; letter-spacing: .04em; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-family: 'Work Sans', sans-serif;
  font-size: .94rem;
  color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--mustard); outline-offset: 1px; }
.calc-out { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 6px; }
.calc-out-row { display: flex; justify-content: space-between; font-size: .9rem; }
.calc-out-row.highlight { font-weight: 700; color: var(--teal); font-size: 1.05rem; }
.calc-note { font-size: .74rem; color: var(--muted); margin-top: 12px; margin-bottom: 0; }

/* ---------- FAQ ---------- */
.faq-list { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 4px; cursor: pointer; font-weight: 600; font-size: .98rem;
}
.faq-q .plus { font-family: 'IBM Plex Mono', monospace; color: var(--mustard-deep); font-size: 1.1rem; transition: transform .15s; }
.faq-item.open .plus { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .2s ease; font-size: .92rem; }
.faq-item.open .faq-a { max-height: 300px; }
.faq-a-inner { padding: 0 4px 20px; }

/* ---------- Contact / form ---------- */
.contact-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 40px; align-items: start; }
.contact-block { padding: 16px 0; border-top: 1px solid var(--line); }
.contact-block:first-child { border-top: none; padding-top: 0; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: .78rem; color: var(--muted); padding: 10px 0; }
.consent input { margin-top: 3px; }
.form-success { display: none; text-align: center; padding: 40px 10px; }
.form-success .tick { width: 46px; height: 46px; color: var(--teal); margin: 0 auto 14px; }

/* ---------- Table (for compare-at-a-glance in guide) ---------- */
.compare-table { width: 100%; border-collapse: collapse; font-size: .88rem; margin: 10px 0 6px; }
.compare-table th, .compare-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.compare-table th { font-family: 'IBM Plex Mono', monospace; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }

/* ---------- CTA band ---------- */
.cta-band { background: var(--teal); color: #fff; border-radius: 8px; padding: 40px; display: flex; justify-content: space-between; align-items: center; gap: 30px; flex-wrap: wrap; }
.cta-band h2 { color: #fff; margin-bottom: 6px; }
.cta-band p { color: #C9DACD; margin-bottom: 0; }
.cta-band .btn-outline { border-color: #fff; color: #fff; }
.cta-band .btn-outline:hover { background: #fff; color: var(--teal); }

/* ---------- Foot note (page bottom, since footer lives outside spine layout) ---------- */
.page-foot { padding: 30px 0 60px; border-top: 1px solid var(--line); margin-top: 30px; font-size: .8rem; color: var(--muted); }
.page-foot a { color: var(--teal); text-decoration: underline; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .spine { display: none; }
  .topbar { display: flex; }
  .hero-grid, .two-col, .contact-grid, .chapter-grid { grid-template-columns: 1fr; }
  .cardset.c2, .cardset.c3 { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .dos-donts-grid { grid-template-columns: 1fr; }
  .calc-fields { grid-template-columns: 1fr; }
  .cta-band { flex-direction: column; align-items: flex-start; }
}
