/* Tokens copied from HM-POS/web/css/variables.css (the app style guide). Keep the two in sync. */
/* Accent palette: blue (default). */
:root { --p-l: #1d4ed8; --p-l-ink: #ffffff; --p-d: #60a5fa; --p-d-ink: #03142e; }

:root {
  --primary: var(--p-l);
  --primary-ink: var(--p-l-ink);
  --accent-soft: color-mix(in srgb, var(--primary) 14%, var(--surface));
  --bg: color-mix(in srgb, var(--primary) 4%, #f4f5f7);
  --surface: #ffffff;
  --surface-2: color-mix(in srgb, var(--primary) 5%, #eff1f3);
  --border: color-mix(in srgb, var(--primary) 10%, #dcdfe3);
  --text: #14191d;
  --muted: #5d666e;
  --success: #067647;  --success-soft: #e7f6ee;
  --warn: #8a5a00;     --warn-soft: #fff4dc;
  --radius-pill: 999px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 20, 25, .06), 0 4px 16px rgba(15, 20, 25, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
/* Dark mode follows the system. The block is written twice on purpose (style guide §3): edit both. */
:root[data-theme="light"] { color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary: var(--p-d);
    --primary-ink: var(--p-d-ink);
    --accent-soft: color-mix(in srgb, var(--primary) 18%, var(--surface));
    --bg: color-mix(in srgb, var(--primary) 4%, #0b0e11);
    --surface: color-mix(in srgb, var(--primary) 5%, #12161a);
    --surface-2: color-mix(in srgb, var(--primary) 7%, #181d22);
    --border: color-mix(in srgb, var(--primary) 12%, #252b31);
    --text: #e7eaed;
    --muted: #98a1a9;
    --success: #4ade80;  --success-soft: #0f2a1a;
    --warn: #f5c56b;     --warn-soft: #33270f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --primary: var(--p-d);
  --primary-ink: var(--p-d-ink);
  --accent-soft: color-mix(in srgb, var(--primary) 18%, var(--surface));
  --bg: color-mix(in srgb, var(--primary) 4%, #0b0e11);
  --surface: color-mix(in srgb, var(--primary) 5%, #12161a);
  --surface-2: color-mix(in srgb, var(--primary) 7%, #181d22);
  --border: color-mix(in srgb, var(--primary) 12%, #252b31);
  --text: #e7eaed;
  --muted: #98a1a9;
  --success: #4ade80;  --success-soft: #0f2a1a;
  --warn: #f5c56b;     --warn-soft: #33270f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 var(--font);
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--primary); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
.num { font-variant-numeric: tabular-nums; }
.wrap { max-width: 1160px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
@media (min-width: 768px) { .wrap { padding-left: 24px; padding-right: 24px; } }

/* Header (sticky, like the POS) */
.site-header { position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--border); padding-top: env(safe-area-inset-top); }
.nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--text); text-decoration: none; min-height: 44px; }
.brand svg { width: 32px; height: 32px; flex: none; }
.logo-bg { fill: var(--p-l); }
.nav-right { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; }
.nav-right a.link { color: var(--text); text-decoration: none; font-weight: 600; font-size: .9rem; min-height: 44px; display: inline-flex; align-items: center; }
.nav-right a.link:hover { color: var(--primary); }

/* Segmented control (language) */
.segmented { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); }
.segmented button {
  min-width: 44px; min-height: 38px; border: 0; border-radius: 8px; cursor: pointer;
  font: 600 .875rem var(--font); background: transparent; color: var(--muted);
}
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* Hero */
.hero { display: flex; flex-direction: column; gap: 24px; padding-top: 64px; padding-bottom: 48px; }
.hero h1 { max-width: 860px; font-weight: 800; font-size: clamp(2.1rem, 6vw, 3.6rem); line-height: 1.08; letter-spacing: -0.02em; }
.hero .sub { max-width: 640px; font-size: 1.2rem; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 28px; background: var(--primary); color: var(--primary-ink); text-decoration: none; font-weight: 700; font-size: 1rem; border-radius: var(--radius-lg); }
.btn:hover { background: color-mix(in srgb, var(--primary) 88%, var(--text)); color: var(--primary-ink); }
.btn:active { transform: translateY(1px); }
.actions .text-link { font-weight: 600; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 16px; margin-bottom: 64px; }
.stat { padding: 20px; display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat .num { font-weight: 800; font-size: 2.4rem; line-height: 1.1; color: var(--primary); }
.stat .num.phrase { font-size: 1.45rem; line-height: 1.2; text-wrap: balance; }
.stat .label { color: var(--muted); font-size: .95rem; }

/* Sections */
h2 { font-weight: 800; font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.15; letter-spacing: -0.015em; }
.kicker { font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.band { background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section { padding-top: 72px; padding-bottom: 72px; }
.section-head { display: flex; flex-direction: column; gap: 12px; max-width: 640px; margin-bottom: 32px; }
.section-head p { color: var(--muted); }

/* Products */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.card-top svg { width: 48px; height: 48px; color: var(--primary); }
.badge { padding: 4px 10px; font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; border-radius: var(--radius-pill); }
.badge.dev { background: var(--accent-soft); color: var(--primary); }
.badge.plan { background: var(--warn-soft); color: var(--warn); }
.card h3 { font-weight: 700; font-size: 1.4rem; }
.card p { color: var(--muted); }
.card ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.card li { display: flex; gap: 10px; }
.card li::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 10px; border-radius: 50%; background: var(--primary); }
.card .more { font-weight: 600; margin-top: 4px; }

/* About */
.about { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(480px, 100%), 1fr)); gap: 48px; }
.about-text { display: flex; flex-direction: column; gap: 18px; }
.about-text p { color: var(--muted); }
.timeline { align-self: start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px 20px; margin: 0; list-style: none; }
.timeline li { padding: 16px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.timeline li:last-child { border-bottom: 0; }
.timeline strong { font-weight: 700; }
.timeline span { color: var(--muted); font-size: .95rem; }

/* Contact */
.contact { background: var(--surface-2); border-top: 1px solid var(--border); }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr)); gap: 40px; }
.contact-text { display: flex; flex-direction: column; gap: 16px; }
.contact-text p { color: var(--muted); max-width: 520px; }
.contact-list { align-self: start; margin: 0; padding: 4px 20px; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.contact-list li { padding: 16px 0; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.contact-list li:last-child { border-bottom: 0; }
.contact-list .k { color: var(--muted); }
.contact-list .v { font-weight: 600; }

/* Footer */
footer { border-top: 1px solid var(--border); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; color: var(--muted); font-size: .85rem; padding-top: 24px; padding-bottom: 32px; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn:active { transform: none; } }

/* ===================== Product pages ===================== */
.nav-right a.link[aria-current="page"] { color: var(--primary); }
.crumb { font-size: .875rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.crumb:hover { color: var(--primary); }

.product-hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 40px; align-items: center; padding-top: 48px; padding-bottom: 64px; }
.product-hero .intro { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.product-hero h1 { font-weight: 800; font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: 1.05; letter-spacing: -0.02em; }
.product-hero .tagline { font-weight: 700; font-size: clamp(1.15rem, 2.4vw, 1.45rem); color: var(--primary); text-wrap: balance; }
.product-hero .sub { font-size: 1.1rem; color: var(--muted); max-width: 560px; }
.product-hero .title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }

/* Sale demo (ported from HM-POS/web/js/ui/onboarding-demo.js and css/layout.css): one 8 s loop,
   each step fades in at its own point and everything fades out together. With reduced motion the
   finished sale is shown, still. */
.demo-wrap { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 440px; justify-self: center; }
.demo-card { margin: 0; padding: 16px 18px; display: grid; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); font-size: 1rem; line-height: 1.45; }
.demo-note { font-size: .85rem; color: var(--muted); text-align: center; }
.demo-card .kicker { font-size: .75rem; }
.obd-head { display: flex; align-items: center; justify-content: space-between; }
.obd-scan { display: grid; color: var(--muted); animation: obd-beep 8s infinite; }
.obd-scan svg { width: 20px; height: 20px; }
.obd-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.obd-lines li { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; padding: 6px 10px; border-radius: var(--radius-md); background: var(--surface-2); }
.obd-name { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.obd-qty { grid-column: 1; font-size: .78rem; color: var(--muted); }
.obd-amt { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-weight: 700; }
.obd-total { display: grid; grid-template-columns: 1fr auto; align-items: baseline; border-top: 1px solid var(--border); padding-top: 8px; font-weight: 700; }
.obd-total .stat-value { font-size: 1.6rem; font-weight: 700; color: var(--primary); }
.obd-tax { grid-column: 1 / -1; text-align: right; font-weight: 400; font-size: .78rem; color: var(--muted); }
.obd-pay { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .875rem; }
.obd-done { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--radius-md); background: var(--success-soft); color: var(--success); font-weight: 700; font-size: .875rem; }
.obd-done svg { width: 18px; height: 18px; flex: none; }
.obd-1 { animation: obd-1 8s infinite both; } .obd-2 { animation: obd-2 8s infinite both; } .obd-3 { animation: obd-3 8s infinite both; }
.obd-4 { animation: obd-4 8s infinite both; } .obd-5 { animation: obd-5 8s infinite both; } .obd-6 { animation: obd-6 8s infinite both; }
@keyframes obd-1 { 0%, 5% { opacity: 0; transform: translateY(6px); } 9%, 92% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; } }
@keyframes obd-2 { 0%, 17% { opacity: 0; transform: translateY(6px); } 21%, 92% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; } }
@keyframes obd-3 { 0%, 29% { opacity: 0; transform: translateY(6px); } 33%, 92% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; } }
@keyframes obd-4 { 0%, 43% { opacity: 0; } 47%, 92% { opacity: 1; } 97%, 100% { opacity: 0; } }
@keyframes obd-5 { 0%, 57% { opacity: 0; } 61%, 92% { opacity: 1; } 97%, 100% { opacity: 0; } }
@keyframes obd-6 { 0%, 69% { opacity: 0; transform: scale(.97); } 73%, 92% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; } }
@keyframes obd-beep { 0%, 3%, 9%, 15%, 21%, 27%, 33%, 100% { color: var(--muted); } 6%, 18%, 30% { color: var(--primary); } }

/* Feature grid */
.feature-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.feature { display: flex; gap: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.feature-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-md); background: var(--accent-soft); color: var(--primary); }
.feature-icon svg { width: 22px; height: 22px; }
.feature-title { font-weight: 700; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.feature-text { color: var(--muted); font-size: .95rem; margin-top: 2px; }
.feature.soon .feature-icon { background: var(--surface-2); color: var(--muted); }
.sub-head { margin: 40px 0 16px; }
.badge.neutral { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

/* General information */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.info { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.info h3 { font-size: 1.05rem; font-weight: 700; }
.info p { color: var(--muted); }
.info ul { margin: 0; padding-left: 18px; color: var(--muted); display: grid; gap: 4px; }

/* Screenshots */
.gallery { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.shot { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.shot button { display: block; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); cursor: zoom-in; }
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption { color: var(--muted); font-size: .95rem; }
.shot figcaption strong { color: var(--text); }
.shot.wide { grid-column: 1 / -1; }
.shot.phone button { max-width: 300px; }
.gallery-note { color: var(--muted); font-size: .875rem; margin-top: 16px; }
.lightbox { padding: 0; border: 0; background: transparent; max-width: min(1600px, 96vw); max-height: 94vh; }
.lightbox::backdrop { background: rgba(5, 8, 12, .82); }
.lightbox img { display: block; max-width: 100%; max-height: 88vh; border-radius: var(--radius); }
.lightbox .close { position: fixed; top: 16px; right: 16px; min-width: 44px; min-height: 44px; border: 0; border-radius: var(--radius-pill); background: var(--surface); color: var(--text); font: 700 1.4rem/1 var(--font); cursor: pointer; }
.lightbox p { color: #e7eaed; text-align: center; margin-top: 10px; font-size: .95rem; }

/* CTA band and coming-soon notice */
.cta-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.cta-band h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); }
.cta-band p { color: var(--muted); margin-top: 6px; max-width: 620px; }
.notice { max-width: 720px; margin: 0 auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 40px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.notice svg { width: 56px; height: 56px; color: var(--primary); }
.notice h1 { font-weight: 800; font-size: clamp(2rem, 5vw, 2.8rem); line-height: 1.1; letter-spacing: -0.02em; }
.notice p { color: var(--muted); max-width: 560px; }
.soon-page { padding-top: 56px; padding-bottom: 72px; }

@media (prefers-reduced-motion: reduce) {
  .demo-card, .demo-card * { animation: none !important; }
}
.card-title-link { color: inherit; text-decoration: none; }
.card-title-link:hover { color: var(--primary); }
.soon-page .notice { margin-top: 20px; }
.notice .actions { justify-content: center; }
.free-note { display: flex; align-items: flex-start; gap: 12px; margin-top: 16px; padding: 14px 16px; border-radius: var(--radius-lg); background: var(--success-soft); border: 1px solid color-mix(in srgb, var(--success) 30%, transparent); max-width: 720px; }
.free-note p { margin: 0; color: var(--text); }
.free-note strong { color: var(--success); }
.badge.free { flex: none; margin-top: 2px; background: var(--success); color: var(--surface); }
/* Footer theme switch */
footer .wrap { align-items: center; }
.theme-switch button { min-height: 36px; padding: 0 12px; font-size: .8rem; }
