/* Articles: the index and one page per grade. Tokens, nav and footer come from styles.css.
   Figures on each page are the app's own (packages/core/domain/logic/gradeEstimate.ts). */
.nav-links a[aria-current="page"] { color: var(--ink); }

.a-hero { max-width: 1040px; margin: 0 auto; padding: 84px 16px 0; text-align: center; }
.crumbs { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-bottom: 26px; font-size: 14px; color: var(--ink-70); }
.crumbs a { border-bottom: 1px solid var(--ink-30); }
.crumbs a:hover { border-color: var(--ink); }
.a-hero h1 { font-size: clamp(40px, 5.6vw, 76px); line-height: 1.04; letter-spacing: -.04em; max-width: 920px; margin-left: auto; margin-right: auto; }
.a-lede { max-width: 640px; margin: 24px auto 0; font-size: clamp(18px, 1.6vw, 22px); line-height: 1.4; color: var(--ink-70); }

.stats { display: grid; grid-template-columns: 1.35fr 1fr 1fr 1fr; gap: 12px; margin-top: 44px; }
/* Each card spans three shared rows (label, figure, note) so the figures sit level whatever the label wraps to. */
.stat { text-align: left; display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 8px; align-content: start; padding: 20px; border-radius: var(--radius-m); background: var(--surface); border: 1px solid var(--hair); }
.stat small { font-size: 12px; line-height: 1.5; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.stat b { font-family: var(--serif); font-weight: 300; font-size: clamp(26px, 2.3vw, 32px); line-height: 1.05; letter-spacing: -.02em; }
.stat b i { font-family: var(--sans); font-style: normal; font-size: 14px; letter-spacing: 0; color: var(--ink-70); margin: 0 .3em; }
.stat span { font-size: 13.5px; color: var(--ink-70); }
.stat.back { background: var(--green-bg); border-color: transparent; }
.stat.back b { color: var(--green); }
.a-caveat { margin-top: 14px; font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--muted); }
/* the grade's take-home pay, in the take-home pay calculator */
.a-calc { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; margin-top: 12px; font-size: 15px; }
.a-calc a { color: var(--nhs-blue); border-bottom: 1px solid rgba(0, 94, 184, .4); padding-bottom: 1px; }
.a-calc a:hover { border-color: var(--nhs-blue); }

.a-sec { max-width: 1040px; margin: 0 auto; padding: 84px 16px 0; }
.a-sec h2 { max-width: 760px; margin-left: auto; margin-right: auto; text-align: center; font-family: var(--serif); font-weight: 300; font-size: clamp(30px, 3.6vw, 48px); line-height: 1.08; letter-spacing: -.035em; }
.a-sec h2 em { font-style: italic; }
.prose { max-width: 620px; margin: 16px auto 0; text-align: center; font-size: 18px; line-height: 1.55; color: var(--ink-70); }
.prose + .prose { margin-top: 12px; }

/* Cost breakdown: one cut receipt per expense, in the Inbox tile's receipt look.
   The paper is masked to a zigzag bottom edge; the drop shadow sits on the wrapper so the mask does not clip it. */
/* Flex, not grid: a row with fewer receipts than the widest row stays centred instead of leaving a gap on one side. */
.slips { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 26px 22px; margin-top: 32px; padding: 6px 0 10px; }
.slip { flex: 0 0 232px; width: 232px; --z: 11px; --rot: 0deg; transform: rotate(var(--rot)); transition: transform .45s cubic-bezier(.34, 1.4, .64, 1);
  filter: drop-shadow(0 0 .6px rgba(28, 28, 28, .45)) drop-shadow(0 12px 14px rgba(39, 37, 30, .1)); }
.slip:nth-child(3n+1) { --rot: -1.5deg; }
.slip:nth-child(3n+2) { --rot: 1.1deg; }
.slip:nth-child(3n) { --rot: -.7deg; }
@media (hover: hover) { .slip:hover { transform: rotate(0) translateY(-5px); } }
.slip-paper {
  height: 100%; display: flex; flex-direction: column; padding: 16px 18px calc(var(--z) + 20px);
  background: #fff; border-radius: 12px 12px 0 0; font-size: 13px; line-height: 1.45;
  -webkit-mask: linear-gradient(#000 0 0) top / 100% calc(100% - var(--z)) no-repeat, conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(var(--z) * 2) var(--z) repeat-x;
          mask: linear-gradient(#000 0 0) top / 100% calc(100% - var(--z)) no-repeat, conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(var(--z) * 2) var(--z) repeat-x;
}
.slip .rcpt-head { margin-bottom: 12px; }
.slip .rcpt-head img { border-radius: 7px; }
.slip .rcpt-head .logo { width: 36px; height: 36px; border-radius: 8px; object-fit: contain; background: #fff; box-shadow: 0 0 0 1px rgba(28, 28, 28, .12); }
.slip .rcpt-head .logo.wide { width: 96px; height: 34px; border-radius: 5px; }
.slip .rcpt-head b { font-size: 14.5px; }
.slip .rcpt-head small { font-size: 11.5px; }
.slip .mono, .slip-total, .till-row { font-family: ui-monospace, Menlo, monospace; font-size: 12px; text-transform: uppercase; letter-spacing: .01em; }
.slip .mono { color: var(--ink-70); }
.slip-total { display: flex; justify-content: space-between; margin-top: auto; padding-top: 10px; border-top: 1.5px dashed rgba(28, 28, 28, .28); font-weight: 600; font-size: 14px; color: var(--ink); }
.slip .mono + .slip-total { margin-top: 14px; }
.slip-pill { align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; margin-top: 12px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.slip-pill.trust { background: var(--green-bg); color: var(--green); }
.slip-pill.hmrc { background: var(--slate-bg); color: var(--slate); }
.slip-body { flex: 1; }

.slip-src { margin-top: 10px; font-size: 12px; line-height: 1.4; color: var(--muted); }
.slip-src a { color: var(--ink-70); border-bottom: 1px solid var(--ink-30); }
.slip-src a:hover { color: var(--ink); border-color: var(--ink); }

/* The till slip: the pathway's totals */
.slip.till { --rot: .9deg; }
.till-row { display: flex; justify-content: space-between; padding: 3px 0; color: var(--ink-70); }
.till-row span:last-child { color: var(--ink); font-weight: 600; }
.till-back { margin-top: auto; padding-top: 12px; border-top: 1.5px dashed rgba(28, 28, 28, .28); }
.till-back small { display: block; font-family: ui-monospace, Menlo, monospace; font-size: 12px; font-weight: 600; text-transform: uppercase; }
.till-back b { display: block; font-family: var(--serif); font-weight: 300; font-size: 40px; line-height: 1.05; letter-spacing: -.02em; color: var(--green); }
.pathway { margin-top: 40px; }
.pathway h3 { display: flex; justify-content: center; align-items: baseline; gap: 12px; font-family: var(--sans); font-weight: 500; font-size: 20px; }
.pathway h3 small { font-size: 14px; font-weight: 400; color: var(--muted); }
.a-note { max-width: 680px; margin: 14px auto 0; text-align: center; font-size: 14px; color: var(--muted); }

/* Who pays you back */
.payers { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 28px; }
.payer { text-align: left; padding: 26px; border-radius: var(--radius-m); background: var(--surface); box-shadow: 0 0 0 1px var(--hair); }
.payer h3 { margin: 12px 0 10px; font-family: var(--serif); font-weight: 400; font-size: 26px; letter-spacing: -.02em; }
.payer p { font-size: 16px; line-height: 1.55; color: var(--ink-70); }
.payer p + p { margin-top: 10px; }

/* Where it gets lost */
.lost { list-style: none; max-width: 680px; margin: 28px auto 0; }
.lost li { position: relative; padding: 14px 0 14px 32px; border-top: 1px solid var(--hair); font-size: 17px; line-height: 1.45; }
.lost li:last-child { border-bottom: 1px solid var(--hair); }
.lost li::before { content: "×"; position: absolute; left: 4px; top: 11px; font-size: 22px; line-height: 1; color: var(--rose); }
.lost-close { margin-top: 22px; text-align: center; font-family: var(--serif); font-size: clamp(22px, 2.4vw, 30px); letter-spacing: -.02em; }

/* How Reimbsr fixes it */
.fix { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 56px; align-items: center; margin-top: 36px; }
.steps { list-style: none; counter-reset: step; text-align: left; }
.steps li { position: relative; padding: 18px 0 18px 54px; border-top: 1px solid var(--hair); counter-increment: step; }
.steps li:last-child { border-bottom: 1px solid var(--hair); }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 14px; font-family: var(--serif); font-size: 34px; line-height: 1; color: var(--sage); }
.steps b { display: block; font-weight: 600; font-size: 18px; }
.steps span { display: block; margin-top: 4px; font-size: 16px; line-height: 1.5; color: var(--ink-70); }
.a-phone { justify-self: center; width: 260px; padding: 5px; border-radius: 40px; background: linear-gradient(100deg, #8a847a, #d8d3ca 7%, #efebe4 35%, #dcd6cc 70%, #a49e94); box-shadow: inset 0 0 0 .6px rgba(0, 0, 0, .35), 0 30px 50px -24px rgba(20, 20, 42, .5); }
.a-phone > div { padding: 3px; border-radius: 35px; background: #0c0c0d; overflow: hidden; }
.a-phone img { display: block; width: 100%; height: auto; border-radius: 32px; }
.a-estimate { max-width: 760px; margin: 40px auto 0; text-align: center; padding: 22px 26px; border-radius: var(--radius-m); background: var(--surface); box-shadow: 0 0 0 1px var(--hair); font-family: var(--serif); font-size: clamp(20px, 2vw, 26px); line-height: 1.3; letter-spacing: -.015em; }
.a-estimate small { display: block; margin-top: 10px; font-family: var(--sans); font-size: 15px; letter-spacing: 0; color: var(--ink-70); }
.a-estimate a { color: var(--ink); border-bottom: 1px solid var(--ink-50); }

.a-cta { min-height: 420px; margin-top: 90px; }
.a-cta .h2 { font-size: clamp(40px, 5.4vw, 76px); margin-bottom: 22px; }

/* Index */
.cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; max-width: 1040px; margin: 48px auto 0; padding: 0 16px; }
.card { flex: 0 1 320px; text-align: left; display: flex; flex-direction: column; gap: 14px; min-height: 280px; padding: 26px; border-radius: var(--radius-l); background: var(--surface); box-shadow: 0 0 0 1px var(--hair); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
@media (hover: hover) { .card:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--ink-30), 0 18px 30px -18px rgba(39, 37, 30, .4); } }
.card:active { transform: scale(.985); }
.card h2 { font-family: var(--serif); font-weight: 300; font-size: 28px; line-height: 1.12; letter-spacing: -.03em; }
.card p { margin-top: auto; font-size: 15px; color: var(--ink-70); }
.card p b { display: block; margin-top: 2px; font-family: var(--serif); font-weight: 300; font-size: 26px; color: var(--green); }

/* Receipts: not-covered pill, monogram when a body has no logo file, ranges in totals */
.slip-pill.none { background: var(--canvas-2); color: var(--muted); }
.slip .rcpt-head .logo-mono { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 8px; background: var(--slate-bg); color: var(--slate); font-size: 11px; font-weight: 700; letter-spacing: .02em; box-shadow: 0 0 0 1px rgba(28, 28, 28, .12); }
.till-row { flex-wrap: wrap; column-gap: 8px; }
.till-back b { font-size: 34px; }
.till-back b i { font-family: var(--sans); font-style: normal; font-size: 13px; letter-spacing: 0; color: var(--ink-70); margin: 0 .25em; }

/* Index: one group per stage of training */
.card-group { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.card-group h2 { margin-top: 64px; text-align: center; font-family: var(--sans); font-weight: 500; font-size: 18px; letter-spacing: .01em; }
.card-group .cards { margin-top: 20px; padding: 0; }
.card h3 { font-family: var(--serif); font-weight: 300; font-size: 24px; line-height: 1.14; letter-spacing: -.03em; }

@media (max-width: 900px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .payers, .fix { grid-template-columns: 1fr; }
  .fix { gap: 40px; }
}
@media (max-width: 560px) {
  /* narrow screens wrap prose to many lines; centred text that long is hard to read, so it goes back to the left edge */
  .prose, .a-estimate { text-align: left; }
  .a-hero { padding-top: 56px; }
  .a-hero h1 { font-size: 34px; line-height: 1.08; }
  .a-sec { padding-top: 64px; }

  /* tighter stat cards, so the four figures do not take a whole screen */
  .stats { grid-template-columns: 1fr; gap: 10px; margin-top: 32px; }
  .stat { padding: 16px 18px; }
  .stat small { font-size: 12.5px; }
  .stat span { font-size: 14px; }

  /* receipts: a swipeable row per group instead of one long column, next one peeking in;
     bigger type, rotation softened. The row bleeds to the screen edges. */
  .slips {
    flex-wrap: nowrap; justify-content: flex-start; gap: 14px;
    margin: 24px -16px 0; padding: 10px 16px 22px;
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px; scrollbar-width: none;
  }
  .slips::-webkit-scrollbar { display: none; }
  .slip { flex: 0 0 84%; width: 84%; scroll-snap-align: start; }
  .slips:has(> .slip:only-child) { justify-content: center; }
  .pathway h3 { flex-direction: column; align-items: center; gap: 2px; text-align: center; }
  .slip:nth-child(3n+1), .slip:nth-child(3n+2), .slip:nth-child(3n) { --rot: -.6deg; }
  .slip:nth-child(even) { --rot: .6deg; }
  .slip .rcpt-head small { font-size: 13px; }
  .slip .mono, .slip-total, .till-row, .till-back small { font-size: 13px; }
  .slip-pill { font-size: 13px; padding: 6px 12px; }

  /* touch targets: at least ~44px tall, without moving the layout (padding is cancelled by the negative margin) */
  .slip-src { font-size: 14px; }
  .slip-src a, .crumbs a, .a-estimate a {
    display: inline-block; padding: 12px 6px; margin: -12px -6px;
    border-bottom: 0; text-decoration: underline; text-decoration-color: var(--ink-30); text-underline-offset: 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .slip, .card { transition: none; }
}

@supports not (grid-template-rows: subgrid) {
  .stat { display: flex; flex-direction: column; grid-row: auto; }
  .stat small { min-height: 3em; }
}
