/* =============================================================================
   Lendspedia — Increase-inspired colour layer (Nov 2026)
   -----------------------------------------------------------------------------
   ADDITIVE OVERRIDE. Loaded AFTER css/aave-theme.css (and after
   aave-theme-quiz.css on loan-quiz.html). Never edits either file.
   Revert = delete the <link> to this file.

   What it does:
     - retires the periwinkle family by re-pointing the --peri-* tokens at
       increase.com's green -> teal -> sky gradient, so every existing usage
       follows without touching the rules that use them
     - mint #31F2BF action buttons with near-black text (13:1)
     - the hero "ribbon staircase" (geometry + timing measured from
       increase.com; see .reanimate/increase-palette/spec.md)

   Contrast (measured on white unless noted):
     #00786d teal text 5.37:1 · #045b54 on mint tints 7.0:1+ ·
     #0a6f8f sky text 5.70:1 · #1aa39a display text 3.11:1 (large type only) ·
     #0b1220 on #31F2BF 13.0:1 · #0b1220 on #DEFF34 16.5:1
   ============================================================================ */

/* === 1. TOKENS =========================================================== */
:root {
  /* Increase's gradient stops, as fills only — none of these pass as text. */
  --lime:  #DEFF34;
  --mint:  #31F2BF;
  --mint-hover: #1fe0ae;
  --green-bright: #12F0AA;
  --teal:  #01D3D8;
  --sky:   #34BCFF;
  --azure: #02A7FF;
  --ink:   #0b1220;
  --grad:  linear-gradient(90deg, #DEFF34 0%, #65F75F 18%, #12F0AA 36%, #33DFDF 56%, #02B7F1 76%, #34BCFF 100%);

  /* The periwinkle names stay (dozens of rules read them); the colours change. */
  --peri:   #31F2BF;
  --peri-2: #9cf5dc;
  --peri-3: #c2f9e8;
  --peri-4: #e0fbf3;
  --peri-5: #f0fdf9;
  --peri-display: #1aa39a;
  --peri-text:    #00786d;
  --peri-ink:     #045b54;

  /* "Blue" becomes the sky end of the gradient, darkened for text. */
  --blue:      #0a6f8f;
  --blue-dark: #075a75;
  --blue-deep: #064a61;
  --blue-light: var(--peri-3);
  --blue-tint:  var(--peri-5);
}

/* aave-theme.css hard-codes the periwinkle ink in a handful of rules. */
.section-label, .hero-eyebrow,
.urgency-badge, .hiw-num, .match-step-num, .faq-chevron, .avatar,
.compare-table td.highlight, .page-header .section-label,
.answer-box .answer-label, .guide-card .guide-tag, .ps-chips span {
  color: var(--peri-ink);
}

/* === 2. BUTTONS =========================================================== */
.btn-blue,
.sticky-cta .btn-blue {
  background: var(--mint);
  color: var(--ink);
}
.btn-blue:hover {
  background: var(--mint-hover);
  color: var(--ink);
}
.btn-blue:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* Nav pill stays near-black like Increase's "Sign up"; it turns mint on hover. */
.btn-quiz-pill { background: var(--ink); }
.btn-quiz-pill:hover { background: var(--mint); color: var(--ink) !important; }

/* Quiz funnel (loan-quiz.html) — next button and slider shadows. */
.btn-quiz-next { background: var(--mint); color: var(--ink); }
.btn-quiz-next:hover { background: var(--mint-hover); }
.slider-wrap input[type="range"]::-webkit-slider-thumb,
input[type="range"]::-webkit-slider-thumb { box-shadow: 0 2px 8px rgba(18, 240, 170, .45); }
input[type="range"]::-moz-range-thumb { box-shadow: 0 2px 8px rgba(18, 240, 170, .45); }

/* === 3. COLOUR ACCENTS ===================================================== */
/* Hero eyebrow becomes Increase's chartreuse announcement pill. */
#hero .hero-eyebrow {
  display: inline-block;
  background: var(--lime);
  border: 0;
  border-radius: 6px;
  padding: 7px 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: none;
}

/* Big numbers on the dark panels pick up the gradient (all stops clear 7:1 on plum). */
#stats .stat-item strong,
.research-stat {
  background: linear-gradient(90deg, #DEFF34, #31F2BF 45%, #34BCFF);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* A thin gradient rule along the top of the dark panels. */
#stats > .container,
#research > .container { position: relative; }
#stats > .container::before,
#research > .container::before {
  content: "";
  position: absolute;
  left: 32px; right: 32px; top: 0;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--grad);
}

/* === 4. HERO RIBBONS ======================================================= */
/* Markup is generated per page (step count and colour window differ by page so
   no two heroes share identical furniture). Each piece carries its own geometry
   in custom properties: --l --t --w --h (percent of the box), --g1/--g2, --d. */
#hero { position: relative; isolation: isolate; }
#hero > .container { position: relative; z-index: 1; }

.ribbons {
  --rb-w: 1400px;
  position: absolute;
  z-index: 0;
  pointer-events: none;
  width: calc(var(--rb-w) * var(--rb-units, 1));
  aspect-ratio: var(--rb-ratio, 1.7067);
  transform: rotate(-20deg);
  transform-origin: top right;
}
.ribbons-inner { position: relative; width: 100%; height: 100%; }
.rb {
  position: absolute;
  left: var(--l); top: var(--t);
  width: var(--w); height: var(--h);
  background: linear-gradient(90deg, var(--g1), var(--g2, var(--g1)));
  animation-duration: .18s;
  animation-delay: var(--d, 0s);
  animation-timing-function: cubic-bezier(.25, .46, .45, .94);
  animation-fill-mode: backwards;
}
.rb-bar  { z-index: 1; transform-origin: bottom; animation-name: rb-bar; }
.rb-diag { clip-path: polygon(0 0, 100% 41%, 100% 100%, 0 59%); animation-name: rb-diag; }
.rb-last { animation-duration: 1s; animation-timing-function: cubic-bezier(.23, 1, .32, 1); }

@keyframes rb-bar  { 0% { opacity: 0; transform: scaleY(0); } 100% { opacity: 1; transform: none; } }
@keyframes rb-diag { 0% { clip-path: polygon(0 0, 0 0, 0 59%, 0 59%); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .rb { animation: none; }
}

/* --- Homepage: staircase rises behind the phone cluster ------------------- */
.ribbons--home {
  --rb-w: 1200px;
  right: calc(50% - 510px);
  bottom: 100px;
}
#hero:has(.ribbons--home) .phone-cluster { position: relative; z-index: 1; }

/* --- Loan pages: text left, staircase right (Increase's own layout) ------- */
@media (min-width: 1181px) {
  #hero:has(.ribbons--page) { text-align: left; padding: 96px 0 104px; }
  #hero:has(.ribbons--page) h1 { margin-left: 0; max-width: 13ch; }
  #hero:has(.ribbons--page) .hero-sub { margin-left: 0; max-width: 540px; }
  /* Same footprint on every loan page; only the shape inside varies. */
  .ribbons--page {
    width: 760px;
    right: calc(50% - 740px);
    top: 30px;
  }
}
/* Narrower screens: copy stays centred and the staircase becomes a band under
   the button, rising out of the bottom edge of the hero. */
@media (max-width: 1180px) {
  #hero:has(.ribbons--page) { padding-bottom: 230px; }
  .ribbons--page {
    width: 520px;
    right: calc(50% - 212px);
    top: calc(100% - 190px);   /* top-anchored: the highest step lands in the same place whatever the shape */
  }
}
@media (max-width: 760px) {
  .ribbons--home { --rb-w: 760px; right: calc(50% - 330px); bottom: 60px; }
  .ribbons--page { width: 320px; right: calc(50% - 139px); top: calc(100% - 155px); }
  #hero:has(.ribbons--page) { padding-bottom: 190px; }
}

/* Scroll-triggered playback (js/main.js). Paused animations also pause their
   delay, so the stagger survives; the 0.8s load-time lead-in is dropped. */
.ribbons.rb-wait .rb { animation-play-state: paused; }
.ribbons.rb-scrolled .rb { animation-delay: calc(var(--d, .8s) - .7s); }

/* === 5. LOAN-PAGE DEMOS ==================================================== */
/* One per loan page, each a different shape (track, stacked bar, table, merge,
   checklist) so the five pages never share furniture. Finished state is the
   markup; js/loan-demos.js replays it on scroll. */
.science-visual.demo {
  --q: cubic-bezier(.23, 1, .32, 1);
  text-align: left;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 24px;
  padding: 28px;
  position: relative;
  overflow: hidden;
}
.science-visual.demo::before {           /* gradient hairline, same family as the hero */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--grad);
}
.demo-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.demo-kicker { font-size: 13px; font-weight: 600; color: var(--slate); letter-spacing: -.005em; }
.demo-tag {
  font-size: 11px; font-weight: 500; letter-spacing: .04em; color: var(--peri-ink);
  background: var(--peri-4); border-radius: 999px; padding: 3px 9px; white-space: nowrap;
}
#science .demo .demo-big { margin: 0 0 18px; font-size: 15px; line-height: 1.3; color: var(--gray-600); }
.demo-big .demo-num {
  display: block; font-family: var(--display); font-size: 56px; font-weight: 500;
  letter-spacing: -.045em; line-height: 1; color: var(--slate); font-variant-numeric: tabular-nums;
}
#science .demo .demo-note { font-size: 13px; line-height: 1.55; color: var(--gray-500); margin: 16px 0 0; }
.demo table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.demo td, .demo th { padding: 8px 0; border-bottom: 1px solid var(--gray-200); text-align: left; color: var(--gray-700); }
.demo td:last-child, .demo th:last-child { text-align: right; }
.demo th { font-size: 11.5px; font-weight: 500; color: var(--gray-500); letter-spacing: .02em; }

/* --- refi: break-even track ---------------------------------------------- */
.be-track { position: relative; height: 14px; border-radius: 999px; background: var(--gray-100); margin: 4px 0 10px; }
.be-fill {
  position: absolute; inset: 0 auto 0 0; width: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #DEFF34, #31F2BF 60%, #34BCFF);
  transform-origin: left; transform: scaleX(var(--p, 1));
}
.be-goal { position: absolute; right: 0; top: -6px; bottom: -6px; width: 2px; background: var(--ink); }
.be-goal span { position: absolute; right: 0; top: -22px; font-size: 11px; font-weight: 500; color: var(--gray-600); white-space: nowrap; }
#science .demo .be-saved { font-size: 13.5px; margin: 0 0 14px; color: var(--gray-600); }
.be-saved b { color: var(--peri-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.demo-assume { list-style: none; margin: 0; padding: 12px 0 0; border-top: 1px dashed var(--gray-200); }
.demo-assume li { font-size: 12.5px; line-height: 1.5; color: var(--gray-600); padding-left: 14px; position: relative; }
.demo-assume li::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; border-radius: 2px; background: var(--mint); }

/* --- heloc: stacked equity bar ------------------------------------------- */
.ltv-bar { position: relative; display: flex; height: 46px; border-radius: 10px; overflow: visible; margin: 26px 0 16px; }
.ltv-seg { width: var(--w); position: relative; display: flex; align-items: center; padding: 0 10px; font-size: 11.5px; font-weight: 500; white-space: nowrap; overflow: hidden; transform-origin: left; }
.ltv-owed { background: var(--slate); color: #fff; border-radius: 10px 0 0 10px; }
.ltv-line { background: linear-gradient(90deg, #12F0AA, #31F2BF); color: var(--ink); }
.ltv-keep { background: repeating-linear-gradient(135deg, var(--gray-100) 0 6px, #fff 6px 12px); color: var(--gray-600); border-radius: 0 10px 10px 0; border: 1px solid var(--gray-200); }
.ltv-cap { position: absolute; left: 85%; top: -10px; bottom: -6px; width: 2px; background: var(--ink); }
.ltv-cap span { position: absolute; left: 50%; top: -18px; transform: translateX(-50%); font-size: 11px; font-weight: 600; color: var(--slate); white-space: nowrap; }
.ltv-total td { font-weight: 600; color: var(--slate); border-bottom: 0; }

/* --- va: fee table with a moving highlight ------------------------------- */
.va-table tbody tr { transition: background .35s var(--q); }
.va-table tbody tr.is-on td { background: var(--peri-5); color: var(--peri-ink); font-weight: 600; }
.va-table tbody tr td:first-child { padding-left: 8px; border-radius: 8px 0 0 8px; }
.va-table tbody tr td:last-child { padding-right: 8px; border-radius: 0 8px 8px 0; }
.va-table th:first-child { padding-left: 8px; } .va-table th:last-child { padding-right: 8px; }

/* --- debt: cards merging into one loan ----------------------------------- */
.merge { position: relative; height: 128px; margin: 4px 0 14px; }
.merge-card, .merge-loan {
  position: absolute; top: 0; height: 58px; border-radius: 12px; padding: 9px 12px;
  display: flex; flex-direction: column; justify-content: center; font-variant-numeric: tabular-nums;
}
.merge-card span, .merge-loan span { font-size: 11px; font-weight: 500; opacity: .8; }
.merge-card b, .merge-loan b { font-family: var(--display); font-size: 18px; font-weight: 500; letter-spacing: -.02em; }
.merge-card {
  width: calc((100% - 16px) / 3); left: calc(var(--i) * ((100% - 16px) / 3 + 8px));
  background: var(--slate); color: #fff;
  transition: transform .7s var(--q), opacity .5s;
}
.merge-loan {
  left: 0; right: 0; top: 70px; background: linear-gradient(90deg, #DEFF34, #31F2BF 55%, #34BCFF); color: var(--ink);
  transition: transform .6s var(--q), opacity .4s;
}
.merge.is-split .merge-loan { opacity: 0; transform: translateY(-10px) scaleX(.6); }
.merge.is-merging .merge-card { transform: translate(calc((1 - var(--i)) * 104%), 70px) scale(.9); opacity: 0; }
.merge-math td.merge-win { color: var(--peri-ink); font-weight: 600; }

/* --- business: profile checklist ----------------------------------------- */
.biz-profile { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.biz-chip { font-size: 12px; font-weight: 500; padding: 5px 10px; border-radius: 999px; background: var(--gray-100); color: var(--slate); transition: background .3s, color .3s; }
.biz-chip.is-flash { background: var(--lime); color: var(--ink); }
.biz-checks { list-style: none; margin: 0; padding: 0; }
.biz-checks li { display: flex; align-items: baseline; gap: 10px; font-size: 13.5px; line-height: 1.45; padding: 8px 0; border-bottom: 1px solid var(--gray-200); color: var(--gray-700); transition: opacity .3s; }
.biz-checks em { font-style: normal; color: var(--gray-500); }
.biz-mark { flex: 0 0 18px; height: 18px; border-radius: 50%; position: relative; top: 3px; background: var(--gray-100); transition: background .3s, transform .35s var(--q); }
.biz-checks li.ok .biz-mark { background: var(--mint); }
.biz-checks li.ok .biz-mark::after { content: ""; position: absolute; left: 6px; top: 3px; width: 5px; height: 9px; border: solid var(--ink); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.biz-checks li.no .biz-mark { background: #ffe1e1; }
.biz-checks li.no .biz-mark::after { content: "\00d7"; position: absolute; inset: 0; text-align: center; line-height: 18px; font-size: 14px; font-weight: 600; color: #a61b1b; }
.biz-checks li.no { color: var(--gray-500); }
.biz-checks li.is-pending .biz-mark { background: var(--gray-100); transform: scale(.7); }
.biz-checks li.is-pending .biz-mark::after { content: none; }
#science .demo .biz-status { margin: 14px 0 0; }
.biz-result { font-size: 12.5px; background: var(--ink); color: var(--mint); padding: 6px 10px; border-radius: 8px; display: inline-block; }

/* Shared reveal used by the script (rows, segments) */
.demo .is-hidden { opacity: 0; transform: translateY(6px); }
.demo .ltv-seg.is-hidden { transform: scaleX(0); opacity: 1; }
.demo [data-anim] { transition: opacity .45s var(--q), transform .6s var(--q); }

@media (max-width: 760px) {
  .science-visual.demo { padding: 22px 18px; }
  .demo-big .demo-num { font-size: 44px; }
  .merge-card b { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .demo [data-anim], .merge-card, .merge-loan, .va-table tbody tr, .biz-mark { transition: none; }
}
