@import url('tokens.css');

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 44rem; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }

header.site {
  border-bottom: 1px solid var(--line); background: var(--surface);
  position: sticky; top: 0; z-index: 10;
}
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 60px; }
.logo { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
header.site nav { display: flex; gap: 1.1rem; flex-wrap: wrap; }
header.site nav a { color: var(--ink-soft); text-decoration: none; font-size: .9rem; }
header.site nav a:hover, header.site nav a[aria-current] { color: var(--accent); }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 .5rem; }
h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); margin-top: 2.5rem; }
.lede { font-size: 1.1rem; color: var(--ink-soft); max-width: 40rem; }

.hero { padding: 3.5rem 0 2rem; }
.hero .flag {
  display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent); background: var(--accent-bg);
  padding: .3rem .6rem; border-radius: 99px; margin-bottom: 1rem;
}

.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.25rem;
}
a.card { text-decoration: none; color: inherit; display: block; transition: border-color .15s, transform .15s; }
a.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card h3 { font-size: 1.05rem; margin-bottom: .35rem; }
.card p { margin: 0; color: var(--ink-soft); font-size: .92rem; }
.card .tag { font-size: .72rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .06em; }

/* ---- tool ---- */
.tool { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); padding: 2rem 0 3rem; }
@media (min-width: 62rem) { .tool { grid-template-columns: 22rem minmax(0, 1fr); align-items: start; } }

.field { margin-bottom: .9rem; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .25rem; }
.field .help { font-size: .78rem; color: var(--ink-faint); margin-top: .25rem; }
.field input[type=text], .field input[type=number], .field select {
  width: 100%; padding: .55rem .65rem; font: inherit; font-size: .95rem;
  color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px;
}
.field input:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.field.inline { display: flex; align-items: center; gap: .5rem; }
.field.inline label { margin: 0; }

.debt-row { display: grid; grid-template-columns: 1.4fr 1fr .7fr 1fr auto; gap: .4rem; align-items: end; margin-bottom: .5rem; }
.debt-row .field { margin: 0; }
.debt-row label { font-size: .72rem; }
.btn-mini {
  border: 1px solid var(--line); background: var(--bg); color: var(--ink-soft);
  border-radius: 6px; cursor: pointer; padding: .5rem .6rem; font: inherit; line-height: 1;
}
.btn-mini:hover { border-color: var(--bad); color: var(--bad); }

.btn {
  display: inline-block; background: var(--accent); color: var(--accent-ink);
  border: 0; border-radius: 8px; padding: .7rem 1.2rem;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }

.headline { text-align: center; padding: 1.5rem 1rem; border-radius: var(--radius); background: var(--accent-bg); margin-bottom: 1rem; }
.headline .v { font-size: clamp(2rem, 6vw, 3rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
.headline .l { color: var(--ink-soft); font-size: .95rem; }
.headline.good .v { color: var(--good); }
.headline.warn .v { color: var(--warn); }
.headline.bad  .v { color: var(--bad); }

table.rows { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.rows td { padding: .6rem .25rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.rows td:first-child { color: var(--ink-soft); width: 55%; }
table.rows td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

.verdict { margin-top: 1rem; padding: 1rem; border-left: 3px solid var(--accent); background: var(--accent-bg); border-radius: 0 8px 8px 0; }
.verdict p { margin: 0; }
.footnote { font-size: .8rem; color: var(--ink-faint); margin-top: .75rem; }

.capture { margin-top: 1.25rem; padding: 1.25rem; border: 1px dashed var(--line); border-radius: var(--radius); }
.capture h3 { font-size: 1rem; }
.capture form { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .6rem; }
.capture input { flex: 1 1 14rem; padding: .6rem .7rem; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); }
.capture .note { font-size: .78rem; color: var(--ink-faint); margin-top: .5rem; }

.disclaimer {
  margin: 2rem 0; padding: 1rem; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface);
  font-size: .85rem; color: var(--ink-soft);
}
.disclaimer strong { color: var(--ink); }

footer.site { border-top: 1px solid var(--line); margin-top: 3rem; padding: 2rem 0; color: var(--ink-faint); font-size: .85rem; }
footer.site nav { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
footer.site a { color: var(--ink-soft); }

article.prose { max-width: 42rem; }
article.prose p, article.prose li { font-family: var(--serif); font-size: 1.06rem; }
article.prose h2 { font-family: var(--sans); }
article.prose blockquote { margin: 1.5rem 0; padding-left: 1rem; border-left: 3px solid var(--accent); color: var(--ink-soft); }

/* ---- narrow screens ---- */
@media (max-width: 40rem) {
  header.site .wrap { flex-direction: column; align-items: flex-start; gap: .4rem; padding-top: .6rem; padding-bottom: .6rem; }
  header.site nav {
    gap: .9rem; width: 100%; overflow-x: auto; padding-bottom: .2rem;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  header.site nav::-webkit-scrollbar { display: none; }
  header.site nav a { white-space: nowrap; }

  /* Five columns will not fit. Give each debt its own labelled block. */
  .debt-row {
    grid-template-columns: 1fr 1fr; gap: .5rem;
    padding: .75rem; border: 1px solid var(--line); border-radius: 8px; margin-bottom: .75rem;
  }
  .debt-row .field:first-child { grid-column: 1 / -1; }
  .debt-row .btn-mini { grid-column: 1 / -1; justify-self: end; }

  table.rows td { font-size: .88rem; }
  table.rows td:first-child { width: 50%; }
}

/* ---- offers ---- */
.offers { margin-top: 1.25rem; }
.offers h3 { font-size: 1.05rem; margin-bottom: .15rem; }
.offers .muted { color: var(--ink-soft); font-size: .9rem; margin: 0 0 .75rem; }
.offer {
  display: flex; gap: 1rem; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .9rem 1rem; margin-bottom: .6rem;
}
.offer-name { font-weight: 600; }
.offer-facts { list-style: none; margin: .25rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.offer-facts li { font-size: .82rem; color: var(--ink-soft); }
.offer-facts li + li::before { content: '· '; color: var(--ink-faint); }
.offer-empty {
  border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 1rem; font-size: .9rem; color: var(--ink-soft);
}
.offer-empty strong { display: block; color: var(--ink); margin-bottom: .2rem; }
.offer-disclosure { font-size: .78rem; color: var(--ink-faint); margin-top: .6rem; }
@media (max-width: 40rem) {
  .offer { flex-direction: column; align-items: stretch; gap: .6rem; }
  .offer .btn { text-align: center; }
}

/* ---- answer-first + claims ---- */
.answer {
  background: var(--accent-bg); border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem; margin: 1.5rem 0 2rem;
}
.answer h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em;
  margin: 0 0 .4rem; color: var(--accent); }
.answer p { margin: 0; font-size: 1.05rem; }
ul.claims { padding-left: 1.1rem; }
ul.claims li { margin-bottom: .5rem; }
article.prose h3 { font-family: var(--sans); font-size: 1.02rem; margin-top: 1.5rem; }
