/* ============================================================
   LOAN-PAYDAY.COM — COMPONENTS  v1.0  (Warm Ledger)
   Pairs with tokens.css. Production component layer.
   ============================================================ */

/* ---------- RESET / BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce){ html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-ui); font-size: var(--text-body);
  line-height: var(--leading-body); -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1,h2,h3 {
  font-family: var(--font-display); font-weight: var(--weight-display);
  font-variation-settings: "SOFT" 50, "WONK" 1, "opsz" 80;
  line-height: var(--leading-tight); letter-spacing: -0.015em; margin: 0 0 .5em;
}
h4,h5 { font-family: var(--font-ui); margin: 0 0 .5em; }
p { margin: 0 0 1em; }
a { color: var(--pine); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--amber-deep); }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; border-radius: 4px; }
.mono { font-family: var(--font-mono); }
.wrap { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-narrow { max-width: var(--container-narrow); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: var(--section-y) 0; }
.section-alt { background: var(--paper-deep); }
.eyebrow {
  font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: var(--sp-4);
  display: flex; align-items: center; gap: .75rem;
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--amber); }
.center { text-align: center; }
.center .eyebrow { justify-content: center; }
.lede { font-size: var(--text-body-lg); color: var(--ink-soft); }
.grid { display: grid; gap: var(--sp-5); }
@media (min-width: 800px){ .grid.cols-2{grid-template-columns:1fr 1fr} .grid.cols-3{grid-template-columns:repeat(3,1fr)} .grid.cols-4{grid-template-columns:repeat(4,1fr)} }

/* ---------- HEADER ---------- */
.site-header { background: var(--paper); border-bottom: var(--border-card); position: sticky; top: 0; z-index: var(--z-sticky); }
.site-header .wrap { display: flex; align-items: center; gap: var(--sp-5); height: 72px; }
.logo { font-family: var(--font-display); font-size: 1.5rem; font-weight: 650; color: var(--ink); text-decoration: none; display: flex; align-items: baseline; gap: 2px; white-space: nowrap; }
.logo .tick { color: var(--amber); font-size: 1.9rem; line-height: 0; }
.nav { display: flex; gap: var(--sp-5); margin-left: auto; }
.nav a { text-decoration: none; color: var(--ink-soft); font-weight: var(--weight-medium); font-size: var(--text-sm); padding: .35rem 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current] { color: var(--ink); border-bottom-color: var(--amber); }
.nav-cta { margin-left: var(--sp-5); }
.menu-toggle { display: none; margin-left: auto; background: none; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: .5rem .7rem; cursor: pointer; }
@media (max-width: 920px){
  .nav, .nav-cta { display: none; }
  .menu-toggle { display: block; }
  .nav.open { display: flex; position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; background: var(--paper); border-bottom: var(--border-card); padding: var(--sp-4) var(--gutter); gap: var(--sp-2); }
  .nav.open a { padding: .6rem 0; }
}

/* ---------- BUTTONS ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font-family: var(--font-ui); font-weight: var(--weight-bold); font-size: var(--text-body); padding: .8em 1.6em; border-radius: var(--radius-md); border: 2px solid transparent; cursor: pointer; text-decoration: none; transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast), box-shadow var(--dur-fast); }
.btn-primary { background: var(--amber); color: var(--ink); border-color: var(--ink); box-shadow: 2px 3px 0 var(--ink); }
.btn-primary:hover { background: var(--amber-deep); color: var(--ink); transform: translate(1px,1px); box-shadow: 1px 2px 0 var(--ink); }
.btn-primary:active { transform: translate(2px,3px); box-shadow: 0 0 0 var(--ink); }
.btn-secondary { background: transparent; color: var(--pine); border-color: var(--pine); }
.btn-secondary:hover { background: var(--pine-tint); color: var(--pine-deep); }
.btn-ghost { background: transparent; color: var(--pine); padding-left: .4em; padding-right: .4em; }
.btn-ghost::after { content: "→"; transition: transform var(--dur-fast) var(--ease-out); }
.btn-ghost:hover::after { transform: translateX(4px); }
.btn-lg { font-size: 1.125rem; padding: 1em 2em; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-block { width: 100%; }

/* ---------- HERO ---------- */
.hero { padding: var(--section-y) 0; position: relative; overflow: hidden; }
.hero .wrap { display: grid; gap: var(--sp-7); align-items: center; }
@media (min-width: 900px){ .hero .wrap { grid-template-columns: 1.1fr .9fr; } }
.hero h1 { font-size: var(--text-hero); }
.hero h1 em { font-style: normal; position: relative; white-space: nowrap; }
.hero h1 em::after { content: ""; position: absolute; left: -2%; right: -2%; bottom: .06em; height: .28em; background: var(--amber); z-index: -1; border-radius: 3px; transform: rotate(-1deg); }
.kicker { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--pine); background: var(--pine-tint); padding: .4em 1em; border-radius: 100px; margin-bottom: var(--sp-4); }
.kicker::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }
@media (prefers-reduced-motion: reduce){ .kicker::before { animation: none; } }

/* ---------- CALCULATOR ---------- */
.calc { background: #fff; border: var(--border-strong); border-radius: var(--radius-lg); box-shadow: 5px 6px 0 var(--pine-tint), 5px 6px 0 1.5px var(--line); padding: var(--sp-6); position: relative; }
.calc::before { content: ""; position: absolute; top: -2px; left: 24px; right: 24px; height: 2px; background-image: radial-gradient(circle at 5px 0, var(--paper) 3.5px, transparent 4px); background-size: 14px 4px; background-repeat: repeat-x; }
.calc h3 { font-size: var(--text-h3); display:flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.calc .amount { font-family: var(--font-mono); font-size: clamp(2.2rem, 5vw, 3rem); font-weight: 600; color: var(--pine); letter-spacing: -.02em; }
.calc input[type="range"] { width: 100%; accent-color: var(--pine); height: 32px; cursor: pointer; }
.calc .scale { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-faint); }
.calc dl { margin: var(--sp-5) 0 0; padding: 0; }
.calc .row { display: flex; justify-content: space-between; padding: .65rem 0; border-bottom: 1px dashed var(--line); font-size: var(--text-sm); }
.calc .row dt { color: var(--ink-soft); margin: 0; }
.calc .row dd { font-family: var(--font-mono); font-weight: 600; margin: 0; }
.calc .row dd.hl { color: var(--pine); }
.calc .fineprint { font-size: var(--text-xs); color: var(--ink-faint); line-height: var(--leading-legal); margin: var(--sp-3) 0 0; }

/* ---------- TRUST BAR ---------- */
.trustbar { background: var(--paper-deep); border-block: var(--border-card); padding: var(--sp-4) 0; }
.trustbar .wrap { display: flex; flex-wrap: wrap; gap: var(--sp-4) var(--sp-7); justify-content: center; }
.trust-item { display: flex; align-items: center; gap: .6rem; font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--ink-soft); }
.trust-item svg { flex: none; }

/* ---------- STEP CARDS ---------- */
.step-card { background: #fff; border: var(--border-card); border-radius: var(--radius-md); padding: var(--sp-6); position: relative; box-shadow: var(--shadow-card); }
.step-num { font-family: var(--font-display); font-variation-settings: "opsz" 144, "WONK" 1; font-size: 3.5rem; font-weight: 350; font-style: italic; color: var(--amber); line-height: 1; display: block; margin-bottom: var(--sp-3); }
.step-card h4 { margin: 0 0 .4em; font-size: var(--text-h4); }
.step-card p { margin: 0; color: var(--ink-soft); font-size: var(--text-sm); }
.step-card .eta { display: inline-block; margin-top: var(--sp-4); font-family: var(--font-mono); font-size: var(--text-xs); background: var(--amber-tint); color: var(--warn); padding: .3em .8em; border-radius: 100px; }

/* ---------- FEATURE CARD (image + text) ---------- */
.feature { display: grid; gap: var(--sp-7); align-items: center; }
@media (min-width: 800px){ .feature { grid-template-columns: 1fr 1fr; } .feature.flip > .feature-media { order: 2; } }
.feature-media { border-radius: var(--radius-lg); overflow: hidden; border: var(--border-card); box-shadow: var(--shadow-card); aspect-ratio: 3/2; }
.feature-media img { width: 100%; height: 100%; object-fit: cover; }
.feature ul.checks { list-style: none; padding: 0; margin: var(--sp-4) 0 0; display: grid; gap: .8rem; }
.feature ul.checks li { display: grid; grid-template-columns: auto 1fr; gap: .7rem; font-size: var(--text-body); align-items: start; }
.feature ul.checks li::before { content: "✓"; color: var(--ok); font-weight: 800; }

/* ---------- FORMS ---------- */
.field { display: grid; gap: .4rem; margin-bottom: var(--sp-4); }
.field label { font-weight: var(--weight-medium); font-size: var(--text-sm); }
.field .hint { font-size: var(--text-xs); color: var(--ink-faint); }
.input { font: inherit; font-family: var(--font-ui); padding: .75em 1em; border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: #fff; color: var(--ink); width: 100%; transition: border-color var(--dur-fast); }
.input:hover { border-color: var(--ink-faint); }
.input:focus { border-color: var(--pine); outline: 3px solid var(--pine-tint); outline-offset: 0; }
.input[aria-invalid="true"] { border-color: var(--danger); background: var(--danger-tint); }
.field .error { font-size: var(--text-xs); color: var(--danger); font-weight: var(--weight-medium); }

/* ---------- LEDGER TABLE ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.ledger { border-collapse: collapse; width: 100%; font-size: var(--text-sm); background: #fff; border: var(--border-card); border-radius: var(--radius-md); overflow: hidden; min-width: 540px; }
.ledger th { font-family: var(--font-mono); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .08em; text-align: left; background: var(--pine); color: #F3EFE6; padding: .9rem 1.1rem; }
.ledger td { padding: .85rem 1.1rem; border-top: 1px solid var(--line); }
.ledger tr:nth-child(even) td { background: var(--paper-deep); }
.ledger td.num { font-family: var(--font-mono); font-weight: 500; }

/* ---------- NOTES / ALERTS ---------- */
.note { border-radius: var(--radius-md); padding: var(--sp-4) var(--sp-5); font-size: var(--text-sm); display: grid; grid-template-columns: auto 1fr; gap: var(--sp-3); align-items: start; border: 1.5px solid; }
.note strong { display: block; margin-bottom: .15em; }
.note-info { background: var(--pine-tint); border-color: #BCD4C8; }
.note-warn { background: var(--warn-tint); border-color: #ECC79A; }
.note-apr { background: var(--paper-deep); border-color: var(--line); grid-template-columns: 1fr; font-size: var(--text-xs); color: var(--ink-soft); line-height: var(--leading-legal); }

/* ---------- FAQ ---------- */
.faq { border: var(--border-card); border-radius: var(--radius-md); background: #fff; overflow: hidden; }
.faq details + details { border-top: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.1rem 1.4rem; font-weight: var(--weight-medium); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-mono); font-size: 1.4rem; color: var(--amber-deep); transition: transform var(--dur-base) var(--ease-out); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .faq-a { padding: 0 1.4rem 1.2rem; color: var(--ink-soft); font-size: var(--text-sm); max-width: 64ch; }

/* ---------- BLOG CARDS ---------- */
.post-card { background: #fff; border: var(--border-card); border-radius: var(--radius-md); overflow: hidden; display: flex; flex-direction: column; transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base); text-decoration: none; color: var(--ink); }
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-pop); color: var(--ink); }
.post-card .thumb { aspect-ratio: 16/9; background: var(--paper-deep) center/cover; }
.post-card .body { padding: var(--sp-5); display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.post-card .cat { font-family: var(--font-mono); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .1em; color: var(--amber-deep); }
.post-card h4 { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; margin: 0; line-height: 1.3; }
.post-card .excerpt { font-size: var(--text-sm); color: var(--ink-soft); margin: 0; }
.post-card .meta { margin-top: auto; padding-top: var(--sp-3); display: flex; align-items: center; gap: .6rem; font-size: var(--text-xs); color: var(--ink-faint); border-top: 1px dashed var(--line); }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--pine); color: #fff; display: grid; place-items: center; font-size: .65rem; font-weight: 700; object-fit: cover; }
.featured-post { grid-column: 1 / -1; display: grid; }
@media (min-width: 800px){ .featured-post { grid-template-columns: 1.2fr 1fr; } .featured-post .thumb { aspect-ratio: auto; } }
.featured-post h4 { font-size: var(--text-h2); }

/* ---------- STAMP ---------- */
.stamp { display: inline-grid; place-items: center; text-align: center; width: 110px; height: 110px; border: 2.5px solid var(--pine); border-radius: 50%; font-family: var(--font-mono); font-size: .6rem; text-transform: uppercase; letter-spacing: .12em; color: var(--pine); transform: rotate(-8deg); padding: 10px; line-height: 1.5; background: radial-gradient(circle, transparent 62%, var(--pine-tint) 63%); }
.stamp b { font-size: .8rem; display: block; }

/* ---------- DARK CTA ---------- */
.cta-dark { background: var(--pine-deep); color: #F3EFE6; border-radius: var(--radius-lg); padding: var(--sp-8) var(--sp-7); text-align: center; }
.cta-dark h2 { color: #F3EFE6; font-size: var(--text-h1); }
.cta-dark p { color: #B9C7C0; }

/* ---------- ARTICLE ---------- */
.article { max-width: var(--container-narrow); margin: 0 auto; }
.article .byline { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; padding: var(--sp-4) 0; border-block: var(--border-card); margin: var(--sp-5) 0; font-size: var(--text-sm); }
.badge-check { display: inline-flex; align-items: center; gap: .35rem; background: var(--ok-tint); color: var(--ok); font-size: var(--text-xs); font-weight: var(--weight-bold); padding: .25em .8em; border-radius: 100px; }
.article > p { font-size: var(--text-body-lg); }
.article h2 { margin-top: 1.6em; font-size: var(--text-h2); }
.takeaways { background: var(--amber-tint); border: 1.5px solid #ECC79A; border-radius: var(--radius-md); padding: var(--sp-5) var(--sp-6); margin: var(--sp-6) 0; }
.takeaways h3 { font-size: var(--text-h4); font-family: var(--font-ui); font-weight: 700; display: flex; gap: .5rem; }
.takeaways ul { margin: 0; padding-left: 1.2em; font-size: var(--text-body); }
.takeaways li { margin: .4em 0; }
.pullquote { font-family: var(--font-display); font-style: italic; font-variation-settings: "opsz" 100, "SOFT" 70; font-size: var(--text-h3); line-height: 1.4; border-left: 4px solid var(--amber); padding-left: var(--sp-5); margin: var(--sp-6) 0; color: var(--pine-deep); }

/* ---------- BREADCRUMB ---------- */
.crumbs { font-size: var(--text-xs); font-family: var(--font-mono); color: var(--ink-faint); padding: var(--sp-4) 0; display: flex; gap: .5rem; flex-wrap: wrap; }
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { color: var(--pine); }

/* ---------- FOOTER ---------- */
.site-footer { background: var(--pine-deep); color: #F3EFE6; padding: var(--sp-8) 0 var(--sp-6); margin-top: var(--sp-8); }
.site-footer a { color: #B9C7C0; text-decoration: none; }
.site-footer a:hover { color: var(--amber); }
.foot-grid { display: grid; gap: var(--sp-6); }
@media (min-width: 800px){ .foot-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.foot-grid h5 { font-family: var(--font-mono); text-transform: uppercase; font-size: var(--text-xs); letter-spacing: .12em; color: #7FA295; margin: 0 0 1em; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; font-size: var(--text-sm); }
.foot-legal { margin-top: var(--sp-7); padding-top: var(--sp-5); border-top: 1px solid #2B5A4B; font-size: var(--text-xs); color: #7FA295; line-height: var(--leading-legal); }

@media (prefers-reduced-motion: reduce){ *, *::before, *::after { transition: none !important; animation: none !important; } }
