/* ═══════════════════════════════════════════════════════════
   matej-bukovsky.cz – "inside the box" theme
   ═══════════════════════════════════════════════════════════ */

:root {
    --depth: 1500px;

    --bg: #070a10;
    --bg-2: #0b1019;
    --panel: rgba(12, 18, 30, 0.74);
    --panel-solid: #0f1726;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.14);

    --text: #e8eef6;
    --muted: #9aa8bb;

    --teal: #4aa3bf;
    --teal-deep: #2f7f99;
    --orange: #e8912e;
    --orange-deep: #c9731a;
    --glow: rgba(74, 163, 191, 0.35);

    --font: 'Inter', system-ui, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    /* driven by JS */
    --mx: 0;
    --my: 0;
    --sy: 0;
    --sp: 0;
}

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

html {
    background: var(--bg);
    scroll-behavior: smooth;
    scrollbar-color: #1c2535 #0a0c12;
    overflow-x: hidden;   /* iOS Safari: body alone is not enough to stop the layout viewport from growing */
}

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    position: relative;
    max-width: 100vw;
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #0a0c12; }
::-webkit-scrollbar-thumb { background: #1c2535; border-radius: 10px; border: 2px solid #0a0c12; }

a { color: var(--teal); text-decoration: none; }
a:hover { color: #7cc4da; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, p { margin: 0; }

.container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 28px;
}

/* ───────────────────────────── 3D room (the box inside the monitor) */
.scene {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    clip-path: inset(0);   /* the 3D walls project far outside; keep them from widening the page on mobile Safari */
    contain: layout paint;
    background: var(--bg);
    perspective: 900px;
    perspective-origin: calc(50% + var(--mx) * 14%) calc(50% + var(--my) * 10%);
}
.look {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
}
.room {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transform: rotateY(calc(var(--mx) * -1.5deg)) rotateX(calc(var(--my) * 1.5deg));
}
.wall {
    position: absolute;
    background-color: #0c1322;
    /* soft-edged lines (no hard 1px step) keep the far, foreshortened parts free of moiré shimmer */
    background-image:
        linear-gradient(rgba(110, 196, 222, 0.38) 0, rgba(110, 196, 222, 0.38) 1.5px, transparent 3px),
        linear-gradient(90deg, rgba(110, 196, 222, 0.38) 0, rgba(110, 196, 222, 0.38) 1.5px, transparent 3px),
        linear-gradient(rgba(74, 163, 191, 0.2) 0, rgba(74, 163, 191, 0.2) 1px, transparent 2.5px),
        linear-gradient(90deg, rgba(74, 163, 191, 0.2) 0, rgba(74, 163, 191, 0.2) 1px, transparent 2.5px);
    background-size: 480px 480px, 480px 480px, 120px 120px, 120px 120px;
    box-shadow: inset 0 0 0 2px rgba(120, 205, 230, 0.55), inset 0 0 40px rgba(74, 163, 191, 0.12);
}
.wall::after {
    content: '';
    position: absolute;
    inset: 0;
}
.wall--back {
    inset: 0;
    transform: translateZ(calc(var(--depth) * -1));
    background-image:
        radial-gradient(45% 45% at 50% 50%, rgba(232, 145, 46, 0.28), transparent 70%),
        radial-gradient(70% 70% at 50% 50%, rgba(74, 163, 191, 0.3), transparent 70%),
        linear-gradient(rgba(110, 196, 222, 0.38) 0, rgba(110, 196, 222, 0.38) 1.5px, transparent 3px),
        linear-gradient(90deg, rgba(110, 196, 222, 0.38) 0, rgba(110, 196, 222, 0.38) 1.5px, transparent 3px),
        linear-gradient(rgba(74, 163, 191, 0.2) 0, rgba(74, 163, 191, 0.2) 1px, transparent 2.5px),
        linear-gradient(90deg, rgba(74, 163, 191, 0.2) 0, rgba(74, 163, 191, 0.2) 1px, transparent 2.5px);
    background-size: 100% 100%, 100% 100%, 480px 480px, 480px 480px, 120px 120px, 120px 120px;
}
.wall--back::after { background: rgba(4, 6, 10, 0.2); }

.wall--left, .wall--right {
    top: 0; bottom: 0;
    width: var(--depth);
}
.wall--left {
    left: 0;
    transform-origin: left center;
    transform: rotateY(90deg);
}
.wall--left::after { background: linear-gradient(90deg, transparent 12%, rgba(4, 6, 10, 0.85) 100%); }
.wall--right {
    right: 0;
    transform-origin: right center;
    transform: rotateY(-90deg);
}
.wall--right::after { background: linear-gradient(270deg, transparent 12%, rgba(4, 6, 10, 0.85) 100%); }

.wall--top, .wall--bottom {
    left: 0; right: 0;
    height: var(--depth);
}
.wall--top {
    top: 0;
    transform-origin: center top;
    transform: rotateX(-90deg);
}
.wall--top::after { background: linear-gradient(180deg, transparent 12%, rgba(4, 6, 10, 0.85) 100%); }
.wall--bottom {
    bottom: 0;
    transform-origin: center bottom;
    transform: rotateX(90deg);
}
.wall--bottom::after { background: linear-gradient(0deg, transparent 12%, rgba(4, 6, 10, 0.85) 100%); }

.mote {
    position: absolute;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--c, var(--teal));
    box-shadow: 0 0 12px 2px var(--c, var(--teal));
    opacity: 0.7;
    transform: translate3d(var(--x), var(--y), var(--z));
    animation: mote-float var(--t, 9s) ease-in-out infinite alternate;
}
@keyframes mote-float {
    from { transform: translate3d(var(--x), var(--y), var(--z)) translateY(-18px); }
    to   { transform: translate3d(var(--x), var(--y), var(--z)) translateY(18px); }
}

/* ───────────────────────────── Cursor light + scroll progress */
.light {
    position: fixed;
    inset: 0;
    z-index: 30;
    pointer-events: none;
    background: radial-gradient(
        700px circle at calc(50% + var(--mx) * 50%) calc(50% + var(--my) * 50%),
        rgba(255, 255, 255, 0.04),
        transparent 60%
    );
}
.progress {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 45;
    height: 2px;
    background: linear-gradient(90deg, var(--teal), var(--orange));
    transform-origin: left;
    transform: scaleX(var(--sp));
    box-shadow: 0 0 10px var(--glow);
    pointer-events: none;
}

/* section indicator */
.osd {
    position: fixed;
    left: 22px;
    bottom: 20px;
    z-index: 35;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    font: 500 11px/1 var(--mono);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--muted);
    background: rgba(8, 12, 20, 0.7);
    border: 1px solid var(--line);
    border-radius: 999px;
    backdrop-filter: blur(10px);
    pointer-events: none;
}
.osd__num { color: var(--orange); }
.osd__dot { width: 5px; height: 5px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 8px var(--teal); }
.osd.flash .osd__label { animation: osd-flash 0.5s ease-out; }
@keyframes osd-flash { 0% { color: #fff; } 100% { color: var(--muted); } }

/* ───────────────────────────── Navigation */
.nav {
    position: fixed;
    top: 18px;
    left: 50%;
    z-index: 50;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px 6px 10px;
    background: rgba(10, 15, 25, 0.72);
    border: 1px solid var(--line);
    border-radius: 999px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
    transition: box-shadow 0.3s, border-color 0.3s;
}
.nav.is-scrolled { border-color: var(--line-strong); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 30px var(--glow); }
.nav__brand {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-right: 8px;
    font: 800 13px/1 var(--mono);
    letter-spacing: 2px;
    color: var(--text);
}
.nav__brand img { width: 26px; height: auto; }
.nav__links { display: flex; gap: 2px; }
.nav__links a {
    position: relative;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--muted);
    border-radius: 999px;
    transition: color 0.2s, background 0.2s;
}
.nav__links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.nav__links a.active { color: #fff; background: rgba(74, 163, 191, 0.18); box-shadow: inset 0 0 0 1px rgba(74, 163, 191, 0.35); }
.nav__toggle {
    display: none;
    width: 38px; height: 38px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
}

/* ───────────────────────────── Shared pieces */
main { position: relative; z-index: 1; }

.section { position: relative; padding: 7.5rem 0; }

.sec-head { max-width: 640px; margin: 0 auto 3.5rem; text-align: center; }
.sec-num {
    display: inline-block;
    margin-bottom: 0.9rem;
    padding: 4px 10px;
    font: 600 11px/1 var(--mono);
    letter-spacing: 2px;
    color: var(--orange);
    border: 1px solid rgba(232, 145, 46, 0.35);
    border-radius: 999px;
    background: rgba(232, 145, 46, 0.08);
}
.sec-title { font-size: clamp(1.9rem, 3.2vw, 2.5rem); font-weight: 800; letter-spacing: -0.5px; margin-bottom: 0.5rem; }
.sec-sub { font-size: 1.05rem; color: var(--muted); }

.panel {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 20px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.85rem 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
    font-family: inherit;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px); }
.btn--primary {
    color: #0a0c12;
    background: linear-gradient(135deg, #ffb45c, var(--orange));
    box-shadow: 0 10px 30px rgba(232, 145, 46, 0.35);
}
.btn--primary:hover { color: #0a0c12; box-shadow: 0 14px 40px rgba(232, 145, 46, 0.5); }
.btn--ghost {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--line-strong);
}
.btn--ghost:hover { color: #fff; border-color: var(--teal); background: rgba(74, 163, 191, 0.1); }

/* scroll reveal (flies in from the depth of the box) */
.reveal {
    opacity: 0;
    transform: perspective(900px) translateZ(-180px) translateY(34px) rotateX(5deg);
    transition: opacity 0.9s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
    transition-delay: var(--d, 0s);
}
.reveal.in { opacity: 1; transform: none; }

/* tilt cards */
[data-tilt] {
    position: relative;
    transform: perspective(800px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(var(--tz, 0));
    transition: transform 0.18s ease-out, box-shadow 0.25s, border-color 0.25s;
    transform-style: preserve-3d;
}
[data-tilt]:hover { --tz: 14px; border-color: rgba(74, 163, 191, 0.4); }
[data-tilt]::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.1), transparent 55%);
    opacity: 0;
    transition: opacity 0.25s;
}
[data-tilt]:hover::after { opacity: 1; }

/* ───────────────────────────── Hero */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 8rem 0 5rem;
    overflow: hidden;
}
.hero__inner {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 3rem;
    align-items: center;
}
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.2rem;
    font: 500 12px/1 var(--mono);
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: #8fd0e4;
}
.eyebrow .cursor { display: inline-block; width: 8px; height: 14px; background: var(--orange); animation: blink 1.1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero__title {
    font-size: clamp(2.8rem, 6.2vw, 5rem);
    font-weight: 800;
    line-height: 1.02;
    letter-spacing: -2px;
    margin-bottom: 0.9rem;
}
.hero__title .grad {
    background: linear-gradient(100deg, var(--teal) 0%, #8fd0e4 45%, var(--orange) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero__tagline { font-size: 1.3rem; font-weight: 500; color: #b9c6d6; margin-bottom: 1rem; }
.hero__desc { font-size: 1.05rem; color: var(--muted); max-width: 540px; line-height: 1.75; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 2rem; }

/* hero 3D stage */
.hero__stage {
    position: relative;
    height: 460px;
    perspective: 1100px;
    transform: translateY(calc(var(--sy) * -0.12px));
}
.stage {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transform: rotateY(calc(var(--mx) * 10deg)) rotateX(calc(var(--my) * -8deg));
}

.win {
    position: absolute;
    left: 50%; top: 50%;
    width: 300px;
    transform: translate(-50%, -50%) translateZ(0);
    border-radius: 16px;
    overflow: hidden;
    background: #0f1726;
    border: 1px solid var(--line-strong);
    box-shadow: 0 40px 90px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 0, 0, 0.4), 0 0 60px var(--glow);
    animation: win-float 7s ease-in-out infinite;
}
@keyframes win-float {
    0%, 100% { transform: translate(-50%, -50%) translateZ(0) translateY(0); }
    50%      { transform: translate(-50%, -50%) translateZ(0) translateY(-12px); }
}
.win__bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    background: #121b2b;
    border-bottom: 1px solid var(--line);
}
.win__bar i { width: 10px; height: 10px; border-radius: 50%; background: #2a3448; }
.win__bar i:nth-child(1) { background: #ff5f57; }
.win__bar i:nth-child(2) { background: #febc2e; }
.win__bar i:nth-child(3) { background: #28c840; }
.win__bar span { margin-left: auto; margin-right: auto; font: 500 11px/1 var(--mono); color: var(--muted); }
.win img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.win__status {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    font: 500 11px/1 var(--mono);
    color: var(--muted);
    background: #121b2b;
}
.win__status b { color: #28c840; font-weight: 500; }

.logo3d {
    position: absolute;
    left: 50%; top: 50%;
    width: 120px;
    transform: translate(-50%, -50%) translate3d(-205px, 175px, 120px)
               rotateY(calc(var(--mx) * 30deg)) rotateX(calc(var(--my) * -30deg));
    transform-style: preserve-3d;
    filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.6));
}
.logo3d img {
    position: absolute;
    inset: 0;
    width: 100%;
    transform: translateZ(calc(var(--i) * 3px));
    filter: brightness(calc(0.35 + var(--i) * 0.11));
}
.logo3d img:last-child { position: relative; }
.logo3d__spin { animation: logo-float 6s ease-in-out infinite; transform-style: preserve-3d; }
@keyframes logo-float { 0%, 100% { transform: translateY(0) rotateZ(-4deg); } 50% { transform: translateY(-14px) rotateZ(4deg); } }

.chip {
    position: absolute;
    left: var(--x);
    top: var(--y);
    padding: 7px 12px;
    font: 500 12px/1 var(--mono);
    color: var(--text);
    background: rgba(12, 18, 30, 0.85);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    transform: translate3d(calc(var(--mx) * var(--p) * 1px), calc(var(--my) * var(--p) * 1px), var(--z));
}
.chip--o { border-color: rgba(232, 145, 46, 0.5); color: #ffc98a; }
.chip--t { border-color: rgba(74, 163, 191, 0.5); color: #9edcee; }
.chip span { display: block; animation: chip-float var(--t, 5s) ease-in-out infinite alternate; }
@keyframes chip-float { from { transform: translateY(-6px); } to { transform: translateY(6px); } }

.scroll-hint {
    position: absolute;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font: 500 10px/1 var(--mono);
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--muted);
    opacity: clamp(0, calc(1 - var(--sy) / 200), 1);
}
.scroll-hint i {
    width: 22px; height: 34px;
    border: 2px solid var(--line-strong);
    border-radius: 12px;
    position: relative;
}
.scroll-hint i::after {
    content: '';
    position: absolute;
    left: 50%; top: 6px;
    width: 3px; height: 7px;
    margin-left: -1.5px;
    border-radius: 3px;
    background: var(--orange);
    animation: wheel 1.6s ease-in-out infinite;
}
@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(12px); opacity: 0; } }

/* ───────────────────────────── About */
.about {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 2rem;
    align-items: stretch;
}
.about__text { padding: 2.4rem 2.6rem; }
.about__text p { color: #c3cedb; line-height: 1.8; }
.about__text p + p { margin-top: 1.1rem; }
.about__aside { padding: 2rem 2.2rem; display: flex; flex-direction: column; gap: 1.6rem; }
.about__label { font: 600 11px/1 var(--mono); letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-bottom: 0.8rem; }
.about__company {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
}
.about__company i { font-size: 1.4rem; color: var(--teal); }
.about__company strong { display: block; font-size: 0.95rem; }
.about__company span { font-size: 0.8rem; color: var(--muted); }
.about__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.82rem;
    font-weight: 500;
    color: #d6e0ea;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    border-radius: 999px;
}
.tag i { color: var(--orange); }

/* ───────────────────────────── Services */
.services {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.4rem;
}
.card { padding: 1.8rem 1.6rem; height: 100%; }
.card__icon {
    width: 50px; height: 50px;
    display: grid;
    place-items: center;
    margin-bottom: 1.2rem;
    font-size: 1.4rem;
    color: #0a0c12;
    background: linear-gradient(135deg, #8fd0e4, var(--teal));
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(74, 163, 191, 0.35);
    transform: translateZ(30px);
}
.card:nth-child(even) .card__icon { background: linear-gradient(135deg, #ffb45c, var(--orange)); box-shadow: 0 10px 24px rgba(232, 145, 46, 0.35); }
.card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.6rem; transform: translateZ(20px); }
.card p { font-size: 0.9rem; line-height: 1.65; color: var(--muted); transform: translateZ(10px); }

/* ───────────────────────────── Tech stack (keycaps) */
.stack {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.4rem;
}
.group { padding: 1.5rem 1.6rem; height: 100%; }
.group__label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1rem;
    font: 600 11px/1 var(--mono);
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--muted);
}
.group__label i { color: var(--teal); font-size: 1rem; }
.keys { display: flex; flex-wrap: wrap; gap: 10px; }
.key {
    display: inline-block;
    padding: 0.5em 0.9em;
    font: 500 0.82rem/1.3 var(--mono);
    color: #dbe6f0;
    background: linear-gradient(#1c2638, #121a28);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9px;
    box-shadow: 0 4px 0 #080c14, 0 7px 16px rgba(0, 0, 0, 0.45);
    transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s, color 0.12s;
    cursor: default;
    user-select: none;
}
.key:hover {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #080c14, 0 2px 6px rgba(0, 0, 0, 0.45);
    color: #fff;
    border-color: var(--orange);
}

/* ───────────────────────────── Contact */
.contact {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem;
    align-items: start;
}
.form { padding: 2.2rem 2.4rem; }
.field { margin-bottom: 1.1rem; }
.field label {
    display: block;
    margin-bottom: 0.45rem;
    font: 600 11px/1 var(--mono);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--muted);
}
.field label em { color: var(--orange); font-style: normal; }
.field input, .field textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    font: 500 1rem/1.5 var(--font);   /* 16px: anything smaller makes iOS Safari zoom in on focus and stay zoomed */
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field textarea:focus {
    border-color: var(--teal);
    background: rgba(74, 163, 191, 0.06);
    box-shadow: 0 0 0 4px rgba(74, 163, 191, 0.15);
}
.form .btn { width: 100%; justify-content: center; margin-top: 0.4rem; }

.alert {
    padding: 1.2rem 1.4rem;
    border-radius: 14px;
    border: 1px solid;
    font-size: 0.95rem;
}
.alert--ok {
    text-align: center;
    padding: 2.4rem;
    color: #b8f5c6;
    background: rgba(40, 200, 64, 0.08);
    border-color: rgba(40, 200, 64, 0.35);
}
.alert--ok i { display: block; font-size: 2.2rem; margin-bottom: 0.6rem; color: #28c840; }
.alert--err {
    margin-bottom: 1.4rem;
    color: #ffc1bd;
    background: rgba(255, 95, 87, 0.08);
    border-color: rgba(255, 95, 87, 0.4);
}

.info { display: flex; flex-direction: column; gap: 1rem; }
.info__item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 1.2rem 1.4rem;
}
.info__item > i {
    width: 44px; height: 44px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 1.2rem;
    color: var(--teal);
    background: rgba(74, 163, 191, 0.12);
    border: 1px solid rgba(74, 163, 191, 0.3);
    border-radius: 12px;
}
.info__item strong {
    display: block;
    font: 600 10px/1 var(--mono);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 4px;
}
.info__item a, .info__item span { font-size: 1rem; font-weight: 500; color: var(--text); }
.info__item a:hover { color: var(--orange); }

/* ───────────────────────────── Footer */
.footer {
    position: relative;
    z-index: 1;
    padding: 2.2rem 0 3.4rem;
    border-top: 1px solid var(--line);
}
.footer .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--muted);
}

/* ───────────────────────────── Responsive */
@media (max-width: 1024px) {
    .services { grid-template-columns: repeat(2, 1fr); }
    .stack { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
    .hero__inner { grid-template-columns: 1fr; gap: 2rem; }
    .hero__stage { height: 420px; order: -1; }
    .hero { padding-top: 7rem; }
    .about, .contact { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .container { padding: 0 18px; }
    .section { padding: 5rem 0; }
    .osd { display: none; }

    .nav {
        left: 12px;
        right: 12px;
        top: 12px;
        transform: none;
        justify-content: space-between;
        border-radius: 22px;
    }
    .nav__toggle { display: grid; place-items: center; }
    .nav__links {
        display: none;
        position: absolute;
        left: 0; right: 0;
        top: calc(100% + 8px);
        flex-direction: column;
        padding: 8px;
        background: rgba(10, 15, 25, 0.92);
        border: 1px solid var(--line);
        border-radius: 18px;
        backdrop-filter: blur(16px);
    }
    .nav.is-open .nav__links { display: flex; }
    .nav__links a { padding: 12px 16px; border-radius: 12px; }

    .hero__title { letter-spacing: -1px; }
    .eyebrow { font-size: 11px; letter-spacing: 1.5px; }
    .hero__stage { height: 380px; }
    .chip:nth-of-type(3), .chip:nth-of-type(5) { display: none; }
    .win { width: 240px; }
    .logo3d { width: 90px; transform: translate(-50%, -50%) translate3d(-135px, 150px, 90px) rotateY(calc(var(--mx) * 30deg)) rotateX(calc(var(--my) * -30deg)); }
    .services, .stack { grid-template-columns: 1fr; }
    .about__text, .form { padding: 1.6rem 1.4rem; }
    .about__aside { padding: 1.5rem 1.4rem; }
    .scroll-hint { display: none; }
}

/* ───────────────────────────── Reduced motion */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
    .win, .logo3d__spin, .chip span, .mote, .eyebrow .cursor, .scroll-hint i::after { animation: none; }
    .hero__stage { transform: none; }
    [data-tilt] { transform: none; }
}

/* ═══════════════════════════════════════════════════════════
   Tunnel mode – sections are stacked along the Z axis inside the
   box; scrolling moves the camera deeper, through each section
   ═══════════════════════════════════════════════════════════ */
.tunnel main { display: none; }
.tunnel .scroll-hint, .tunnel .osd, .tunnel .rail { display: none !important; }
.tunnel .scroll-hint span::after { content: ' · do hloubky'; }
.tunnel .osd__hint { display: inline; padding-left: 10px; border-left: 1px solid var(--line-strong); color: #6f7d8e; }
.osd__hint { display: none; }

/* the box is drawn as 2D vector lines (SVG) sharing the sections' perspective; look-around = moving vanishing point */
.box { display: none; }
.tunnel .box {
    display: block;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background: #0a111d;
}
.box__minor { fill: none; stroke: rgba(74, 163, 191, 0.26); stroke-width: 1; }
.box__major { fill: none; stroke: rgba(110, 196, 222, 0.5); stroke-width: 1; }
.box__edge  { fill: none; stroke: rgba(120, 205, 230, 0.75); stroke-width: 1.5; }
.tunnel .scene {
    z-index: 1;
    background: transparent;
    perspective-origin: calc(50% + var(--mx) * 10%) calc(50% + var(--my) * 4%);
}
.tunnel .room { transform: none; }
.tunnel .wall { display: none; }
.tunnel .mote, .tunnel .light { display: none; }
.tunnel .wall { box-shadow: inset 0 0 0 2px rgba(120, 205, 230, 0.55); }

/* the box stays fixed; only the stack of sections travels toward the viewer */
.deck {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
}
.tunnel .deck { transform: translateZ(calc(var(--cam) * 1px)); }
.tunnel .wall--back { transform: translateZ(calc(var(--depth) * -1)); }


.tunnel .slide {
    position: absolute;
    left: 50%; top: 50%;
    width: min(1140px, calc(100vw - 48px));
    transform: translate(-50%, -50%) translateZ(calc(var(--z) * 1px)) scale(var(--fit, 1));
    transform-style: preserve-3d;
    min-height: 0;
    padding: 0;
    pointer-events: none;
}
.tunnel .slide > .container { pointer-events: auto; }
.tunnel .slide.is-far, .tunnel .slide.is-past { visibility: hidden; }
.tunnel .slide:not(.is-current) .container * { pointer-events: none; }

.tunnel .slide .sec-head { margin-bottom: 2.2rem; }
.tunnel .hero { display: block; overflow: visible; min-height: 0; padding: 0; }
.tunnel .hero__stage { transform: none; }
.tunnel .scroll-hint { position: static; transform: none; opacity: 1; margin-top: 2rem; }
.tunnel .reveal { opacity: 1; transform: none; transition: none; }
.tunnel .panel {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(12, 18, 30, 0.93);
}
.tunnel .footer { margin-top: 1.6rem; padding: 1.2rem 0 0; }

/* depth label on the side rail */
.rail {
    position: fixed;
    right: 22px;
    top: 50%;
    z-index: 35;
    transform: translateY(-50%);
    display: none;
    flex-direction: column;
    gap: 14px;
    pointer-events: none;
}
.tunnel .rail { display: flex; }
.rail a {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    font: 500 10px/1 var(--mono);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #5c6b7d;
    transition: color 0.3s;
}
.rail a i {
    width: 8px; height: 8px;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    background: transparent;
    transition: background 0.3s, box-shadow 0.3s, border-color 0.3s;
}
.rail a.active { color: var(--text); }
.rail a.active i { background: var(--orange); border-color: var(--orange); box-shadow: 0 0 10px var(--orange); }
.rail a span { opacity: 0; transform: translateX(6px); transition: opacity 0.3s, transform 0.3s; }
.rail:hover a span, .rail a.active span { opacity: 1; transform: none; }

/* ───────────────────────────── Builder bot (contact section) – one bot stacks all three boxes in turn */
.build { position: relative; --t: 0s; }
.build__lift {
    position: relative;
    animation: build-fly 1.4s var(--t) cubic-bezier(0.3, 0.8, 0.3, 1) both paused;
}
.build__box { animation: build-settle 0.7s calc(var(--t) + 1.45s) ease-out both paused; }
.bot {
    position: absolute;
    right: -60px;
    top: 50%;
    width: 80px;
    height: 80px;
    margin-top: -40px;
    pointer-events: none;
    filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.55));
    visibility: hidden;   /* each box has its own bot; only one is shown at a time so it reads as a single robot */
    animation:
        bot-exit 0.85s calc(var(--t) + 1.45s) cubic-bezier(0.45, 0, 0.35, 1) both paused,
        bot-vis 2.3s var(--t) linear forwards paused;
}
.build--last .bot {
    animation:
        bot-release 0.9s calc(var(--t) + 1.45s) cubic-bezier(0.4, 0, 0.3, 1) both paused,
        bot-vis-stay 0.05s var(--t) linear forwards paused;
}
.bot svg { width: 100%; height: 100%; overflow: visible; animation: bot-hover 2.6s ease-in-out infinite paused; }
.bot__body   { fill: #16233a; stroke: var(--teal); stroke-width: 1.5; }
.bot__screen { fill: #0b1322; }
.bot__eyes circle { fill: #8fd0e4; animation: bot-blink 4s 2.4s infinite paused; transform-origin: center; }
.bot__chest  { fill: #1e2f4a; }
.bot__dot    { fill: var(--orange); }
.bot__stem   { stroke: var(--teal); stroke-width: 2; stroke-linecap: round; }
.bot__light  { fill: var(--orange); animation: bot-light-work 0.6s var(--t) steps(1) infinite paused; }
.build--last .bot__light { animation: bot-light 2.4s var(--t) steps(1) both paused; }
.bot__arm rect { fill: #243755; stroke: var(--teal); stroke-width: 1.2; }
.bot__claw   { fill: none; stroke: #8fd0e4; stroke-width: 2; stroke-linecap: round; }
.bot__arm    { animation: bot-arm 0.6s calc(var(--t) + 1.45s) ease-out both paused; }
.bot__arm--top    { transform-origin: 36px 32px; --open: -14deg; }
.bot__arm--bottom { transform-origin: 36px 48px; --open: 14deg; }
.bot__jet    { fill: var(--teal); opacity: 0.45; animation: bot-jet 0.18s ease-in-out infinite alternate paused; transform-origin: 55px 62px; }
.bot__jet--core { fill: #ffb45c; opacity: 0.8; }
.spark {
    position: absolute;
    left: var(--sx); top: var(--sy);
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #ffd08a;
    box-shadow: 0 0 10px 2px rgba(255, 180, 92, 0.8);
    opacity: 0;
    pointer-events: none;
    animation: spark 0.6s calc(var(--t) + 1.5s) ease-out forwards paused;
}
/* run when the section is in view (tunnel: current slide, linear: revealed) */
.is-current .build *, .reveal.in .build * { animation-play-state: running; }

/* box starts lying on the ground (--gx/--gy/--gr), gets tugged, then carried up to its slot */
@keyframes build-fly {
    0%   { transform: translate(var(--gx), var(--gy)) rotate(var(--gr)); }
    18%  { transform: translate(var(--gx), calc(var(--gy) - 8px)) rotate(var(--gr)); }
    70%  { transform: translate(12px, 10px) rotate(-1.5deg); }
    100% { transform: translate(0, 0) rotate(0); }
}
@keyframes build-settle {
    0%   { transform: translateY(0); }
    30%  { transform: translateY(7px); }
    60%  { transform: translateY(-3px); }
    100% { transform: translateY(0); }
}
/* fly from the placed box straight to the next box on the ground (--ex/--ey = that box's pick-up spot) */
@keyframes bot-exit {
    0%   { transform: translate(0, 0) rotate(0); }
    30%  { transform: translate(calc(var(--ex) * 0.4 + 26px), calc(var(--ey) * 0.25)) rotate(8deg); }
    100% { transform: translate(var(--ex), var(--ey)) rotate(0); }
}
@keyframes bot-release {
    0%   { transform: translate(0, 0); }
    100% { transform: translate(-150px, 118px); }
}
@keyframes bot-hover {
    0%, 100% { transform: translateY(0) rotate(0); }
    50%      { transform: translateY(-7px) rotate(2deg); }
}
@keyframes bot-arm { to { transform: rotate(var(--open)); } }
@keyframes bot-vis { 0%, 99.9% { visibility: visible; } 100% { visibility: hidden; } }
@keyframes bot-vis-stay { 0%, 100% { visibility: visible; } }
@keyframes bot-jet { from { transform: scaleX(0.85); opacity: 0.35; } to { transform: scaleX(1.1); opacity: 0.6; } }
@keyframes bot-blink { 0%, 92%, 100% { transform: scaleY(1); } 96% { transform: scaleY(0.1); } }
@keyframes bot-light-work { 0% { fill: var(--orange); } 50% { fill: #7a4a14; } }
@keyframes bot-light {
    0%   { fill: var(--orange); }
    15%  { fill: #7a4a14; }
    30%  { fill: var(--orange); }
    45%  { fill: #7a4a14; }
    60%  { fill: var(--orange); }
    75%  { fill: #7a4a14; }
    100% { fill: #28c840; }
}
@keyframes spark {
    0%   { opacity: 1; transform: translate(0, 0) scale(0.6); }
    100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.4); }
}
@media (max-width: 1024px) {
    .bot, .spark { display: none; }
    .build__lift, .build__box { animation: none; }
}
@media (prefers-reduced-motion: reduce) {
    .bot svg, .bot__jet, .bot__eyes circle, .bot__light { animation: none; }
    .build__lift, .build__box, .bot, .bot__arm, .spark { animation-duration: 0.01s; animation-delay: 0s; }
}
