@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600;700&family=Instrument+Serif&family=Newsreader:opsz,wght@6..72,500;6..72,600&display=swap');

:root {
  color-scheme: light;
  --ink: #242b19;
  --muted: #525843;
  --paper: #fbf9f0;
  --line: #d9d8c7;
  --olive: #303c20;
  --leaf: #dbe8a3;
  font: 100%/1.55 "DM Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
a { color: inherit; text-underline-offset: .22em; }
a:focus-visible { outline: 3px solid #746123; outline-offset: 5px; }
.wrapper { width: min(72rem, calc(100% - 3rem)); margin-inline: auto; }
.header, .footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.header { min-height: 5.25rem; border-bottom: 1px solid var(--line); }
.brand { font-size: 2.45rem; line-height: 1; font-weight: 700; letter-spacing: -.09em; text-decoration: none; }
.brand { display: inline-flex; align-items: center; color: var(--ink); }
.brand .wordmark { display: block; width: 70px; height: 36px; }
nav { display: flex; flex-wrap: wrap; gap: .5rem 1.75rem; }
nav a { font-weight: 700; text-decoration: none; }
nav a:hover { text-decoration: underline; }
.hero { display: grid; grid-template-columns: 1.22fr 1fr; align-items: center; gap: clamp(2rem, 6vw, 5.5rem); padding-block: clamp(3rem, 8vw, 7rem); }
h1, h2 { font: 400 clamp(2.6rem, 4vw, 4rem)/1.03 "Instrument Serif", Georgia, serif; margin: 0 0 1rem; }
h1 { font-size: clamp(3.45rem, 7.1vw, 7.1rem); letter-spacing: -.035em; }
h3 { line-height: 1.23; margin: 0 0 .45rem; }
p { margin: 0 0 1rem; }
.eyebrow { font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; }
.intro { max-width: 35rem; font-size: 1.15rem; color: var(--muted); }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem 1.25rem; margin-top: 1.7rem; }
.button { display: inline-flex; gap: .8rem; background: var(--olive); color: white; padding: .8rem 1.05rem; border-radius: .4rem; font-weight: 700; text-decoration: none; }
.button:hover { background: #44532b; }
.muted { color: var(--muted); }
.receipt-stage { background: var(--leaf); padding: clamp(1rem, 4vw, 3rem); border-radius: .8rem; }
.receipt { background: #fffdf5; padding: clamp(1rem, 2.5vw, 2rem); box-shadow: 0 10px 18px #303c2020; border-radius: .25rem; }
.receipt h2 { font-size: clamp(2.1rem, 4vw, 3.2rem); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: .5rem .3rem; text-align: right; }
th:first-child { text-align: left; }
tbody { border-block: 1px dashed #abac95; }
tfoot { font-weight: 700; }
.receipt-note { background: #e8efca; margin: .65rem 0 0; padding: .5rem; text-align: center; font-size: .9rem; }
.band { background: #eff1e4; }
.section { padding-block: clamp(2.6rem, 6vw, 5rem); }
.steps, .guides { display: grid; gap: 1rem; margin: 1.4rem 0 0; }
.steps { grid-template-columns: repeat(3, 1fr); padding-left: 1.35rem; column-gap: 2.5rem; }
.steps li::marker { font-weight: 700; }
.steps p, .guides p, .footer p { color: var(--muted); }
.guides { grid-template-columns: 1fr 1fr; }
.guides a { display: block; background: #fffdf5; border: 1px solid var(--line); padding: 1.25rem; border-radius: .4rem; text-decoration: none; }
.guides a:hover { border-color: var(--olive); }
.guides span { font-weight: 700; text-decoration: underline; }
.footer { padding-block: 1.5rem; border-top: 1px solid var(--line); }
.footer p { margin: 0; }
.article { max-width: 48rem; }
.article h1 { font-size: clamp(3rem, 7vw, 5rem); }
.article h2 { margin-top: 2.3rem; font-size: clamp(2rem, 4vw, 2.8rem); }
.article table { border-block: 1px solid var(--line); margin-bottom: 1rem; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: absolute; background: white; padding: .5rem; z-index: 1; }
@media (max-width: 48rem) {
  .hero, .steps, .guides { grid-template-columns: 1fr; }
  .receipt-stage { max-width: 31rem; }
}
@media (max-width: 28rem) {
  .wrapper { width: calc(100% - 2rem); }
  nav { column-gap: .8rem; }
  .footer { align-items: flex-start; flex-direction: column; }
}

/* ==========================================================================
   Homepage (hybrid): warm dark ground, lime accent, cream paper for documents.
   Values from the Bori Design System (tokens.json). Scoped to body.home so the
   guide pages keep their current light styles.
   ========================================================================== */
.home {
  color-scheme: dark;
  --b-page: #1E1708;
  --b-card: #2A2010;
  --b-line: rgba(240, 228, 200, 0.10);
  --b-text: #E4D8BC;
  --b-text-70: rgba(228, 216, 188, 0.70);
  --b-text-55: rgba(228, 216, 188, 0.55);
  --b-lime: #94B73A;
  --b-lime-ghost: rgba(148, 183, 58, 0.12);
  --b-lime-soft: rgba(148, 183, 58, 0.40);
  --b-on-lime: #1E1708;
  --b-paper: #E4D8BC;
  --b-paper-list: #D7C598;
  --b-ink: #1C1A17;
  --b-ink-soft: #3D3526;
  --b-ink-faint: #5B5340;
  --b-rule: #B3A684;
  --b-display: "Newsreader", Georgia, "Times New Roman", serif;
  --b-ui: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --b-mono: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;
  background: var(--b-page);
  color: var(--b-text);
  font: 100%/1.55 var(--b-ui);
}
.home h1, .home h2, .home h3 { font-family: var(--b-display); font-weight: 500; letter-spacing: -0.01em; margin: 0; }
.home h3 { font-family: var(--b-ui); font-weight: 600; letter-spacing: 0; }
.home p { margin: 0; }
.home a { color: var(--b-text); }
.home a:hover { color: var(--b-lime); }
.home a:focus-visible, .home summary:focus-visible { outline: 3px solid var(--b-lime); outline-offset: 3px; border-radius: 4px; }
.home .skip:focus { background: var(--b-text); color: var(--b-ink); }
.wordmark { display: block; color: currentColor; }

.h-wrap { width: min(75rem, 100% - 2.5rem); margin-inline: auto; }

/* Header */
.h-header { border-bottom: 1px solid var(--b-line); }
.h-header__inner { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; padding-block: .75rem; }
.h-logo { display: inline-flex; align-items: center; min-height: 44px; color: var(--b-text); }
.h-logo .wordmark { width: 58px; height: 30px; }
.h-nav { display: flex; align-items: center; gap: .25rem; }
.h-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .65rem; font-size: .9375rem; font-weight: 500; color: var(--b-text-70); text-decoration: none; }
.h-nav a:hover { color: var(--b-text); }
.h-nav__pill { border: 1px solid var(--b-line); border-radius: 999px; padding: 0 .95rem !important; }
.h-nav__wide { display: none !important; }

/* Shared bits */
.h-eyebrow { font-family: var(--b-mono); font-size: .6875rem; letter-spacing: .12em; text-transform: uppercase; color: var(--b-text-55); }
.h-accent { color: var(--b-lime); }
.h-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--b-lime-ghost); color: var(--b-lime); font-size: .75rem; font-weight: 600; line-height: 1; }
.h-button { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 1.6rem; border-radius: 14px; background: var(--b-lime); color: var(--b-on-lime) !important; font-weight: 600; font-size: .9375rem; text-decoration: none; }
.h-button:hover { background: #83A031; }
.h-body { color: var(--b-text-70); }
.h-small, .h-note { font-size: .8125rem; color: var(--b-text-70); }
.home h2 { font-size: 1.875rem; line-height: 1.1; }

/* Hero (mobile first: copy, action, then screenshot) */
.h-hero { display: flex; flex-direction: column; gap: 1.75rem; padding-block: 2rem 1.75rem; }
.h-hero__copy { display: flex; flex-direction: column; gap: 1.125rem; }
.h-hero h1 { font-size: 2.5rem; line-height: 1.08; letter-spacing: -0.02em; }
.h-lede { font-size: 1.0625rem; color: var(--b-text-70); max-width: 34em; }
.h-actions { display: flex; flex-direction: column; align-items: center; gap: .75rem; }
.h-actions .h-button { align-self: stretch; }

/* Screenshot frame (placeholder until real screenshots land) */
.h-shot { margin: 0; display: flex; justify-content: center; background: var(--b-card); border: 1px solid var(--b-line); border-radius: 20px; padding-top: 1.5rem; overflow: hidden; }
.h-shot__phone { width: 230px; height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; padding: 1.25rem; text-align: center; background: var(--b-page); border: 2px dashed var(--b-lime-soft); border-bottom: 0; border-radius: 30px 30px 0 0; }
.h-shot__tag { font-family: var(--b-mono); font-size: .625rem; letter-spacing: .12em; text-transform: uppercase; color: var(--b-text-55); }
.h-shot__title { font-weight: 600; }
.h-shot__desc { font-size: .8125rem; color: var(--b-text-70); }

/* Basket example */
.h-example { background: var(--b-card); border-block: 1px solid var(--b-line); scroll-margin-top: 1rem; }
.h-example__inner { display: flex; flex-direction: column; gap: 1rem; padding-block: 2.25rem; }
.h-example__copy { display: flex; flex-direction: column; gap: 1rem; }
.h-example__app { display: flex; flex-direction: column; gap: .75rem; margin-top: .5rem; }

/* Receipt: result first, breakdown, items folded on phones */
.receipt { margin: 0; background: var(--b-paper); color: var(--b-ink); border-radius: 4px; font-family: var(--b-mono); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); overflow: hidden; }
.receipt__head { padding: 1rem 1rem 0; }
.receipt__logo { display: flex; justify-content: center; margin-bottom: .625rem !important; color: var(--b-ink); }
.receipt__logo .wordmark { width: 58px; height: 30px; }
.receipt__cap { display: flex; justify-content: space-between; padding: .5rem 0; border-top: 1.2px dashed var(--b-rule); font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; color: var(--b-ink-faint); }
.receipt__result { padding: .875rem 1rem 1rem; background: var(--b-ink); color: var(--b-paper); }
.receipt__label { font-size: .6875rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: .5rem !important; }
.receipt__totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.receipt__store { font-size: .75rem; }
.receipt__total { font-size: 1.625rem; font-weight: 500; line-height: 1.2; }
.receipt__win { color: var(--b-lime); }
.receipt__diff { margin-top: .75rem !important; padding: .5rem .625rem; border-radius: 4px; background: var(--b-lime); color: var(--b-on-lime); font-family: var(--b-ui); font-size: .9375rem; font-weight: 700; text-align: center; }
.receipt__body { padding: .25rem 1rem 1rem; }
.receipt__table { width: 100%; border-collapse: collapse; font-size: .8125rem; color: var(--b-ink-soft); font-variant-numeric: tabular-nums; }
.receipt__table th, .receipt__table td { padding: .25rem 0; font-weight: 400; text-align: right; border: 0; }
.receipt__table th:first-child { text-align: left; padding-right: .5rem; }
.receipt__table td:last-child, .receipt__table thead th:last-child { padding-left: .75rem; }
.receipt__table td:nth-child(2), .receipt__table thead th:nth-child(2) { width: 4rem; }
.receipt__table td:last-child { width: 4.75rem; }
.receipt__table thead th { padding-top: .625rem; color: var(--b-ink); font-weight: 500; }
.receipt__table thead th:first-child { color: var(--b-ink-faint); font-weight: 400; }
.receipt__table tbody { border: 0; }
.receipt__qty { color: var(--b-ink-faint); }
.receipt__note { margin-top: .5rem !important; font-family: var(--b-ui); font-size: .8125rem; line-height: 1.45; color: var(--b-ink-faint); }
.receipt__items { margin-top: .625rem; border-top: 1.2px dashed var(--b-rule); }
.receipt__items summary { display: flex; align-items: center; gap: .5rem; min-height: 44px; cursor: pointer; font-family: var(--b-ui); font-size: .9375rem; font-weight: 600; color: var(--b-ink); text-decoration: underline; text-underline-offset: 3px; list-style: none; }
.receipt__items summary::-webkit-details-marker { display: none; }
.receipt__items summary::after { content: "▾"; text-decoration: none; display: inline-block; transition: transform .15s; }
.receipt__items[open] summary::after { transform: rotate(180deg); }

/* How it works */
.h-how { padding-block: 2.25rem; }
.h-how h2 { margin-bottom: 1.25rem; }
.h-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.h-steps li { display: flex; gap: .875rem; background: var(--b-card); border: 1px solid var(--b-line); border-radius: 12px; padding: 1rem; }
.h-steps__n { flex: none; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--b-lime); color: var(--b-on-lime); font-family: var(--b-mono); font-weight: 500; }
.h-steps h3 { font-size: 1rem; margin-bottom: .25rem; }
.h-steps p { color: var(--b-text-70); font-size: .9375rem; }

/* Light paper band: questions + guides */
.h-paper { background: var(--b-paper); color: var(--b-ink); padding-block: 2.25rem; color-scheme: light; }
.h-paper h2 { color: var(--b-ink); margin-bottom: .875rem; }
.h-paper a { color: var(--b-ink); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.h-paper a:hover { color: var(--b-ink-soft); }
.h-paper a:focus-visible { outline-color: var(--b-ink); }
.h-faq > div { border-top: 1px solid var(--b-rule); padding-block: 1rem; }
.h-faq > div:last-child { border-bottom: 1px solid var(--b-rule); }
.h-faq h3 { font-size: 1rem; color: var(--b-ink); margin-bottom: .375rem; }
.h-faq p { color: var(--b-ink-soft); font-size: .9375rem; }
.h-guides { border-top: 1px solid var(--b-rule); }
.h-guides__grid { display: grid; gap: .875rem; }
.h-guide { display: flex; flex-direction: column; gap: .375rem; padding: 1.125rem; background: var(--b-paper-list); border: 1.3px dashed var(--b-rule); border-radius: 12px; text-decoration: none; }
.h-guide__tag { font-family: var(--b-mono); font-size: .6875rem; letter-spacing: .1em; text-transform: uppercase; color: var(--b-ink-soft); }
.h-guide__title { font-family: var(--b-display); font-size: 1.375rem; font-weight: 500; line-height: 1.18; }
.h-guide__desc { font-size: .9375rem; color: var(--b-ink-soft); }
.h-guide__cta { font-weight: 600; font-size: .9375rem; text-decoration: underline; text-underline-offset: 3px; }

/* Closing band + footer */
.h-end { border-top: 1px solid var(--b-line); }
.h-end__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2.5rem; padding-block: 2.25rem; }
.h-end__status { font-size: 1.125rem; font-weight: 600; color: var(--b-lime); }
.h-footer { background: var(--b-card); border-top: 1px solid var(--b-line); font-size: .875rem; color: var(--b-text-70); }
.h-footer__inner { display: flex; flex-direction: column; gap: .75rem; padding-block: 1.75rem 2.25rem; }
.h-footer__about { display: flex; flex-direction: column; gap: .625rem; }
.h-footer__about p { max-width: 32em; }
.h-footer__logo { display: flex; color: var(--b-text); }
.h-footer__logo .wordmark { width: 54px; height: 28px; }
.h-footer__nav { display: flex; flex-direction: column; margin-top: .25rem; padding-top: .5rem; border-top: 1px solid var(--b-line); }
.h-footer__nav a { display: flex; align-items: center; min-height: 40px; }

/* Desktop */
@media (min-width: 64rem) {
  .h-wrap { width: min(75rem, 100% - 5rem); }
  .h-header__inner { padding-block: .875rem; }
  .h-logo .wordmark { width: 70px; height: 36px; }
  .h-nav__wide { display: inline-flex !important; }
  .h-nav__narrow { display: none !important; }
  .h-nav .h-badge { margin-left: .625rem; }
  .home h2 { font-size: 2.75rem; }
  .h-hero { flex-direction: row; align-items: center; gap: 3.5rem; padding-block: 4.5rem 5rem; }
  .h-hero__copy { flex: 1 1 520px; gap: 1.375rem; }
  .h-hero__shot { flex: 1 1 380px; }
  .h-hero h1 { font-size: 4rem; line-height: 1.04; }
  .h-lede { font-size: 1.1875rem; }
  .h-actions { flex-direction: row; gap: .875rem 1.5rem; }
  .h-actions .h-button { align-self: auto; min-height: 52px; font-size: 1rem; }
  .h-note, .h-small { font-size: .875rem; }
  .h-shot { border-radius: 28px; padding-top: 2.25rem; }
  .h-shot__phone { width: 280px; height: 470px; border-radius: 40px 40px 0 0; }
  .h-example__inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); grid-template-areas: "copy receipt" "app receipt"; align-items: start; gap: 1.25rem 3.5rem; padding-block: 5rem; }
  .h-example__copy { grid-area: copy; }
  .h-example__app { grid-area: app; }
  .receipt { grid-area: receipt; }
  .h-example__app .h-shot__phone { width: 260px; height: 420px; }
  .receipt__head { padding: 1.5rem 1.5rem 0; }
  .receipt__logo .wordmark { width: 70px; height: 36px; }
  .receipt__result { padding: 1.125rem 1.5rem 1.25rem; }
  .receipt__body { padding: .25rem 1.5rem 1.5rem; }
  .receipt__table { font-size: .9375rem; }
  .receipt__table td:nth-child(2), .receipt__table thead th:nth-child(2) { width: 5.25rem; }
  .receipt__table td:last-child { width: 6rem; }
  .receipt__note { font-size: .875rem; }
  .h-how { padding-block: 5rem; }
  .h-how h2 { margin-bottom: 2rem; }
  .h-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
  .h-steps li { flex-direction: column; gap: .75rem; padding: 1.5rem; border-radius: 14px; }
  .h-steps h3 { font-size: 1.1875rem; }
  .h-steps p { font-size: 1rem; }
  .h-paper { padding-block: 5rem; }
  .h-paper h2 { margin-bottom: 1.75rem; }
  .h-faq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 3.5rem; }
  .h-faq > div { padding-block: 1.375rem; }
  .h-faq > div:last-child { border-bottom: 0; }
  .h-faq h3 { font-size: 1.125rem; }
  .h-faq p { font-size: 1rem; }
  .h-guides__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
  .h-guide { padding: 1.75rem; gap: .625rem; }
  .h-guide__title { font-size: 1.75rem; }
  .h-end__inner { padding-block: 5rem; }
  .h-end__status { font-size: 1.1875rem; }
  .h-footer__inner { flex-direction: row; flex-wrap: wrap; justify-content: space-between; gap: 1.25rem 2.5rem; padding-block: 2.25rem 3rem; }
  .h-footer__about { flex: 1 1 360px; }
  .h-footer__logo .wordmark { width: 62px; height: 32px; }
  .h-footer__nav { flex-direction: row; flex-wrap: wrap; gap: .25rem 1.5rem; margin: 0; padding: 0; border: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .receipt__items summary::after { transition: none; }
}
