/*
 * AlphaCardio web — ONE dark canvas, and a type system held to FOUR sizes, TWO weights and
 * THREE colours (owner 2026-10-16; `bin/alphacardio.sh web check` refuses anything else):
 *
 *   sizes    --s 14 px (labels, notes, footer) · --m 17 px (all text, card titles)
 *            --l 28 px (section titles, values) · --xl 40–56 px (the opening title only)
 *   weights  --regular 400 · --bold 700
 *   colours  --text (white) · --muted (grey) · --accent (mint, the one accent)
 *            + for the PLANNED / EXPECTED marks ONLY: --planned (green) · --expected (orange)
 *            (the owner's one exception, 2026-10-17)
 *
 * --bg, --surface and --line are tones of the canvas, not colours. A status is told by the
 * SHAPE of its icon (✓ △ !), never by a fourth colour. site-config.json's "theme" overrides
 * these defaults by name; "decor" names the side pattern and its speed. No font is loaded.
 */
:root {
    --text: #e6edef;
    --muted: #a3b7bc;
    --accent: #7fdcc7;
    --bg: #13262d;
    --surface: #183039;
    --line: #2a4852;
    --planned: #a6e36f;     /* the marks only: PLANNED (v1), a lime green apart from the mint accent */
    --expected: #f5a35c;    /* the marks only: EXPECTED (v2) */

    --s: 14px;
    --m: 17px;
    --l: 28px;
    --xl: clamp(40px, 6.5vw, 56px);
    --regular: 400;
    --bold: 700;

    --pattern: url("/images/pattern.svg");
    --patternSeconds: 90s;

    --radius: 18px;
    --radius-sm: 12px;
    --wrap: 880px;
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Arial, sans-serif;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; background: var(--bg); overflow-x: clip; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: var(--m);
    font-weight: var(--regular);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    font-variant-numeric: tabular-nums;
    /* A hidden EXP / BACKLOG note near the right edge must not widen the page; `clip`, unlike
       `hidden`, keeps the sticky bar working. An open note is moved on screen by app.js. */
    overflow-x: clip;
}

h1, h2, h3, h4 { margin: 0; font-size: var(--m); font-weight: var(--bold); line-height: 1.2; letter-spacing: -0.01em; }
p { margin: 0 0 0.85em; }
strong { font-weight: var(--bold); color: var(--text); }
em { font-style: italic; }
a { color: inherit; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; margin: 0; padding: 0; }
input, button { font-family: var(--font); font-size: var(--m); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip {
    position: absolute; left: 16px; top: -60px; z-index: 20;
    background: var(--accent); color: var(--bg); padding: 10px 16px; border-radius: 999px;
    font-weight: var(--bold); text-decoration: none;
}
.skip:focus { top: 12px; }

.icon {
    width: 24px; height: 24px; flex: none;
    fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}

/* ---- the side pattern: an ECG trace unrolling slowly down both margins ----------------- */

.decor {
    position: fixed; top: 0; bottom: 0; z-index: 0; overflow: hidden; pointer-events: none;
    width: max(0px, calc((100vw - var(--wrap)) / 2 - 24px));
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 18%, black 82%, transparent);
            mask-image: linear-gradient(to bottom, transparent, black 18%, black 82%, transparent);
}
.decor-left { left: 0; }
.decor-right { right: 0; transform: scaleX(-1); }
.decor::before {
    content: ""; position: absolute; left: 0; right: 0; top: -720px; height: calc(100% + 1440px);
    background-image: var(--pattern);
    background-repeat: repeat-y;
    background-position: center top;
    animation: unroll var(--patternSeconds) linear infinite;
    will-change: transform;
}
.decor-right::before { animation-delay: calc(var(--patternSeconds) / -2); }
@keyframes unroll { from { transform: translateY(0); } to { transform: translateY(720px); } }

.topbar, .page, .footer { position: relative; z-index: 1; }

/* ---- top bar ------------------------------------------------------------------------- */

.topbar {
    position: sticky; top: 0; z-index: 10;
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}
.topbar-inner {
    max-width: var(--wrap); margin: 0 auto; padding: 12px 16px;
    display: flex; align-items: center; gap: 24px;
}
.brand {
    display: inline-flex; align-items: center; gap: 9px;
    font-size: var(--m); font-weight: var(--bold); text-decoration: none; white-space: nowrap;
}
.brand-icon { color: var(--accent); }
.nav { display: flex; gap: 2px; margin-left: auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
    color: var(--muted); text-decoration: none; font-size: var(--s);
    padding: 12px 10px; border-radius: 999px; white-space: nowrap;
}
.nav a:hover { color: var(--text); }
.tagline { display: none; }

/* CZ | EN — the language switch, top right */
.lang { display: flex; flex: none; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 999px; }
.lang a {
    font-size: var(--s); font-weight: var(--bold); color: var(--muted); text-decoration: none;
    min-width: 40px; padding: 8px 10px; border-radius: 999px; text-align: center; letter-spacing: 0.04em;
}
.lang a:hover { color: var(--text); }
.lang a.lang-current { background: var(--surface); color: var(--text); }

/* ---- page + sections ----------------------------------------------------------------- */

.page { max-width: var(--wrap); margin: 0 auto; padding: 24px 16px; }
.section { padding: 56px 0; border-top: 1px solid var(--line); }
.section-hero { border-top: 0; padding-top: 8px; }
.section-hero + .section { border-top: 0; }

.kicker {
    color: var(--accent); font-size: var(--s); font-weight: var(--bold);
    letter-spacing: 0.12em; text-transform: uppercase; margin: 0 0 10px;
}
.section-title { font-size: var(--l); letter-spacing: -0.02em; margin-bottom: 20px; max-width: 26ch; }
.subtitle { margin: 36px 0 12px; }
.lead { max-width: 60ch; }
.prose p, .prose-more p { max-width: 64ch; color: var(--muted); }
.note { color: var(--muted); font-size: var(--s); }
.eyebrow {
    font-size: var(--s); letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--muted); margin: 0 0 6px;
}
.quote {
    margin: 24px 0 0; padding: 2px 0 2px 18px; border-left: 2px solid var(--accent);
    font-weight: var(--bold); max-width: 46ch;
}

/* "Číst dál" — the rest of a section's text, one tap away */
.more { margin-top: 4px; }
.more summary {
    display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none;
    color: var(--accent); font-size: var(--s); font-weight: var(--bold); padding: 8px 0; min-height: 44px;
}
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: "↓"; transition: transform 0.2s ease; }
.more[open] summary::after { transform: rotate(180deg); }
.more[open] summary { margin-bottom: 6px; }

/* ---- buttons ------------------------------------------------------------------------- */

.button {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 46px; padding: 0 22px; border: 0; border-radius: 999px;
    background: var(--accent); color: var(--bg);
    font-size: var(--m); font-weight: var(--bold); line-height: 1; text-decoration: none; cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease;
}
.button:hover { filter: brightness(1.06); transform: translateY(-1px); }
.button:disabled { background: var(--surface); color: var(--muted); border: 1px solid var(--line); cursor: not-allowed; transform: none; filter: none; }
.button-icon { width: 16px; height: 16px; stroke-width: 2; }
.button-wide { width: 100%; }

/* ---- hero ---------------------------------------------------------------------------- */

.hero-image {
    width: 100%; aspect-ratio: 16 / 7; object-fit: cover; object-position: 60% center;
    border-radius: var(--radius); border: 1px solid var(--line);
}
.hero-body { padding: 36px 0 4px; }
.hero-title { font-size: var(--xl); letter-spacing: -0.035em; line-height: 1.05; margin-bottom: 22px; }
.hero-title span { display: block; }
.hero-title span:last-child { color: var(--accent); }
.hero-lead { max-width: 52ch; }
.hero-text { color: var(--muted); max-width: 56ch; margin-bottom: 26px; }
.pillars {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
    margin: 40px 0 0; padding-top: 22px; border-top: 1px solid var(--line);
}
.pillar { display: flex; gap: 12px; align-items: flex-start; }
.pillar .icon { color: var(--accent); }
.pillar strong { display: block; }
.pillar span { color: var(--muted); font-size: var(--s); }

/* ---- cards (privacy) ----------------------------------------------------------------- */

.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: 22px;
}
.card h3 { margin: 14px 0 6px; }
.card p { color: var(--muted); margin: 0; }
.card-icon { color: var(--accent); }
.notice { margin: 20px 0; }

/* ---- steps --------------------------------------------------------------------------- */

.steps { display: grid; gap: 22px; }
.step { display: grid; grid-template-columns: 56px 1fr; gap: 18px; align-items: start; }
.tile {
    width: 56px; height: 56px; border-radius: 14px;
    background: var(--surface); border: 1px solid var(--line);
    display: grid; place-items: center; color: var(--accent);
}
.step h3 { margin: 2px 0 4px; }
.step p { margin: 0; color: var(--muted); }

/* ---- dashboard demo ------------------------------------------------------------------ */

.demo {
    margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 24px;
}
.demo-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.badge {
    border: 1px solid var(--accent); color: var(--accent); font-size: var(--s); font-weight: var(--bold);
    padding: 2px 12px; border-radius: 999px;
}
.demo-title { margin-bottom: 18px; }
.demo-top { display: flex; gap: 20px; align-items: center; justify-content: space-between; }
.demo-headline { font-size: var(--l); font-weight: var(--bold); letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 6px; }
.demo-summary { color: var(--muted); max-width: 48ch; }
.ring { position: relative; width: 112px; height: 112px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring-track { stroke: var(--line); }
.ring-value { stroke: var(--accent); stroke-linecap: round; }
.ring-label {
    position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
    font-size: var(--s); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.ring-arrow { font-size: var(--l); line-height: 1.1; color: var(--accent); }
.metrics {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 22px 0;
    background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden;
}
.metric { background: var(--surface); padding: 14px 16px; }
.metric p { margin: 0; }
.metric-label { display: flex; gap: 7px; align-items: center; font-size: var(--s); color: var(--muted); }
.metric-label .icon { width: 16px; height: 16px; }
.metric-value { font-size: var(--l); font-weight: var(--bold); letter-spacing: -0.02em; line-height: 1.25; margin-top: 6px !important; }
.metric-note { color: var(--muted); font-size: var(--s); }
.advice-title { display: flex; gap: 8px; align-items: center; font-weight: var(--bold); }
.advice-title .icon { color: var(--accent); }
.advice p:last-child { color: var(--muted); }
.disclaimer {
    margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line);
    color: var(--muted); font-size: var(--s);
}

/* Three modes, told apart by the icon's shape: ✓ grey, △ mint, ! white with a white frame. */
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.mode {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: 18px; border-top: 2px solid var(--line);
}
.mode h4 { margin: 10px 0 6px; }
.mode p { margin: 0; color: var(--muted); }
.mode-ok .icon { color: var(--muted); }
.mode-warn { border-top-color: var(--accent); } .mode-warn .icon { color: var(--accent); }
.mode-alert { border-color: var(--text); } .mode-alert .icon { color: var(--text); } .mode-alert p { color: var(--text); }

/* ---- tiers --------------------------------------------------------------------------- */

.tiers { display: grid; gap: 12px; }
.tier {
    display: grid; grid-template-columns: 132px 1fr; gap: 22px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
}
.tier-image { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); }
.tier h3 { margin-bottom: 6px; }
.tier p { color: var(--muted); }
.tier .tier-tagline { color: var(--text); }
.price { font-weight: var(--bold); color: var(--accent) !important; }

/* ---- waitlist ------------------------------------------------------------------------ */

.join {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 34px 28px 22px;
}
.join-lines { font-size: var(--l); font-weight: var(--bold); letter-spacing: -0.02em; line-height: 1.25; }
.join-lines span { display: block; }
.join-text { color: var(--muted); max-width: 56ch; }
.join-form { display: grid; gap: 10px; margin: 22px 0 18px; max-width: 460px; }
.join-form label { font-size: var(--s); color: var(--muted); }
.join-form input {
    min-height: 48px; padding: 0 20px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
.join-form input::placeholder { color: var(--muted); }
.join-form input:disabled { opacity: 0.7; }
.join-note { margin: 0; color: var(--muted); font-size: var(--s); min-height: 1.4em; }
.join-closing { color: var(--muted); font-size: var(--s); margin: 0; }

/* ---- footer -------------------------------------------------------------------------- */

.footer { border-top: 1px solid var(--line); color: var(--muted); }
.footer-inner { max-width: var(--wrap); margin: 0 auto; padding: 28px 16px 40px; font-size: var(--s); }
.emergency {
    display: flex; gap: 12px; align-items: flex-start; color: var(--text);
    border: 1px solid var(--text); border-radius: var(--radius-sm);
    padding: 14px 16px; margin-bottom: 18px; font-size: var(--m);
}
.copyright { margin: 14px 0 0; }

/* ---- entrance ------------------------------------------------------------------------ */

.reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
    .button, .more summary::after { transition: none; }
    .decor::before { animation: none; }
}

/* ---- narrower screens ---------------------------------------------------------------- */

@media (max-width: 1080px) {
    .decor { display: none; }
}

@media (max-width: 760px) {
    .page { padding-top: 16px; }
    .section { padding: 44px 0; }
    .nav a { padding: 12px 8px; }
    .cards, .pillars, .modes { grid-template-columns: 1fr; }
    .metrics { grid-template-columns: repeat(2, 1fr); }
    .metric-value { font-size: var(--m); }
    .tier { grid-template-columns: 1fr; }
    .tier-image { width: 96px; }
    .demo-top { flex-direction: column-reverse; align-items: flex-start; }
    .hero-image { aspect-ratio: 4 / 3; }
    .join { padding: 26px 18px 18px; }
}

/* ---- PLANNED / EXPECTED marks -----------------------------------------------------------
 * A claim the app does not yet make true (owner 2026-10-16; two kinds since 2026-10-17):
 * green = PLANNED (committed for the first release), orange = EXPECTED (a later version — a
 * regulatory decision, a partner or phase 2). The two colours are the owner's one exception to
 * the three, for the marks only. The note shows on hover, keyboard focus or tap; app.js keeps
 * it on screen.
 */
.mark { position: relative; display: inline-block; vertical-align: super; line-height: 1; margin-left: 4px; }
.mark-tag {
    font-size: var(--s); font-weight: var(--bold); letter-spacing: 0.06em; line-height: 1;
    min-height: 24px; padding: 4px 8px; border-radius: 999px; cursor: help;
    background: transparent; border: 1px solid currentColor; color: var(--muted);
}
.mark-planned .mark-tag { color: var(--planned); }
.mark-expected .mark-tag { color: var(--expected); }
.mark-tip {
    position: absolute; bottom: calc(100% + 8px); left: 50%; z-index: 30;
    transform: translateX(calc(-50% + var(--shift, 0px)));
    width: max-content; max-width: min(300px, calc(100vw - 32px));
    padding: 10px 12px; border-radius: var(--radius-sm);
    background: var(--bg); border: 1px solid var(--muted); color: var(--text);
    font-size: var(--s); font-weight: var(--regular); letter-spacing: 0; line-height: 1.45;
    text-transform: none; text-align: left; white-space: normal;
    opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.15s ease;
}
.mark.below .mark-tip { bottom: auto; top: calc(100% + 8px); }
.mark:hover .mark-tip, .mark.open .mark-tip, .mark-tag:focus-visible + .mark-tip { opacity: 1; visibility: visible; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 4px 0 0; }
.legend .mark { vertical-align: baseline; margin-left: 0; }
@media (prefers-reduced-motion: reduce) { .mark-tip { transition: none; } }

/* A named link inside text (`[text](key)` → site.links): the accent, underlined, bold. */
.text-link { color: var(--accent); font-weight: var(--bold); text-decoration: underline; text-underline-offset: 3px; }
.text-link:hover { color: var(--text); }
