:root {
    --bg: #f7f7f5;
    --text: #141414;
    --muted: #5c5c5c;
    --border: #e7e4e1;
    --accent: #8f1d24;
    --accent-2: #5b3db5;
    --surface: #ffffff;
    --surface-soft: rgba(255, 255, 255, 0.9);
    --surface: #ffffff;
    --surface-soft: rgba(255, 255, 255, 0.9);
    --glass: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(231, 228, 225, 0.7);
    --shadow-sm: 0 6px 18px rgba(20, 20, 20, 0.08);
    --shadow-md: 0 14px 40px rgba(20, 20, 20, 0.12);
    --radius-lg: 22px;
    --radius-md: 18px;
    --headline-rest-color: rgba(20, 20, 20, 0.7);
    --space-1: 8px;
    --space-2: 16px;
    --space-3: 24px;
    --space-4: 32px;
    --space-5: 48px;
    --space-6: 64px;
    --space-7: 80px;
    --space-8: 112px;
    --transition: 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Inter", sans-serif;
    background: radial-gradient(circle at 15% 20%, rgba(143, 29, 36, 0.08), transparent 42%), radial-gradient(circle at 85% 10%, rgba(91, 61, 181, 0.08), transparent 36%), radial-gradient(circle at 50% 80%, rgba(20, 20, 20, 0.04), transparent 40%), var(--bg);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

body.dark {
    --bg: #0b0f14;
    --text: #e6edf3;
    --muted: #9aa4b2;
    --border: #1f2a37;
    --accent: #c43d45;
    --accent-2: #7c6cff;
    --surface: #111827;
    --surface-soft: rgba(17, 24, 39, 0.92);
    --glass: rgba(17, 24, 39, 0.55);
    --glass-border: rgba(148, 163, 184, 0.2);
    --shadow-sm: 0 8px 20px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 18px 50px rgba(0, 0, 0, 0.55);
    --headline-rest-color: #fff;
    background: radial-gradient(circle at 20% 10%, rgba(124, 108, 255, 0.18), transparent 42%), radial-gradient(circle at 80% 0%, rgba(196, 61, 69, 0.18), transparent 36%), radial-gradient(circle at 50% 80%, rgba(255, 255, 255, 0.04), transparent 40%), var(--bg);
}

h1,
h2,
h3 {
    font-family: "Plus Jakarta Sans", sans-serif;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2rem, 3vw, 3.2rem);
    line-height: 1.08;
}

h2 {
    font-size: clamp(1.6rem, 2.2vw, 2.2rem);
    line-height: 1.15;
}

p {
    font-size: 1.02rem;
    color: var(--muted);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button {
    border: none;
    background: none;
    font: inherit;
    cursor: pointer;
}

.container {
    width: min(1120px, 92%);
    margin: 0 auto;
}

.page-noise {
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.06'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

.floating-nodes {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
    opacity: 0.35;
    transform: translateY(var(--nodes-parallax, 0px));
}

.floating-nodes::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(20, 20, 20, 0.08) 1px, transparent 1px);
    background-size: 120px 120px;
    opacity: 0.35;
}

.node {
    position: absolute;
    top: 0;
    left: 0;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    box-shadow: 0 10px 26px rgba(20, 20, 20, 0.12);
    display: grid;
    place-items: center;
    pointer-events: none;
    transition: transform var(--transition);
}

.node svg {
    width: 26px;
    height: 26px;
    stroke: var(--accent);
    stroke-width: 1.6;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.node:nth-child(3n) svg {
    stroke: var(--accent-2);
}

.node::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 12px);
    transform: translateX(-50%);
    background: rgba(20, 20, 20, 0.9);
    color: #fff;
    font-size: 0.78rem;
    padding: 6px 10px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.node.is-hovered::after {
    opacity: 1;
}

.icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(247, 247, 245, 0.82);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

body.dark .site-header {
    background: rgba(16, 16, 16, 0.82);
}

.site-header.scrolled {
    box-shadow: var(--shadow-sm);
    border-color: var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
}

.logo {
    font-weight: 700;
    font-size: 1.2rem;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 38px;
    height: 38px;
    padding: 0;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.theme-icon {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
}

.theme-icon svg {
    width: 18px;
    height: 18px;
    stroke: var(--text);
    stroke-width: 1.7;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.theme-icon--sun {
    display: none;
}

body.dark .theme-icon--sun {
    display: grid;
}

body.dark .theme-icon--moon {
    display: none;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: var(--space-3);
}

.nav-links a {
    color: var(--muted);
    transition: color var(--transition);
    position: relative;
}

.nav-links a.active,
.nav-links a:hover,
.nav-links a:focus {
    color: var(--text);
}

.nav-toggle {
    display: none;
}

.header-cta {
    display: none;
}

.hero {
    padding: var(--space-7) 0 var(--space-6);
    position: relative;
    z-index: 2;
}

.hero-grid {
    display: grid;
    gap: var(--space-5);
}

.hero-content {
    max-width: 640px;
}

.hero-headline {
    display: block;
}

.portrait-inline {
    display: none;
    width: 110px;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.headline-first,
.headline-rest {
    display: block;
}

.subheadline {
    margin: var(--space-3) 0;
    max-width: 60ch;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.chip {
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    font-size: 0.9rem;
    color: var(--text);
}

.stat-row {
    margin-bottom: var(--space-3);
    font-weight: 600;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    border-radius: 999px;
    font-weight: 600;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 10px 24px rgba(143, 29, 36, 0.3);
}

.btn-primary::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: translateX(-120%);
    transition: var(--transition);
}

.btn-primary:hover::after,
.btn-primary:focus::after {
    transform: translateX(120%);
}

.btn-secondary {
    border: 1px solid var(--border);
    color: var(--text);
    background: var(--surface);
}

.header-cta {
    padding: 8px 14px;
    font-size: 0.88rem;
    box-shadow: 0 8px 18px rgba(143, 29, 36, 0.24);
}

.btn-tertiary {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 16px;
    font-size: 0.92rem;
    color: var(--text);
    background: transparent;
}

.btn:hover,
.btn:focus {
    transform: translateY(-2px) scale(1.01);
}

.hero-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
}

.portrait-wrap {
    position: relative;
    width: min(440px, 90vw);
    padding: 18px;
    border-radius: 26px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-md);
}

.portrait-halo {
    position: absolute;
    inset: -8% -8% -4% -8%;
    background: radial-gradient(circle at top, rgba(143, 29, 36, 0.25), transparent 60%), radial-gradient(circle at bottom, rgba(91, 61, 181, 0.2), transparent 60%);
    filter: blur(6px);
    z-index: 0;
}

.portrait {
    position: relative;
    z-index: 1;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    animation: float 7s ease-in-out infinite;
}

.trust-line {
    font-size: 0.95rem;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.trust-line a {
    color: var(--text);
    font-weight: 600;
}

.section {
    padding: var(--space-6) 0;
    position: relative;
    z-index: 2;
}

.section-heading {
    display: inline-flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: var(--space-4);
}

.heading-underline {
    width: 54px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), transparent);
}

.cards-grid {
    display: grid;
    gap: var(--space-3);
}

.card {
    padding: var(--space-3);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface-soft);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: grid;
    place-items: center;
    margin-bottom: var(--space-2);
    background: var(--surface);
}

.icon svg {
    width: 22px;
    height: 22px;
    stroke: var(--accent);
    stroke-width: 1.6;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.examples {
    display: block;
    margin-top: 8px;
    font-size: 0.92rem;
    color: var(--muted);
}

.case-thumb {
    width: 100%;
    border-radius: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.cta-line {
    margin-top: var(--space-3);
    font-weight: 600;
}

.cta-line a {
    color: var(--accent);
}

.badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-2);
}

.badge {
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    text-align: center;
    font-weight: 600;
    font-size: 0.92rem;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.badge-wide {
    padding: 10px 18px;
}

.process-grid {
    display: grid;
    gap: var(--space-3);
}

.process-step {
    padding: var(--space-3);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface);
}

.step-number {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-2);
}

.testimonials-grid .card {
    min-height: 160px;
}

.testimonial-name {
    display: block;
    margin-top: var(--space-2);
    font-weight: 600;
    color: var(--text);
}

.about-grid {
    display: grid;
    gap: var(--space-3);
    align-items: start;
}

.about-list {
    list-style: none;
    display: grid;
    gap: 12px;
}

.about-list li::before {
    content: "•";
    color: var(--accent);
    margin-right: 8px;
}

.contact-grid {
    display: grid;
    gap: var(--space-4);
}

.contact-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    box-shadow: var(--shadow-sm);
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: var(--space-3);
}

input,
select,
textarea {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 1rem;
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus,
a:focus,
button:focus {
    outline: 2px solid rgba(143, 29, 36, 0.4);
    outline-offset: 2px;
}

.form-success {
    display: none;
    margin-top: var(--space-2);
    color: var(--accent);
    font-weight: 600;
}

.form-success.show {
    display: block;
}

.footer {
    padding: var(--space-4) 0;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.footer-inner {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    align-items: flex-start;
}

.footer-links {
    display: flex;
    gap: var(--space-2);
}

.footer-contacts {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 600;
    color: var(--text);
}

.footer-contacts a {
    color: var(--text);
}

.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: grid;
    place-items: center;
    box-shadow: var(--shadow-md);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    z-index: 1000;
}

.back-to-top.show {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    z-index: 1200;
}

.modal.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: min(640px, 92%);
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    box-shadow: var(--shadow-md);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    font-size: 1.4rem;
}

.contact-choice-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: var(--transition);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.work-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 16px;
}

.work-stack span {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text);
}

@media (min-width: 900px) {
    .hero-grid {
        grid-template-columns: 1.2fr 0.8fr;
        align-items: center;
    }
    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .process-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .about-grid,
    .contact-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .header-cta {
        display: inline-flex;
    }
    .floating-nodes .node:nth-child(n+13) {
        display: none;
    }
    .header-actions {
        order: 2;
    }
    .theme-toggle {
        order: 3;
    }
}

@media (max-width: 899px) {
    .header-cta {
        display: inline-flex;
    }
    .header-controls {
        gap: 10px;
    }
    .header-actions {
        order: 1;
    }
    .theme-toggle {
        order: 2;
    }
    .nav {
        order: 3;
    }
    .nav-links {
        position: absolute;
        top: 64px;
        right: 4%;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-md);
        padding: var(--space-3);
        flex-direction: column;
        gap: var(--space-2);
        min-width: 220px;
        display: none;
    }
    .nav-links.open {
        display: flex;
    }
    .nav-toggle {
        display: inline-flex;
        width: 40px;
        height: 40px;
        align-items: center;
        justify-content: center;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: var(--surface);
    }
    .hamburger {
        width: 20px;
        height: 2px;
        background: var(--text);
        position: relative;
    }
    .hamburger::before,
    .hamburger::after {
        content: "";
        position: absolute;
        width: 20px;
        height: 2px;
        background: var(--text);
        left: 0;
        transition: var(--transition);
    }
    .hamburger::before {
        top: -6px;
    }
    .hamburger::after {
        top: 6px;
    }
    .nav-toggle[aria-expanded="true"] .hamburger {
        background: transparent;
    }
    .nav-toggle[aria-expanded="true"] .hamburger::before {
        transform: rotate(45deg) translate(4px, 4px);
    }
    .nav-toggle[aria-expanded="true"] .hamburger::after {
        transform: rotate(-45deg) translate(4px, -4px);
    }
    .hero {
        padding-top: var(--space-6);
    }
    .hero-visual {
        display: none;
    }
    .hero-content {
        order: 1;
    }
    .hero-headline {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 14px;
        align-items: center;
    }
    .portrait-inline {
        display: block;
        width: min(300px, 84vw);
        border-radius: 18px;
        box-shadow: var(--shadow-md);
    }
    .hero-headline h1 {
        font-size: clamp(1.55rem, 4.4vw, 2.05rem);
        line-height: 1.1;
        max-width: 16ch;
    }
    .headline-rest {
        font-size: clamp(0.9rem, 3vw, 1.1rem);
        line-height: 1.25;
        color: var(--headline-rest-color);
    }
    .subheadline {
        color: var(--text);
    }
    .floating-nodes .node:nth-child(n+6) {
        display: none;
    }
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
    html {
        scroll-behavior: auto;
    }
}
