/* ══════════════════════════════════════
   AI Prakticky — shared styles
   ══════════════════════════════════════ */

:root {
    --bg:               #faf9f5;
    --surface:          #FFFEF8;
    --surface-ia:       #ffffff;
    --ui-surface:       #f7f6f0;
    --text:             #282728;
    --text-muted:       #5a585a;
    --border:           #e0d8c8;
    --primary:          #2e8896;
    --primary-rgb:      46, 136, 150;
    --error:            #b80037;
    --accent:           #c76060;
    --hero-dot:         rgba(46, 136, 150, 0.08);
    --hero-dot-size:    1px;
    --card-hover-bg:    rgba(46, 136, 150, 0.03);
    --font-mono:        ui-monospace, 'SF Mono', 'Consolas', 'Menlo',
                        'DejaVu Sans Mono', 'Liberation Mono', 'Courier New', monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --scrollbar-thumb: #5f5f5d;
        --bg:           #000000;
        --surface:      #0a0a09;
        --surface-ia:   #1c1b19;
        --ui-surface:   #000000;
        --text:         #eedfce;
        --text-muted:   #eedfce;
        --border:       #3f444a;
        --primary:      #4cbaba;
        --primary-rgb:  76, 186, 186;
        --error:        #ff4d7d;
        --accent:       #ea666b;
        --hero-dot:     rgba(76, 186, 186, 0.06);
        --hero-dot-size: 1px;
        --card-hover-bg: rgba(76, 186, 186, 0.04);
    }
}

/* ── Forced themes ── */
html[data-theme="dark"] {
    --scrollbar-thumb: #5f5f5d;
    --bg:           #000000;
    --surface:      #0a0a09;
    --surface-ia:   #1c1b19;
    --ui-surface:   #000000;
    --text:         #eedfce;
    --text-muted:   #eedfce;
    --border:       #3f444a;
    --primary:      #4cbaba;
    --primary-rgb:  76, 186, 186;
    --error:        #ff4d7d;
    --accent:       #ea666b;
    --hero-dot:     rgba(76, 186, 186, 0.06);
    --card-hover-bg: rgba(76, 186, 186, 0.04);
}
html[data-theme="dark"] header { background-color: rgba(0, 0, 0, 0.85); }
html[data-theme="dark"] .btn,
html[data-theme="dark"] .btn:visited,
html[data-theme="dark"] .header-cta,
html[data-theme="dark"] .header-cta:visited { color: #1a1a1a; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .btn,
    :root:not([data-theme="light"]) .btn:visited,
    :root:not([data-theme="light"]) .header-cta,
    :root:not([data-theme="light"]) .header-cta:visited { color: #1a1a1a; }
}

html[data-theme="light"] {
    --scrollbar-thumb:  #e0d8c8;
    --bg:               #faf9f5;
    --surface:          #FFFEF8;
    --surface-ia:       #ffffff;
    --ui-surface:       #f7f6f0;
    --text:             #282728;
    --text-muted:       #5a585a;
    --border:           #e0d8c8;
    --primary:          #2e8896;
    --primary-rgb:      46, 136, 150;
    --error:            #b80037;
    --accent:           #c76060;
    --hero-dot:         rgba(46, 136, 150, 0.08);
    --card-hover-bg:    rgba(46, 136, 150, 0.03);
}
html[data-theme="light"] header { background-color: rgba(247, 246, 240, 0.88); }

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-mono);
    font-weight: 450;
    font-size: 20px;
    line-height: 1.75;
    background-color: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

@media (max-width: 768px) {
    body {
        font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
        font-size: 17px;
    }
}

.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 32px;
}

@media (max-width: 480px) {
    .container { padding: 0 16px; }
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: opacity 150ms ease;
}
a:visited { color: var(--primary); }
a:hover { opacity: 0.75; }
.header-cta, .header-cta:visited,
.btn, .btn:visited { color: #fff; }
.bio a strong { color: inherit; }

/* ── Animations ── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0; }
}

@keyframes subtlePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0.25); }
    50%      { box-shadow: 0 0 0 6px rgba(var(--primary-rgb), 0); }
}

.reveal {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}
.reveal-d1 { animation-delay: 0.1s; }
.reveal-d2 { animation-delay: 0.2s; }
.reveal-d3 { animation-delay: 0.35s; }
.reveal-d4 { animation-delay: 0.5s; }
.reveal-d5 { animation-delay: 0.65s; }

/* ── Header ── */
header {
    background-color: var(--ui-surface);
    border-bottom: 2px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

@media (prefers-color-scheme: dark) {
    header { background-color: rgba(0, 0, 0, 0.85); }
}
@media (prefers-color-scheme: light) {
    header { background-color: rgba(247, 246, 240, 0.88); }
}

header .container {
    display: flex;
    align-items: center;
    gap: 24px;
    max-width: 1100px;
}
.logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    line-height: 0;
}
.logo-svg { display: block; height: 21px; width: auto; }
.logo-svg .logo-ai { fill: var(--accent); }
.logo-svg .logo-prakticky { fill: var(--primary); }
/* HTML text varianty (h1 spany na úvode) */
.logo-ai { color: var(--accent); }
.logo-prakticky { color: var(--primary); }

/* ── Nav links ── */
.header-links {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-left: auto;
}

.header-link {
    font-size: 0.8em;
    font-weight: bold;
    color: var(--primary);
    text-decoration: none;
    transition: color 150ms ease;
}
.header-link:hover { color: var(--text-muted); }
.header-link.active { color: var(--text-muted); }

.header-cta {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.75em;
    font-weight: bold;
    color: #fff;
    background-color: var(--primary);
    border: 2px solid var(--primary);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 150ms ease, transform 150ms ease;
    white-space: nowrap;
}
.header-cta:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

/* ── Mobile menu ── */
.header-cta.mobile-visible { display: none; }

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 4px;
    width: 28px;
    height: 24px;
    position: relative;
    flex-shrink: 0;
}
.menu-bar {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
    transition: transform 300ms ease, opacity 200ms ease;
    position: absolute;
    left: 0;
}
.menu-bar:nth-child(1) { top: 4px; }
.menu-bar:nth-child(2) { top: 11px; }
.menu-bar:nth-child(3) { top: 18px; }
.menu-toggle.open .menu-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.menu-toggle.open .menu-bar:nth-child(2) {
    opacity: 0;
}
.menu-toggle.open .menu-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 700px) {
    .menu-toggle { display: block; }

    header .container { gap: 16px; }

    .logo { font-size: 1.4em; }
    .logo-svg { height: 20px; }

    .header-cta.mobile-visible {
        display: inline-block;
        margin-left: auto;
        font-size: 0.7em;
    }

    .header-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background-color: var(--ui-surface);
        border-bottom: 2px solid var(--border);
        padding: 8px 0;
    }

    html[data-theme="dark"] .header-links { background-color: rgba(0, 0, 0, 0.95); }
    html[data-theme="light"] .header-links { background-color: rgba(247, 246, 240, 0.98); }
    @media (prefers-color-scheme: dark) {
        .header-links { background-color: rgba(0, 0, 0, 0.95); }
    }

    .header-links.open { display: flex; }

    .header-links .header-link {
        display: block;
        padding: 12px 32px;
        font-size: 0.9em;
        margin-left: 0;
        text-align: left;
    }

    .header-links .header-cta { display: none; }

    header { position: sticky; }
}

@media (max-width: 480px) {
    .logo { font-size: 1.1em; letter-spacing: 0.02em; }
    .logo-svg { height: 17px; }
    header .container { gap: 10px; }
    .header-cta.mobile-visible { padding: 5px 10px; font-size: 0.65em; }
    .menu-toggle { font-size: 1.25em; padding: 2px; }
}

@media (max-width: 380px) {
    .logo-svg { height: 15px; }
    header .container { gap: 8px; padding-left: 16px; padding-right: 16px; }
    .header-cta.mobile-visible { padding: 4px 8px; font-size: 0.6em; }
    .menu-toggle { font-size: 1.15em; }
}

/* ── Common elements ── */
.label {
    font-size: 0.75em;
    color: var(--primary);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.label::after {
    content: '█';
    font-size: 0.85em;
    margin-left: 2px;
    animation: blink 1s step-end infinite;
}

h1 {
    font-size: 2.2em;
    line-height: 1.25;
    margin-bottom: 28px;
}

.accent {
    color: var(--accent);
}

h1 .accent {
    position: relative;
}

h1 .accent::after { display: none; }

h2 {
    font-size: 1.6em;
    line-height: 1.4;
    margin-bottom: 40px;
}

hr { border: none; border-top: 2px solid var(--border); }

/* ── Alternating section backgrounds ── */
.section-alt {
    background-color: var(--surface-ia);
}

@media (max-width: 768px) {
    h1 { font-size: 1.7em; }
}

@media (max-width: 480px) {
    h1 { font-size: 1.5em; }
}

/* ── Hero (index) ── */
.hero {
    padding: 96px 0 80px;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 30% 65%, rgba(var(--primary-rgb), 0.14) 0%, transparent 55%),
        radial-gradient(ellipse at 72% 58%, rgba(199, 96, 96, 0.13) 0%, transparent 45%),
        linear-gradient(145deg, #f8f6f2 0%, #f0ece6 50%, #e8e3dc 100%);
}

html[data-theme="dark"] .hero {
    background:
        radial-gradient(ellipse at 30% 65%, rgba(var(--primary-rgb), 0.28) 0%, transparent 55%),
        radial-gradient(ellipse at 72% 58%, rgba(234, 102, 107, 0.18) 0%, transparent 45%),
        linear-gradient(145deg, #1e1e1c 0%, #121210 50%, #0a0a08 100%);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .hero {
        background:
            radial-gradient(ellipse at 30% 65%, rgba(var(--primary-rgb), 0.28) 0%, transparent 55%),
            radial-gradient(ellipse at 72% 58%, rgba(234, 102, 107, 0.18) 0%, transparent 45%),
            linear-gradient(145deg, #1e1e1c 0%, #121210 50%, #0a0a08 100%);
    }
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to top, var(--bg), transparent);
    pointer-events: none;
    z-index: 1;
}

.hero .container { position: relative; z-index: 1; }

.hero > .container > p {
    color: var(--text-muted);
    max-width: 560px;
    margin-bottom: 48px;
}

@media (max-width: 768px) {
    .hero { padding: 56px 0 48px; }
}

@media (max-width: 480px) {
    .hero { padding: 40px 0 36px; }
}

/* ── Hero body with portrait ── */
.hero-body {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: end;
    margin-bottom: 32px;
}

.hero-portrait {
    width: 180px;
    margin-top: -60px;
}

.hero-portrait picture { display: block; line-height: 0; }

.hero-portrait-img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    mix-blend-mode: screen;
}

html[data-theme="light"] .hero-portrait-img { mix-blend-mode: multiply; }
@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) .hero-portrait-img { mix-blend-mode: multiply; }
}

.hero-illustration {
    width: 300px;
    flex-shrink: 0;
    margin-top: -120px;
}
.hero-illustration picture { display: block; line-height: 0; }
.hero-illustration-img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    opacity: 0.88;
}

@media (max-width: 768px) {
    .hero-portrait { width: 140px; }
    .hero-illustration { width: 200px; margin-top: -80px; }
}

@media (max-width: 480px) {
    .hero-body {
        grid-template-columns: 1fr;
    }
    .hero-portrait {
        width: 100px;
        margin-top: 0;
        order: -1;
    }
    .hero-illustration {
        width: 100%;
        margin-top: 0;
        order: -1;
    }
}

/* ── Forms ── */
.form-row {
    display: flex;
    gap: 12px;
}

input[type="email"] {
    flex: 1;
    min-width: 0;
    padding: 14px 16px;
    font-family: var(--font-mono);
    font-size: 0.9em;
    background-color: var(--surface-ia);
    color: var(--text);
    border: 2px solid var(--border);
    border-radius: 6px;
    outline: none;
    transition: border-color 200ms ease, box-shadow 200ms ease;
}

@media (max-width: 768px) {
    input[type="email"] {
        font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    }
}

input[type="email"]::placeholder { color: var(--text-muted); }
input[type="email"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
}

button[type="submit"] {
    padding: 14px 28px;
    font-family: var(--font-mono);
    font-size: 0.9em;
    font-weight: bold;
    background-color: var(--primary);
    color: var(--surface);
    border: 2px solid var(--primary);
    border-radius: 6px;
    cursor: pointer;
    transition: transform 150ms ease, opacity 150ms ease;
    white-space: nowrap;
    flex-shrink: 0;
}
button[type="submit"]:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}
button[type="submit"]:active {
    transform: translateY(0);
}

@media (max-width: 520px) {
    .form-row { flex-direction: column; }
    button[type="submit"] { width: 100%; }
}

.form-note {
    font-size: 0.75em;
    color: var(--text-muted);
    margin-top: 12px;
}

.success-msg {
    display: none;
    color: var(--primary);
    font-size: 0.88em;
    font-weight: bold;
    margin-top: 14px;
    animation: fadeInUp 0.4s ease;
}

/* ── Offer card (homepage single merged card) ── */
.offer-card {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    background-color: var(--surface);
    border: 2px solid var(--border);
    border-radius: 6px;
    padding: 36px 32px;
    transition: border-color 200ms ease;
}
.offer-card:hover { border-color: rgba(var(--primary-rgb), 0.5); }
.offer-card-icon { color: var(--primary); flex-shrink: 0; margin-top: 4px; }
.offer-card-icon svg { width: 32px; height: 32px; }
.offer-card-body h3 { font-size: 1.2rem; margin-bottom: 12px; color: var(--text); }
.offer-card-body p { color: var(--text-muted); line-height: 1.7; margin-bottom: 20px; }

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    text-decoration: none;
    transition: gap 150ms ease;
}
.link-arrow:hover { gap: 10px; }
.link-arrow svg { width: 16px; height: 16px; }

@media (max-width: 480px) {
    .offer-card { flex-direction: column; gap: 16px; }
}

/* ── Courses ── */
.courses { padding: 80px 0; }

.course-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 768px) {
    .course-grid { grid-template-columns: 1fr; }
}

.course-card {
    background-color: var(--surface);
    border: 2px solid var(--border);
    border-radius: 6px;
    padding: 28px 24px;
    transition: border-color 200ms ease, background-color 200ms ease, transform 200ms ease;
}
.course-card:hover {
    border-color: rgba(var(--primary-rgb), 0.5);
    background-color: var(--card-hover-bg);
    transform: translateY(-2px);
}

.course-icon {
    font-size: 1.4em;
    color: var(--primary);
    margin-bottom: 16px;
    font-weight: bold;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(var(--primary-rgb), 0.25);
    border-radius: 6px;
    background: rgba(var(--primary-rgb), 0.05);
}

.course-card h3 {
    font-size: 1em;
    font-weight: bold;
    margin-bottom: 8px;
}

.course-card p {
    font-size: 0.85em;
    color: var(--text-muted);
    line-height: 1.6;
}

.course-tag {
    display: inline-block;
    font-size: 0.7em;
    color: var(--primary);
    border: 1px solid rgba(var(--primary-rgb), 0.4);
    padding: 2px 8px;
    border-radius: 6px;
    margin-top: 14px;
}

/* ── Why ── */
.why { padding: 80px 0; }

.why-list {
    list-style: none;
    display: grid;
    gap: 20px;
}
.why-list li {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.why-list .arrow {
    color: var(--primary);
    font-weight: bold;
    flex-shrink: 0;
    margin-top: 2px;
}
.why-list .item-text {
    font-size: 0.95em;
    color: var(--text-muted);
}
.why-list .item-text strong { color: var(--text); }

/* ── Scroll reveal ── */
.section-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.section-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
    .section-reveal {
        transform: none;
        transition-duration: 0.3s;
        transition-property: opacity;
    }
}

/* ── Course detail page ── */
.course-detail { padding: 80px 0; }
@media (max-width: 768px) {
    .course-detail { padding: 48px 0; }
}
@media (max-width: 480px) {
    .course-detail { padding: 24px 0; }
}

.course-detail-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 32px;
}

.course-detail-header .course-icon { margin-bottom: 0; }
.course-detail-header h2 { margin-bottom: 4px; }

.course-subtitle {
    color: var(--text-muted);
    font-size: 0.9em;
}

.course-body {
    color: var(--text-muted);
    max-width: 640px;
    margin-bottom: 32px;
}

.course-levels {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

@media (max-width: 768px) {
    .course-levels { grid-template-columns: 1fr; }
    .course-detail-header { flex-direction: column; }
}

.course-level {
    background-color: var(--surface);
    border: 2px solid var(--border);
    border-radius: 6px;
    padding: 28px 24px;
}

.course-level h3 {
    font-size: 1em;
    margin-bottom: 8px;
}

.course-level > p {
    color: var(--text-muted);
    font-size: 0.85em;
    margin-bottom: 16px;
    line-height: 1.6;
}

.course-topics {
    list-style: none;
    display: grid;
    gap: 10px;
}

.course-topics li {
    font-size: 0.8em;
    color: var(--text-muted);
    padding-left: 18px;
    position: relative;
    line-height: 1.5;
}

.course-topics li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

/* ── Event list (calendar page) ── */
.event-list {
    display: grid;
    gap: 20px;
}

.event-card {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    padding: 24px;
    border: 2px solid var(--border);
    border-radius: 6px;
    background-color: var(--surface);
    transition: border-color 200ms ease;
}
.event-card:hover { border-color: rgba(var(--primary-rgb), 0.4); }

.event-card.upcoming { border-left: 4px solid var(--primary); }
.event-card.past { opacity: 0.8; }

.event-date {
    flex-shrink: 0;
    min-width: 56px;
    text-align: center;
}

.event-month {
    display: block;
    font-size: 0.7em;
    font-weight: bold;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.event-day {
    display: block;
    font-size: 0.75em;
    color: var(--text-muted);
}

.event-info h3 {
    font-size: 1em;
    margin-bottom: 6px;
}

.event-info p {
    font-size: 0.85em;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 8px;
}

.event-info p:last-child { margin-bottom: 0; }

.event-photo {
    flex-shrink: 0;
    width: 220px;
    margin-left: auto;
}
.event-photo img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
}

@media (max-width: 900px) {
    .event-photo { width: 180px; }
}

@media (max-width: 700px) {
    .event-card { flex-direction: column; gap: 12px; padding: 18px; }
    .event-date { text-align: left; min-width: 0; display: flex; gap: 8px; align-items: baseline; }
    .event-photo { width: 100%; margin-left: 0; }
    .event-info h3 { font-size: 1.05em; }
}

@media (max-width: 480px) {
    .event-card { padding: 14px; }
}

/* ── CTA box ── */
.cta { padding: 80px 0; }

.cta-box {
    background-color: var(--surface-ia);
    border: 2px solid var(--border);
    border-radius: 6px;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

.cta-box::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.6;
    z-index: 1;
}

.cta-box h2 { margin-bottom: 12px; }
.cta-box > p,
.cta-box p {
    color: var(--text-muted);
    font-size: 0.9em;
    margin-bottom: 32px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.9em;
    font-weight: bold;
    color: #fff;
    background-color: var(--primary);
    border: 2px solid var(--primary);
    padding: 14px 28px;
    border-radius: 6px;
    text-decoration: none;
    transition: opacity 150ms ease, transform 150ms ease;
}
.btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}
.btn svg { width: 16px; height: 16px; }

@media (max-width: 480px) {
    .cta-box { padding: 28px 20px; }
}

/* ── Footer ── */
footer {
    background-color: var(--ui-surface);
    border-top: 2px solid var(--border);
    padding: 24px 0;
}
footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
footer p {
    font-size: 0.8em;
    color: var(--text-muted);
}

/* ── Theme toggle ── */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.85em;
    line-height: 1;
    color: var(--text-muted);
    transition: border-color 150ms ease, color 150ms ease;
}
.theme-toggle:hover {
    border-color: rgba(var(--primary-rgb), 0.5);
    color: var(--primary);
}

/* ── Selection ── */
::selection {
    background: rgba(var(--primary-rgb), 0.25);
    color: var(--text);
}

html {
    scroll-behavior: smooth;
    scrollbar-color: var(--scrollbar-thumb) var(--bg);
    --scrollbar-thumb: #e0d8c8;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ══════════════════════════════════════
   Lektor page
   ══════════════════════════════════════ */

.page-hero { padding: 64px 0 48px; }
.page-hero .subtitle {
    color: var(--text-muted);
    font-size: 0.95em;
}

@media (max-width: 768px) {
    .page-hero { padding: 48px 0 36px; }
}

/* ── Page heroes with particles ── */
#lektor-hero,
#kontakt-hero,
#kurzy-hero,
#akcie-hero,
#firmy-hero {
    padding: 96px 0 80px;
}

#lektor-hero .subtitle,
#kontakt-hero .subtitle,
#kurzy-hero .subtitle,
#akcie-hero .subtitle,
#firmy-hero .subtitle {
    color: var(--text-muted);
    font-size: 0.95em;
}

.js-particles {
    position: absolute;
    inset: 0;
    z-index: 0;
}

@media (max-width: 768px) {
    #lektor-hero,
    #kontakt-hero,
    #kurzy-hero,
    #akcie-hero,
    #firmy-hero { padding: 56px 0 48px; }
}

@media (max-width: 480px) {
    #lektor-hero,
    #kontakt-hero,
    #kurzy-hero,
    #akcie-hero,
    #firmy-hero { padding: 32px 0 16px; }
}

/* ── Lektor poster sticky scroll ── */
.lektor-poster-wrap {
    position: relative;
}

.lektor-poster-sticky {
    position: sticky;
    top: 0;
    z-index: 0;
    overflow: hidden;
    background-color: var(--bg);
}

.lektor-poster-sticky picture {
    display: block;
    line-height: 0;
}

.lektor-poster-sticky img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 70vh;
    object-fit: contain;
    object-position: center;
}

.lektor-poster-content {
    position: relative;
    z-index: 1;
    background: linear-gradient(
        to bottom,
        transparent 0px,
        var(--bg) 80px
    );
    padding-top: 40px;
}

@media (max-width: 768px) {
    .lektor-poster-sticky img {
        max-height: 50vh;
    }
    .lektor-poster-content {
        padding-top: 20px;
    }
}

/* ── Bio ── */
.bio { padding: 48px 0; }
.bio p {
    color: var(--text-muted);
    margin-bottom: 24px;
}
.bio p:last-child { margin-bottom: 0; }
.bio strong { color: var(--text); }

/* ── Timeline ── */
.timeline { padding: 48px 0; }
.timeline h2 { font-size: 1.25em; margin-bottom: 32px; }

.timeline-list {
    list-style: none;
    display: grid;
    gap: 24px;
}

.timeline-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.timeline-year {
    font-size: 0.8em;
    color: var(--primary);
    font-weight: bold;
    flex-shrink: 0;
    min-width: 52px;
    padding-top: 2px;
}

.timeline-content {
    font-size: 0.9em;
    color: var(--text-muted);
    border-left: 2px solid var(--border);
    padding-left: 20px;
}
.timeline-content strong { color: var(--text); }

/* ── Skills grid ── */
.skills { padding: 48px 0; }
.skills h2 { font-size: 1.25em; margin-bottom: 32px; }

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.skill-tag {
    background-color: var(--surface-ia);
    border: 2px solid var(--border);
    border-radius: 6px;
    padding: 14px 18px;
    font-size: 0.85em;
    color: var(--text);
    transition: border-color 200ms ease;
}
.skill-tag:hover { border-color: rgba(var(--primary-rgb), 0.5); }
.skill-tag .icon {
    color: var(--primary);
    margin-right: 8px;
    font-weight: bold;
}

/* ══════════════════════════════════════
   Kontakt page
   ══════════════════════════════════════ */

.contact-section { padding: 48px 0; }

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

@media (max-width: 768px) {
    .contact-grid { grid-template-columns: 1fr; }
}

.contact-card {
    background-color: var(--surface);
    border: 2px solid var(--border);
    border-radius: 6px;
    padding: 32px;
    container-type: inline-size;
}

.contact-card h2 {
    font-size: 1.1em;
    margin-bottom: 16px;
}

.contact-card p {
    color: var(--text-muted);
    font-size: 0.9em;
    margin-bottom: 16px;
    line-height: 1.6;
}

.contact-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: bold;
    font-size: 1em;
}
.contact-link:hover { opacity: 0.8; }

.eml-rtl { unicode-bidi: bidi-override; direction: rtl; }
.eml-js:not(:empty) + .eml-rtl,
.eml-js:not(:empty) ~ .eml-rtl { display: none; }

.billing-details {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 20px;
    font-size: 0.85em;
}

.billing-details dt {
    color: var(--text-muted);
    font-weight: bold;
}

.billing-details dd {
    color: var(--text);
    line-height: 1.5;
    overflow-wrap: anywhere;
}

/* Stack labels above values when the card itself is narrow (e.g. two-up grid
   on desktop), regardless of viewport width. */
@container (max-width: 360px) {
    .billing-details {
        grid-template-columns: 1fr;
        gap: 2px 0;
    }
    .billing-details dt {
        margin-top: 10px;
    }
    .billing-details dt:first-child {
        margin-top: 0;
    }
}

@media (max-width: 480px) {
    .contact-card {
        padding: 20px;
    }
}

/* ── References ── */
.reference-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
}
.reference-header {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.reference-tag {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.08);
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    padding: 2px 10px;
    border-radius: 4px;
}
.reference-card h3 {
    font-size: 1.15rem;
    margin-bottom: 12px;
    color: var(--text);
}
.reference-card > p {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 28px;
}
.reference-metrics {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}
.metric { display: flex; flex-direction: column; }
.metric-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--primary);
    line-height: 1;
}
.metric-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 5px;
    font-family: var(--font-mono);
}

/* ── Lucide icons ── */
.section-icon { color: var(--primary); margin-bottom: 12px; }
.section-icon svg { width: 32px; height: 32px; }
.course-icon svg { width: 24px; height: 24px; }
.contact-card-icon { color: var(--primary); margin-bottom: 12px; }
.contact-card-icon svg { width: 28px; height: 28px; }

.contact-portrait {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 16px;
    background-color: var(--ui-surface);
}
.contact-portrait picture { display: block; line-height: 0; }
.contact-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    mix-blend-mode: screen;
}
html[data-theme="light"] .contact-portrait img { mix-blend-mode: multiply; }
@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) .contact-portrait img { mix-blend-mode: multiply; }
}

.contact-h2-icon {
    color: var(--primary);
    vertical-align: -3px;
    margin-right: 6px;
}

/* ── Illustration theme switching ── */
.ill-light { display: none; }
.ill-dark  { display: contents; }

html[data-theme="light"] .ill-dark  { display: none; }
html[data-theme="light"] .ill-light { display: contents; }

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) .ill-dark  { display: none; }
    :root:not([data-theme="dark"]) .ill-light { display: contents; }
}

/* ── Illustration dividers ── */
main > .illustration-divider {
    position: sticky;
    top: 0;
    z-index: 0;
}
main > section {
    z-index: 1;
    background: var(--bg);
}
main > section.section-alt {
    background: var(--surface);
}
main > .lektor-poster-wrap {
    z-index: 0;
}

@media (max-width: 700px) {
    main > section,
    main > .lektor-poster-wrap {
        position: sticky;
        top: 0;
    }
    .page-landing > section,
    .page-landing > .illustration-divider {
        position: relative;
    }
    main > .illustration-divider {
        display: none;
    }
    .page-ai-agenti > section,
    .page-ai-agenti > .lektor-poster-wrap {
        position: relative;
    }
}

.illustration-divider {
    overflow: hidden;
    line-height: 0;
    max-width: 960px;
    margin: 0 auto;
}

.illustration-divider picture {
    display: block;
    line-height: 0;
}

.illustration-banner {
    width: 100%;
    height: auto;
    max-height: 240px;
    object-fit: cover;
    object-position: center;
    opacity: 0.35;
    transition: opacity 400ms ease;
    mix-blend-mode: screen;
    mask-image: linear-gradient(to bottom, transparent, black 25%, black 75%, transparent),
                linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    mask-composite: intersect;
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 25%, black 75%, transparent),
                        linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-composite: source-in;
}

html[data-theme="light"] .illustration-banner { mix-blend-mode: multiply; }
@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) .illustration-banner { mix-blend-mode: multiply; }
}



/* ── CTA with illustration ── */
.cta-box-illustration {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 0;
    overflow: hidden;
    cursor: default;
}

.cta-illustration-wrap {
    overflow: hidden;
    background-color: var(--bg);
}

.cta-illustration-wrap picture {
    display: block;
    height: 100%;
}

.cta-illustration-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 600ms ease;
}

.cta-box-illustration:hover .cta-illustration-wrap img {
    transform: scale(1.03);
}

.cta-box-content {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cta-box-illustration .cta-box-content p {
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .cta-box-illustration {
        grid-template-columns: 1fr;
    }
    .cta-illustration-wrap {
        max-height: 200px;
    }
    .cta-box-content {
        padding: 28px 20px;
    }
}

/* ── Lightbox ── */
.js-lightbox,
.js-lightbox picture,
.js-lightbox img { cursor: pointer; }
.js-lightbox img { transition: opacity 150ms ease; }
.js-lightbox:hover img { opacity: 0.88; }

.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 24px;
    cursor: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24'%3E%3Ccircle cx='10' cy='10' r='7' fill='%23ffffff' stroke='%23000000' stroke-width='1.5'/%3E%3Cline x1='7' y1='10' x2='13' y2='10' stroke='%23000000' stroke-width='2'/%3E%3Cline x1='19' y1='19' x2='15' y2='15' stroke='%23000000' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E") 10 10, pointer;
    opacity: 0;
    transition: opacity 200ms ease;
}
.lightbox-overlay.is-open { opacity: 1; }

.lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
}

/* ── Reduce-motion: vypni infinite loopy, ponechaj jednorazové reveal animácie ── */
@media (prefers-reduced-motion: reduce) {
    .label::after { animation: none; }
}
