/* =========================================================
   Ondřej Malik — AI & Innovation
   Minimalistic dark technical design
   ========================================================= */

:root {
    --bg: #0a0a0b;
    --bg-soft: #111114;
    --bg-elev: #16161a;
    --border: #1f1f25;
    --border-strong: #2a2a33;
    --fg: #f2f2f5;
    --fg-muted: #8a8a96;
    --fg-dim: #5a5a66;
    --accent: #e8ff5e;
    --accent-soft: rgba(232, 255, 94, 0.12);
    --danger: #ff5e5e;

    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;

    --radius: 4px;
    --radius-lg: 8px;

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

    --container: 1200px;
    --pad: clamp(1.25rem, 4vw, 2.5rem);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--fg);
    background: var(--bg);
    overflow-x: hidden;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }
img, svg { display: block; max-width: 100%; }
input, textarea, select { font: inherit; color: inherit; }

ul { list-style: none; }

::selection { background: var(--accent); color: var(--bg); }

/* --- Utilities ------------------------------------------ */
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--pad);
}

.mono {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fg-muted);
}

/* --- Background FX -------------------------------------- */
.noise {
    position: fixed; inset: 0;
    pointer-events: none; z-index: 1;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.grid-bg {
    position: fixed; inset: 0;
    pointer-events: none; z-index: 0;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 80px 80px;
    mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.4) 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.4) 0%, transparent 70%);
    opacity: 0.6;
}

main, .nav, .footer { position: relative; z-index: 2; }

/* --- Navigation ----------------------------------------- */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 50;
    padding: 1rem 0;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(10, 10, 11, 0.6);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--pad);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    transition: opacity 0.2s var(--ease);
}
.nav-logo:hover { opacity: 0.7; }
.logo-bracket { color: var(--accent); }

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-links a {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fg-muted);
    transition: color 0.2s var(--ease);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    left: 0; bottom: -4px;
    width: 0; height: 1px;
    background: var(--accent);
    transition: width 0.3s var(--ease-out);
}

.nav-links a:hover { color: var(--fg); }
.nav-links a:hover::after { width: 100%; }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
}
.nav-toggle span {
    display: block;
    width: 22px; height: 1.5px;
    background: var(--fg);
    transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
}
.nav-toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* --- Hero ----------------------------------------------- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 8rem 0 4rem;
    position: relative;
}

.hero-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--border-strong);
    border-radius: 100px;
    margin-bottom: 2.5rem;
    background: var(--bg-soft);
}

.meta-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent);
    animation: pulse 2s ease-in-out infinite;
}

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

.hero-title {
    font-size: clamp(3.5rem, 14vw, 10rem);
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: -0.04em;
    margin-bottom: 2rem;
}

.hero-line {
    display: block;
    animation: slideUp 0.9s var(--ease-out) both;
}
.hero-line:nth-child(2) { animation-delay: 0.1s; }

.hero-line--accent {
    color: var(--accent);
    font-style: italic;
    font-weight: 300;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-tagline {
    font-family: var(--font-mono);
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--fg);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideUp 0.9s var(--ease-out) 0.3s both;
}

.tagline-prefix {
    color: var(--accent);
    font-weight: 600;
}

.hero-description {
    max-width: 540px;
    font-size: 1.1rem;
    color: var(--fg-muted);
    margin-bottom: 3rem;
    animation: slideUp 0.9s var(--ease-out) 0.4s both;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    animation: slideUp 0.9s var(--ease-out) 0.5s both;
}

.hero-scroll {
    position: absolute;
    bottom: 2rem;
    left: var(--pad);
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--fg-dim);
}
.scroll-line {
    width: 60px; height: 1px;
    background: linear-gradient(90deg, var(--fg-dim), transparent);
    position: relative;
    overflow: hidden;
}
.scroll-line::after {
    content: '';
    position: absolute;
    left: 0; top: 0;
    width: 20px; height: 100%;
    background: var(--accent);
    animation: slide 2.5s ease-in-out infinite;
}
@keyframes slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}

/* --- Buttons -------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.9rem 1.6rem;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    border-radius: var(--radius);
    transition: all 0.25s var(--ease);
    cursor: pointer;
    border: 1px solid transparent;
    white-space: nowrap;
}

.btn svg { transition: transform 0.25s var(--ease); }
.btn:hover svg { transform: translateX(3px); }

.btn--primary {
    background: var(--accent);
    color: var(--bg);
    font-weight: 600;
}
.btn--primary:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(232, 255, 94, 0.2);
}

.btn--ghost {
    background: transparent;
    color: var(--fg);
    border-color: var(--border-strong);
}
.btn--ghost:hover {
    border-color: var(--fg);
    background: var(--bg-soft);
}

.btn--full { width: 100%; }

/* --- Sections ------------------------------------------- */
.section {
    padding: 8rem 0;
    border-top: 1px solid var(--border);
}

.section-head {
    max-width: 720px;
    margin-bottom: 4rem;
}

.section-num {
    display: inline-block;
    color: var(--accent);
    margin-bottom: 1rem;
}

.section-title {
    font-size: clamp(2.25rem, 5vw, 3.75rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.05;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--fg-muted);
    max-width: 560px;
}

/* --- About ---------------------------------------------- */
.about-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 4rem;
    align-items: start;
}

.about-lead p {
    font-size: clamp(1.25rem, 2vw, 1.6rem);
    line-height: 1.5;
    font-weight: 400;
    color: var(--fg);
}
.about-lead strong {
    color: var(--accent);
    font-weight: 500;
}

.about-body p {
    color: var(--fg-muted);
    margin-bottom: 1rem;
}
.about-body p:last-child { margin-bottom: 0; }

.about-stats {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    margin-top: 3rem;
    background: var(--border);
    border: 1px solid var(--border);
}
.about-stats li {
    padding: 2rem;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: background 0.25s var(--ease);
}
.about-stats li:hover { background: var(--bg-soft); }

.stat-num {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 600;
    color: var(--accent);
    line-height: 1;
}
.stat-label {
    font-size: 0.9rem;
    color: var(--fg-muted);
}

/* --- Work / Cards --------------------------------------- */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.35s var(--ease-out),
                border-color 0.25s var(--ease),
                background 0.25s var(--ease);
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    padding: 1px;
    background: linear-gradient(135deg, transparent, var(--accent), transparent);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s var(--ease);
    pointer-events: none;
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--border-strong);
    background: var(--bg-elev);
}
.card:hover::before { opacity: 0.6; }

.card-media {
    aspect-ratio: 16 / 10;
    background:
        radial-gradient(circle at 30% 30%, rgba(232, 255, 94, 0.08), transparent 50%),
        linear-gradient(135deg, #16161a, #0a0a0b);
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.card-media::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.3;
    pointer-events: none;
}

.card-tag {
    background: var(--accent-soft);
    color: var(--accent);
    padding: 0.25rem 0.6rem;
    border-radius: 100px;
    border: 1px solid rgba(232, 255, 94, 0.2);
    z-index: 1;
}

.card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.card-meta { color: var(--fg-dim); }

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.card-desc {
    color: var(--fg-muted);
    font-size: 0.95rem;
    flex: 1;
}

.card-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--accent);
    margin-top: 0.5rem;
}

.card-cta svg { transition: transform 0.25s var(--ease); }
.card:hover .card-cta svg { transform: translate(2px, -2px); }

/* --- Contact -------------------------------------------- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 4rem;
    align-items: start;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.info-block {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}
.info-block:last-child { border-bottom: none; padding-bottom: 0; }

.info-label { color: var(--fg-dim); }

.info-value {
    font-size: 1.15rem;
    font-weight: 500;
    transition: color 0.2s var(--ease);
}
a.info-value:hover { color: var(--accent); }

.info-value--status {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1rem;
    color: var(--fg-muted);
    font-weight: 400;
}

/* Form */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 2rem;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.hp-field {
    position: absolute !important;
    left: -9999px !important;
    opacity: 0;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.field label { color: var(--fg-dim); }

.field input,
.field textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--fg);
    font-size: 0.95rem;
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
    resize: vertical;
    font-family: var(--font-sans);
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-elev);
}

.field textarea { min-height: 120px; }

/* --- Footer --------------------------------------------- */
.footer {
    padding: 2rem 0;
    border-top: 1px solid var(--border);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-meta { color: var(--fg-dim); }

/* --- Responsive ----------------------------------------- */
@media (max-width: 860px) {
    .about-grid,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .section { padding: 5rem 0; }
    .hero { padding: 7rem 0 3rem; }
    .hero-scroll { display: none; }
}

@media (max-width: 640px) {
    .nav-toggle { display: flex; }

    .nav-links {
        position: fixed;
        top: 62px;
        left: 0; right: 0;
        flex-direction: column;
        gap: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        padding: 1rem 0;
        transform: translateY(-120%);
        transition: transform 0.35s var(--ease-out);
    }
    .nav-links.is-open { transform: translateY(0); }

    .nav-links li {
        border-bottom: 1px solid var(--border);
    }
    .nav-links li:last-child { border-bottom: none; }

    .nav-links a {
        display: block;
        padding: 1rem var(--pad);
        font-size: 0.85rem;
    }

    .about-stats {
        grid-template-columns: 1fr;
    }

    .hero-actions { flex-direction: column; align-items: stretch; }
    .btn { width: 100%; }
}

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

/* =========================================================
   Presentation pages (/p/<slug>/)
   ========================================================= */

.prez-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 50;
    padding: 1rem 0;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(10, 10, 11, 0.6);
    border-bottom: 1px solid var(--border);
}

.prez-nav-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--pad);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.prez-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fg-muted);
    transition: color 0.2s var(--ease);
}
.prez-back:hover { color: var(--accent); }
.prez-back svg { transition: transform 0.25s var(--ease); }
.prez-back:hover svg { transform: translateX(-3px); }

.prez-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--border-strong);
    border-radius: 100px;
    background: var(--bg-soft);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fg-muted);
}
.prez-badge::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--fg-dim);
}

.prez-cover {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 9rem 0 4rem;
    border-bottom: 1px solid var(--border);
}

.prez-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem 2rem;
    margin-bottom: 2rem;
}

.prez-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.prez-meta-item .label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fg-dim);
}
.prez-meta-item .value {
    font-size: 0.95rem;
    color: var(--fg);
}

.prez-title {
    font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
    max-width: 900px;
}
.prez-title em {
    color: var(--accent);
    font-style: italic;
    font-weight: 300;
}

.prez-lead {
    font-size: clamp(1.1rem, 1.5vw, 1.35rem);
    color: var(--fg-muted);
    max-width: 720px;
    line-height: 1.55;
}

.prez-body {
    padding: 5rem 0;
}

.prose {
    max-width: 760px;
    margin: 0 auto;
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--fg);
}

.prose > * + * { margin-top: 1.25rem; }

.prose h2 {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-top: 3.5rem;
    margin-bottom: 1rem;
    line-height: 1.15;
}
.prose h2::before {
    content: '§ ';
    color: var(--accent);
    font-family: var(--font-mono);
    font-weight: 500;
}

.prose h3 {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
}

.prose p { color: var(--fg); }
.prose strong { color: var(--accent); font-weight: 500; }
.prose em { color: var(--fg); font-style: italic; }

.prose a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 1px;
    text-decoration-color: var(--border-strong);
    transition: text-decoration-color 0.2s var(--ease);
}
.prose a:hover { text-decoration-color: var(--accent); }

.prose ul, .prose ol {
    padding-left: 1.5rem;
    color: var(--fg);
}
.prose ul { list-style: none; }
.prose ul li {
    position: relative;
    margin-top: 0.5rem;
}
.prose ul li::before {
    content: '—';
    position: absolute;
    left: -1.5rem;
    color: var(--accent);
    font-family: var(--font-mono);
}
.prose ol { list-style: decimal; }
.prose ol li { margin-top: 0.5rem; padding-left: 0.25rem; }
.prose ol li::marker {
    color: var(--accent);
    font-family: var(--font-mono);
    font-weight: 600;
}

.prose blockquote {
    border-left: 2px solid var(--accent);
    padding: 0.5rem 0 0.5rem 1.5rem;
    margin: 2rem 0;
    font-size: 1.2rem;
    font-style: italic;
    color: var(--fg-muted);
}

.prose code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    padding: 0.15em 0.4em;
    border-radius: 3px;
    color: var(--accent);
}

.prose pre {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    overflow-x: auto;
    font-size: 0.9rem;
    margin: 1.5rem 0;
}
.prose pre code {
    background: none;
    border: none;
    padding: 0;
    color: var(--fg);
}

.prose figure {
    margin: 2.5rem 0;
}
.prose img {
    width: 100%;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}
.prose figcaption {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--fg-dim);
    text-align: center;
}

.prose hr {
    border: none;
    height: 1px;
    background: var(--border);
    margin: 3rem 0;
}

.prez-footer {
    border-top: 1px solid var(--border);
    padding: 3rem 0;
    text-align: center;
}
.prez-footer p { color: var(--fg-muted); margin-bottom: 1.5rem; }

@media (max-width: 640px) {
    .prez-cover { min-height: 55vh; padding: 7rem 0 3rem; }
    .prez-body { padding: 3rem 0; }
    .prez-meta { gap: 1rem 1.5rem; }
}
