/* ClearPayee website layout. NFR-10: colours, type, spacing, radii and shadows come only from
   tokens.css variables and the token type classes (display-xl, display, h1, h2, body,
   body-strong, caption, label, code). Pixel values here are layout only: page width, column
   minimums and breakpoints. IA: docs/design/website.md.

   Dark bands: an element with data-theme="dark" picks up the dark token set, so inside it
   --paper is the ink ground and --ink is the light text, in both page themes. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-width: 0; overflow-x: clip; }
h1, h2, h3, p, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, .cp-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-sm); }
a.cp-btn { text-decoration: none; }
.cp-btn:focus-visible { border-radius: var(--radius-md); }

.muted { color: var(--ink-muted); }
p, li { text-wrap: pretty; }
h1, h2 { text-wrap: balance; }
.visually-hidden, .sprite { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip { position: absolute; z-index: 10; left: var(--space-4); top: calc(-1 * var(--space-12)); background: var(--surface); color: var(--ink); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); }
.skip:focus { top: var(--space-2); }

.wrap { max-width: 1240px; margin: 0 auto; padding-inline: var(--space-4); }

/* Line icons: 1.5px stroke, inline SVG sprite (#i-*). */
.i { flex: none; width: calc(var(--space-4) + var(--space-1)); height: calc(var(--space-4) + var(--space-1)); fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.i--sm { width: var(--space-4); height: var(--space-4); stroke-width: 1.75; }
.i--lg { width: var(--space-6); height: var(--space-6); }

/* Display sizes drop to the wrapper's size (h1) on phones: <h2 class="h1"><span class="display fluid">. */
@media (max-width: 600px) { .fluid { font-size: inherit; line-height: inherit; letter-spacing: inherit; } }

/* ---------- Bands ---------- */
.band { padding-block: var(--space-16); }
.band--paper { background: var(--paper); }
.band--surface { background: var(--surface); }
.band--ink { background: var(--paper); color: var(--ink); }
@media (min-width: 720px) { .band { padding-block: var(--space-24); } }

.section-head { display: grid; gap: var(--space-3); max-width: 880px; margin-bottom: var(--space-12); }

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.btn-lg { font: inherit; min-height: var(--space-12); padding-inline: var(--space-6); border-radius: var(--radius-lg); }
.btn-lg .i { margin-left: var(--space-1); }

/* ---------- Header (ink) ---------- */
.site-head__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-6); padding-block: var(--space-4); }
.site-head__logo:focus-visible { outline-offset: 4px; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-6); }
.site-nav__link { text-decoration: none; color: var(--ink-muted); }
.site-nav__link:hover { color: var(--ink); text-decoration: underline; }

/* ---------- Hero (ink) ---------- */
.band--hero { padding-block: var(--space-12) calc(var(--space-24) * 2); }
.hero { display: grid; gap: var(--space-8); align-items: end; }
.hero__title { max-width: 13em; }
.hero__side { display: grid; gap: var(--space-6); }
.hero__lede { font-weight: 400; color: var(--ink-muted); max-width: 24em; }
.hero .actions { font-weight: 600; }

/* ---------- Product window (quality bar: framed app window) ---------- */
.band--showcase { display: flow-root; padding-block: 0 var(--space-16); }
.showcase { position: relative; margin-top: calc(var(--space-24) * -2 + var(--space-8)); }
.window { background: var(--surface); color: var(--ink); border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-2); }
.window-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) var(--space-6); background: var(--surface); color: var(--ink); border-bottom: 1px solid var(--line); }
.window-bar__logo { font-size: inherit; }
.window-bar { font-size: inherit; }
.window-bar__tag { color: var(--ink-muted); }
.title-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); padding: var(--space-6); border-bottom: 1px solid var(--line); }
.title-row__meta { margin-left: auto; }
.count-pill { font-weight: 600; padding: 2px var(--space-3); border-radius: var(--radius-pill); background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; vertical-align: middle; padding: var(--space-6); }
.table thead th { color: var(--ink-muted); padding-block: var(--space-4); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table tbody tr + tr:not(.row-detail) { border-top: 1px solid var(--line); }
.table .num { text-align: right; font-variant-numeric: lining-nums proportional-nums; white-space: nowrap; }
.row__payee { font-weight: 600; }
.row__acct { white-space: nowrap; }
.row__acct .code { color: var(--ink); }
.row-detail td { padding: 0 var(--space-6) var(--space-6); }

/* Status pills: icon + word + decision colour on its tint (G-10). */
.status { display: inline-flex; align-items: center; gap: var(--space-1); padding: var(--space-1) var(--space-3) var(--space-1) var(--space-2); border-radius: var(--radius-pill); font-weight: 600; white-space: nowrap; justify-self: start; }
.status--pay    { color: var(--pay);    background: var(--pay-tint); }
.status--review { color: var(--review); background: var(--review-tint); }
.status--verify { color: var(--verify); background: var(--verify-tint); }
.status--hold   { color: var(--hold);   background: var(--hold-tint); }
.status--checking { color: var(--ink-muted); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.status__spinner { width: var(--space-3); height: var(--space-3); margin-inline: 2px; border-radius: var(--radius-pill); border: 2px solid currentColor; border-right-color: transparent; animation: cp-spin .8s linear 3; }

.stack { display: inline-grid; }
.stack > * { grid-area: 1 / 1; }
.row-detail .stack { display: grid; }

.checking { display: grid; align-content: center; gap: var(--space-3); padding: var(--space-4) var(--space-6); border-radius: var(--radius-lg); background: var(--paper); }
.bar { display: block; height: var(--space-1); border-radius: var(--radius-pill); background: var(--line); overflow: hidden; max-width: 420px; }
.bar > span { display: block; height: 100%; background: var(--ink-muted); transform-origin: left; animation: cp-fill 2s ease-in-out both; }

.why { display: grid; gap: var(--space-3) var(--space-8); padding: var(--space-4) var(--space-6); border-radius: var(--radius-lg); background: var(--hold-tint); color: var(--ink); }
.why__label { color: var(--hold); }
.why__list { display: grid; gap: var(--space-3) var(--space-8); }
.why__list li { display: flex; gap: var(--space-3); align-items: flex-start; }
.why__list .i { color: var(--hold); margin-top: 1px; }
.why__list li > span { display: grid; }
@media (min-width: 960px) {
  .why { grid-template-columns: auto minmax(0, 1fr); align-items: center; }
  .why__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* The overlaid hero number (demo data, labelled). */
.hero-stat { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-6); margin-top: var(--space-4); padding: var(--space-6); border-radius: var(--radius-xl); background: var(--paper); color: var(--ink); box-shadow: var(--shadow-2), inset 0 0 0 1px var(--line); }
.hero-stat__icon { display: grid; place-items: center; width: var(--space-12); height: var(--space-12); border-radius: var(--radius-pill); background: var(--hold-tint); color: var(--hold); }
.hero-stat__icon .i { width: var(--space-6); height: var(--space-6); }
.hero-stat__num { white-space: nowrap; }
.hero-stat__label { display: grid; }
.showcase__caption { margin-top: var(--space-4); }
@media (min-width: 960px) {
  .hero-stat { position: absolute; right: calc(var(--space-8) + var(--space-12)); bottom: calc(var(--space-12) * -1); margin: 0; padding: var(--space-6) var(--space-8); flex-wrap: nowrap; }
  .hero-stat__label { padding-left: var(--space-6); border-left: 1px solid var(--line); }
  .showcase__caption { margin-top: var(--space-6); max-width: 40%; }
  .band--showcase { padding-bottom: var(--space-24); }
}

/* Motion: Checking -> Hold, once. The resting state is the final state, so reduced motion and
   no-animation both show the verdict straight away. */
.is-checking { opacity: 0; visibility: hidden; animation: cp-out 2.3s ease both; }
.is-result { animation: cp-in .3s 2.2s ease-out both; }
.is-late { animation: cp-in .4s 2.6s ease-out both; }
@keyframes cp-out { 0%, 92% { opacity: 1; visibility: visible; } 100% { opacity: 0; visibility: hidden; } }
@keyframes cp-in { from { opacity: 0; transform: translateY(var(--space-1)); } to { opacity: 1; transform: none; } }
@keyframes cp-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes cp-spin { to { transform: rotate(360deg); } }

/* ---------- Four verdicts ---------- */
.tiles { display: grid; gap: var(--space-4); }
.tile { display: grid; gap: var(--space-2); align-content: start; padding: var(--space-8); border-radius: var(--radius-xl); color: var(--ink); }
.tile__icon { display: grid; place-items: center; width: var(--space-12); height: var(--space-12); border-radius: var(--radius-pill); background: var(--surface); margin-bottom: var(--space-8); }
.tile__word { margin-bottom: var(--space-2); }
.tile__do { color: var(--ink); }
.tile--pay    { background: var(--pay-tint); }    .tile--pay    .tile__word, .tile--pay    .tile__icon { color: var(--pay); }
.tile--review { background: var(--review-tint); } .tile--review .tile__word, .tile--review .tile__icon { color: var(--review); }
.tile--verify { background: var(--verify-tint); } .tile--verify .tile__word, .tile--verify .tile__icon { color: var(--verify); }
.tile--hold   { background: var(--hold-tint); }   .tile--hold   .tile__word, .tile--hold   .tile__icon { color: var(--hold); }

/* ---------- How it works ---------- */
.steps { display: grid; gap: var(--space-12); position: relative; }
.step { display: grid; gap: var(--space-2); align-content: start; position: relative; }
.step__icon { display: grid; place-items: center; width: var(--space-16); height: var(--space-16); border-radius: var(--radius-lg); background: var(--ink); color: var(--surface); margin-bottom: var(--space-4); }
.step .h2 { max-width: 14em; }
.step .body { max-width: 30em; }

/* ---------- What we catch (ink) ---------- */
.bento { display: grid; gap: var(--space-4); }
.catch { display: grid; gap: var(--space-3); align-content: start; padding: var(--space-6); border-radius: var(--radius-xl); background: var(--surface); }
.catch .status { margin-top: var(--space-1); }
.catch__text { display: grid; gap: var(--space-3); align-content: center; }
.mini { display: grid; gap: var(--space-2); align-content: center; min-height: calc(var(--space-24) + var(--space-6)); padding: var(--space-4); margin-bottom: var(--space-3); border-radius: var(--radius-lg); background: var(--paper); }
.chip { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-1) var(--space-3); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); justify-self: start; }
.chip--old { color: var(--ink-muted); text-decoration: line-through; }
.chip--old .code { color: var(--ink-muted); }
.chip--new { background: var(--ink); color: var(--paper); box-shadow: none; }
.mini__swap { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.mini__swap > .i { flex: none; }
.mini__arrow { color: var(--ink-muted); }
.mini__line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-1) var(--space-3); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--surface); }
.mini__line--hit { background: var(--ink); color: var(--paper); }
.mini__line .caption { font-variant-numeric: lining-nums proportional-nums; }
.mini__line .caption:nth-child(2) { margin-left: auto; }
.mini--shared { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.mini__names { display: grid; gap: var(--space-2); }
.mini--bars { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-3); }
.bars { display: flex; align-items: flex-end; gap: var(--space-2); height: var(--space-16); }
.bars > span { width: var(--space-4); border-radius: var(--radius-sm); background: var(--line-strong); height: var(--space-4); }
.bars > span:nth-child(2) { height: var(--space-6); }
.bars > span:nth-child(3) { height: calc(var(--space-4) + var(--space-1)); }
.bars > span:nth-child(4) { height: var(--space-6); }
.bars > span:nth-child(5) { height: calc(var(--space-4) + var(--space-1)); }
.bars > .bars__hit { height: var(--space-16); background: var(--ink); }
.mini--bars .caption { font-weight: 600; }

/* ---------- Why it matters ---------- */
.proof { display: grid; gap: var(--space-4); }
.proof__card { display: grid; gap: var(--space-3); align-content: start; padding: var(--space-8); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow-1); }
.proof__src { margin-top: var(--space-3); }
.proof__card--try .actions { margin-top: var(--space-3); }
.facts { display: grid; gap: var(--space-6); margin-top: var(--space-12); }
.fact { display: flex; gap: var(--space-3); align-items: flex-start; padding-top: var(--space-6); border-top: 1px solid var(--line); }
.fact .i { margin-top: 1px; }
.fact > div { display: grid; gap: var(--space-1); }

/* ---------- Closing (ink) ---------- */
.closing { display: grid; justify-items: center; text-align: center; gap: var(--space-6); }
.closing .h1 { max-width: 16em; }
.closing .actions { justify-content: center; font-weight: 600; }

/* ---------- Footer ---------- */
.site-foot { background: var(--paper); border-top: 1px solid var(--line); padding-block: var(--space-12); }
.site-foot__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-6); }
.site-foot__links { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); }
.site-foot__legal { flex-basis: 100%; }

/* ---------- Simple pages (fraud-now) ---------- */
.page-hero { display: grid; gap: var(--space-6); max-width: 760px; }
.page-hero .h2 { font-weight: 400; color: var(--ink); }
.page-cards { display: grid; gap: var(--space-4); }
.page-card { display: grid; gap: var(--space-4); align-content: start; padding: var(--space-8); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow-1); }
.page-card ul { display: grid; gap: var(--space-3); }
.page-card li { display: flex; gap: var(--space-3); align-items: flex-start; }
.page-card li .i { margin-top: 1px; }
.band--page { padding-block: var(--space-16); }
.page-note { margin-top: var(--space-8); }

/* ---------- Dark page theme ---------- */
/* Ink bands and paper bands share a ground in dark mode, so a hairline marks the change. */
@media (prefers-color-scheme: dark) {
  .band.band--ink:not(.band--hero) { border-block: 1px solid var(--line); }
  .window { box-shadow: var(--shadow-2), 0 0 0 1px var(--line); }
  .proof__card, .page-card { box-shadow: inset 0 0 0 1px var(--line); }
}

/* ---------- Phone: the window table becomes stacked rows ---------- */
@media (max-width: 719px) {
  .window-bar { padding-inline: var(--space-4); }
  .title-row { padding: var(--space-4); }
  .title-row__meta { margin-left: 0; flex-basis: 100%; }
  .table, .table tbody { display: block; }
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .table tr.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2) var(--space-3); padding: var(--space-4); align-items: center; }
  .table tr.row > * { display: block; padding: 0; }
  .row__payee { grid-column: 1; grid-row: 1; }
  .row__amt { grid-column: 2; grid-row: 1; }
  .row__acct { grid-column: 1; grid-row: 2; }
  .row__status { grid-column: 2; grid-row: 2; justify-self: end; }
  .row__why { grid-column: 1 / -1; grid-row: 3; }
  .table tr.row--focus .row__why { display: none; }
  .table tr.row-detail, .table tr.row-detail td { display: block; }
  .row-detail td { padding: 0 var(--space-4) var(--space-4); }
  .why, .checking { padding: var(--space-4); }
}

/* ---------- Wider screens ---------- */
@media (min-width: 720px) {
  .wrap { padding-inline: var(--space-8); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-8); }
  .steps::before { content: ""; position: absolute; top: var(--space-8); left: var(--space-16); right: var(--space-16); height: 1px; background: var(--line); }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catch--wide { grid-column: 1 / -1; }
  .proof { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proof__card--try { grid-column: 1 / -1; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 960px) {
  .hero { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-12); }
  .band--hero { padding-top: var(--space-16); }
  .catch--wide { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-8); align-items: center; }
  .catch--wide { align-content: stretch; padding: var(--space-8); }
  .catch--wide .mini { margin: 0; align-self: stretch; gap: var(--space-4); padding: var(--space-8); }
  .catch--wide .chip { padding: var(--space-2) var(--space-4); }
  .catch--wide .chip .code { font-size: inherit; }
  .catch--wide .mini__swap { flex-wrap: nowrap; }
}
@media (min-width: 1100px) {
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .bento { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .catch--wide { grid-column: span 2; }
  .proof__card--try { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--space-12); }
  .proof__card--try .h2, .proof__card--try .body { grid-column: 1; }
  .proof__card--try .actions { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
  .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 479px) {
  .site-nav__link[href="sample-report.html"] { display: none; }
  .actions .cp-btn { flex: 1 1 100%; }
  .tile, .proof__card, .page-card { padding: var(--space-6); }
  .tile { grid-template-columns: auto minmax(0, 1fr); column-gap: var(--space-4); }
  .tile > p { grid-column: 1 / -1; }
  .tile__icon { margin: 0; }
  .tile__word { margin: 0; align-self: center; }
  .catch { padding: var(--space-4); }
}

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

@media print {
  .site-head, .skip, .actions, .site-nav { display: none; }
  .band { padding-block: var(--space-8); }
  .band--ink, .band--hero { background: none; }
  .tile, .step, .catch, .proof__card, .fact, .window { break-inside: avoid; }
  .is-checking { display: none; }
  .is-result, .is-late { animation: none; }
}
