:root {
    /* Legacy variable names kept for backward-compat with older markup */
    --primary-color: #e0913f;
    --secondary-color: #c97a2b;
    --accent-color: #e0913f;

    --bg: #0b0a09;
    --bg-alt: #0f0e0c;
    --surface: #141210;
    --line: #2a2621;
    --line-soft: #1c1a17;
    --text: #f3ede4;
    --text-muted: #a89e8f;
    --text-dim: #6f6558;
    --accent: #e0913f;
    --accent-soft: #f4b968;
    --accent-deep: #c97a2b;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text);
}

.font-serif-display { font-family: 'Fraunces', ui-serif, Georgia, serif; }
.font-mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; }

::selection { background: var(--accent); color: #0b0a09; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* Legacy hooks used by blog templates */
.text-idl-primary { color: var(--accent); }
.text-idl-accent { color: var(--accent-soft); }
.bg-idl-primary { background-color: var(--accent); }
.border-idl-primary { border-color: var(--accent); }
.hover\:text-idl-primary:hover { color: var(--accent); }
.hover\:text-idl-accent:hover { color: var(--accent-soft); }

.section-padding { padding-top: 6.5rem; padding-bottom: 6.5rem; }

/* Eyebrow / spec label */
.eyebrow {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
}

.hairline { border-color: var(--line); }
.hairline-soft { border-color: var(--line-soft); }

/* Underline-draw hover, used on nav + text links */
.underline-hover {
    position: relative;
    text-decoration: none;
}
.underline-hover::after {
    content: '';
    position: absolute;
    left: 0; right: 100%; bottom: -2px;
    height: 1px;
    background: currentColor;
    transition: right .35s cubic-bezier(.2,.7,.2,1);
}
.underline-hover:hover::after { right: 0; }

/* Numbered spec rows (features) */
.spec-row { border-top: 1px solid var(--line); transition: background-color .3s ease; }
.spec-row:hover { background-color: rgba(224,145,63,0.03); }
.spec-index {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    color: var(--text-dim);
    font-size: 0.875rem;
    letter-spacing: 0.05em;
}

/* Buttons: flat, no gradients */
.btn-primary {
    background-color: var(--accent);
    color: #0b0a09;
    font-weight: 600;
    transition: background-color .25s ease, transform .25s ease;
}
.btn-primary:hover { background-color: var(--accent-soft); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
    border: 1px solid var(--line);
    color: var(--text);
    transition: border-color .25s ease, color .25s ease;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-soft); }

/* App store badges */
.store-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.25rem;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    transition: border-color .25s ease, color .25s ease, transform .25s ease;
}
a.store-badge:hover { border-color: var(--accent); color: var(--accent-soft); transform: translateY(-1px); }
.store-badge-icon { width: 1.75rem; height: 1.75rem; flex-shrink: 0; }
.store-badge-eyebrow {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dim);
    display: block;
}
.store-badge-title { display: block; font-size: 1rem; font-weight: 500; line-height: 1.2; margin-top: 0.1rem; }
.store-badge-disabled { opacity: 0.5; cursor: default; }
.store-badge-disabled:hover { border-color: var(--line); color: var(--text); transform: none; }

/* Minimal underline form inputs (editorial style, no boxes) */
.field-underline {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    padding: 0.6rem 0.1rem;
    transition: border-color .25s ease;
}
.field-underline:focus { outline: none; border-bottom-color: var(--accent); }
.field-underline::placeholder { color: var(--text-dim); }

/* Product screenshot frame: hairline border + duotone filter so light-mode
   screenshots sit quietly inside the dark editorial canvas */
.shot-frame {
    border: 1px solid var(--line);
    background: var(--surface);
}
.shot-duotone {
    filter: grayscale(0.55) contrast(1.08) brightness(0.92) sepia(0.12);
    transition: filter .5s ease;
}
.shot-frame:hover .shot-duotone { filter: grayscale(0.15) contrast(1.05) brightness(0.98) sepia(0.04); }

/* Scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1);
    will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1.is-visible { transition-delay: .08s; }
.reveal-delay-2.is-visible { transition-delay: .16s; }
.reveal-delay-3.is-visible { transition-delay: .24s; }
.reveal-delay-4.is-visible { transition-delay: .32s; }
.reveal-delay-5.is-visible { transition-delay: .4s; }
.reveal-delay-6.is-visible { transition-delay: .48s; }

/* Mono ticker (integrations) */
.ticker-mask {
    -webkit-mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
}
.ticker-track {
    display: flex;
    width: max-content;
    animation: ticker 34s linear infinite;
}
.ticker-wrap:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Hero signal diagram animation */
.signal-arc {
    transform-origin: center;
    animation: signal-pulse 3.2s ease-out infinite;
    opacity: 0;
}
.signal-arc.d1 { animation-delay: 0s; }
.signal-arc.d2 { animation-delay: .8s; }
.signal-arc.d3 { animation-delay: 1.6s; }
@keyframes signal-pulse {
    0% { opacity: 0; transform: scale(0.85); }
    15% { opacity: .9; }
    70% { opacity: .15; }
    100% { opacity: 0; transform: scale(1.05); }
}
.scan-line {
    animation: scan-sweep 4s cubic-bezier(.4,0,.2,1) infinite;
}
@keyframes scan-sweep {
    0%, 100% { transform: translateY(-46px); opacity: 0; }
    10% { opacity: 1; }
    50% { transform: translateY(46px); opacity: 1; }
    60% { opacity: 0; }
}
.hero-tilt { transition: transform .3s ease-out; transform-style: preserve-3d; }

/* Levitating, side-angled phone mockup that rocks gently as it floats */
@keyframes levitate-phone {
    0%   { transform: perspective(1400px) rotateY(-20deg) rotateX(7deg) translateY(0); }
    50%  { transform: perspective(1400px) rotateY(-32deg) rotateX(11deg) translateY(-18px); }
    100% { transform: perspective(1400px) rotateY(-20deg) rotateX(7deg) translateY(0); }
}
.phone-levitate {
    transform: perspective(1400px) rotateY(-20deg) rotateX(7deg) translateY(0);
    transform-style: preserve-3d;
    animation: levitate-phone 7s ease-in-out infinite;
}
@keyframes levitate-shadow {
    0%, 100% { transform: scaleX(1); opacity: 0.4; }
    50% { transform: scaleX(0.78); opacity: 0.22; }
}
.phone-shadow { animation: levitate-shadow 5.5s ease-in-out infinite; }

/* Stat strip */
.stat-number { font-variant-numeric: tabular-nums; font-family: 'Fraunces', ui-serif, serif; }

/* Header scroll state, toggled by JS */
#site-header { transition: background-color .3s ease, border-color .3s ease, backdrop-filter .3s ease; border-bottom: 1px solid transparent; }
#site-header.scrolled { background-color: rgba(11,10,9,0.82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom-color: var(--line); }

/* Blog article content, editorial-adapted */
.article-content { color: var(--text-muted); }
.article-content h2, .article-content h3, .article-content strong { color: var(--text); }
.article-content pre { background: var(--surface); border-left: 3px solid var(--accent); padding: 1rem; border-radius: .25rem; overflow-x: auto; margin: 1rem 0; font-size: .9em; color: var(--text); }
.article-content blockquote { border-left: 3px solid var(--accent-soft); padding-left: 1rem; margin: 1rem 0; font-style: italic; color: var(--text-muted); }
.article-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.article-card { height: 100%; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===== Legal document pages (/legal) ===== */
.legal-content {
    font-family: 'Inter', sans-serif;
    color: var(--text-muted);
    font-size: 0.975rem;
    line-height: 1.75;
}
.legal-content strong { color: var(--text); font-weight: 600; }
.legal-content p { margin: 0 0 1.25rem; }
.legal-content > p:last-child { margin-bottom: 0; }
.legal-content em { color: var(--text-dim); font-style: italic; }

/* --- Recursive multilevel numbering (Podmínky užívání aplikace) --- */
.legal-nested ol {
    list-style: none;
    counter-reset: item;
    margin: 0;
    padding-left: 0;
}
.legal-nested ol ol {
    margin-top: 0.85rem;
    padding-left: 1.9rem;
}
.legal-nested li {
    counter-increment: item;
    position: relative;
    padding-left: 2.6rem;
    margin-bottom: 0.85rem;
}
.legal-nested li::before {
    content: counters(item, '.') '.';
    position: absolute;
    left: 0;
    top: 0;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.8rem;
    color: var(--accent);
    letter-spacing: 0.02em;
}
.legal-nested > ol > li > strong:first-child {
    display: block;
    font-family: 'Fraunces', ui-serif, serif;
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.6rem;
}
.legal-nested > ol > li {
    padding-top: 1.75rem;
    border-top: 1px solid var(--line);
    margin-bottom: 1.75rem;
}
.legal-nested > ol > li:first-child {
    padding-top: 0;
    border-top: none;
}

/* --- Chaptered numbering: H2 sections + clause lists (Obchodní podmínky) --- */
.legal-chaptered { counter-reset: chapter; }
.legal-chaptered h2 {
    counter-increment: chapter;
    counter-reset: clause;
    font-family: 'Fraunces', ui-serif, serif;
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text);
    margin: 3rem 0 1.25rem;
    padding-top: 2rem;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 0.75rem;
    align-items: baseline;
}
.legal-chaptered h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.legal-chaptered h2::before {
    content: counter(chapter) '.';
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 1rem;
    color: var(--accent);
    flex-shrink: 0;
}
.legal-chaptered h2 strong { font-weight: 500; color: inherit; }
.legal-chaptered ul {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
}
.legal-chaptered ul > li {
    position: relative;
    padding-left: 1.4rem;
    margin-bottom: 0.6rem;
}
.legal-chaptered ul > li::before {
    content: '\2014';
    position: absolute;
    left: 0;
    color: var(--text-dim);
}
.legal-chaptered ol.clause-list {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
}
.legal-chaptered ol.clause-list > li {
    counter-increment: clause;
    position: relative;
    padding-left: 3.1rem;
    margin-bottom: 0.85rem;
}
.legal-chaptered ol.clause-list > li::before {
    content: counter(chapter) '.' counter(clause) '.';
    position: absolute;
    left: 0;
    top: 0;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.8rem;
    color: var(--accent);
}
.legal-chaptered ol.sub-list {
    list-style: none;
    counter-reset: subclause;
    margin: 0.85rem 0 0;
    padding-left: 1.9rem;
}
.legal-chaptered ol.sub-list > li {
    counter-increment: subclause;
    position: relative;
    padding-left: 2.6rem;
    margin-bottom: 0.6rem;
}
.legal-chaptered ol.sub-list > li::before {
    content: counter(chapter) '.' counter(clause) '.' counter(subclause) '.';
    position: absolute;
    left: 0;
    top: 0;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.8rem;
    color: var(--accent);
}

/* --- Legal page chrome (hub + doc header) --- */
.legal-card {
    border: 1px solid var(--line);
    transition: border-color .3s ease, background-color .3s ease;
}
.legal-card:hover { border-color: var(--accent); background-color: rgba(224,145,63,0.03); }
.legal-doc-meta {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: var(--text-dim);
}
