/* ── Tokens ─────────────────────────────────── */
/* Copied from index.html's :root block — keep these two files in sync
   manually; index.html itself must never be edited to reference this file. */
:root {
  --bg:          oklch(1.000 0.000 0);
  --surface:     oklch(0.975 0.004 70);
  --ink:         oklch(0.12 0.000 0);
  --ink-muted:   oklch(0.48 0.000 0);
  --primary:     oklch(0.52 0.140 65);
  --primary-fg:  oklch(1.000 0.000 0);
  --border:      oklch(0.90 0.000 0);

  --font:   'Bricolage Grotesque', system-ui, sans-serif;
  --pad-x:  clamp(1.5rem, 5vw, 4rem);
  --max-w:  1200px;

  --z-nav: 10;
}

/* ── Reset ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ── Nav ────────────────────────────────────── */
.nav {
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.125rem var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.nav__name {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.nav__nmls {
  font-size: 0.75rem;
  color: var(--ink-muted);
}
.nav__links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.nav__logo {
  /* Padding + matching negative margin: grows the tap target to ~44px
     without changing the visible logo's size or position in the row. */
  padding-block: 0.6875rem;
  margin-block: -0.6875rem;
}
.nav__link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-muted);
  transition: color 0.15s ease;
  padding-block: 0.6875rem;
  margin-block: -0.6875rem;
}
.nav__link:hover { color: var(--ink); }

/* ── Footer ─────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem var(--pad-x);
}
.footer__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.footer p {
  font-size: 0.75rem;
  color: var(--ink-muted);
}

/* ── Page wrapper ───────────────────────────────
   Used by simple content pages (blog index, posts). Landing-page-style
   templates (hero + calc + quiz + contact) instead lay their own
   full-bleed <section>s directly in <main>, each owning its own
   max-width/padding — same pattern as the original index.html. */
.page-narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4rem) var(--pad-x);
}

/* ── Blog index ─────────────────────────────── */
.page-narrow > h1 {
  font-size: clamp(1.875rem, 3.5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 2rem;
}
.blog-list {
  display: grid;
  gap: 2rem;
}
.blog-list__item h2 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.375rem;
}
.blog-list__item time {
  font-size: 0.8125rem;
  color: var(--ink-muted);
}
.blog-list__item p {
  color: var(--ink-muted);
  font-size: 0.9375rem;
  margin-top: 0.5rem;
}

/* ── Blog post ──────────────────────────────── */
.post__meta {
  font-size: 0.8125rem;
  color: var(--ink-muted);
  margin-bottom: 0.75rem;
}
.post__title {
  font-size: clamp(1.875rem, 3.5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.75rem;
}
.post__byline {
  font-size: 0.875rem;
  color: var(--ink-muted);
  margin-bottom: 2rem;
}
.post__body {
  font-size: 1.0625rem;
  line-height: 1.7;
}
.post__body > * + * { margin-top: 1.25rem; }
.post__body h2 {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-top: 2rem;
}
.post__reviewed {
  margin-top: 2rem;
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

/* ── Pillar pages ───────────────────────────── */
.pillar h1 {
  font-size: clamp(1.875rem, 3.5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1rem;
}
.pillar__intro {
  color: var(--ink-muted);
  font-size: 1.0625rem;
  line-height: 1.65;
  margin-bottom: 2rem;
}
.pillar__toc {
  background: var(--surface);
  border-radius: 0.5rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}
.pillar__toc ul {
  list-style: none;
  display: grid;
  gap: 0.5rem;
}
.pillar__toc a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: oklch(0.52 0.140 65 / 0.35);
  text-underline-offset: 2px;
}
.pillar__body {
  font-size: 1.0625rem;
  line-height: 1.7;
}
.pillar__body > * + * { margin-top: 1.25rem; }
.pillar__body h2 {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-top: 2rem;
  scroll-margin-top: 1.5rem;
}
.pillar__related {
  border-top: 1px solid var(--border);
  margin-top: 2.5rem;
  padding-top: 2rem;
}
.pillar__related h2 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.pillar__related-list {
  list-style: none;
  display: grid;
  gap: 0.5rem;
}
.pillar__related-list a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: oklch(0.52 0.140 65 / 0.35);
  text-underline-offset: 2px;
}
.pillar__cta {
  border-top: 1px solid var(--border);
  margin-top: 2.5rem;
  padding-top: 2rem;
}
.pillar__quiz-link {
  margin-top: 1rem;
  font-size: 0.9375rem;
}
.pillar__quiz-link a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: oklch(0.52 0.140 65 / 0.35);
  text-underline-offset: 2px;
}
.pillar__reviewed {
  margin-top: 2rem;
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

/* ── 404 page ───────────────────────────────── */
.error-page {
  text-align: center;
}
.error-page h1 {
  font-size: clamp(1.875rem, 3.5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}
.error-page > p {
  color: var(--ink-muted);
  max-width: 50ch;
  margin: 0 auto 2rem;
}
.error-page .hero__cta-group {
  justify-content: center;
  margin-bottom: 2rem;
}
.error-page__links {
  font-size: 0.9375rem;
}
.error-page__links a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: oklch(0.52 0.140 65 / 0.35);
  text-underline-offset: 2px;
}

/* ── Landing-page sections ──────────────────────
   Hero / CTA button / rate badge / calculator / quiz / contact strip.
   Used by the homepage (content/index.njk) and any future niche landers
   built the same way. */

/* ── Hero ───────────────────────────────────── */
.hero {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 6rem) var(--pad-x) 0;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 4vw, 5rem);
  align-items: end;
}

.hero__content {
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

.hero__tag {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--primary);
  letter-spacing: 0.01em;
  margin-bottom: 1.5rem;
}
.hero__tag::before {
  content: '';
  display: block;
  width: 1.25rem;
  height: 2px;
  background: var(--primary);
  flex-shrink: 0;
}

.hero__h1 {
  font-size: clamp(2.25rem, 4.5vw, 4.25rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
  margin-bottom: 1.5rem;
}

.hero__sub {
  font-size: clamp(1rem, 1.4vw, 1.125rem);
  color: var(--ink-muted);
  max-width: 50ch;
  line-height: 1.65;
  text-wrap: pretty;
  margin-bottom: 1.5rem;
}

.hero__cta-line {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  max-width: 42ch;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.hero__cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ── CTA button ─────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary);
  color: var(--primary-fg);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.9rem 1.75rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  letter-spacing: -0.01em;
  transition:
    transform 0.18s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.18s ease;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px oklch(0.52 0.140 65 / 0.28);
}
.btn:active { transform: translateY(0); transition-duration: 0.08s; }
.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}
.btn__arrow {
  transition: transform 0.18s ease;
}
.btn:hover .btn__arrow { transform: translateX(3px); }

/* ── Rate hero (the page's headline stat) ─────
   Spans both grid columns — the one element on this hero centered to
   the full page width, independent of the left-aligned text column. */
.rate-hero {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.375rem;
  margin-bottom: clamp(1rem, 2vw, 1.5rem);
  /* Reserves its own final height up front (fixed line heights + the
     value's own fluid size) so populating it on fetch doesn't reflow
     hero__content/hero__photo beneath it. */
  min-height: calc(3.3rem + clamp(3rem, 7vw, 5.25rem));
}
/* Invisible (not display:none) while the rate loads, so the reserved
   space above holds — but still out of the accessibility tree, same as
   the old [hidden] attribute, until content is ready to announce. */
.rate-hero--pending {
  visibility: hidden;
}
.rate-hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 0.4375rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.rate-hero__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}
.rate-hero__value {
  font-size: clamp(3rem, 7vw, 5.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--primary);
  line-height: 1;
}
.rate-hero__label {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-muted);
  letter-spacing: 0.01em;
}
.rate-hero__updated {
  font-size: 0.75rem;
  color: var(--ink-muted);
  opacity: 0.75;
}

@media (prefers-reduced-motion: no-preference) {
  .rate-hero__dot {
    animation: pulse 2.4s ease-in-out infinite;
  }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ── Hero photo ─────────────────────────────── */
.hero__photo {
  position: relative;
  align-self: end;
}
.hero__photo img {
  width: 100%;
  max-width: 460px;
  height: clamp(380px, 60vh, 640px);
  object-fit: cover;
  object-position: center top;
  border-radius: 1rem 1rem 0 0;
  margin: 0 auto;
}

/* ── Hero nameplate ─────────────────────────── */
.hero__nameplate {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4rem 1.5rem 1.75rem;
  background: linear-gradient(
    to top,
    oklch(0.08 0 0 / 0.88) 0%,
    oklch(0.08 0 0 / 0.5) 55%,
    transparent 100%
  );
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  pointer-events: none;
}
.hero__nameplate-name {
  font-size: clamp(1.875rem, 3.2vw, 2.5rem);
  font-weight: 800;
  color: oklch(1 0 0);
  letter-spacing: -0.02em;
  line-height: 1;
}
.hero__nameplate-title {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: oklch(1 0 0 / 0.72);
}

/* ── Calculator section ─────────────────────── */
.calc {
  border-top: 1px solid var(--border);
  padding: clamp(3rem, 6vw, 5rem) var(--pad-x);
}
.calc__inner {
  max-width: 640px;
  margin: 0 auto;
}
.calc__h2 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin-bottom: 0.5rem;
}
.calc__sub {
  color: var(--ink-muted);
  font-size: 0.9375rem;
  margin-bottom: 2rem;
}
.calc__form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.calc__field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-muted);
}
.calc__field input {
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 0.5rem;
  background: var(--bg);
  transition: border-color 0.15s ease;
  -moz-appearance: textfield;
}
.calc__field input::-webkit-outer-spin-button,
.calc__field input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.calc__field input:focus-visible {
  outline: none;
  border-color: var(--primary);
}
.calc__dp {
  position: relative;
  display: flex;
  align-items: center;
}
.calc__dp input { width: 100%; padding-right: 2.25rem; }
.calc__suffix {
  position: absolute;
  right: 1rem;
  color: var(--ink-muted);
  font-weight: 600;
  pointer-events: none;
}
.calc__form .btn--outline { grid-column: 1 / -1; justify-content: center; }

.btn--outline {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink);
}
.btn--outline:hover {
  background: var(--ink);
  color: var(--bg);
  box-shadow: none;
}
.btn--outline:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.calc__result {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.calc__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
}
.calc__total-label {
  font-size: 0.875rem;
  color: var(--ink-muted);
}
.calc__total-value {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--primary);
  white-space: nowrap;
}
.calc__breakdown {
  display: grid;
  gap: 0.625rem;
  margin-bottom: 1.5rem;
}
.calc__breakdown > div {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
}
.calc__breakdown dt { color: var(--ink-muted); }
.calc__breakdown dd { font-weight: 600; }
.calc__cta {
  font-size: 0.875rem;
  color: var(--ink-muted);
}
.calc__cta a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: oklch(0.52 0.140 65 / 0.35);
  text-underline-offset: 2px;
}
.calc__error {
  color: var(--ink-muted);
  font-size: 0.875rem;
}
.calc__error a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: oklch(0.52 0.140 65 / 0.35);
  text-underline-offset: 2px;
}

/* ── Loan types ─────────────────────────────── */
.loan-types {
  border-top: 1px solid var(--border);
  padding: clamp(3rem, 6vw, 5rem) var(--pad-x);
}
.loan-types__inner {
  max-width: 900px;
  margin: 0 auto;
}
.loan-types h2 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 2rem;
}
.loan-types__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.loan-types__card {
  display: block;
  padding: 1.25rem 1.5rem;
  border: 1.5px solid var(--border);
  border-radius: 0.5rem;
  font-weight: 600;
  text-align: center;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.loan-types__card:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.loan-types__card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ── Why work with me ───────────────────────── */
.why-me {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: clamp(3rem, 6vw, 5rem) var(--pad-x);
}
.why-me__inner {
  max-width: 640px;
  margin: 0 auto;
}
.why-me h2 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
.why-me p {
  color: var(--ink-muted);
  line-height: 1.7;
}

/* ── FAQ ────────────────────────────────────── */
.faq {
  border-top: 1px solid var(--border);
  padding: clamp(3rem, 6vw, 5rem) var(--pad-x);
}
.faq__inner {
  max-width: 720px;
  margin: 0 auto;
}
.faq h2 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}
.faq__list {
  display: grid;
  gap: 0.75rem;
}
.faq__item {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
}
.faq__item summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: '+';
  float: right;
  color: var(--primary);
  font-weight: 700;
}
.faq__item[open] summary::after {
  content: '\2212';
}
.faq__item p {
  color: var(--ink-muted);
  margin-top: 0.75rem;
  line-height: 1.6;
}

/* ── Quiz section ───────────────────────────── */
.quiz {
  background: var(--surface);
  padding: clamp(3rem, 6vw, 5rem) var(--pad-x);
}
.quiz__lead {
  text-align: center;
  max-width: 42ch;
  margin: 0 auto 2rem;
}
.quiz__lead-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-bottom: 0.375rem;
}
.quiz__lead-sub {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-muted);
  letter-spacing: 0.01em;
}
.quiz__embed {
  max-width: 800px;
  margin: 0 auto;
}

/* ── Contact strip ──────────────────────────── */
.contact {
  padding: clamp(2.5rem, 5vw, 3.5rem) var(--pad-x);
  text-align: center;
  border-top: 1px solid var(--border);
}
.contact__label {
  font-size: 0.9375rem;
  color: var(--ink-muted);
  margin-bottom: 0.75rem;
}
.contact__number {
  display: inline-block;
  font-size: clamp(1.625rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--primary);
  text-decoration: none;
  transition: opacity 0.15s ease;
  /* Padding + matching negative margin: grows the tap target to ~44px
     without changing the visible number's size or position. */
  padding-block: 0.375rem;
  margin-block: -0.375rem;
}
.contact__number:hover { opacity: 0.75; }
.contact__number:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ── Responsive ─────────────────────────────── */
@media (max-width: 680px) {
  .hero {
    grid-template-columns: 1fr;
    padding-bottom: 0;
  }
  .hero__content {
    order: 1;
    padding-bottom: 2rem;
  }
  .hero__photo {
    order: 2;
  }
  .hero__photo img {
    max-width: 100%;
    height: 320px;
    border-radius: 0.75rem 0.75rem 0 0;
    object-position: center 15%;
  }
  .calc__form { grid-template-columns: 1fr; }
  .hero__nameplate {
    padding: 3rem 1rem 1.25rem;
  }
  .hero__nameplate-name {
    font-size: 1.625rem;
  }
}

/* ── Motion ─────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .rate-hero,
  .hero__tag,
  .hero__h1,
  .hero__sub,
  .hero__cta-line,
  .hero__content .btn {
    opacity: 0;
    transform: translateY(18px);
    animation: rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  }
  .rate-hero { animation-delay: 0.05s; }
  .hero__tag { animation-delay: 0.12s; }
  .hero__h1  { animation-delay: 0.2s; }
  .hero__sub { animation-delay: 0.28s; }
  .hero__cta-line { animation-delay: 0.35s; }
  .hero__content .btn { animation-delay: 0.42s; }

  .hero__photo img {
    opacity: 0;
    animation: appear 0.8s ease 0.1s forwards;
  }

  .hero__nameplate {
    opacity: 0;
    animation: appear 0.7s ease 0.55s forwards;
  }
}

@keyframes rise   { to { opacity: 1; transform: none; } }
@keyframes appear { to { opacity: 1; } }
