/* ==========================================================================
   CoreCredit — corecredit.idlery.com
   Idlery Services LLC. Self-contained: no web fonts, no CDN, no trackers.
   ========================================================================== */

/* --------------------------------------------------------------- tokens -- */
:root {
  color-scheme: light dark;

  /* Brand blue sampled from the CoreCredit app icon. */
  --blue: #0053fd;
  --blue-deep: #0039b0;
  --blue-wash: #eaf0ff;
  --blue-edge: #c3d5ff;

  --ground: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --rule: #dbe2ef;
  --rule-strong: #c2ccdf;

  --ink: #0b1220;
  --ink-mid: #3d4a63;
  --ink-soft: #55617a;

  --risk: #a4331f;
  --risk-wash: #fdeeea;
  --settled: #12693f;
  --settled-wash: #e6f4ec;
  --hold: #855100;
  --hold-wash: #fdf1de;

  --shadow-sm: 0 1px 2px rgb(11 18 32 / 0.05), 0 2px 8px rgb(11 18 32 / 0.04);
  --shadow-md: 0 2px 6px rgb(11 18 32 / 0.06), 0 14px 32px rgb(11 18 32 / 0.07);

  --radius-sm: 0.5rem;
  --radius: 0.875rem;
  --radius-lg: 1.25rem;

  --wide: 70rem;
  --prose: 42rem;
  --gutter: clamp(1.125rem, 4vw, 2.5rem);
  --section-y: clamp(3.25rem, 7vw, 5.75rem);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-num: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --blue: #6f9dff;
    --blue-deep: #a8c4ff;
    --blue-wash: #14203a;
    --blue-edge: #2b3f68;

    --ground: #080b12;
    --surface: #131a26;
    --surface-2: #182131;
    --rule: #27303f;
    --rule-strong: #38445a;

    --ink: #f2f5fa;
    --ink-mid: #b9c4d6;
    --ink-soft: #a4b0c4;

    --risk: #ffa695;
    --risk-wash: #2c1512;
    --settled: #74d6a3;
    --settled-wash: #0f2419;
    --hold: #f0c078;
    --hold-wash: #2a1e0a;

    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-md: 0 2px 6px rgb(0 0 0 / 0.4), 0 14px 32px rgb(0 0 0 / 0.35);
  }
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.18;
  letter-spacing: -0.021em;
  font-weight: 700;
  color: var(--ink);
  text-wrap: balance;
}

h1 { font-size: clamp(2rem, 1.35rem + 2.9vw, 3.35rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.35vw, 2.125rem); }
h3 { font-size: clamp(1.125rem, 1.04rem + 0.4vw, 1.3125rem); letter-spacing: -0.012em; }
h4 { font-size: 1.0625rem; letter-spacing: -0.008em; }

p { margin: 0; }
img, svg { max-width: 100%; height: auto; display: block; }

a { color: var(--blue); text-underline-offset: 0.18em; }
a:hover { color: var(--blue-deep); }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  border-radius: 0.25rem;
}

::selection { background: var(--blue); color: #fff; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1.125rem;
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--blue);
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { left: 0.75rem; top: 0.75rem; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ------------------------------------------------------------- layout ---- */
.wrap {
  width: 100%;
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--prose { max-width: calc(var(--prose) + var(--gutter) * 2); }

.section { padding-block: var(--section-y); }
.section--tint { background: var(--surface-2); border-block: 1px solid var(--rule); }

.lede {
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  line-height: 1.6;
  color: var(--ink-mid);
  max-width: 40rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
}

.stack > * + * { margin-top: 1rem; }
.stack-lg > * + * { margin-top: 1.75rem; }

/* ------------------------------------------------------------- header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--rule);
}
@supports not (backdrop-filter: blur(1px)) {
  .site-header { background: var(--ground); }
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  min-height: 4rem;
  padding-block: 0.6rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}
.brand img { border-radius: 22.5%; box-shadow: var(--shadow-sm); }
.brand:hover { color: var(--blue); }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.375rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  display: block;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink-mid);
  text-decoration: none;
}
.site-nav a:hover { color: var(--blue); background: var(--blue-wash); }
.site-nav a[aria-current="page"] { color: var(--blue); background: var(--blue-wash); }

@media (max-width: 30rem) {
  .brand { margin-right: 0; width: 100%; }
  .site-nav { width: 100%; }
  .site-nav ul { justify-content: flex-start; margin-left: -0.6rem; }
}

/* -------------------------------------------------------------- badges --- */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.8rem 0.35rem 0.65rem;
  border: 1px solid var(--blue-edge);
  background: var(--blue-wash);
  color: var(--blue-deep);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.status-pill::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--blue);
}

.tag {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.tag--risk { background: var(--risk-wash); color: var(--risk); }
.tag--settled { background: var(--settled-wash); color: var(--settled); }

/* ------------------------------------------------------------ buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.35rem;
  min-height: 2.875rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 1rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-deep); color: #fff; }
.btn--ghost {
  background: transparent;
  color: var(--blue);
  border-color: var(--rule-strong);
}
.btn--ghost:hover { background: var(--blue-wash); border-color: var(--blue-edge); }
@media (prefers-color-scheme: dark) {
  .btn--primary { color: #06122c; }
  .btn--primary:hover { color: #06122c; }
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

/* --------------------------------------------------------------- hero ---- */
.hero {
  position: relative;
  padding-block: clamp(2.75rem, 6vw, 5rem) var(--section-y);
  background:
    radial-gradient(60rem 32rem at 82% -12%, var(--blue-wash), transparent 62%),
    var(--ground);
}

.hero__grid {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
}
@media (min-width: 60rem) {
  .hero__grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); }
}

.hero__icon {
  border-radius: 22.5%;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
}

.hero h1 { margin-bottom: 1.125rem; }

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  align-items: center;
  margin-top: 1.75rem;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

/* ------------------------------------------------- the "at risk" panel --- */
.riskcard {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: clamp(1.25rem, 3vw, 1.75rem);
}
.riskcard__head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--rule);
}
.riskcard__label {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.riskcard__note { font-size: 0.8125rem; color: var(--ink-soft); }

.statuslist { list-style: none; margin: 0; padding: 0; }
.statuslist li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem 0.75rem;
  align-items: baseline;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule);
}
.statuslist li:last-child { border-bottom: 0; padding-bottom: 0; }
.statuslist .name {
  font-weight: 650;
  font-size: 0.9688rem;
  color: var(--ink);
  flex: 1 1 11rem;
}
.statuslist .what {
  flex: 1 1 100%;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* --------------------------------------------------------- pull quote ---- */
.pull {
  margin: 0;
  padding: clamp(1.5rem, 4vw, 2.25rem) clamp(1.25rem, 4vw, 2.5rem);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.pull p {
  font-size: clamp(1.1875rem, 1.05rem + 0.7vw, 1.625rem);
  line-height: 1.35;
  font-weight: 650;
  letter-spacing: -0.014em;
  text-wrap: balance;
}

/* ---------------------------------------------------------- step flow ---- */
.steps {
  counter-reset: step;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}
@media (min-width: 48rem) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 72rem) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.steps li {
  counter-increment: step;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1.25rem 3.75rem;
  box-shadow: var(--shadow-sm);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 1.25rem;
  top: 1.25rem;
  width: 1.875rem;
  height: 1.875rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
@media (prefers-color-scheme: dark) { .steps li::before { color: #06122c; } }
.steps h3 { margin-bottom: 0.375rem; }
.steps p { font-size: 0.9375rem; color: var(--ink-soft); line-height: 1.55; }

/* ----------------------------------------------------------- features ---- */
.features {
  display: grid;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (min-width: 44rem) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 68rem) { .features { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.features li {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1.375rem;
  box-shadow: var(--shadow-sm);
}
.features h3 { margin-bottom: 0.375rem; }
.features p { font-size: 0.9375rem; color: var(--ink-soft); line-height: 1.55; }

/* -------------------------------------------------------- fact strips ---- */
.facts {
  display: grid;
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (min-width: 40rem) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.facts li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.9rem 1.05rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--ink-mid);
}
.facts li::before {
  content: "";
  flex: none;
  margin-top: 0.45rem;
  width: 0.4375rem;
  height: 0.4375rem;
  border-radius: 50%;
  background: var(--blue);
}

/* -------------------------------------------------------- final panel ---- */
.finale {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 6vw, 3.5rem) clamp(1.25rem, 5vw, 3rem);
  box-shadow: var(--shadow-md);
}
.finale img { margin: 0 auto 1.25rem; border-radius: 22.5%; box-shadow: var(--shadow-sm); }
.finale h2 { margin-bottom: 0.875rem; }
.finale .lede { margin-inline: auto; }
.finale .status-pill { margin-top: 1.5rem; }

.poweredby {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.75rem;
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-mid);
  text-decoration: none;
}
.poweredby:hover { border-color: var(--blue-edge); background: var(--blue-wash); color: var(--blue-deep); }
.poweredby img { border-radius: 0.3rem; }

/* ------------------------------------------------------------- footer ---- */
.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--surface-2);
  padding-block: clamp(2.25rem, 5vw, 3.25rem);
  font-size: 0.9375rem;
  color: var(--ink-soft);
}
.site-footer__grid {
  display: grid;
  gap: 2rem;
}
@media (min-width: 44rem) {
  .site-footer__grid { grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); }
}
.site-footer h2 {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.75rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li + li { margin-top: 0.5rem; }
.site-footer a { color: var(--ink-mid); text-decoration: none; }
.site-footer a:hover { color: var(--blue); text-decoration: underline; }
.site-footer__legal {
  margin-top: 2.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
}
.site-footer__legal p + p { margin-top: 0.4rem; }
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  margin-bottom: 0.75rem;
}
.footer-brand img { border-radius: 22.5%; }

/* --------------------------------------------------------- prose pages -- */
.doc-header {
  padding-block: clamp(2.5rem, 6vw, 4rem) clamp(1.5rem, 4vw, 2.25rem);
  background:
    radial-gradient(48rem 24rem at 12% -30%, var(--blue-wash), transparent 65%),
    var(--ground);
  border-bottom: 1px solid var(--rule);
}
.doc-header h1 { margin-bottom: 0.875rem; }
.doc-meta {
  margin-top: 1.125rem;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}
.doc-meta span + span::before { content: " · "; }

.doc {
  padding-block: clamp(2rem, 5vw, 3rem) clamp(3rem, 7vw, 4.5rem);
  font-size: 1.0625rem;
}
.doc h2 {
  font-size: clamp(1.25rem, 1.13rem + 0.55vw, 1.5rem);
  margin-top: 2.75rem;
  margin-bottom: 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}
.doc h2:first-of-type { margin-top: 1.25rem; }
.doc h3 { margin-top: 1.75rem; margin-bottom: 0.5rem; }
.doc p { margin-bottom: 1rem; line-height: 1.7; color: var(--ink-mid); }
.doc ul, .doc ol { margin: 0 0 1.125rem; padding-left: 1.35rem; color: var(--ink-mid); }
.doc li { margin-bottom: 0.5rem; line-height: 1.65; }
.doc strong { color: var(--ink); font-weight: 650; }

.callout {
  margin: 0 0 1.5rem;
  padding: 1.125rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.callout p { margin-bottom: 0; color: var(--ink); }

.toc {
  margin: 0 0 2rem;
  padding: 1.125rem 1.25rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.toc h2 {
  all: unset;
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.75rem;
}
.toc ol {
  margin: 0;
  padding-left: 1.25rem;
  columns: 2;
  column-gap: 1.75rem;
  font-size: 0.9375rem;
}
@media (max-width: 34rem) { .toc ol { columns: 1; } }
.toc li { margin-bottom: 0.35rem; break-inside: avoid; }

/* FAQ-style support entries */
.qa { margin: 0; }
.qa > div + div { margin-top: 1.75rem; padding-top: 1.75rem; border-top: 1px solid var(--rule); }
.qa dt {
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  font-weight: 700;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin-bottom: 0.5rem;
}
.qa dd { margin: 0; }
.qa dd p { margin-bottom: 0.875rem; color: var(--ink-mid); line-height: 1.65; }
.qa dd p:last-child { margin-bottom: 0; }
.qa dd ul { margin-bottom: 0.875rem; }

/* -------------------------------------------------------------- 404 ------ */
.notfound {
  min-height: 58vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding-block: clamp(3rem, 9vw, 6rem);
}
.notfound img { margin: 0 auto 1.5rem; border-radius: 22.5%; box-shadow: var(--shadow-md); }
.notfound .lede { margin-inline: auto; }
.notfound .btn-row { justify-content: center; }

/* -------------------------------------------------- reduced motion ------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* -------------------------------------------------------------- print --- */
@media print {
  .site-header, .site-footer nav, .skip-link { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .doc h2 { break-after: avoid; }
}

/* ------------------------------------------------------ screen summaries -- */
.screens {
  counter-reset: screen;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}
@media (min-width: 44rem) { .screens { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 68rem) { .screens { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.screens li {
  counter-increment: screen;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1.375rem;
  box-shadow: var(--shadow-sm);
}
.screens li::before {
  content: counter(screen, decimal-leading-zero);
  display: block;
  margin-bottom: 0.5rem;
  font-family: var(--font-num);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--blue);
}
.screens h3 { margin-bottom: 0.375rem; }
.screens p { font-size: 0.9375rem; color: var(--ink-soft); line-height: 1.55; }

.preview-note {
  max-width: 44rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink-soft);
  padding-left: 0.9375rem;
  border-left: 2px solid var(--rule-strong);
}
