/* verificus.es. Tokens from verificus/front/DESIGN.md (olive leaf, sand leaf, the brand-action
   olive for primary buttons, one typeface, weight capped at 600), pushed further than the app:
   this is the brand's own page, so colour carries it. Light only, like the app.

   Motion is CSS only: the page runs no script (the CSP has no script-src, and img-src has no
   data:, so there are no data: URIs here either). The hero plays once on load; the rest follows
   the scroll where the browser supports scroll-driven animations, and is simply there where it
   does not. Every element's resting style is its final state, so with prefers-reduced-motion (or
   no support) nothing is hidden. */

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('plus-jakarta-sans-latin.cd8db90cd9.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --leaf: #a1ad47;
  --leaf-300: #c6cd89;
  --primary-pale: #eff1df;
  --primary-faint: #f8f9f1;
  --olive-700: #4f5822;
  --olive-800: #41481e;
  --olive-900: #333918;
  --action: #3e5214;
  --action-hover: #33440f;
  --link: #656f2a;
  --sand-50: #fcf8f3;
  --sand-100: #f6efe4;
  --sand-200: #ecdcc5;
  --sand-300: #dfc39c;
  --ink: #272720;
  --body: #5f5f54;
  --ghost: #737368;
  --hairline: #e5e5e0;
  --wash: #f8f8f7;
  --white: #ffffff;
  --success-50: #f1f9f4;
  --success-200: #c1e1ce;
  --success-500: #3d8f5f;
  --success-700: #225939;
  --warning-50: #fdf6e7;
  --warning-200: #f3dca6;
  --warning-700: #8a5a0c;
  --info-50: #eef4f6;
  --info-200: #c5d9df;
  --info-700: #2f5562;
  --r-field: 8px;
  --r-item: 10px;
  --r-container: 12px;
  --r-hero: 16px;
  --font: 'Plus Jakarta Sans', Arial, sans-serif;
  --expo: cubic-bezier(0.16, 1, 0.3, 1);
  --quint: cubic-bezier(0.22, 1, 0.36, 1);
  --row: 76px;
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--white);
  color: var(--body);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* Short pages (the form's result pages) keep the footer at the bottom of the screen. */
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 3px; }
a:focus-visible,
.btn:focus-visible,
summary:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: var(--r-field); }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 32px; }

.skip { position: absolute; left: 16px; top: -48px; z-index: 10; padding: 8px 12px; background: var(--white); color: var(--ink); border: 1px solid var(--hairline); border-radius: var(--r-field); }
.skip:focus { top: 12px; }

main { flex: 1 0 auto; }

h2 { color: var(--ink); font-size: clamp(1.875rem, 1.3rem + 1.8vw, 2.75rem); font-weight: 600; line-height: 1.1; letter-spacing: -0.03em; text-wrap: balance; }

/* Header: on the hero's sand, so the top of the page is one colour */
.top { position: relative; z-index: 2; background: var(--sand-100); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 1.1875rem; letter-spacing: -0.015em; }
.brand img { width: 32px; transition: transform 0.6s var(--expo); }
.brand:hover img { transform: rotate(-8deg) scale(1.06); }
.top-nav { display: flex; align-items: center; gap: 20px; }
/* Language: the current code with a chevron; the list opens below it */
.lang-menu { position: relative; }
.lang-menu summary { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: var(--r-field); color: var(--ghost); font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; list-style: none; cursor: pointer; transition: background-color 0.2s, color 0.2s; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary::after { content: ''; width: 6px; height: 6px; margin-top: -3px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform 0.3s var(--expo); }
.lang-menu summary:hover,
.lang-menu[open] summary { color: var(--ink); background: var(--sand-200); }
.lang-menu[open] summary::after { margin-top: 3px; transform: rotate(-135deg); }
/* While open, an invisible layer over the whole page belongs to the summary, so a click anywhere
   outside the list toggles the menu closed. No script needed. */
.lang-menu[open] summary::before { content: ''; position: fixed; inset: 0; z-index: 4; cursor: default; }
.langs { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; display: grid; min-width: 152px; padding: 6px; border: 1px solid var(--hairline); border-radius: var(--r-container); background: var(--white); box-shadow: 0 8px 24px rgb(23 25 21 / 0.07); }
.langs a { display: block; padding: 8px 12px; border-radius: var(--r-field); color: var(--body); font-size: 0.875rem; text-decoration: none; }
.langs a:hover { color: var(--ink); background: var(--wash); }
.langs a[aria-current='page'] { color: var(--ink); font-weight: 600; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; min-height: 48px; padding: 12px 24px; border-radius: var(--r-field); font: 600 0.9375rem/1 var(--font); text-decoration: none; transition: background-color 0.2s ease, transform 0.4s var(--expo), border-color 0.2s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(0.98); transition-duration: 0.1s; }
.btn-primary { background: var(--action); color: var(--white); }
.btn-primary:hover { background: var(--action-hover); }
.btn-secondary { border: 1px solid var(--link); color: var(--link); font-weight: 500; }
.btn-secondary:hover { background: var(--primary-pale); }
.btn-quiet { min-height: 38px; padding: 9px 16px; border: 1px solid var(--sand-300); color: var(--ink); font-weight: 500; font-size: 0.875rem; }
.btn-quiet:hover { background: var(--sand-200); }

/* Hero: the sand leaf's colour, with both leaves of the logo oversized behind it */
.hero { position: relative; background: var(--sand-100); }
/* The leaves stay inside the sand; the product card is what crosses into the next band. */
.hero-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.hero-leaves { position: absolute; right: -4vw; top: -24px; width: min(52vw, 720px); height: auto; }
.leaf-sand { fill: var(--sand-200); }
.leaf-olive { fill: #e6e9cc; }
.hero-inner { position: relative; z-index: 1; padding-top: 64px; }
.eyebrow { color: var(--link); font-size: 0.9375rem; font-weight: 600; }
.hero h1 { margin-top: 18px; color: var(--ink); font-size: clamp(2.5rem, 1rem + 4.6vw, 4.5rem); font-weight: 600; line-height: 1.02; letter-spacing: -0.045em; }
.h1-b { display: block; color: var(--olive-700); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 64px; align-items: start; margin-top: 40px; }
.lede { max-width: 30em; font-size: 1.1875rem; line-height: 1.6; color: var(--body); text-wrap: pretty; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-copy { padding-bottom: 88px; }

/* The product visual hangs off the hero into the band below it */
.hero-visual { position: relative; z-index: 1; margin-bottom: -150px; }
.ui { overflow: hidden; border: 1px solid var(--hairline); border-radius: var(--r-hero); background: var(--white); font-size: 0.875rem; line-height: 1.4; box-shadow: 0 30px 60px -20px rgb(51 57 24 / 0.28), 0 2px 6px rgb(51 57 24 / 0.06); }
.ui-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--hairline); }
.ui-title { color: var(--ink); font-size: 1rem; font-weight: 600; }
.ui-btn { padding: 7px 12px; border-radius: var(--r-field); background: var(--action); color: var(--white); font-size: 0.8125rem; font-weight: 600; white-space: nowrap; }
.ui-window { height: calc(var(--row) * 3); overflow: hidden; }
.ui-rows li { display: grid; height: var(--row); grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: 'main amount badge' 'aeat aeat aeat'; align-content: center; align-items: center; column-gap: 16px; row-gap: 4px; padding: 0 22px; border-bottom: 1px solid var(--hairline); background: var(--white); }
.ui-main { grid-area: main; display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.ui-main b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.ui-main span { overflow: hidden; color: var(--body); text-overflow: ellipsis; white-space: nowrap; }
.ui-amount { grid-area: amount; color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
.badge { grid-area: badge; justify-self: end; padding: 2px 10px; border: 1px solid; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.badge-paid { border-color: var(--success-200); background: var(--success-50); color: var(--success-700); }
.badge-pending { border-color: var(--warning-200); background: var(--warning-50); color: var(--warning-700); }
.badge-info { border-color: var(--info-200); background: var(--info-50); color: var(--info-700); }
.ui-aeat { grid-area: aeat; display: inline-flex; align-items: center; gap: 6px; color: var(--success-700); font-size: 0.8125rem; font-weight: 500; }
.ui-aeat-live { display: grid; }
.ui-aeat-live > span { grid-area: 1 / 1; display: inline-flex; align-items: center; gap: 6px; }
.aeat-sending { color: var(--ghost); opacity: 0; }
.tick { flex: none; width: 14px; height: 14px; padding: 1px; border-radius: 9999px; background: var(--success-50); }
.tick path { fill: none; stroke: var(--success-500); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.spinner { width: 12px; height: 12px; border: 2px solid var(--hairline); border-top-color: var(--leaf); border-radius: 9999px; }


/* How it works: the one deep-olive band */
.flow { background: var(--olive-900); color: var(--sand-200); padding: 150px 0 112px; }
.flow h2 { max-width: 18ch; color: var(--white); }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; margin-top: 56px; }
.step h3 { margin-top: 28px; color: var(--white); font-size: 1.3125rem; font-weight: 600; letter-spacing: -0.015em; }
.step p { margin-top: 10px; max-width: 34ch; color: var(--sand-200); }
.step-visual { display: grid; place-items: center; height: 240px; padding: 28px; border-radius: var(--r-hero); background: var(--olive-800); }
.step:nth-child(2) .step-visual { background: var(--action); }

.mini-form { display: grid; width: 100%; max-width: 280px; padding: 18px; border-radius: var(--r-container); background: var(--white); color: var(--ink); font-size: 0.8125rem; line-height: 1.3; }
.mf-label { color: var(--ghost); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.mf-field { margin: 4px 0 12px; padding: 7px 10px; border: 1px solid var(--leaf); border-radius: var(--r-field); box-shadow: 0 0 0 3px var(--primary-pale); }
.mf-line { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; }
.mf-line b { font-weight: 500; font-variant-numeric: tabular-nums; }
.mf-tax { color: var(--body); }
.mf-total { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--hairline); font-weight: 600; }
.mf-total b { font-weight: 600; }

.chain { display: grid; gap: 14px; width: 100%; max-width: 260px; }
.chain li { position: relative; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--r-item); background: var(--olive-900); color: var(--sand-200); font-size: 0.8125rem; }
.chain li + li::before { content: ''; position: absolute; left: 24px; top: -15px; width: 2px; height: 16px; background: var(--leaf); }
.chain b { color: var(--white); font-weight: 600; font-variant-numeric: tabular-nums; }
.chain code { color: var(--leaf-300); font: 500 0.75rem/1 var(--font); letter-spacing: 0.02em; }
.chain li.chain-last { background: var(--white); color: var(--ink); }
.chain-last b { color: var(--ink); }
.chain-last code { color: var(--link); }
.chain-ok { flex-basis: 100%; color: var(--success-700); font-size: 0.75rem; font-weight: 600; }

.pdf-foot { display: flex; align-items: center; gap: 18px; padding: 20px 22px; border-radius: var(--r-field); background: var(--white); box-shadow: 0 18px 40px -16px rgb(0 0 0 / 0.45); transform: rotate(-2deg); }
.pdf-foot img { width: 96px; height: 96px; }
.pdf-foot span { display: block; }
.pdf-label { color: var(--body); font-size: 0.75rem; }
.pdf-vf { margin-top: 4px; color: var(--ink); font-size: 1rem; font-weight: 600; letter-spacing: 0.04em; }

/* What it does: a bento, each cell in a different colour of the brand */
.features { padding: 112px 0; }
.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; margin-top: 48px; }
.cell { display: flex; flex-direction: column; justify-content: space-between; gap: 28px; padding: 32px; border-radius: var(--r-hero); transition: transform 0.5s var(--expo); }
.cell:hover { transform: translateY(-3px); }
.cell h3 { color: var(--ink); font-size: 1.3125rem; font-weight: 600; line-height: 1.25; letter-spacing: -0.015em; }
.cell p { margin-top: 10px; max-width: 44ch; }
.cell-invoices { grid-column: span 4; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; border: 1px solid var(--hairline); background: var(--white); }
.cell-scan { grid-column: span 2; grid-row: span 2; background: var(--sand-100); }
.cell-catalog { grid-column: span 2; background: var(--primary-pale); }
.cell-firm { grid-column: span 2; background: var(--leaf); }
.cell-firm p { color: var(--ink); }

.chart { display: grid; gap: 14px; view-timeline: --chart; }
.bars { display: flex; align-items: flex-end; gap: 14px; height: 180px; padding-bottom: 1px; border-bottom: 1px solid var(--hairline); }
.bar { display: flex; flex: 1; align-items: flex-end; gap: 3px; height: 100%; }
.bar i { flex: 1; border-radius: 4px 4px 0 0; transform-origin: bottom; }
.b-inv { background: var(--leaf); }
.b-col { background: var(--sand-300); }
.b1 { height: 55%; } .b2 { height: 72%; } .b3 { height: 48%; } .b4 { height: 86%; } .b5 { height: 64%; } .b6 { height: 96%; }
.b1c { height: 50%; } .b2c { height: 66%; } .b3c { height: 45%; } .b4c { height: 70%; } .b5c { height: 41%; } .b6c { height: 58%; }
.legend { display: flex; gap: 20px; color: var(--body); font-size: 0.8125rem; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend span::before { content: ''; width: 10px; height: 10px; border-radius: 3px; }
.lg-inv::before { background: var(--leaf); }
.lg-col::before { background: var(--sand-300); }

.scan { display: grid; gap: 16px; view-timeline: --scan; }
.receipt { position: relative; display: grid; gap: 10px; width: 62%; padding: 22px 20px 26px; overflow: hidden; border-radius: var(--r-field) var(--r-field) 2px 2px; background: var(--white); box-shadow: 0 16px 30px -18px rgb(114 84 49 / 0.45); transform: rotate(2deg); }
.receipt i { height: 7px; border-radius: 4px; background: var(--sand-200); }
.receipt i.short { width: 55%; }
.scan-line { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--leaf); box-shadow: 0 0 14px 3px rgb(161 173 71 / 0.6); opacity: 0; }
.extracted { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.extracted div { padding: 8px 12px; border-radius: var(--r-item); background: var(--white); }
.extracted dt { color: var(--ghost); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.extracted dd { color: var(--ink); font-size: 0.875rem; font-weight: 500; font-variant-numeric: tabular-nums; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 6px 12px; border: 1px solid var(--leaf-300); border-radius: 9999px; background: var(--white); color: var(--ink); font-size: 0.8125rem; font-weight: 500; }

.request { display: grid; grid-template-columns: 1fr auto; gap: 10px 12px; padding: 16px 18px; border-radius: var(--r-container); background: var(--white); color: var(--ink); font-size: 0.875rem; }
.req-title { font-weight: 600; }
.req-count { color: var(--success-700); font-weight: 600; font-variant-numeric: tabular-nums; }
.request ul { grid-column: 1 / -1; display: grid; gap: 6px; }
.request li { display: flex; align-items: center; gap: 8px; color: var(--body); }
.request li::before { content: ''; display: grid; place-items: center; width: 16px; height: 16px; border: 1.5px solid var(--hairline); border-radius: 4px; color: var(--white); font-size: 0.6875rem; font-weight: 600; line-height: 1; }
.request li.done { color: var(--ink); }
.request li.done::before { content: '✓'; border-color: var(--success-500); background: var(--success-500); }

/* For accounting firms */
.firms { background: var(--primary-pale); }
.firms-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: center; padding-top: 112px; padding-bottom: 112px; }
.firms-copy p { max-width: 46ch; margin-top: 18px; font-size: 1.0625rem; }
.firms-copy .btn { margin-top: 32px; }
.firms-visual .ui { transform: rotate(-1.5deg); }
.client-rows li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; }
.client-rows li + li { border-top: 1px solid var(--hairline); }
.client-rows b { color: var(--ink); font-weight: 600; }

/* Questions */
.faq { padding: 112px 0; }
.faq-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 48px; }
.faq-list details { border-bottom: 1px solid var(--hairline); scroll-margin-top: 24px; }
.faq-list summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px 0; color: var(--ink); font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; list-style: none; cursor: pointer; }
.faq-list summary::-webkit-details-marker { display: none; }
/* A plus drawn with two gradients; it turns into a cross when open. */
.faq-list summary::after { content: ''; flex: none; width: 28px; height: 28px; border-radius: 9999px; background: linear-gradient(var(--link), var(--link)) center / 12px 2px no-repeat, linear-gradient(var(--link), var(--link)) center / 2px 12px no-repeat, var(--primary-pale); transition: transform 0.4s var(--expo), background-color 0.2s; }
.faq-list summary:hover::after { background-color: var(--leaf-300); }
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list details p { max-width: 62ch; padding-bottom: 24px; font-size: 1.0625rem; }

/* Contact form: a plain HTML post to the Verificus API, which redirects to a result page */
.contact { background: var(--sand-50); border-top: 1px solid var(--sand-200); scroll-margin-top: 16px; }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 48px; padding-top: 112px; padding-bottom: 112px; }
.contact-intro p { max-width: 32ch; margin-top: 16px; font-size: 1.0625rem; }
.contact-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field-wide { grid-column: 1 / -1; }
.field label { color: var(--ink); font-size: 0.875rem; font-weight: 500; }
.optional { color: var(--ghost); font-weight: 400; }
.field input,
.field textarea { width: 100%; padding: 11px 14px; border: 1px solid var(--sand-300); border-radius: var(--r-field); background: var(--white); color: var(--ink); font: 400 1rem/1.5 var(--font); transition: border-color 0.2s, box-shadow 0.3s var(--expo); }
.field input:hover,
.field textarea:hover { border-color: var(--leaf); }
.field textarea { min-height: 148px; resize: vertical; }
.field input:focus,
.field textarea:focus { outline: none; border-color: var(--leaf); box-shadow: 0 0 0 4px var(--primary-pale); }
.field input:focus-visible,
.field textarea:focus-visible { outline: 2px solid var(--link); outline-offset: 1px; }
.form-foot { display: flex; align-items: flex-start; gap: 24px; }
.form-foot .btn { flex: none; border: 0; cursor: pointer; }
.privacy { max-width: 60ch; color: var(--ghost); font-size: 0.8125rem; line-height: 1.5; }
/* The honeypot: off-screen for people, still in the form for bots. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* The page the form returns to */
.result { max-width: 680px; padding-top: 96px; padding-bottom: 120px; }
.result h1 { color: var(--ink); font-size: clamp(2rem, 1.5rem + 1.5vw, 2.75rem); font-weight: 600; line-height: 1.1; letter-spacing: -0.03em; }
.result p { margin-top: 16px; margin-bottom: 32px; font-size: 1.125rem; }

/* Footer: who operates Verificus */
.foot { border-top: 1px solid var(--hairline); background: var(--wash); font-size: 0.875rem; line-height: 1.5; }
.foot-row { display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; padding-top: 40px; padding-bottom: 40px; }
.foot-brand { display: flex; align-items: center; gap: 12px; color: var(--ink); font-weight: 500; }
.foot-brand img { flex: none; width: 28px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }

/* Motion. Resting styles above are final states; keyframes start from somewhere else. */
@media (prefers-reduced-motion: no-preference) {
  /* The hero, once, on load */
  .rise { animation: rise 0.9s var(--expo) both; }
  .hero h1 { animation-delay: 0.08s; }
  .lede { animation-delay: 0.18s; }
  .actions { animation-delay: 0.26s; }
  .hero-leaves { animation: leaves 1.8s var(--expo) both; }
  .hero-visual { animation: card 1.1s var(--expo) 0.3s both; }
  /* A new invoice arrives at the top of the list, then Hisenda takes it */
  .ui-rows { animation: rows-in 0.8s var(--expo) 1.4s both; }
  .row-new { animation: row-new 3.6s ease-out 1.4s both; }
  .aeat-sending { animation: sending 1.5s linear 1.6s both; }
  .spinner { animation: spin 0.7s linear 1.6s 3; }
  .aeat-sent { animation: appear 0.4s var(--expo) 3.05s both; }
  .row-new .tick path { animation: draw 0.5s var(--quint) 3.15s both; }

  .faq-list details[open] p { animation: rise 0.5s var(--expo) both; }
  .lang-menu[open] .langs { animation: menu 0.25s var(--expo) both; }
}

/* Scroll-driven, where supported: content follows the scroll in and is otherwise just there */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal { animation: reveal linear both; animation-timeline: view(); animation-range: entry 5% cover 30%; }
    .step:nth-child(2) { animation-range: entry 15% cover 38%; }
    .step:nth-child(3) { animation-range: entry 25% cover 46%; }
    .chart.reveal,
    .scan.reveal { animation: none; }
    .bar i { animation: grow linear both; animation-timeline: --chart; animation-range: entry 30% cover 55%; }
    .bar:nth-child(2) i { animation-range: entry 34% cover 58%; }
    .bar:nth-child(3) i { animation-range: entry 38% cover 61%; }
    .bar:nth-child(4) i { animation-range: entry 42% cover 64%; }
    .bar:nth-child(5) i { animation-range: entry 46% cover 67%; }
    .bar:nth-child(6) i { animation-range: entry 50% cover 70%; }
    .scan-line { animation: scan linear both; animation-timeline: --scan; animation-range: entry 40% cover 60%; }
    .extracted div { animation: reveal linear both; animation-timeline: --scan; animation-range: entry 50% cover 55%; }
    .extracted div:nth-child(2) { animation-range: entry 55% cover 58%; }
    .extracted div:nth-child(3) { animation-range: entry 60% cover 61%; }
    .extracted div:nth-child(4) { animation-range: entry 65% cover 64%; }
    .hero-leaves { animation: leaves 1.8s var(--expo) both, drift linear both; animation-timeline: auto, scroll(); animation-range: normal, 0 600px; }
  }
}

@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes leaves { from { opacity: 0; transform: scale(0.94) rotate(-4deg); } }
@keyframes drift { to { translate: 0 80px; rotate: 3deg; } }
@keyframes card { from { opacity: 0; transform: translateY(40px) rotate(1.5deg); } }
@keyframes rows-in { from { transform: translateY(calc(var(--row) * -1)); } }
@keyframes row-new { from { opacity: 0; background-color: var(--primary-pale); } 15% { opacity: 1; background-color: var(--primary-pale); } to { background-color: var(--white); } }
@keyframes sending { 0%, 90% { opacity: 1; } 100% { opacity: 0; } }
@keyframes appear { from { opacity: 0; transform: translateY(4px); } }
@keyframes draw { from { stroke-dashoffset: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes menu { from { opacity: 0; transform: translateY(-4px); } }
@keyframes reveal { from { opacity: 0; transform: translateY(40px); } }
@keyframes grow { from { transform: scaleY(0); } }
@keyframes scan { from { opacity: 1; transform: translateY(0); } 90% { opacity: 1; } to { opacity: 0; transform: translateY(150px); } }

@media (max-width: 960px) {
  .wrap { padding-left: 24px; padding-right: 24px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .hero-visual { max-width: 620px; margin-bottom: -120px; }
  .hero-copy { padding-bottom: 0; }
  .flow { padding: 184px 0 88px; }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 56px; max-width: 560px; }
  .features, .faq { padding: 88px 0; }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cell-invoices, .cell-scan { grid-column: span 2; }
  .cell-scan { grid-row: auto; }
  .cell-catalog, .cell-firm { grid-column: span 1; }
  .receipt { width: 48%; }
  .firms-grid, .contact-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; padding-top: 88px; padding-bottom: 88px; }
  .faq-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}

@media (max-width: 640px) {
  :root { --row: 72px; }
  .wrap { padding-left: 16px; padding-right: 16px; }
  .top-row { height: 60px; }
  .top-nav { gap: 8px; }
  .btn-quiet { padding: 8px 10px; }
  .hero-leaves { width: 110vw; right: -45vw; top: 140px; }
  .hero-copy { padding-bottom: 0; }
  .hero-visual { margin-bottom: -96px; }
    .hero-inner { padding-top: 32px; }
  .lede { font-size: 1.0625rem; }
  .actions .btn { flex: 1 1 auto; }
  .hero-grid { margin-top: 24px; gap: 36px; }
  .ui-head, .ui-rows li { padding-left: 14px; padding-right: 14px; }
  .ui-rows li { column-gap: 10px; }
  .ui-main { flex-direction: column; gap: 0; }
  .ui-main span { font-size: 0.8125rem; }
  .flow { padding: 148px 0 72px; }
  .step-visual { height: 220px; padding: 20px; }
  .bento { grid-template-columns: minmax(0, 1fr); }
  .cell-invoices, .cell-scan, .cell-catalog, .cell-firm { grid-column: auto; }
  .cell { padding: 24px; }
  .cell-invoices { grid-template-columns: minmax(0, 1fr); }
    .bars { height: 140px; }
  .receipt { width: 70%; }
  .firms-grid, .contact-grid { padding-top: 72px; padding-bottom: 72px; }
  .features, .faq { padding: 72px 0; }
  .contact-form { grid-template-columns: minmax(0, 1fr); }
  .form-foot { flex-direction: column; gap: 16px; }
  .form-foot .btn { width: 100%; }
  .result { padding-top: 56px; padding-bottom: 72px; }
  .foot-row { flex-direction: column; align-items: flex-start; padding-top: 32px; padding-bottom: 32px; }
}
