/* ============================================================================
   loanloon.ca — visual system

   A deliberately simple, conventional layout: one centred container, a single
   white header bar with the logo on the left, a horizontal nav and one obvious
   primary call to action. Content sits in plain card grids on a white ground.
   No fixed side rail, no full-bleed banding, no editorial rules.

   The brand green is taken from the loanloon.ca mark. Type is Inter for UI and
   Source Serif 4 for headings — a warm, readable pairing for a page of
   financial explanation.
   ========================================================================= */

:root {
  --ink:        #0E1512;
  --ink-2:      #1F2A24;
  --ink-3:      #5B6A62;
  --ink-4:      #8B968F;

  --paper:      #FFFFFF;
  --paper-2:    #F6F9F4;
  --paper-3:    #EDF3E9;

  --brand:      #6FBF3B;
  --brand-dk:   #4C8F22;
  --brand-lt:   #A8E072;
  --brand-ink:  #3F7A1C;

  --rule:       #DFE6DA;
  --rule-2:     #C9D4C3;

  --container:  1140px;
  --radius:     10px;
  --radius-lg:  14px;

  --shadow-sm:  0 1px 2px rgba(14, 21, 18, .06);
  --shadow-md:  0 2px 10px rgba(14, 21, 18, .07);
  --shadow-lg:  0 8px 28px rgba(14, 21, 18, .10);

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;

  --fs-h1: clamp(1.9rem, 1.35rem + 2.1vw, 2.85rem);
  --fs-h2: clamp(1.35rem, 1.15rem + .8vw, 1.8rem);
  --fs-h3: 1.15rem;
  --fs-body: 1.0625rem;
  --fs-sm: .9375rem;
  --fs-xs: .8125rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--ink-2);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }

a { color: var(--brand-dk); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--brand-dk); outline-offset: 2px; border-radius: 4px; }

.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-link { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--ink); color: #fff; padding: 10px 16px; }
.skip-link:focus { left: 0; }

/* ------------------------------------------------------------------ layout */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.section { padding: clamp(30px, 5vw, 56px) 0; }
.section-alt { background: var(--paper-2); }
.section-tight { padding: clamp(20px, 3vw, 32px) 0; }

/* ------------------------------------------------------------------ header */
.header {
  background: #fff;
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner { display: flex; flex-direction: column; }

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
}

.logo { display: block; flex: 0 0 auto; }
.logo img { width: 124px; height: auto; }

.header-end { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; justify-content: flex-end; }

.nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }

.nav-link {
  display: inline-block;
  padding: 9px 13px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink-2);
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
}
.nav-link:hover { background: var(--paper-2); color: var(--ink); text-decoration: none; }
.nav-link.is-active { color: var(--brand-ink); background: var(--paper-3); font-weight: 600; }

.nav-cta-wrap { flex: 0 0 auto; }

.nav-toggle {
  display: none;
  width: 42px;
  height: 38px;
  padding: 0;
  background: #fff;
  border: 1px solid var(--rule-2);
  border-radius: 8px;
  cursor: pointer;
  position: relative;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 18px;
  height: 2px;
  background: var(--ink);
  transform: translateX(-50%);
}
.nav-toggle span { top: 50%; margin-top: -1px; }
.nav-toggle span::before { top: -6px; left: 0; transform: none; }
.nav-toggle span::after { top: 6px; left: 0; transform: none; }

/* -------------------------------------------------------------------- type */
h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 .6em;
}
h1 { font-size: var(--fs-h1); letter-spacing: -.015em; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: 1.02rem; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }
strong { color: var(--ink); font-weight: 600; }

.eyebrow {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--brand-ink);
  margin: 0 0 10px;
}
.lede { font-size: 1.1rem; color: var(--ink-3); }
.card__meta { font-size: var(--fs-xs); color: var(--ink-4); }

/* --------------------------------------------------------------------- hero */
.hero { padding: clamp(32px, 5vw, 60px) 0 clamp(26px, 4vw, 44px); }
.hero-inner { max-width: 780px; }
.hero h1 { margin-bottom: .5em; }
.hero .lede { margin-bottom: 1.5rem; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 1.6rem; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  border-top: 1px solid var(--rule);
  padding-top: 20px;
}
.hero-stat { display: flex; flex-direction: column; gap: 2px; }
.stat__value { font-family: var(--serif); font-size: 1.85rem; line-height: 1.1; color: var(--ink); }
.stat__label { font-size: var(--fs-xs); color: var(--ink-3); }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.3;
  padding: 11px 20px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.btn-primary { background: var(--brand); border-color: var(--brand-dk); color: #10240A; }
.btn-primary:hover { background: var(--brand-lt); color: #10240A; text-decoration: none; }
.btn-secondary { background: #fff; border-color: var(--rule-2); color: var(--ink); }
.btn-secondary:hover { border-color: var(--ink); background: #fff; text-decoration: none; }
.btn-lg { padding: 14px 26px; font-size: 1rem; }
.btn-block { display: block; width: 100%; }
.btn-quiet { background: transparent; border-color: var(--rule); color: var(--ink-3); }
.btn-quiet:hover { border-color: var(--ink); color: var(--ink); }

/* ------------------------------------------------------------------- grids */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ------------------------------------------------------------------- cards */
.card {
  display: block;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  color: var(--ink-2);
  text-decoration: none;
}
.card-link { transition: box-shadow .14s ease, border-color .14s ease, transform .14s ease; }
.card-link:hover { box-shadow: var(--shadow-md); border-color: var(--rule-2); text-decoration: none; transform: translateY(-1px); }
.card__title { display: block; font-family: var(--serif); font-size: 1.08rem; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.card__body { display: block; font-size: var(--fs-sm); color: var(--ink-3); }

/* ------------------------------------------------------------------- lists */
.related { list-style: none; margin: 0; padding: 0; }
.related__item { border-bottom: 1px solid var(--rule); padding: 10px 0; font-size: var(--fs-sm); }
.related__item:last-child { border-bottom: 0; }

.index-rows { display: grid; gap: 12px; }
.index-rows .card { padding: 16px; }

.sources { list-style: none; margin: 0; padding: 0; font-size: var(--fs-sm); }
.sources li { padding: 7px 0; color: var(--ink-3); border-bottom: 1px solid var(--rule); }
.sources li:last-child { border-bottom: 0; }

/* ------------------------------------------------------------------- prose */
.prose { max-width: 70ch; }
.prose h2 { margin-top: 2rem; }
.prose h3 { margin-top: 1.5rem; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1.1rem; }
.prose li { margin-bottom: .4rem; }
.prose blockquote { margin: 1.4rem 0; padding: 2px 0 2px 16px; border-left: 3px solid var(--brand-lt); color: var(--ink-3); }
.step-list { padding-left: 1.2rem; }
.step-list li { margin-bottom: .55rem; }

/* ------------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; margin: 0 0 1.2rem; border: 1px solid var(--rule); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
caption { caption-side: top; text-align: left; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-3); padding: 12px 14px 6px; }
th, td { text-align: left; padding: 11px 14px; vertical-align: top; border-bottom: 1px solid var(--rule); }
thead th { background: var(--paper-2); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); white-space: nowrap; }
tbody th { font-weight: 600; color: var(--ink); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--paper-2); }

/* --------------------------------------------------------------- section head */
.section-head { margin-bottom: 1.4rem; max-width: 72ch; }
.section-head h2 { margin-bottom: .35em; }
.section-head .lede { margin: 0; }

/* ------------------------------------------------------------- disclosures */
.disclosure {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--brand);
  background: var(--paper-2);
  border-radius: var(--radius);
  padding: 13px 15px;
  font-size: var(--fs-sm);
  color: var(--ink-3);
  margin: 0 0 1.2rem;
}
.disclosure strong { color: var(--ink); }

.position-line { font-size: var(--fs-sm); color: var(--ink-3); margin: 1.1rem 0 0; }

.callout {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--ink);
  background: var(--paper-2);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 0 0 1.3rem;
}
.callout--warn { border-left-color: #C05621; }
.callout--info { border-left-color: #2E9FD4; }
.callout p:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------- offer box */
.offer {
  background: #fff;
  border: 1px solid var(--rule);
  border-top: 3px solid var(--brand);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-md);
  margin: 0 0 1.6rem;
}
.offer__label { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-4); margin: 0 0 6px; }
.offer h3 { margin: 0 0 6px; }
.offer__facts { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: var(--fs-xs); color: var(--ink-3); margin: 0 0 14px; }
.offer .btn { margin-bottom: 12px; }
.offer .disclosure { margin-bottom: 0; }

/* -------------------------------------------------------------------- FAQ */
.faq { border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.faq__item { border-bottom: 1px solid var(--rule); background: #fff; }
.faq__item:last-child { border-bottom: 0; }
.faq__q {
  padding: 15px 42px 15px 18px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  position: relative;
}
.faq__q::-webkit-details-marker { display: none; }
.faq__q::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); color: var(--brand-dk); font-size: 1.25rem; font-weight: 400; }
details[open] .faq__q::after { content: "\2212"; }
.faq__a { padding: 0 18px 16px; color: var(--ink-3); font-size: var(--fs-sm); }

/* -------------------------------------------------------------------- TOC */
.toc { background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px 20px; margin: 0 0 2rem; }
.toc__label { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-4); margin: 0 0 8px; }
.toc ol { margin: 0; padding-left: 1.6rem; font-size: var(--fs-sm); list-style: decimal; }
.toc ol li { margin-bottom: 5px; padding-left: 2px; }
.toc ol li::marker { color: var(--brand-ink); font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------- takeaways */
.takeaways { background: var(--paper-3); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px 20px; margin: 0 0 2rem; }
.takeaways__label { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-ink); margin: 0 0 8px; }
.takeaways ul { margin: 0; padding-left: 1.15rem; font-size: var(--fs-sm); }
.takeaways li { margin-bottom: 5px; }

/* -------------------------------------------------------------- calculator */
.calc { background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: 20px; margin: 0 0 1.5rem; }
.calc__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 18px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: var(--fs-xs); font-weight: 600; color: var(--ink); }
.field input, .field select {
  font-family: var(--sans);
  font-size: 1rem;
  padding: 10px 12px;
  border: 1px solid var(--rule-2);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
.field input:focus, .field select:focus { border-color: var(--brand-dk); outline: 2px solid var(--brand-lt); outline-offset: 0; }
.field__hint { font-size: var(--fs-xs); color: var(--ink-4); }
.calc__actions { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }

.calc-out { background: #fff; border: 1px solid var(--rule); border-top: 3px solid var(--brand); border-radius: var(--radius); padding: 20px; margin: 0 0 1.2rem; box-shadow: var(--shadow-md); }
.calc-out__label { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-4); margin: 0 0 4px; }
.calc-out__value { font-family: var(--serif); font-size: clamp(1.8rem, 1.4rem + 1.5vw, 2.4rem); line-height: 1.1; margin: 0 0 6px; color: var(--ink); font-variant-numeric: tabular-nums; }
.calc-out__note { font-size: var(--fs-sm); color: var(--ink-3); margin: 0; }
.calc-rows { list-style: none; margin: 14px 0 0; padding: 0; }
.calc-rows li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: var(--fs-sm); }
.calc-rows li:last-child { border-bottom: 0; }
.calc-rows li span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.calc-error { color: #8A3B12; }

/* ------------------------------------------------------------------ figures */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.figure { background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); padding: 15px 16px; }
.figure__value { display: block; font-family: var(--serif); font-size: 1.6rem; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.figure__label { display: block; font-size: var(--fs-xs); color: var(--ink-3); margin-top: 3px; }

/* --------------------------------------------------------------- breadcrumb */
.breadcrumbs-wrap { padding-top: 18px; }
.breadcrumbs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 7px; font-size: var(--fs-xs); color: var(--ink-4); }
.breadcrumbs li + li::before { content: "/"; margin-right: 7px; color: var(--rule-2); }
.breadcrumbs a { color: var(--ink-3); }

/* ------------------------------------------------------------------- byline */
.byline { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: var(--fs-xs); color: var(--ink-4); margin: 0 0 1.5rem; }

/* ------------------------------------------------------------------- footer */
.footer { background: var(--paper-2); border-top: 1px solid var(--rule); margin-top: clamp(30px, 5vw, 56px); padding: clamp(30px, 4vw, 48px) 0 0; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.foot-col h2 { font-family: var(--sans); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-4); margin: 0 0 10px; }
.foot-col p { font-size: var(--fs-sm); color: var(--ink-3); }
.foot-col ul { list-style: none; margin: 0; padding: 0; font-size: var(--fs-sm); }
.foot-col li { margin-bottom: 7px; }
.foot-legal { border-top: 1px solid var(--rule); margin-top: 30px; padding: 18px 0 26px; font-size: var(--fs-xs); color: var(--ink-4); }
.foot-legal p { margin: 0 0 8px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  /* The nav collapses into a panel under the header row. */
  .nav-toggle { display: block; }
  .nav {
    display: none;
    order: 3;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border-top: 1px solid var(--rule);
    padding: 6px 0 10px;
  }
  .nav.is-open { display: flex; }
  .nav-link { padding: 12px 8px; border-radius: 6px; font-size: 1rem; }
  .header-row { flex-wrap: wrap; min-height: 64px; }
  .header-inner { padding-bottom: 2px; }
  .nav-cta-wrap { margin-left: auto; }
  .nav-cta { padding: 9px 14px; font-size: var(--fs-xs); }
  .logo img { width: 104px; }
}

@media (max-width: 640px) {
  :root { --fs-body: 1rem; }
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-actions .btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

@media print {
  .header, .footer, .hero-actions, .offer .btn { display: none !important; }
  a { color: #000; }
}
