/* Kweet site: "thermal paper" look, matching the app (docs/UI_PLAN.md §3). */

:root {
  --paper: #F4EBDD;
  --card: #FFFBF4;
  --ink: #231C17;
  --ink-muted: #6E6258;
  --rule: #E2D6C4;
  --accent: #2F6B4F;
  --accent-ink: #FFFBF4;
  --accent-soft: #E1EBDF;
  --warn: #A0560F;
  --danger: #B3362B;
  --shadow: rgba(60, 40, 20, .16);
  --radius: 14px;
  --tooth: 10px;
  --sans: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1C1714;
    --card: #27211D;
    --ink: #F2E9DC;
    --ink-muted: #A89A8C;
    --rule: #3A322C;
    --accent: #6FBF95;
    --accent-ink: #14110F;
    --accent-soft: #24332B;
    --warn: #E7A35C;
    --danger: #EF7D72;
    --shadow: rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 7vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 4.5vw, 2.1rem); font-weight: 700; }
h3 { font-size: 1.125rem; font-weight: 700; }
p { margin: 0 0 1em; }

.mono, .eyebrow, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 780px; }
@media (min-width: 700px) { .wrap { padding: 0 28px; } }

.skip { position: absolute; left: 12px; top: -60px; z-index: 10; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 8px; text-decoration: none; }
.skip:focus { top: 12px; }

.eyebrow { display: inline-block; font-size: .8125rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 0 0 .75em; }

/* ---------- Torn receipt edge ---------- */
/* The shadow sits on the wrapper: mask cuts the element after its own filter. */
.tear { filter: drop-shadow(0 1px 0 var(--rule)) drop-shadow(0 8px 16px var(--shadow)); }
.receipt {
  position: relative;
  background: var(--card);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 22px 20px calc(22px + var(--tooth));
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--tooth)) 100%;
          mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--tooth)) 100%;
}
.dash { border: 0; border-top: 2px dashed var(--rule); margin: 16px 0; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: saturate(1.2) blur(8px); -webkit-backdrop-filter: saturate(1.2) blur(8px); border-bottom: 1px solid var(--rule); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.25rem; }
.brand img { border-radius: 9px; box-shadow: 0 0 0 1px var(--rule); }
.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav a { color: var(--ink); text-decoration: none; font-weight: 500; padding: 10px 12px; border-radius: 10px; min-height: 44px; display: inline-flex; align-items: center; }
.site-nav a:hover { background: var(--card); }
.site-nav .nav-cta { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.site-nav .nav-cta:hover { background: var(--accent); filter: brightness(1.08); }
@media (max-width: 560px) { .hide-sm { display: none !important; } }

/* ---------- Buttons & store links ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 20px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-weight: 700; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }

.stores { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.store { display: inline-flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 20px 10px 16px; border-radius: 14px; background: var(--ink); color: var(--paper); text-decoration: none; }
.store:hover { filter: brightness(1.15); }
.store svg { width: 24px; height: 24px; flex: none; }
.store span { display: flex; flex-direction: column; line-height: 1.15; }
.store small { font-size: .75rem; opacity: .8; }
.store b { font-size: 1.0625rem; }

/* ---------- Hero ---------- */
.hero { padding: 40px 0 56px; }
.hero .wrap { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .hero { padding: 72px 0 88px; } .hero .wrap { grid-template-columns: 1.1fr .9fr; gap: 56px; } }
.hero .lead { font-size: 1.1875rem; color: var(--ink-muted); max-width: 34em; }
.hero .lead strong { color: var(--ink); }
.ticks { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-family: var(--mono); font-size: .875rem; color: var(--ink-muted); }
.ticks li::before { content: "✓ "; color: var(--accent); font-weight: 700; }

/* Sample receipt in the hero */
.sample { max-width: 400px; margin: 0 auto; width: 100%; transform: rotate(-1.2deg); }
.sample .receipt { padding: 26px 24px calc(28px + var(--tooth)); }
.sample .shop { text-align: center; font-family: var(--mono); font-size: .8125rem; color: var(--ink-muted); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 4px; }
.sample .title { font-weight: 700; font-size: 1.25rem; text-align: center; margin: 0; }
.sample .meta { font-family: var(--mono); font-size: .8125rem; color: var(--ink-muted); display: flex; justify-content: space-between; gap: 12px; }
.clock { margin-top: 14px; }
.clock .row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.clock .label { font-size: .9375rem; font-weight: 600; }
.clock .when { font-family: var(--mono); font-size: .8125rem; color: var(--ink-muted); white-space: nowrap; }
.bar { height: 8px; border-radius: 99px; background: var(--rule); margin-top: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.bar.warn i { background: var(--warn); }
.stamp { display: inline-block; margin: 18px auto 0; padding: 4px 12px; border: 2px solid var(--accent); color: var(--accent); border-radius: 8px; font-family: var(--mono); font-weight: 700; letter-spacing: .12em; transform: rotate(-4deg); }
.sample .center { text-align: center; }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section.alt { background: var(--card); border-block: 1px solid var(--rule); }
.section-head { max-width: 40em; margin-bottom: 32px; }
.section-head p { color: var(--ink-muted); }

.features { display: grid; gap: 28px 20px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .features { grid-template-columns: repeat(3, 1fr); } }
.feature .receipt { height: 100%; }
.feature .tear { height: 100%; }
.feature .icon { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 14px; }
.feature .icon svg { width: 24px; height: 24px; }
.feature p { color: var(--ink-muted); margin: 0; }
.section.alt .receipt { background: var(--paper); }

/* Screenshots */
.shots { display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 16px 20px; margin: 0 -16px; scrollbar-width: thin; }
.shots:focus-visible { outline-offset: -3px; }
.shots figure { flex: 0 0 auto; width: min(64vw, 250px); margin: 0; scroll-snap-align: center; }
.shots img { width: 100%; border-radius: 28px; background: var(--card); box-shadow: 0 0 0 1px var(--rule), 0 10px 24px var(--shadow); aspect-ratio: 600 / 1300; object-fit: cover; }
.shots figcaption { font-size: .9375rem; color: var(--ink-muted); text-align: center; margin-top: 12px; }
@media (min-width: 1080px) { .shots { justify-content: center; overflow: visible; margin: 0; padding: 4px 0 20px; } }

/* Privacy */
.privacy { display: grid; gap: 32px; align-items: start; }
@media (min-width: 900px) { .privacy { grid-template-columns: 1fr 1fr; gap: 48px; } }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 2px dashed var(--rule); }
.checklist li:last-child { border-bottom: 0; }
.checklist .yes, .checklist .no { flex: none; font-family: var(--mono); font-weight: 700; width: 1.4em; }
.checklist .yes { color: var(--accent); }
.checklist .no { color: var(--ink-muted); }
.receipt .total { display: flex; justify-content: space-between; font-family: var(--mono); font-weight: 700; margin-top: 4px; }

/* FAQ */
.faq { display: grid; gap: 12px; max-width: 780px; }
.faq details { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); }
.section.alt .faq details { background: var(--paper); }
.faq summary { cursor: pointer; list-style: none; padding: 16px 52px 16px 18px; font-weight: 700; position: relative; min-height: 48px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-family: var(--mono); font-size: 1.375rem; color: var(--accent); }
.faq details[open] summary::after { content: "−"; }
.faq .answer { padding: 0 18px 16px; color: var(--ink-muted); }
.faq .answer p:last-child { margin-bottom: 0; }

/* Download CTA */
.cta { text-align: center; }
.cta .stores { justify-content: center; }
.cta .receipt { padding: 36px 20px calc(36px + var(--tooth)); }
.cta p { color: var(--ink-muted); max-width: 32em; margin-inline: auto; }

.note { font-size: .9375rem; color: var(--ink-muted); }

/* ---------- Legal documents ---------- */
.doc { padding: 28px 0 64px; }
.back { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 12px; font-weight: 500; }
.back::before { content: "← "; white-space: pre; }
.doc .receipt { padding: 28px 20px calc(36px + var(--tooth)); }
@media (min-width: 700px) { .doc .receipt { padding: 44px 48px calc(48px + var(--tooth)); } }
.doc h1 { font-size: clamp(1.9rem, 6vw, 2.6rem); }
.doc h2 { font-size: 1.375rem; margin-top: 1.8em; }
.doc section { scroll-margin-top: 84px; }
.doc .meta { font-family: var(--mono); font-size: .875rem; color: var(--ink-muted); }
.doc ul, .doc ol { padding-left: 1.3em; }
.doc li { margin-bottom: .45em; }
.summary { background: var(--accent-soft); border-radius: 12px; padding: 18px 20px; margin: 24px 0; }
.summary h2 { margin-top: 0; font-size: 1.125rem; }
.summary ul { margin: 0; }
.summary p { margin: 10px 0 0; font-size: .9375rem; }
.toc { border: 2px dashed var(--rule); border-radius: 12px; padding: 16px 20px; margin: 24px 0; }
.toc h2 { margin-top: 0; font-size: 1.125rem; }
.toc ol { margin: 0; }
.legal-list > li { padding-left: .2em; }
.legal-list ol { margin-top: .5em; }
.callout { border-left: 4px solid var(--accent); background: var(--accent-soft); padding: 12px 16px; border-radius: 0 10px 10px 0; margin: 0 0 1em; }
.callout p { margin: 0; }
.table-wrap { overflow-x: auto; margin: 0 0 1em; }
table { width: 100%; border-collapse: collapse; font-size: .9688rem; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--rule); }
thead th { font-family: var(--mono); font-size: .8125rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-muted); }
tbody th { width: 28%; min-width: 8em; font-weight: 700; }

/* ---------- 404 ---------- */
.notfound { padding: 56px 0 80px; }
.notfound .tear { max-width: 480px; margin: 0 auto; }
.notfound .receipt { text-align: center; padding: 36px 24px calc(40px + var(--tooth)); }
.notfound .big { font-family: var(--mono); font-size: clamp(3.5rem, 16vw, 5.5rem); font-weight: 700; line-height: 1; margin: 0 0 12px; color: var(--accent); }
.notfound p { color: var(--ink-muted); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--rule); padding: 40px 0 28px; font-size: .9375rem; }
.site-footer .cols { display: grid; gap: 28px; }
@media (min-width: 760px) { .site-footer .cols { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer h2 { font-size: .8125rem; font-family: var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-muted); margin: 0 0 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li a { display: inline-flex; min-height: 36px; align-items: center; color: var(--ink); }
.site-footer .disclaimer { color: var(--ink-muted); margin-top: 12px; max-width: 34em; }
.site-footer .bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; margin-top: 28px; padding-top: 16px; border-top: 2px dashed var(--rule); color: var(--ink-muted); font-family: var(--mono); font-size: .8125rem; }
