:root {
    --bg: #05070c;
    --bg-soft: #0a0f18;
    --panel: rgba(12, 18, 29, 0.82);
    --panel-solid: #0d1420;
    --line: rgba(148, 163, 184, 0.16);
    --line-strong: rgba(56, 189, 248, 0.38);
    --text: #f8fafc;
    --muted: #aeb8c8;
    --soft: #718096;
    --accent: #38bdf8;
    --accent-2: #34d399;
    --accent-3: #f59e0b;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
    --radius: 8px;
    --container: 1120px;
    --flow-shift: 0;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.13), transparent 31rem),
        radial-gradient(circle at 88% 16%, rgba(52, 211, 153, 0.08), transparent 27rem),
        var(--bg);
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.055) 1px, transparent 1px);
    background-position: -1px -1px;
    background-size: 32px 32px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.45) 58%, transparent 96%);
    z-index: -2;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(56, 189, 248, 0.075) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.075) 1px, transparent 1px);
    background-size: 128px 128px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.58), transparent 78%);
    z-index: -1;
}

a {
    color: inherit;
    text-decoration: none;
}

.icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

svg {
    display: block;
}

svg:not(.integration-svg):not(.icon-sprite) {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.site-shell {
    min-height: 100vh;
    overflow: hidden;
}

.container {
    width: min(100% - 40px, var(--container));
    margin: 0 auto;
}

.main-header {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--line);
    background: rgba(5, 7, 12, 0.8);
    backdrop-filter: blur(18px);
}

.header-content {
    min-height: 74px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 20px;
}

.logo {
    width: 42px;
    height: 42px;
    position: relative;
    display: inline-grid;
    place-items: center;
    border: 2px solid rgba(56, 189, 248, 0.8);
    border-radius: 4px;
    color: #dff8ff;
    background:
        linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
        linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(52, 211, 153, 0.1)),
        #07111d;
    background-size: 6px 6px, 6px 6px, auto, auto;
    font-family: "Courier New", Consolas, monospace;
    font-size: 1.02rem;
    font-weight: 900;
    letter-spacing: -1px;
    line-height: 1;
    text-shadow:
        2px 0 0 rgba(56, 189, 248, 0.26),
        0 2px 0 rgba(52, 211, 153, 0.18);
    box-shadow:
        4px 4px 0 rgba(56, 189, 248, 0.16),
        inset 0 0 0 2px rgba(2, 6, 23, 0.78),
        0 0 28px rgba(56, 189, 248, 0.12);
    image-rendering: pixelated;
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.logo::before,
.logo::after {
    content: "";
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--bg);
}

.logo::before {
    top: -2px;
    right: -2px;
}

.logo::after {
    left: -2px;
    bottom: -2px;
}

.logo:hover {
    transform: translate(-1px, -1px);
    border-color: var(--accent-2);
    box-shadow:
        5px 5px 0 rgba(52, 211, 153, 0.16),
        inset 0 0 0 2px rgba(2, 6, 23, 0.78),
        0 0 34px rgba(56, 189, 248, 0.18);
}

.nav-links {
    justify-self: center;
    display: flex;
    align-items: center;
    gap: 3px;
}

.nav-links a {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    padding: 0 11px;
    border-radius: var(--radius);
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 180ms ease, background 180ms ease;
}

.nav-links a:hover {
    color: var(--text);
    background: rgba(148, 163, 184, 0.08);
}

.header-actions,
.lang-switcher,
.hero-actions,
.contact-actions,
.footer-links {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lang-switcher {
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.68);
}

.lang-btn {
    min-width: 38px;
    min-height: 32px;
    border: 0;
    border-radius: 6px;
    color: var(--muted);
    background: transparent;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
}

.lang-btn.active {
    color: #03111b;
    background: var(--accent);
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.72);
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    background: var(--text);
}

.btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-weight: 800;
    font-size: 0.94rem;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.btn-icon {
    width: 18px;
    height: 18px;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-small {
    min-height: 38px;
    padding: 0 13px;
    font-size: 0.84rem;
}

.btn-primary {
    color: #03111b;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 12px 30px rgba(56, 189, 248, 0.2);
}

.btn-outline,
.btn-ghost {
    border-color: var(--line);
    background: rgba(15, 23, 42, 0.58);
    color: var(--text);
}

.btn-outline:hover,
.btn-ghost:hover {
    border-color: var(--line-strong);
    background: rgba(14, 22, 35, 0.92);
}

.section {
    padding: 90px 0;
}

.section-band {
    padding: 86px 0 72px;
}

.section-muted {
    border-block: 1px solid var(--line);
    background: rgba(2, 6, 23, 0.34);
}

.hero-grid {
    min-height: calc(100vh - 146px);
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(390px, 0.88fr);
    align-items: center;
    gap: 58px;
}

.eyebrow {
    margin: 0 0 14px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    max-width: 650px;
    margin-bottom: 10px;
    font-size: clamp(3rem, 6.4vw, 5rem);
    line-height: 0.98;
    letter-spacing: 0;
}

h2 {
    margin-bottom: 18px;
    font-size: clamp(2rem, 4vw, 3.05rem);
    line-height: 1.07;
    letter-spacing: 0;
}

h3 {
    margin-bottom: 10px;
    font-size: 1.08rem;
}

.role-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0 26px;
}

.role-stack span {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--muted);
    background: rgba(15, 23, 42, 0.55);
    font-size: 0.88rem;
    font-weight: 700;
}

.brand-statement {
    max-width: 680px;
    margin-bottom: 14px;
    color: var(--text);
    font-size: clamp(1.25rem, 2.15vw, 1.65rem);
    font-weight: 700;
    line-height: 1.28;
}

.hero-summary {
    max-width: 690px;
    color: var(--muted);
    font-size: clamp(0.98rem, 1.55vw, 1.08rem);
}

.hero-actions {
    margin-top: 30px;
    flex-wrap: wrap;
}

.system-card,
.case-panel,
.contact-card,
.skill-card,
.tech-grid article {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.system-card {
    position: relative;
    min-height: 470px;
    padding: 22px;
    overflow: hidden;
}

.system-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.045) 1px, transparent 1px);
    background-size: 26px 26px;
}

.system-card::after {
    content: "";
    position: absolute;
    inset: auto -20% -46% 18%;
    height: 58%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.18), transparent 64%);
}

.diagram-header {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    color: var(--muted);
    font-size: 0.88rem;
}

.diagram-header strong {
    color: var(--accent-2);
}

.integration-svg {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 392px;
    margin-top: 12px;
    overflow: visible;
}

.diagram-node rect,
.diagram-service rect {
    stroke-width: 1.2;
}

.diagram-node rect {
    fill: rgba(5, 7, 12, 0.78);
    stroke: rgba(125, 211, 252, 0.45);
}

.diagram-service rect {
    stroke: rgba(167, 243, 208, 0.62);
    fill: #39c6d6;
}

.diagram-node text,
.diagram-service text {
    fill: var(--text);
    font-size: 16px;
    font-weight: 800;
    text-anchor: middle;
    dominant-baseline: middle;
}

.diagram-service text {
    fill: #03111b;
}

.flow-path {
    fill: none;
    stroke-width: 1.7;
    stroke-dasharray: 8 9;
    stroke-dashoffset: var(--flow-shift);
    marker-end: url("#arrowHead");
}

.flow-cyan {
    stroke: rgba(56, 189, 248, 0.88);
}

.flow-green {
    stroke: rgba(52, 211, 153, 0.88);
}

.arrow-fill {
    fill: var(--accent);
}

.section-heading {
    max-width: 790px;
    margin-bottom: 36px;
}

.section-heading h2 {
    margin-bottom: 0;
}

.section-heading p:not(.eyebrow) {
    color: var(--muted);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.skill-card {
    min-height: 238px;
    padding: 22px;
    box-shadow: none;
}

.card-icon {
    width: 24px;
    height: 24px;
    display: block;
    margin-bottom: 28px;
    border: 1px solid rgba(56, 189, 248, 0.55);
    border-radius: 6px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.95), rgba(52, 211, 153, 0.75));
    box-shadow: 0 0 24px rgba(56, 189, 248, 0.18);
}

.skill-card p,
.case-copy p,
.case-points span,
.tech-grid p {
    color: var(--muted);
}

.case-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
    gap: 42px;
    align-items: start;
}

.case-points {
    display: grid;
    gap: 12px;
    margin-top: 30px;
}

.case-points div {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 16px;
    padding: 16px 0;
    border-top: 1px solid var(--line);
}

.case-points strong {
    color: var(--accent-2);
}

.case-panel {
    padding: 24px;
    background: var(--panel-solid);
}

.case-panel ul {
    display: grid;
    gap: 12px;
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
}

.case-panel li {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--muted);
    background: rgba(2, 6, 23, 0.35);
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.tech-grid article {
    min-height: 158px;
    padding: 20px;
    box-shadow: none;
    transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.tech-grid article:hover {
    border-color: var(--line-strong);
    background: rgba(15, 23, 42, 0.9);
    transform: translateY(-2px);
}

.tech-icon {
    width: 44px;
    height: 44px;
    display: inline-grid;
    place-items: center;
    margin-bottom: 18px;
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: var(--radius);
    color: var(--accent);
    background:
        linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(52, 211, 153, 0.08)),
        rgba(2, 6, 23, 0.28);
}

.tech-grid h3 {
    color: var(--text);
}

.tech-grid p {
    margin-bottom: 0;
}

.evolution-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(260px, 360px);
    gap: 44px;
    align-items: start;
}

.timeline {
    position: relative;
    display: grid;
    gap: 10px;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 18px;
    top: 22px;
    bottom: 22px;
    width: 1px;
    background: linear-gradient(var(--accent), var(--accent-2), var(--accent-3));
}

.timeline div {
    position: relative;
    min-height: 54px;
    display: flex;
    align-items: center;
    padding-left: 48px;
}

.timeline div::before {
    content: "";
    position: absolute;
    left: 10px;
    width: 17px;
    height: 17px;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: var(--bg-soft);
}

.timeline span {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-soft);
    color: var(--text);
    font-weight: 800;
}

.contact-section {
    padding-top: 40px;
}

.contact-card {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 26px;
    padding: 30px;
}

.contact-card h2 {
    max-width: 760px;
    margin-bottom: 0;
}

.contact-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.footer {
    border-top: 1px solid var(--line);
    color: var(--soft);
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.2), rgba(5, 7, 12, 0.82)),
        rgba(5, 7, 12, 0.72);
}

.footer-content {
    min-height: 116px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.footer-logo {
    width: 46px;
    height: 46px;
}

.footer p {
    margin: 0;
    font-weight: 800;
    color: var(--text);
}

.footer-brand span {
    display: block;
    margin-top: 2px;
    color: var(--soft);
    font-size: 0.9rem;
}

.footer a {
    color: var(--muted);
    font-weight: 600;
}

.footer-links {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.footer-links a {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.5);
    transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.footer-links a:hover {
    color: var(--text);
    border-color: var(--line-strong);
    background: rgba(14, 22, 35, 0.92);
    transform: translateY(-1px);
}

.footer-links svg {
    width: 18px;
    height: 18px;
    color: var(--accent);
}

@media (max-width: 1000px) {
    .header-content {
        grid-template-columns: auto auto 1fr;
    }

    .menu-toggle {
        display: inline-block;
        order: 2;
    }

    .logo {
        order: 1;
    }

    .header-actions {
        order: 3;
        justify-self: end;
    }

    .nav-links {
        position: absolute;
        top: 74px;
        left: 20px;
        right: 20px;
        display: none;
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 10px;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: rgba(5, 7, 12, 0.96);
        box-shadow: var(--shadow);
    }

    .nav-links.open {
        display: grid;
    }

    .nav-links a {
        justify-content: center;
    }

    .hero-grid,
    .case-layout,
    .evolution-layout,
    .contact-card {
        grid-template-columns: 1fr;
    }

    .hero-grid {
        min-height: auto;
    }

    .system-card {
        min-height: 420px;
    }

    .integration-svg {
        height: 340px;
    }

    .cards-grid,
    .tech-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .contact-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 680px) {
    .container {
        width: min(100% - 28px, var(--container));
    }

    body::before {
        background-size: 28px 28px;
    }

    .header-content {
        min-height: 70px;
        gap: 10px;
    }

    .nav-links {
        top: 70px;
        left: 14px;
        right: 14px;
    }

    .header-actions .btn-small {
        display: none;
    }

    .section,
    .section-band {
        padding: 68px 0;
    }

    h1 {
        font-size: clamp(2.75rem, 13vw, 4rem);
    }

    h2 {
        font-size: clamp(1.82rem, 8vw, 2.45rem);
    }

    .brand-statement {
        font-size: 1.16rem;
    }

    .hero-actions,
    .contact-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .system-card {
        min-height: 340px;
        padding: 16px;
    }

    .diagram-header {
        display: grid;
        gap: 4px;
    }

    .integration-svg {
        height: 265px;
    }

    .diagram-node text,
    .diagram-service text {
        font-size: 15px;
    }

    .cards-grid,
    .tech-grid {
        grid-template-columns: 1fr;
    }

    .skill-card,
    .tech-grid article {
        min-height: auto;
    }

    .case-points div {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .footer-content {
        min-height: 120px;
        align-items: flex-start;
        justify-content: center;
        flex-direction: column;
    }

    .footer-links {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}
