/* InvoiceBook landing — "Everything in the book" feature cards.
   Glossy sheets of the bill book: a white face with a lit top edge, a soft
   highlight that follows the pointer, and a sheen that sweeps across once
   when the card arrives and again on hover. Each group takes one ink from
   the carbon-copy palette. */
section.features { max-width: 1240px; margin: 0 auto; padding: 88px 32px 32px; position: relative; }
section.features::before {
  content: ""; position: absolute; inset: 40px 0 auto; height: 520px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(520px 260px at 12% 20%, rgba(44, 58, 140, .10), transparent 70%),
    radial-gradient(460px 240px at 88% 10%, rgba(244, 211, 216, .55), transparent 70%),
    radial-gradient(420px 220px at 60% 80%, rgba(243, 227, 162, .40), transparent 70%);
}
.features-head { max-width: 720px; }
.eyebrow { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--carbon); }
.features h2 { margin-bottom: 18px; }
.features .section-lede { margin: 0 0 32px; max-width: 58ch; }

/* ---- figures that count up */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0 0 30px; }
.stat {
  padding: 18px 20px; border-radius: 16px; background: rgba(255, 255, 255, .62);
  border: 1px solid rgba(255, 255, 255, .9); box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 8px 24px -14px rgba(28, 32, 51, .25);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.stat strong { display: block; font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; color: var(--ink); text-shadow: 2px 1.5px 0 rgba(44, 58, 140, .14); }
.stat span { display: block; margin-top: 6px; font-size: 13.5px; color: var(--muted); line-height: 1.35; }

/* ---- filter chips */
.fchips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.fchip {
  font: 600 14px var(--font); color: var(--ink); cursor: pointer; padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--rule); background: rgba(255, 255, 255, .75);
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.fchip:hover { border-color: var(--carbon); transform: translateY(-1px); }
.fchip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: 0 6px 16px -8px rgba(28, 32, 51, .6); }

/* ---- the cards */
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 18px; perspective: 1100px; }
.fcard {
  --tint: var(--carbon-soft); --tint-ink: var(--carbon);
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 0%;
  position: relative; overflow: hidden; isolation: isolate; border-radius: 18px; padding: 22px 22px 24px; min-height: 212px;
  background: linear-gradient(165deg, #FFFFFF 0%, #FCFCFA 55%, #F5F6F1 100%);
  border: 1px solid rgba(28, 32, 51, .08);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 1) inset, 0 -1px 0 rgba(28, 32, 51, .04) inset, 0 2px 6px rgba(28, 32, 51, .05), 0 18px 36px -22px rgba(28, 32, 51, .35);
  transform: rotateX(var(--rx)) rotateY(var(--ry)) translateZ(0);
  transform-style: preserve-3d;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s, opacity .55s cubic-bezier(.2, .8, .2, 1), translate .55s cubic-bezier(.2, .8, .2, 1);
}
/* colour wash along the top edge */
.fcard::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(240px 160px at var(--mx) var(--my), rgba(255, 255, 255, .95), transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--tint) 85%, transparent) 0, transparent 46%);
  opacity: .9; transition: opacity .3s;
}
/* the sheen */
.fcard::after {
  content: ""; position: absolute; top: -20%; bottom: -20%; left: -60%; width: 45%; pointer-events: none;
  background: linear-gradient(105deg, transparent 0, rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, .85) 50%, rgba(255, 255, 255, 0) 80%, transparent 100%);
  transform: skewX(-18deg) translateX(0); opacity: 0;
}
.fcard.in::after { animation: sheen 1.1s calc(var(--i) * 70ms + 250ms) cubic-bezier(.3, .6, .2, 1) 1 both; }
.fcard:hover::after { animation: sheen .9s cubic-bezier(.3, .6, .2, 1) 1 both; }
@keyframes sheen { 0% { opacity: 0; transform: skewX(-18deg) translateX(0); } 15% { opacity: 1; } 100% { opacity: 0; transform: skewX(-18deg) translateX(420%); } }
.fcard:hover { box-shadow: 0 1px 0 #fff inset, 0 4px 10px rgba(28, 32, 51, .06), 0 28px 48px -24px rgba(28, 32, 51, .45); }

.fic {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; margin-bottom: 16px;
  background: linear-gradient(160deg, #fff, var(--tint)); color: var(--tint-ink);
  box-shadow: 0 1px 0 #fff inset, 0 6px 14px -8px color-mix(in srgb, var(--tint-ink) 70%, transparent), 0 0 0 1px color-mix(in srgb, var(--tint-ink) 14%, transparent);
  transform: translateZ(30px);
}
.fic svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.fic svg * { stroke-dasharray: 80; stroke-dashoffset: 80; }
.fcard.in .fic svg * { animation: draw .9s calc(var(--i) * 70ms + 150ms) ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.fgroup { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--tint-ink); margin-bottom: 4px; transform: translateZ(18px); }
.fcard h3 { margin: 0 0 8px; font-size: 19px; line-height: 1.2; letter-spacing: -0.015em; transform: translateZ(22px); }
.fcard p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; transform: translateZ(12px); }

.tone-carbon { --tint: #E3E6F4; --tint-ink: #2C3A8C; }
.tone-green  { --tint: #DCEFE4; --tint-ink: #2F7A56; }
.tone-pink   { --tint: #F7DDE1; --tint-ink: #9C2F45; }
.tone-yellow { --tint: #F6EBC0; --tint-ink: #8A6A10; }
.tone-ink    { --tint: #E4E5EA; --tint-ink: #1C2033; }

/* arrival: only when the script is running, so the page reads fine without it */
.js-features .fcard:not(.in) { opacity: 0; translate: 0 26px; }
.js-features .fcard.in { transition-delay: 0s, 0s, calc(var(--i) * 70ms), calc(var(--i) * 70ms); }
.fcard.out { opacity: 0 !important; translate: 0 10px; }
.fcard[hidden] { display: none; }

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  section.features { padding: 64px 16px 24px; }
  .fgrid { grid-template-columns: 1fr; gap: 14px; }
  .fcard { min-height: 0; }
  .stat { padding: 14px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .js-features .fcard:not(.in) { opacity: 1; translate: none; }
  .fic svg * { stroke-dashoffset: 0; }
  .fcard { transform: none !important; }
}
