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

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

@media (prefers-color-scheme: dark) {
    :root {
        --bg:           #000000;
        --surface:      #0a0a09;
        --surface-ia:   #1c1b19;
        --ui-surface:   #000000;
        --text:         #ede0ce;
        --text-muted:   #b8a896;
        --border:       #3f444a;
        --primary:      #4cbaba;
        --primary-rgb:  76, 186, 186;
        --error:        #ff4d7d;
        --accent:       #f27c6e;
        --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"] {
    --bg:           #000000;
    --surface:      #0a0a09;
    --surface-ia:   #1c1b19;
    --ui-surface:   #000000;
    --text:         #ede0ce;
    --text-muted:   #b8a896;
    --border:       #3f444a;
    --primary:      #4cbaba;
    --primary-rgb:  76, 186, 186;
    --error:        #ff4d7d;
    --accent:       #f27c6e;
    --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="light"] {
    --bg:               #faf9f5;
    --surface:          #FFFEF8;
    --surface-ia:       #FFFEF8;
    --ui-surface:       #f7f6f0;
    --text:             #282728;
    --text-muted:       #5a585a;
    --border:           #e0d8c8;
    --primary:          #26a6a6;
    --primary-rgb:      38, 166, 166;
    --error:            #b80037;
    --accent:           #f27c6e;
    --hero-dot:         rgba(38, 166, 166, 0.08);
    --card-hover-bg:    rgba(38, 166, 166, 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; }
}

/* ── 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: 36px;
}
.logo {
    font-size: 1.05em;
    font-weight: bold;
    color: var(--text);
    text-decoration: none;
    letter-spacing: 0.06em;
}
.logo span { color: var(--primary); }

.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: var(--surface);
    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);
}

/* ── 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;
}

h1 .accent {
    color: var(--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;
}

#hero-particles {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.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; }
}

/* ── 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;
}

/* ── 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);
}

/* ── 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;
}

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

.cta-box .btn {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.9em;
    font-weight: bold;
    color: var(--surface);
    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;
}
.cta-box .btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

@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; }

/* ══════════════════════════════════════
   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; }
}

/* ── 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;
}
