/* ================================================================
   PAVOL OCELKA — Portfolio Design System
   Apple keynote-grade. Tech minimalist. Premium feel.
   ================================================================ */

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

:root {
    --bg: #050507;
    --bg-card: rgba(255,255,255,0.04);
    --bg-card-hover: rgba(255,255,255,0.07);
    --border: rgba(255,255,255,0.08);
    --border-hover: rgba(255,255,255,0.15);
    --text: #f5f5f7;
    --text-muted: rgba(245,245,247,0.55);
    --accent: #6366f1;
    --accent-light: #a78bfa;
    --accent-glow: rgba(99,102,241,0.35);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --display: 'Space Grotesk', 'Inter', sans-serif;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --radius: 20px;
    --radius-sm: 12px;
}

html { scroll-behavior: smooth; font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

::selection { background: rgba(99,102,241,0.4); color: #fff; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; }

/* Accessibility: skip-to-content link (visible only on keyboard focus) */
.skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    z-index: 10000;
    padding: 12px 18px;
    background: var(--accent);
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: top 0.2s ease;
}
.skip-link:focus { top: 16px; outline: 2px solid #fff; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
.narrow { max-width: 800px; }

/* ==================== TYPOGRAPHY ==================== */
.label {
    font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.15em; color: var(--accent); margin-bottom: 1rem;
}

.heading-xl {
    font-family: var(--display);
    font-size: clamp(3rem, 7vw, 5.5rem);
    font-weight: 700; letter-spacing: -0.04em; line-height: 1.05;
    margin-bottom: 1.5rem;
}

.heading-lg {
    font-family: var(--display);
    font-size: clamp(2.2rem, 4.5vw, 3.8rem);
    font-weight: 700; letter-spacing: -0.03em; line-height: 1.1;
    margin-bottom: 1.25rem;
}

.body-text { font-size: 1.1rem; line-height: 1.75; max-width: 560px; color: var(--text-muted); }
.body-text strong { color: var(--text); font-weight: 600; }
.muted { color: var(--text-muted); }
.center-text { margin-left: auto; margin-right: auto; text-align: center; }
.text-center { text-align: center; }

/* ==================== GLASSMORPHISM ==================== */
.glass {
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
}

.glass-card {
    background: rgba(255,255,255,0.03);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.4s ease, box-shadow 0.4s ease, transform 0.5s var(--ease);
}
.glass-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 16px 48px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.06);
}

/* ==================== LOADER ==================== */
.loader {
    position: fixed; inset: 0; z-index: 10000;
    background: var(--bg);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2rem;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}
.loader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-logo {
    font-family: var(--display);
    font-size: 2rem; font-weight: 700; letter-spacing: -0.04em;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.loader-bar { width: 120px; height: 2px; background: rgba(255,255,255,0.06); border-radius: 2px; overflow: hidden; }
.loader-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--accent-light)); border-radius: 2px; transition: width 0.3s ease; }

/* ==================== CURSOR ==================== */
.cursor, .cursor-dot { position: fixed; pointer-events: none; z-index: 9999; border-radius: 50%; transform: translate(-50%, -50%); will-change: transform; }
.cursor { width: 36px; height: 36px; border: 1.5px solid rgba(167,139,250,0.35); transition: width 0.3s var(--ease-spring), height 0.3s var(--ease-spring), border-color 0.3s ease; mix-blend-mode: difference; }
.cursor.hover { width: 56px; height: 56px; border-color: rgba(167,139,250,0.6); }
.cursor-dot { width: 5px; height: 5px; background: var(--accent-light); box-shadow: 0 0 12px rgba(167,139,250,0.5); }
@media (pointer: coarse) { .cursor, .cursor-dot { display: none !important; } }

/* ==================== NAVIGATION ==================== */
.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    padding: 1.25rem 2rem;
    transition: all 0.5s var(--ease);
}
.nav.scrolled {
    background: rgba(5,5,7,0.8);
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
    padding: 0.875rem 2rem;
}
.nav-inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.nav-logo {
    font-family: var(--display); font-size: 1rem; font-weight: 700; letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a { font-size: 0.85rem; font-weight: 500; color: var(--text-muted); transition: color 0.3s ease; }
.nav-links a:hover { color: var(--text); }
.nav-cta {
    background: var(--accent) !important; color: #fff !important; padding: 0.5rem 1.25rem;
    border-radius: 100px; font-weight: 600 !important; transition: opacity 0.3s ease !important;
}
.nav-cta:hover { opacity: 0.9; }

.nav-toggle { display: none; background: none; border: none; width: 24px; height: 18px; position: relative; cursor: pointer; z-index: 1001; }
.nav-toggle span { display: block; width: 100%; height: 2px; background: var(--text); border-radius: 2px; position: absolute; left: 0; transition: all 0.3s var(--ease); }
.nav-toggle span:first-child { top: 0; }
.nav-toggle span:last-child { bottom: 0; }
.nav-toggle.active span:first-child { top: 50%; transform: translateY(-50%) rotate(45deg); }
.nav-toggle.active span:last-child { bottom: 50%; transform: translateY(50%) rotate(-45deg); }

/* ==================== BUTTONS ==================== */
.btn-primary {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.875rem 2rem; background: var(--accent); color: #fff;
    font-size: 0.95rem; font-weight: 600; border-radius: 100px; border: none;
    transition: all 0.4s var(--ease); position: relative; overflow: hidden; cursor: pointer;
}
.btn-primary::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: translateX(-100%); transition: transform 0.6s ease;
}
.btn-primary:hover { box-shadow: 0 8px 32px var(--accent-glow); transform: translateY(-2px); }
.btn-primary:hover::after { transform: translateX(100%); }

.btn-ghost {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.875rem 2rem; background: transparent; color: var(--text);
    font-size: 0.95rem; font-weight: 500; border-radius: 100px;
    border: 1px solid var(--border); transition: all 0.4s var(--ease); cursor: pointer;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-light); transform: translateY(-2px); }

.btn-soon {
    opacity: 0.5; cursor: default; pointer-events: none;
}

/* ==================== SECTIONS ==================== */
.section { position: relative; padding: 8rem 0; z-index: 1; }
.section-header { margin-bottom: 5rem; }

/* ==================== HERO ==================== */
.hero {
    position: relative; min-height: 100vh;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 6rem 2rem 4rem;
    overflow: hidden;
}

.hero-bg {
    position: absolute; inset: 0; overflow: hidden; pointer-events: none;
}
.hero-orb {
    position: absolute; border-radius: 50%;
    filter: blur(120px); opacity: 0.12;
    animation: orb-drift 25s ease-in-out infinite;
}
.hero-orb-1 {
    width: 600px; height: 600px;
    background: var(--accent);
    top: -15%; right: -5%;
}
.hero-orb-2 {
    width: 450px; height: 450px;
    background: #06b6d4;
    bottom: -10%; left: -5%;
    animation-delay: -8s;
}
.hero-orb-3 {
    width: 300px; height: 300px;
    background: var(--accent-light);
    top: 40%; left: 45%;
    animation-delay: -16s;
}
@keyframes orb-drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(40px, 30px) scale(1.02); }
}

.hero-content {
    position: relative; z-index: 1;
    max-width: 800px; width: 100%;
}

.hero-badge {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.45rem 1rem; border-radius: 100px;
    font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em;
    color: var(--text-muted); margin-bottom: 2.5rem;
}
.pulse-dot {
    width: 6px; height: 6px; background: #22c55e; border-radius: 50%;
    animation: pulse 2s ease infinite;
    box-shadow: 0 0 8px rgba(34,197,94,0.5);
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

.hero-name {
    font-family: var(--display);
    font-size: clamp(4.5rem, 13vw, 11rem);
    font-weight: 700; letter-spacing: -0.06em; line-height: 0.92;
    background: linear-gradient(160deg, #fff 0%, rgba(245,245,247,0.65) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    margin-bottom: 1.5rem;
}

.hero-role {
    font-family: var(--display);
    font-size: clamp(1.1rem, 2.5vw, 1.6rem);
    font-weight: 500; letter-spacing: -0.01em;
    color: var(--accent-light); margin-bottom: 1.25rem;
}

.hero-desc {
    font-size: clamp(1rem, 1.3vw, 1.15rem);
    color: var(--text-muted); max-width: 480px;
    margin: 0 auto 2.5rem; line-height: 1.7;
}

.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.hero-name, .hero-role, .hero-desc, .hero-actions, .hero-badge {
    opacity: 0; transform: translateY(24px);
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.hero-name.visible, .hero-role.visible, .hero-desc.visible,
.hero-actions.visible, .hero-badge.visible {
    opacity: 1; transform: translateY(0);
}

.hero-scroll {
    position: absolute; bottom: 2.5rem; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
    font-size: 0.65rem; font-weight: 600; letter-spacing: 0.2em;
    text-transform: uppercase; color: var(--text-muted);
    opacity: 0.5; animation: scroll-bob 2.5s ease infinite;
}
.scroll-line {
    width: 1px; height: 40px;
    background: linear-gradient(to bottom, var(--accent-light), transparent);
}
@keyframes scroll-bob { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(10px); } }

/* ==================== PROJECTS ==================== */
.project {
    padding: 6rem 0;
    border-top: 1px solid rgba(255,255,255,0.04);
}
.project:first-of-type { border-top: none; }

.project-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 5rem; align-items: center;
}
.project-grid.reverse .project-info { order: 2; }
.project-grid.reverse .project-visual { order: 1; }

.project-number {
    font-family: var(--display); font-size: 0.8rem; font-weight: 700;
    letter-spacing: 0.15em; color: var(--accent); display: block;
    margin-bottom: 1.25rem;
}

.project-title {
    font-family: var(--display);
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 700; letter-spacing: -0.03em; line-height: 1.05;
    margin-bottom: 0.5rem;
}

.project-subtitle {
    font-size: 1rem; color: var(--text-muted); margin-bottom: 1.5rem;
}

.project-desc {
    font-size: 1rem; line-height: 1.75; color: var(--text-muted);
    max-width: 440px; margin-bottom: 2rem;
}

.project-tags {
    display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2.5rem;
}
.tag {
    font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.08em; padding: 0.35rem 0.85rem;
    border-radius: 100px; border: 1px solid var(--border);
    color: var(--text-muted); background: var(--bg-card);
    transition: border-color 0.3s ease, color 0.3s ease;
}
.tag:hover { border-color: var(--accent); color: var(--accent-light); }

/* Project gallery — mosaic layout for real images */
.project-gallery {
    display: grid; grid-template-columns: 1.4fr 1fr;
    gap: 0.75rem; border-radius: var(--radius);
    transition: transform 0.6s var(--ease);
}
.gallery-main {
    border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 16px 48px rgba(0,0,0,0.3);
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 3/4; }

.gallery-side {
    display: flex; flex-direction: column; gap: 0.75rem;
}
.gallery-side img {
    flex: 1; width: 100%; object-fit: cover;
    border-radius: var(--radius-sm); overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

/* Placeholder visual for coming-soon projects */
.project-placeholder {
    aspect-ratio: 4/3; border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(99,102,241,0.06) 0%, rgba(6,182,212,0.04) 50%, rgba(99,102,241,0.06) 100%);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.6s var(--ease);
    box-shadow: 0 16px 48px rgba(0,0,0,0.2);
}
.placeholder-icon {
    font-family: var(--display); font-size: 5rem; font-weight: 700;
    color: rgba(255,255,255,0.04); letter-spacing: -0.04em;
}

/* ==================== ABOUT ==================== */
.about-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 5rem; align-items: start;
}
.about-text .body-text { margin-bottom: 1rem; }

.about-details { padding-top: 0.5rem; }
.about-block { margin-bottom: 3rem; }
.about-block h4 {
    font-family: var(--display); font-size: 0.8rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.skill-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.skill-tag {
    font-size: 0.8rem; font-weight: 500; padding: 0.5rem 1rem;
    border-radius: 100px; border: 1px solid var(--border);
    color: var(--text-muted); background: var(--bg-card);
    transition: all 0.3s ease;
}
.skill-tag:hover { border-color: var(--accent); color: var(--accent-light); background: rgba(99,102,241,0.06); }

.about-stats {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
}
.stat { text-align: center; }
.stat-number {
    font-family: var(--display); font-size: 2rem; font-weight: 700;
    letter-spacing: -0.03em; display: block; margin-bottom: 0.25rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.stat-label {
    font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.1em; color: var(--text-muted);
}

/* ==================== CONTACT ==================== */
.contact { padding-bottom: 8rem; }
.contact .heading-xl { margin-bottom: 1rem; }
.contact-actions { margin-top: 2rem; margin-bottom: 2.5rem; }
.contact-links { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.contact-link {
    padding: 0.75rem 1.5rem; border-radius: var(--radius-sm);
    font-size: 0.9rem; color: var(--text-muted); transition: all 0.4s var(--ease);
}
.contact-link:hover { color: var(--text); border-color: var(--accent); transform: translateY(-2px); }

/* ==================== FOOTER ==================== */
.footer { padding: 2.5rem 2rem; border-top: 1px solid var(--border); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; }
.footer p { font-size: 0.8rem; }

/* ==================== SCROLL REVEALS ==================== */
.reveal {
    opacity: 0; transform: translateY(40px);
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-d1 { transition-delay: 0.15s; }
.reveal-d2 { transition-delay: 0.25s; }

/* ==================== PROJECT PAGE (shared for templates) ==================== */
.project-hero-section {
    position: relative; min-height: 60vh;
    display: flex; align-items: flex-end;
    padding: 8rem 0 5rem; overflow: hidden;
}
.project-hero-section .hero-bg { position: absolute; inset: 0; }
.project-hero-content { position: relative; z-index: 1; }
.project-hero-title {
    font-family: var(--display);
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700; letter-spacing: -0.04em; line-height: 1;
    margin-bottom: 1rem;
}
.project-hero-tagline {
    font-size: clamp(1rem, 2vw, 1.3rem); color: var(--text-muted);
    max-width: 520px; line-height: 1.7;
}

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 3rem; }
.feature-card {
    padding: 2.5rem; border-radius: var(--radius); background: var(--bg-card);
    border: 1px solid var(--border); transition: border-color 0.3s ease, transform 0.4s var(--ease);
}
.feature-card:hover { border-color: var(--border-hover); transform: translateY(-4px); }
.feature-icon {
    width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
    background: rgba(99,102,241,0.1); border: 1px solid rgba(99,102,241,0.15);
    border-radius: 14px; font-size: 1.3rem; margin-bottom: 1.25rem;
}
.feature-card h4 {
    font-family: var(--display); font-size: 1.05rem; font-weight: 700;
    margin-bottom: 0.5rem; letter-spacing: -0.01em;
}
.feature-card p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.65; }

.showcase-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 3rem; }
.showcase-cell {
    border-radius: var(--radius-sm); overflow: hidden;
    border: 1px solid var(--border); transition: transform 0.5s var(--ease);
}
.showcase-cell:hover { transform: translateY(-4px) scale(1.02); }
.showcase-cell img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }

.back-link {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-size: 0.85rem; font-weight: 500; color: var(--text-muted);
    transition: color 0.3s ease;
}
.back-link:hover { color: var(--accent-light); }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .project-grid { gap: 3rem; }
    .about-grid { grid-template-columns: 1fr; gap: 3rem; }
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .section { padding: 5rem 0; }
    .container { padding: 0 1.25rem; }

    .nav-links {
        position: fixed; top: 0; right: -100%; width: 280px; height: 100vh;
        background: rgba(5,5,7,0.97); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
        flex-direction: column; justify-content: center; gap: 2rem; padding: 2rem;
        transition: right 0.4s var(--ease); border-left: 1px solid var(--border);
    }
    .nav-links.open { right: 0; }
    .nav-links a { font-size: 1.1rem; }
    .nav-toggle { display: block; }

    .hero { padding: 5rem 1.5rem 3rem; }
    .hero-name { font-size: clamp(3.5rem, 15vw, 6rem); }

    .project-grid { grid-template-columns: 1fr; gap: 3rem; }
    .project-grid.reverse .project-info { order: 1; }
    .project-grid.reverse .project-visual { order: 2; }

    .about-grid { grid-template-columns: 1fr; }
    .about-stats { grid-template-columns: repeat(3, 1fr); gap: 1rem; }

    .footer-inner { flex-direction: column; gap: 1rem; text-align: center; }
    .contact-links { flex-direction: column; align-items: center; }

    .feature-grid { grid-template-columns: 1fr; }
    .showcase-grid { grid-template-columns: repeat(2, 1fr); }

    .project-hero-section { min-height: 50vh; padding: 6rem 0 3rem; }
}

@media (max-width: 480px) {
    .hero-name { font-size: 3.2rem; }
    .heading-lg { font-size: 2rem; }
    .heading-xl { font-size: 2.5rem; }
    .hero-actions { flex-direction: column; width: 100%; }
    .btn-primary, .btn-ghost { justify-content: center; width: 100%; }
    .project-title { font-size: 2rem; }
    .about-stats { grid-template-columns: 1fr 1fr 1fr; }
}

/* ==================== REDUCED MOTION ==================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
    .reveal { opacity: 1; transform: none; }
    .cursor, .cursor-dot { display: none !important; }
    .hero-name, .hero-role, .hero-desc, .hero-actions, .hero-badge { opacity: 1; transform: none; }
}
