/* ── Sdílené efekty — cursor, reveal, about, contact ── */

body.fx-cursor-active.page-home,
body.fx-cursor-active.page-home * {
    cursor: none !important;
}

.fx-cursor-ring,
.fx-cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 40000;
    pointer-events: none;
    mix-blend-mode: difference;
    opacity: 0;
    visibility: hidden;
    filter: none;
    transition:
        opacity 0.42s ease,
        filter 0.42s ease,
        visibility 0s linear 0.42s;
}

body.fx-cursor-live .fx-cursor-ring,
body.fx-cursor-live .fx-cursor-dot {
    visibility: visible;
    transition:
        opacity 0.42s ease,
        filter 0.42s ease,
        visibility 0s;
}

body.fx-cursor-live.fx-cursor-in .fx-cursor-ring,
body.fx-cursor-live.fx-cursor-in .fx-cursor-dot {
    opacity: calc(1 - var(--away-level, 0) * 0.92);
    filter: blur(calc(var(--away-level, 0) * 7px));
    transition-duration: 0.07s, 0.07s, 0s;
}

body.fx-cursor-live.fx-cursor-out .fx-cursor-ring,
body.fx-cursor-live.fx-cursor-out .fx-cursor-dot {
    opacity: calc(1 - var(--away-level, 0) * 0.92);
    filter: blur(calc(var(--away-level, 0) * 7px));
    transition-duration: 0.48s, 0.48s, 0s;
}

.fx-cursor-dot {
    width: 6px;
    height: 6px;
    margin: -3px 0 0 -3px;
    border-radius: 50%;
    background: #64ffda;
    box-shadow: 0 0 12px rgba(100, 255, 218, 0.8);
}

.fx-cursor-ring {
    width: 36px;
    height: 36px;
    margin: -18px 0 0 -18px;
    border-radius: 50%;
    border: 1px solid rgba(100, 255, 218, 0.55);
    box-shadow: 0 0 24px rgba(100, 255, 218, 0.15);
}

/* ── Away state — obsah zůstává, aurora kopie navrch (screen blend) ── */
.fx-away-stack {
    position: fixed;
    inset: 0;
    z-index: 12;
    pointer-events: none;
    opacity: calc(var(--away-aurora, 0) * 0.52);
    transform: translateZ(0) scale(calc(1.008 - var(--away-aurora, 0) * 0.008));
    filter: saturate(calc(1 + var(--away-aurora, 0) * 0.05));
    will-change: opacity, transform;
}

.fx-aurora-clone {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100lvh;
    min-height: 100vh;
    min-height: 100svh;
    pointer-events: none;
    mix-blend-mode: screen;
}

.fx-aurora-clone--fallback {
    background: transparent;
    overflow: hidden;
}

.fx-away-overlay {
    position: fixed;
    inset: 0;
    z-index: 8050;
    pointer-events: none;
    opacity: var(--away-level, 0);
}

.fx-away-shade {
    position: absolute;
    inset: 0;
    opacity: calc(var(--away-level, 0) * 0.09);
    background:
        radial-gradient(ellipse 85% 75% at 50% 42%, transparent 45%, rgba(0, 0, 0, 0.42) 100%);
}

.fx-away-brand {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    margin: 0;
    font-family: "Inter", system-ui, sans-serif;
    font-weight: 900;
    font-size: clamp(1.35rem, 4.5vw, 2.4rem);
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    pointer-events: none;
    opacity: calc(var(--away-level, 0) * 0.96);
    transform: translate(-50%, -50%) scale(calc(0.92 + var(--away-level, 0) * 0.08));
    filter: drop-shadow(0 0 24px rgba(100, 255, 218, 0.12));
}

.fx-away-brand span {
    color: #64ffda;
    text-shadow: 0 0 14px rgba(100, 255, 218, 0.55);
}

.fx-away-scan {
    position: absolute;
    inset: 0;
    opacity: calc(var(--away-level, 0) * 0.14);
    background: repeating-linear-gradient(
        0deg,
        transparent 0,
        transparent 3px,
        rgba(100, 255, 218, 0.018) 3px,
        rgba(100, 255, 218, 0.018) 4px
    );
    mix-blend-mode: overlay;
}

.fx-away-cracks {
    position: absolute;
    inset: -2%;
    opacity: calc(var(--away-level, 0) * 0.22);
    background:
        linear-gradient(108deg, transparent 44.5%, rgba(100, 255, 218, 0.08) 45%, rgba(255, 255, 255, 0.05) 45.15%, transparent 45.8%),
        linear-gradient(71deg, transparent 58%, rgba(255, 255, 255, 0.035) 58.4%, transparent 59%),
        linear-gradient(163deg, transparent 72%, rgba(100, 255, 218, 0.05) 72.3%, transparent 73%),
        linear-gradient(12deg, transparent 28%, rgba(255, 255, 255, 0.025) 28.2%, transparent 28.6%);
}

body.fx-away-active .fx-away-scan {
    animation: fx-away-scan-drift 5s linear infinite;
}

body.fx-away-glitch .fx-away-overlay {
    animation: fx-away-burst 0.65s cubic-bezier(0.16, 1, 0.3, 1) 1;
}

body.fx-away-glitch .fx-away-cracks {
    opacity: calc(var(--away-level, 0) * 0.32);
}

/* Blur + jemné ztmavení obsahu — text zůstává minimálně čitelný */
body.page-home.fx-away-active:not(.intro-boot):not(.intro-sequence):not(.intro-arriving):not(.intro-exiting) .home-main,
body.page-home.fx-away-active:not(.intro-boot):not(.intro-sequence):not(.intro-arriving):not(.intro-exiting) .home-footer,
body.page-home.fx-away-active:not(.intro-boot):not(.intro-sequence):not(.intro-arriving):not(.intro-exiting) .home-nav {
    filter: blur(calc(var(--away-blur, 0) * 3.5px)) brightness(calc(1 - var(--away-blur, 0) * 0.07));
    opacity: calc(1 - var(--away-blur, 0) * 0.03);
}

@keyframes fx-away-scan-drift {
    0% { transform: translateY(0); }
    100% { transform: translateY(5px); }
}

@keyframes fx-away-burst {
    0%, 100% { transform: translate(0); }
    35% { transform: translate(-1px, 0.5px); }
    70% { transform: translate(1px, -0.5px); }
}

@keyframes fx-away-crack {
    0% { opacity: calc(var(--away-level, 0) * 0.15); }
    50% { opacity: calc(var(--away-level, 0) * 0.45); }
    100% { opacity: calc(var(--away-level, 0) * 0.38); }
}

.reveal-on-scroll {
    opacity: 0;
    transform: translateY(16px);
    transition:
        opacity 1s cubic-bezier(0.16, 1, 0.3, 1),
        transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-on-scroll.delay-1 { transition-delay: 0.08s; }
.reveal-on-scroll.delay-2 { transition-delay: 0.16s; }
.reveal-on-scroll.delay-3 { transition-delay: 0.24s; }

/* ── Bottom portal — jemné odwarpování jen u spodku při scrollu ── */
.fx-bottom-portal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(36px + var(--bottom-warp, 0) * 52px);
    pointer-events: none;
    z-index: 3;
    opacity: var(--bottom-warp, 0);
    background:
        radial-gradient(ellipse 90% 130% at 50% 100%, rgba(100, 255, 218, 0.11), transparent 70%),
        radial-gradient(ellipse 130% 70% at 50% 115%, rgba(255, 255, 255, 0.035), transparent 62%);
    filter: blur(calc(3px + var(--bottom-warp, 0) * 8px));
    transform: scaleY(calc(0.9 + var(--bottom-warp, 0) * 0.18));
    transform-origin: 50% 100%;
}

.fx-bottom-portal__curve {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: calc(100vw + var(--bottom-warp, 0) * 60px);
    height: calc(18px + var(--bottom-warp, 0) * 28px);
    transform: translateX(-50%);
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    background: linear-gradient(to top, rgba(2, 6, 10, 0.55), transparent);
    opacity: calc(var(--bottom-warp, 0) * 0.85);
}

body.fx-bottom-warp .home-footer {
    transform: perspective(1000px) rotateX(calc(var(--bottom-warp, 0) * -4.5deg)) translateY(calc(var(--bottom-warp, 0) * -3px));
    transform-origin: 50% 100%;
    transition: transform 0.16s ease-out;
}

body.intro-exiting .fx-cursor-ring,
body.intro-exiting .fx-cursor-dot,
body.intro-sequence .fx-cursor-ring,
body.intro-sequence .fx-cursor-dot,
body.intro-arriving .fx-cursor-ring,
body.intro-arriving .fx-cursor-dot,
body.intro-boot .fx-cursor-ring,
body.intro-boot .fx-cursor-dot,
body:not(.fx-cursor-live) .fx-cursor-ring,
body:not(.fx-cursor-live) .fx-cursor-dot {
    opacity: 0 !important;
    visibility: hidden !important;
    filter: none !important;
}

body.intro-boot .fx-away-overlay,
body.intro-sequence .fx-away-overlay,
body.intro-arriving .fx-away-overlay,
body.intro-exiting .fx-away-overlay,
body.intro-boot .fx-away-stack,
body.intro-sequence .fx-away-stack,
body.intro-arriving .fx-away-stack,
body.intro-exiting .fx-away-stack {
    opacity: 0 !important;
    pointer-events: none;
}

/* ── About ── */
.about-shell {
    width: 100%;
    max-width: min(1320px, 100%);
    margin: 0 auto;
    padding: 0 clamp(1.25rem, 5vw, 3.5rem) clamp(3rem, 6vw, 5rem);
    position: relative;
    z-index: 2;
}

.hero--about {
    min-height: auto;
    padding: calc(7rem + env(safe-area-inset-top)) 0 2.5rem;
    justify-content: flex-end;
    align-items: flex-start;
    text-align: left;
    will-change: transform;
}

.hero--about .display-title {
    font-size: clamp(2.75rem, 7vw, 4.75rem);
}

.hero--about .hero-motto {
    max-width: 36rem;
    margin-left: 0;
    margin-right: auto;
}

.about-manifest,
.about-columns,
.about-cta {
    text-align: center;
}

.about-manifest {
    margin-bottom: clamp(3rem, 7vw, 4.5rem);
    padding-bottom: clamp(2rem, 5vw, 3rem);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.about-manifest .hero-overline {
    display: inline-block;
}

.prose-block {
    margin: 0 auto;
    max-width: min(56rem, 100%);
    font-size: clamp(1.05rem, 2.2vw, 1.2rem);
    line-height: 1.9;
    color: rgba(255, 255, 255, 0.82);
    font-weight: 300;
}

.about-columns {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: clamp(2.5rem, 6vw, 5rem);
    align-items: start;
    margin-bottom: clamp(2.5rem, 6vw, 4rem);
}

.about-col .flow-title {
    font-size: clamp(1.75rem, 3.5vw, 2.25rem);
    font-weight: 700;
    margin: 0 0 1.75rem;
    line-height: 1.15;
}

.about-col .timeline-list,
.about-col .skills-plain {
    text-align: left;
    max-width: 28rem;
    margin-inline: auto;
}

.about-col .hero-overline {
    margin-bottom: 0.75rem;
}

.timeline-list {
    --timeline-axis: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}

.timeline-list::before {
    content: "";
    position: absolute;
    left: var(--timeline-axis);
    top: 0.5rem;
    bottom: 0;
    width: 1px;
    transform: translateX(-50%);
    background: rgba(100, 255, 218, 0.18);
}

.timeline-item {
    position: relative;
    padding: 0 0 2rem 1.75rem;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: var(--timeline-axis);
    top: 0.45rem;
    width: 8px;
    height: 8px;
    margin-left: 0;
    transform: translateX(-50%);
    border-radius: 50%;
    background: var(--accent-cyan);
    box-shadow: 0 0 12px rgba(100, 255, 218, 0.45);
}

.timeline-date {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(100, 255, 218, 0.75);
}

.timeline-item h3 {
    margin: 0 0 0.45rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
}

.timeline-item p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.75;
    color: var(--text-muted);
    font-weight: 300;
}

.skills-plain {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.skills-plain-item h3 {
    margin: 0 0 0.4rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent-cyan);
}

.skills-plain-item p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--text-muted);
    font-weight: 300;
}

.about-cta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    padding-top: 0.5rem;
    text-align: center;
}

/* ── Contact ── */
.terminal-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.terminal-run {
    position: absolute;
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
    font-size: clamp(0.62rem, 1.8vw, 0.74rem);
    letter-spacing: 0.02em;
    color: rgba(100, 255, 218, 0.55);
    opacity: 0;
    white-space: nowrap;
    transition: opacity 2.4s cubic-bezier(0.22, 1, 0.36, 1);
    text-shadow: 0 0 16px rgba(100, 255, 218, 0.08);
}

.terminal-run.is-visible {
    opacity: 0.11;
}

.contact-page {
    flex: 0 0 auto;
    width: 100%;
    min-height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: calc(5rem + env(safe-area-inset-top)) clamp(1.25rem, 5vw, 3rem) 1.5rem;
    position: relative;
    z-index: 2;
    gap: 0.15rem;
}

.contact-stage {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.contact-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.contact-status--available {
    background: rgba(100, 255, 218, 0.06);
    border: 1px solid rgba(100, 255, 218, 0.18);
    color: rgba(100, 255, 218, 0.9);
}

.contact-status--unavailable {
    background: rgba(255, 120, 120, 0.06);
    border: 1px solid rgba(255, 120, 120, 0.2);
    color: rgba(255, 160, 160, 0.9);
}

.contact-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    animation: statusPulse 2.4s ease-in-out infinite;
}

.contact-status--available .contact-status-dot {
    background: #64ffda;
    box-shadow: 0 0 10px rgba(100, 255, 218, 0.8);
}

.contact-status--unavailable .contact-status-dot {
    background: #ff7878;
    box-shadow: 0 0 10px rgba(255, 120, 120, 0.6);
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.85); }
}

.contact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 2rem;
}

#copy-email {
    min-height: 48px;
    padding: 0.85rem 1.75rem;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.85);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    transition: border-color 0.3s ease, background 0.3s ease, color 0.3s ease;
}

#copy-email:hover,
#copy-email.is-copied {
    border-color: rgba(100, 255, 218, 0.35);
    background: rgba(100, 255, 218, 0.08);
    color: var(--accent-cyan);
}

@media (max-width: 768px) {
    .about-columns {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .about-shell {
        padding-left: 5vw;
        padding-right: 5vw;
    }

    .hero--about {
        padding-top: calc(5.5rem + env(safe-area-inset-top));
    }

    .contact-page {
        padding-left: 5vw;
        padding-right: 5vw;
        padding-bottom: 1rem;
    }

    .fx-cursor-ring,
    .fx-cursor-dot {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .reveal-on-scroll {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .fx-cursor-ring,
    .fx-cursor-dot {
        display: none;
    }

    .contact-status-dot {
        animation: none;
    }

    .terminal-run {
        transition: none;
    }

    .fx-bottom-portal {
        display: none;
    }

    body.fx-bottom-warp .home-footer {
        transform: none !important;
    }

    body.page-home.fx-away-active .home-main,
    body.page-home.fx-away-active .home-footer,
    body.page-home.fx-away-active .home-nav {
        filter: none !important;
    }

    .fx-aurora-clone {
        display: none;
    }

    .fx-away-stack {
        display: none;
    }

    .fx-away-overlay {
        display: none;
    }
}
