/* ============================================================
   В. В. Мациборка — Strategic Solution Architect
   Light editorial / Swiss-minimal theme
   ============================================================ */

:root {
    /* Surfaces */
    --bg: #fcfcfd;
    --bg-alt: #f6f6f8;
    --surface: #ffffff;

    /* Ink */
    --ink: #16181d;
    --ink-2: #4a505a;
    --ink-3: #868d99;

    /* Lines & accent */
    --line: #e6e7ec;
    --line-strong: #d3d5dd;
    --accent: #2f54d6;
    --accent-2: #7b5cf0;
    --accent-soft: #eef1fc;
    --grad: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 100%);

    /* Type */
    --font-sans: 'Outfit', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-mono: ui-monospace, 'SFMono-Regular', 'JetBrains Mono', Menlo, Consolas, monospace;

    /* Layout */
    --maxw: 1180px;
    --gut: clamp(1.25rem, 5vw, 5rem);
    --radius: 14px;
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

    /* Depth */
    --shadow-sm: 0 1px 2px rgba(22,24,29,0.04), 0 4px 12px rgba(22,24,29,0.05);
    --shadow-md: 0 10px 30px -12px rgba(22,24,29,0.18);
    --shadow-lg: 0 24px 60px -20px rgba(47, 84, 214, 0.25);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.container { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gut); }

/* Shared label / mono eyebrow */
.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-3);
}

/* ---------- Navigation ---------- */
.nav {
    position: fixed;
    inset: 3px 0 auto 0;
    z-index: 100;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.nav.scrolled { border-bottom-color: var(--line); }

.nav__inner {
    max-width: var(--maxw);
    margin-inline: auto;
    padding: 1.1rem var(--gut);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.brand {
    font-weight: 600;
    font-size: 1.02rem;
    letter-spacing: -0.01em;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}
.brand__mark {
    width: 11px; height: 11px;
    border-radius: 3px;
    background: var(--accent);
    transform: rotate(45deg);
}

.nav__links { display: flex; align-items: center; gap: 2rem; }
.nav__links a {
    font-size: 0.92rem;
    color: var(--ink-2);
    font-weight: 500;
    position: relative;
    transition: color 0.2s var(--ease);
}
.nav__links a::after {
    content: '';
    position: absolute;
    left: 0; bottom: -4px;
    width: 0; height: 1.5px;
    background: var(--accent);
    transition: width 0.25s var(--ease);
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { width: 100%; }

.nav__right { display: flex; align-items: center; gap: 1.1rem; }

.lang {
    display: inline-flex;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: 0.72rem;
}
.lang button {
    background: none;
    border: 0;
    padding: 0.32rem 0.6rem;
    cursor: pointer;
    color: var(--ink-3);
    font: inherit;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.lang button.is-active { background: var(--ink); color: #fff; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.62rem 1.15rem;
    border-radius: 999px;
    font-weight: 500;
    font-size: 0.9rem;
    border: 1px solid transparent;
    background: var(--grad);
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s var(--ease), filter 0.2s var(--ease);
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); filter: none; }
.btn--ghost:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); filter: none; }

.nav__toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none; border: 0; cursor: pointer;
    padding: 6px;
}
.nav__toggle span {
    width: 22px; height: 2px; background: var(--ink);
    transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.nav.open .nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.open .nav__toggle span:nth-child(2) { opacity: 0; }
.nav.open .nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { padding: clamp(8rem, 18vh, 12rem) 0 clamp(4rem, 8vh, 6rem); }

.hero__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(2.5rem, 5vw, 4rem);
    align-items: center;
}

/* Portrait */
.hero__portrait { margin: 0; justify-self: center; order: -1; }
.hero__portrait img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 280px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center top;
    filter: drop-shadow(0 24px 36px rgba(22, 24, 29, 0.22));
    /* нижній зріз ілюстрації плавно розчиняється у фоні сторінки */
    -webkit-mask-image: linear-gradient(to bottom, #000 86%, transparent 99%);
            mask-image: linear-gradient(to bottom, #000 86%, transparent 99%);
}

@media (min-width: 920px) {
    .hero__grid { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
    .hero__portrait { order: 0; }
    .hero__portrait img { max-width: 100%; }
}

.hero__title {
    font-size: clamp(2rem, 4.6vw, 3.4rem);
    line-height: 1.05;
    font-weight: 600;
    letter-spacing: -0.03em;
    margin: 1.4rem 0 1rem;
    max-width: 20ch;
}

/* Тези про AI: друкуються по черзі й усі лишаються */
.hero__theses {
    margin: 0 0 1.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.hero__theses li {
    font-size: clamp(1.15rem, 2.4vw, 1.6rem);
    line-height: 1.3;
    min-height: 1.3em; /* резерв висоти: порожні рядки не дають стрибків макета */
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--accent);
}

.hero__lead {
    font-size: clamp(1.05rem, 2vw, 1.3rem);
    color: var(--ink-2);
    max-width: 56ch;
    margin-bottom: 2.4rem;
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }

.hero__meta {
    margin-top: 3.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.5rem 2rem;
}
.meta-item .meta-item__k {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-3);
    display: block;
    margin-bottom: 0.35rem;
}
.meta-item .meta-item__v { font-size: 1.02rem; font-weight: 500; color: var(--ink); }
.meta-item .dot {
    display: inline-block;
    width: 7px; height: 7px; border-radius: 50%;
    background: #18a558; margin-right: 0.45rem;
    box-shadow: 0 0 0 3px color-mix(in srgb, #18a558 18%, transparent);
}

/* ---------- Section scaffold ---------- */
.section { padding: clamp(4.5rem, 9vh, 7rem) 0; border-top: 1px solid var(--line); scroll-margin-top: 84px; }

.section__head {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}
.section__index {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--accent);
    letter-spacing: 0.05em;
}
.section__title {
    font-size: clamp(1.7rem, 3.5vw, 2.5rem);
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* ---------- About ---------- */
.about__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: start;
}
.about__body p { font-size: 1.12rem; color: var(--ink-2); margin-bottom: 1.4rem; }
.about__quote {
    border-left: 2px solid var(--accent);
    padding-left: 1.4rem;
    margin-top: 2rem;
    font-size: 1.25rem;
    color: var(--ink);
    font-weight: 500;
}
.about__aside {
    background: color-mix(in srgb, var(--surface) 75%, transparent);
    backdrop-filter: blur(8px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.8rem;
}
.about__aside h3 { font-size: 0.95rem; margin-bottom: 1.2rem; }
.stat { padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.stat:last-child { border-bottom: 0; padding-bottom: 0; }
.stat:first-child { padding-top: 0; }
.stat__num { font-size: 1.9rem; font-weight: 600; letter-spacing: -0.02em; }
.stat__num span { color: var(--accent); }
.stat__label { font-size: 0.88rem; color: var(--ink-3); }

/* ---------- Skills ---------- */
.skills {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
}
.skill {
    padding: 1.9rem;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    transition: background 0.25s var(--ease);
}
.skill:hover { background: var(--bg-alt); }
.skill__head { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 1.1rem; }
.skill__head .ico { color: var(--accent); width: 1.4rem; text-align: center; }
.ico { display: inline-flex; align-items: center; justify-content: center; }
.skill__head h3 { font-size: 1.05rem; font-weight: 600; }
.skill__list li {
    font-size: 0.94rem;
    color: var(--ink-2);
    padding: 0.32rem 0;
    display: flex;
    gap: 0.55rem;
}
.skill__list li::before { content: '—'; color: var(--ink-3); }

/* ---------- Projects ---------- */
.projects { display: flex; flex-direction: column; }
.project {
    display: grid;
    grid-template-columns: 4rem minmax(0, 1fr) minmax(0, 1.1fr);
    gap: clamp(1rem, 3vw, 2.5rem);
    padding: 2.2rem 0;
    border-top: 1px solid var(--line);
    transition: background 0.25s var(--ease);
}
.project:first-child { border-top: 0; }
.project:hover { background: var(--bg-alt); }
.project__no { font-family: var(--font-mono); font-size: 0.82rem; color: var(--ink-3); padding-top: 0.4rem; }
.project__main h3 { font-size: 1.4rem; font-weight: 600; margin-bottom: 0.7rem; letter-spacing: -0.01em; }
.project__main p { color: var(--ink-2); font-size: 0.98rem; margin-bottom: 1rem; }
.project__tags { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.03em;
    padding: 0.25rem 0.6rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--ink-2);
}
.project__result {
    background: var(--accent-soft);
    border: 1px solid color-mix(in srgb, var(--accent) 14%, transparent);
    border-radius: 12px;
    padding: 1.2rem 1.3rem;
    align-self: start;
}
.project__result .eyebrow { color: var(--accent); margin-bottom: 0.5rem; display: block; }
.project__result p { font-size: 0.96rem; color: var(--ink); margin: 0; }
.projects__more {
    margin-top: 2rem;
    padding-top: 1.6rem;
    border-top: 1px solid var(--line);
    text-align: center;
}
.projects__more a {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    color: var(--ink-2);
    transition: color 0.2s var(--ease);
}
.projects__more a:hover { color: var(--accent); }

/* ---------- Services ---------- */
.section--services { background: var(--bg-alt); }

.services {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.4rem;
}
@media (max-width: 640px) {
    .services { grid-template-columns: 1fr; }
}
@media (min-width: 1080px) {
    .services { grid-template-columns: repeat(4, 1fr); }
}

.service {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.9rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
    transform-style: preserve-3d;
}
.service:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(var(--surface), var(--surface)) padding-box,
                var(--grad) border-box;
    border-color: transparent;
}

.service__head .ico {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent);
    transition: background 0.3s var(--ease), color 0.3s var(--ease);
    transform: translateZ(28px);
}
.service:hover .service__head .ico {
    background: var(--grad);
    color: #fff;
}

.service h3 {
    font-size: 1.12rem;
    font-weight: 600;
    margin: 1.1rem 0 0.5rem;
}

.service p {
    font-size: 0.95rem;
    color: var(--ink-2);
}

/* ---------- Approach ---------- */
.approach { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.6rem; }
.principle { padding-top: 1.3rem; border-top: 2px solid var(--ink); }
.principle h3 { font-size: 1.1rem; margin-bottom: 0.6rem; font-weight: 600; }
.principle p { color: var(--ink-2); font-size: 0.96rem; }

/* ---------- Testimonials ---------- */
.section__lead {
    color: var(--ink-3);
    font-size: 0.97rem;
    max-width: 560px;
    margin-top: .6rem;
    width: 100%;
}

.testi {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.4rem;
    margin-top: 2.5rem;
}
@media (max-width: 900px) {
    .testi { grid-template-columns: 1fr; }
}

.testi__card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.8rem;
    position: relative;
    margin: 0;
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
    transform-style: preserve-3d;
}
.testi__card::before {
    content: '\201C';
    position: absolute;
    top: 0.6rem;
    left: 1.2rem;
    font-size: 4rem;
    line-height: 1;
    color: color-mix(in srgb, var(--accent) 18%, transparent);
    font-family: Georgia, serif;
    pointer-events: none;
}
.testi__card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.testi__stars {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 0.06em;
    color: var(--accent);
    margin-bottom: 1rem;
    transform: translateZ(22px);
}
.testi__stars span { color: var(--ink-3); }

.testi__text {
    font-size: 1rem;
    line-height: 1.65;
    margin: 0 0 1.2rem;
    color: var(--ink);
    font-weight: 400;
}

.testi__meta {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}
.testi__name { font-weight: 600; font-size: 0.96rem; }
.testi__role { font-size: 0.82rem; color: var(--ink-3); }

.testi__more {
    margin-top: 2rem;
    padding-top: 1.6rem;
    border-top: 1px solid var(--line);
    text-align: center;
}
.testi__more a {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    color: var(--ink-2);
    transition: color 0.2s var(--ease);
}
.testi__more a:hover { color: var(--accent); }

/* ---------- Contact / footer ---------- */
.contact { text-align: center; }
.contact__title {
    font-size: clamp(2rem, 5vw, 3.4rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    max-width: 18ch;
    margin: 0 auto 1.2rem;
    line-height: 1.08;
}
.contact__lead { color: var(--ink-2); font-size: 1.1rem; margin-bottom: 2.2rem; }
.contact__actions { display: flex; flex-wrap: wrap; gap: 0.9rem; justify-content: center; }

.foot {
    margin-top: clamp(4rem, 8vh, 6rem);
    padding: 2rem 0;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}
.foot__copy { font-size: 0.85rem; color: var(--ink-3); }
.socials { display: flex; gap: 0.6rem; }
.socials a {
    width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    color: var(--ink-2);
    transition: color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.socials a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
    .about__grid { grid-template-columns: 1fr; }
    .project { grid-template-columns: 1fr; }
    .project__no { padding-top: 0; }
}

@media (max-width: 720px) {
    .nav__toggle { display: flex; }
    .nav__inner { position: relative; z-index: 2; }
    .nav__right { position: relative; z-index: 2; }
    .nav__links {
        /* .nav має backdrop-filter і стає containing block для fixed-нащадків:
           inset:0 розтягнувся б лише на бокс шапки, тому висота — у viewport-одиницях */
        position: fixed;
        inset: 0 0 auto 0;
        height: 100vh;
        height: 100dvh;
        flex-direction: column;
        gap: 0;
        background: color-mix(in srgb, var(--bg) 96%, transparent);
        backdrop-filter: blur(16px);
        padding: 5.5rem var(--gut) 2rem;
        transform: translateY(-100%);
        transition: transform 0.35s var(--ease);
        align-items: stretch;
        z-index: 1;
        overflow-y: auto;
    }
    .nav.open .nav__links { transform: none; }
    .nav__links a { padding: 1rem 0; border-bottom: 1px solid var(--line); font-size: 1.15rem; }
    .nav__links a::after { display: none; }
    .nav__right .btn { display: none; }
    .hero { padding-top: clamp(6.5rem, 14vh, 9rem); }
    .contact__actions .btn { width: min(100%, 360px); justify-content: center; }
    .contact__actions { flex-direction: column; align-items: center; }
}

/* ============================================================
   Corporate polish + animations
   ============================================================ */

/* Top accent + scroll progress */
.topbar {
    position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 150;
    background: var(--line);
}
.scroll-progress {
    position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 151;
    background: linear-gradient(90deg, var(--accent), #5b7bf0);
    transition: width 0.08s linear;
}

/* Subtle hero backdrop for depth */
.hero { position: relative; }
.hero::before {
    content: '';
    position: absolute; inset: 0; z-index: -1;
    background:
        radial-gradient(900px 500px at 85% 0%, rgba(47,84,214,0.10), transparent 60%),
        radial-gradient(700px 400px at 0% 30%, rgba(47,84,214,0.07), transparent 60%),
        radial-gradient(600px 400px at 60% 80%, rgba(123,92,240,0.07), transparent 60%);
    pointer-events: none;
}
.hero::after {
    content: '';
    position: absolute; inset: 0; z-index: -1;
    background-image:
        linear-gradient(rgba(22,24,29,0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(22,24,29,0.035) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(ellipse at 70% 20%, #000 30%, transparent 70%);
            mask-image: radial-gradient(ellipse at 70% 20%, #000 30%, transparent 70%);
    pointer-events: none;
}
.hero__canvas {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ---------- Hero 3D decorative shapes ---------- */
.hero__shapes { position: absolute; inset: 0; z-index: -1; pointer-events: none; perspective: 1200px; }
.shape-wrap { position: absolute; will-change: transform; }
.shape-wrap--cube { top: 10%; right: 5%; }
.shape-wrap--ring { left: 3%; bottom: 14%; perspective: 600px; }
.shape-wrap--orb { top: 14%; left: 52%; }

/* Cube */
.shape--cube {
    width: 116px; height: 116px;
    transform-style: preserve-3d;
    animation: cubeSpin 26s linear infinite;
    /* opacity тут не можна: вона сплющує preserve-3d; прозорість — у кольорах граней */
}
.shape--cube i {
    position: absolute; inset: 0;
    border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
    background: color-mix(in srgb, var(--accent) 2.5%, transparent);
}
.shape--cube i:nth-child(1) { transform: rotateY(0deg)    translateZ(58px); }
.shape--cube i:nth-child(2) { transform: rotateY(90deg)   translateZ(58px); }
.shape--cube i:nth-child(3) { transform: rotateY(180deg)  translateZ(58px); }
.shape--cube i:nth-child(4) { transform: rotateY(-90deg)  translateZ(58px); }
.shape--cube i:nth-child(5) { transform: rotateX(90deg)   translateZ(58px); }
.shape--cube i:nth-child(6) { transform: rotateX(-90deg)  translateZ(58px); }
@keyframes cubeSpin {
    from { transform: rotateX(-16deg) rotateY(0deg); }
    to   { transform: rotateX(-16deg) rotateY(360deg); }
}

/* Ring */
.shape--ring {
    width: 180px; height: 180px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--accent), var(--accent-2), transparent 65%, var(--accent));
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
            mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
    opacity: 0.5;
    animation: ringSpin 18s linear infinite;
}
@keyframes ringSpin {
    from { transform: rotateX(64deg) rotateZ(0deg); }
    to   { transform: rotateX(64deg) rotateZ(360deg); }
}

/* Orb */
.shape--orb {
    width: 54px; height: 54px;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, #ffffff 0%, color-mix(in srgb, var(--accent-2) 70%, #fff) 30%, var(--accent) 85%);
    box-shadow: 0 18px 30px -12px color-mix(in srgb, var(--accent) 45%, transparent);
    opacity: 0.55;
    animation: floatY 9s ease-in-out infinite;
}

/* Adaptive: tablet/mobile */
@media (max-width: 919px) {
    .shape-wrap--ring,
    .shape-wrap--orb { display: none; }
    .shape--cube { width: 72px; height: 72px; }
    .shape--cube i {
        border-color: color-mix(in srgb, var(--accent) 13%, transparent);
        background: color-mix(in srgb, var(--accent) 1.5%, transparent);
    }
    .shape--cube i:nth-child(1) { transform: rotateY(0deg)    translateZ(36px); }
    .shape--cube i:nth-child(2) { transform: rotateY(90deg)   translateZ(36px); }
    .shape--cube i:nth-child(3) { transform: rotateY(180deg)  translateZ(36px); }
    .shape--cube i:nth-child(4) { transform: rotateY(-90deg)  translateZ(36px); }
    .shape--cube i:nth-child(5) { transform: rotateX(90deg)   translateZ(36px); }
    .shape--cube i:nth-child(6) { transform: rotateX(-90deg)  translateZ(36px); }
    .shape-wrap--cube { top: 6%; right: 2%; }
}

.hero__portrait { position: relative; }
.hero__portrait img { will-change: transform; }

/* ---------- Preloader ---------- */
/* Без JS прелоадер не показуємо (нема кому його сховати) */
.preloader { display: none; }
.js .preloader {
    display: flex;
    position: fixed; inset: 0; z-index: 1000;
    background: var(--bg);
    align-items: center; justify-content: center;
    transition: opacity 0.5s var(--ease), visibility 0.5s var(--ease);
}
.preloader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader__inner { display: flex; flex-direction: column; align-items: center; gap: 1.1rem; }
.preloader__mark {
    width: 26px; height: 26px;
    border-radius: 7px;
    background: var(--grad);
    transform: rotate(45deg);
    animation: preloaderPulse 1.1s ease-in-out infinite;
}
.preloader__text { font-weight: 600; font-size: 1.02rem; letter-spacing: -0.01em; }
.preloader__bar {
    width: 140px; height: 2px;
    background: var(--line);
    border-radius: 2px;
    overflow: hidden;
}
.preloader__bar i {
    display: block; height: 100%; width: 40%;
    background: var(--grad);
    border-radius: 2px;
    animation: preloaderBar 1.2s ease-in-out infinite;
}
@keyframes preloaderPulse { 0%,100% { transform: rotate(45deg) scale(1); } 50% { transform: rotate(45deg) scale(1.22); } }
@keyframes preloaderBar { from { transform: translateX(-110%); } to { transform: translateX(360%); } }

/* ---------- Hero entrance (staggered) ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes sheen { to { background-position: 200% center; } }

/* До повного завантаження (html.loaded) hero прихований, анімації не стартують.
   Після завантаження зʼявляються eyebrow, заголовок і тези (вони друкуються);
   фото, лід, кнопки й мета чекають на html.typed — кінець друку. */
.js .hero .eyebrow,
.js .hero__title,
.js .hero__theses,
.js .hero__lead,
.js .hero__actions,
.js .hero__meta,
.js .hero__portrait { opacity: 0; }
.js.loaded .hero .eyebrow,
.js.loaded .hero__title,
.js.loaded .hero__theses { animation: fadeUp 0.7s var(--ease) forwards; }
.js.loaded .hero .eyebrow   { animation-delay: 0.05s; }
.js.loaded .hero__title     { animation-delay: 0.15s; }
.js.loaded .hero__theses    { animation-delay: 0.25s; }
.js.typed .hero__lead,
.js.typed .hero__actions,
.js.typed .hero__meta,
.js.typed .hero__portrait { animation: fadeUp 0.7s var(--ease) forwards; }
.js.typed .hero__portrait { animation-delay: 0.05s; }
.js.typed .hero__lead     { animation-delay: 0.15s; }
.js.typed .hero__actions  { animation-delay: 0.30s; }
.js.typed .hero__meta     { animation-delay: 0.45s; }

@media (min-width: 920px) {
    .hero__portrait img { animation: floatY 7s ease-in-out 1.2s infinite; }
}


/* ---------- Trust band ---------- */
.trust {
    background: var(--bg-alt);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: clamp(2.2rem, 5vw, 3.2rem) 0;
}
.trust__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem 2rem;
}
.trust__item { text-align: left; position: relative; padding-left: 1.2rem; }
.trust__item::before {
    content: ''; position: absolute; left: 0; top: 4px; bottom: 4px;
    width: 2px; background: var(--accent); border-radius: 2px;
}
.trust__num {
    font-size: clamp(2.1rem, 4vw, 2.9rem);
    font-weight: 600; letter-spacing: -0.02em; line-height: 1;
    color: var(--ink); display: flex; align-items: baseline;
}
.trust__num i { font-style: normal; color: var(--accent); font-size: 0.7em; margin-left: 2px; }
.trust__label { margin-top: 0.45rem; color: var(--ink-2); font-size: 0.92rem; }

/* ---------- Clients marquee ---------- */
.clients { padding: clamp(2.5rem, 5vw, 3.5rem) 0 clamp(3rem, 6vw, 4rem); }
.clients__eyebrow { text-align: center; margin-bottom: 1.6rem; }
.marquee {
    position: relative; overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
            mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    display: flex; width: 100%;
}
.marquee__track {
    display: flex; flex-shrink: 0; align-items: center;
    gap: 3rem; padding-right: 3rem;
    /* вміст треку подвоєний (безшовне коло), тому тривалість удвічі більша за базову */
    animation: marquee 56s linear infinite;
    white-space: nowrap;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__track li {
    display: inline-flex; align-items: center; gap: 0.6rem;
    font-size: clamp(1.05rem, 2vw, 1.45rem); font-weight: 500;
    color: var(--ink-2); letter-spacing: -0.01em;
}
.marquee__track .flag { font-size: 1.3em; line-height: 1; }
@keyframes marquee { to { transform: translateX(-100%); } }

/* Tech marquee */
.marquee--tech { margin-top: 1.1rem; }
.marquee--tech .marquee__track {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-3);
    gap: 2.2rem;
    animation-duration: 48s;
}
.marquee__track--reverse { animation-direction: reverse; }
.marquee--tech li {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.85rem;
    font-weight: 400;
}
.marquee--tech li::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.5;
    flex-shrink: 0;
}

/* ---------- Card & button polish ---------- */
.skill { position: relative; }
.skill::before {
    content: ''; position: absolute; left: 0; top: -1px; height: 2px; width: 0;
    background: var(--accent); transition: width 0.35s var(--ease);
}
.skill:hover::before { width: 100%; }

.project { position: relative; }
.project::before {
    content: ''; position: absolute; left: 0; top: -1px; height: 2px; width: 0;
    background: var(--accent); transition: width 0.4s var(--ease);
}
.project:hover::before { width: 64px; }

.about__aside { box-shadow: var(--shadow-sm); transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease); }
.about__aside:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

.principle { transition: transform 0.3s var(--ease); }
.principle:hover { transform: translateY(-4px); }

.btn { position: relative; overflow: hidden; }
.btn::after {
    content: ''; position: absolute; top: 0; left: -120%; width: 60%; height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,0.35), transparent);
    transition: left 0.6s var(--ease);
}
.btn:hover::after { left: 140%; }

/* ---------- Staggered reveal for grids (двосторонній: поява і зникнення) ----------
   Transitions замість keyframes: при знятті .is-visible елементи так само плавно ховаються. */

/* Елементи без власних transform-ефектів: випливають знизу */
.js .skills .skill,
.js .projects .project,
.js .about__grid > *,
.js .trust__item {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.section.is-visible .skill,
.section.is-visible .project,
.section.is-visible .about__grid > *,
.trust.is-visible .trust__item { opacity: 1; transform: none; }

/* Картки з tilt/hover-трансформами: ховаємо лише прозорістю,
   transform лишається швидким (0.3s) для tilt і hover */
.js .services .service,
.js .testi .testi__card {
    opacity: 0;
    transition: opacity 0.6s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.js .approach .principle {
    opacity: 0;
    transition: opacity 0.6s var(--ease), transform 0.3s var(--ease);
}
.section.is-visible .service,
.section.is-visible .testi__card,
.section.is-visible .principle { opacity: 1; }

/* Каскадні затримки — лише на появу; зникають всі одночасно без затримки */
.section.is-visible .skill:nth-child(2),
.section.is-visible .project:nth-child(2),
.trust.is-visible .trust__item:nth-child(2) { transition-delay: 0.08s; }
.section.is-visible .skill:nth-child(3),
.section.is-visible .project:nth-child(3),
.trust.is-visible .trust__item:nth-child(3) { transition-delay: 0.16s; }
.section.is-visible .skill:nth-child(4),
.section.is-visible .project:nth-child(4),
.trust.is-visible .trust__item:nth-child(4) { transition-delay: 0.24s; }
.section.is-visible .skill:nth-child(5) { transition-delay: 0.32s; }
.section.is-visible .skill:nth-child(6) { transition-delay: 0.40s; }
/* для карток затримка діє тільки на opacity (transform/тінь реагують миттєво) */
.section.is-visible .service:nth-child(2),
.section.is-visible .testi__card:nth-child(2) { transition-delay: 0.08s, 0s, 0s, 0s, 0s; }
.section.is-visible .service:nth-child(3),
.section.is-visible .testi__card:nth-child(3) { transition-delay: 0.16s, 0s, 0s, 0s, 0s; }
.section.is-visible .service:nth-child(4) { transition-delay: 0.24s, 0s, 0s, 0s, 0s; }
.section.is-visible .principle:nth-child(2) { transition-delay: 0.10s, 0s; }
.section.is-visible .principle:nth-child(3) { transition-delay: 0.20s, 0s; }
.section.is-visible .principle:nth-child(4) { transition-delay: 0.30s, 0s; }

/* Каретка на рядку, що друкується */
.hero__theses li.typing::after {
    content: '';
    display: inline-block;
    width: 2px;
    height: 0.95em;
    margin-left: 3px;
    background: var(--accent);
    vertical-align: -0.1em;
    animation: caretBlink 1s steps(1) infinite;
}
@keyframes caretBlink { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; animation: none !important; }
    .reveal { opacity: 1; transform: none; transition: none; }
    .btn:hover, .socials a:hover { transform: none; }
    .js .hero .eyebrow, .js .hero__title, .js .hero__theses, .js .hero__lead,
    .js .hero__actions, .js .hero__meta, .js .hero__portrait,
    .js .skills .skill, .js .approach .principle, .js .projects .project,
    .js .about__grid > *, .js .services .service, .js .trust__item,
    .js .testi .testi__card { opacity: 1 !important; transform: none !important; transition: none !important; }
    .marquee__track { animation: none; }
    .marquee__track--reverse { animation: none; }
    .service:hover, .testi__card:hover { transform: none; }
    .hero__theses li.typing::after { display: none; }
}
