:root {
    --bg: #050914;
    --card: #0b1223e8;
    --line: #ffffff1f;
    --text: #f8fbff;
    --muted: #b8c0d0;
    --p: #7cffb2;
    --s: #60d9ff;
    --y: #ffd36a;
    --r: #ff7b8a;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, Arial, sans-serif;
    line-height: 1.6;
}

body.backend { --p: #60d9ff; --s: #b59cff; }
body.frontend { --p: #ffd36a; --s: #ff9bd2; }

a { color: inherit; }

#bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.wrap {
    position: relative;
    z-index: 1;
    width: min(1240px, calc(100% - 28px));
    margin: auto;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 10px;
    z-index: 100;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--p);
    color: #061019;
    font-weight: 900;
}

.skip-link:focus { left: 12px; }

.nav {
    position: sticky;
    top: 10px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 14px auto 24px;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #08101fe8;
    backdrop-filter: blur(16px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
    font-weight: 950;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ffffff25;
}

.admin-avatar {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--p), var(--s));
    color: #061019;
    font-weight: 900;
}

.links,
.badges,
.chips,
.actions,
.filters {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
}

.links { gap: 8px; }
.actions, .badges, .chips, .filters { margin-top: 16px; }
.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    border: 1px solid var(--line);
    border-radius: 999px;
}

.lang-switch a {
    padding: 7px 9px;
    border-radius: 999px;
}

.lang-switch a.active {
    background: linear-gradient(135deg, var(--p), var(--s));
    color: #061019;
}

.links a,
.links button,
.btn,
.inline-form button {
    padding: 10px 13px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-decoration: none;
    font: inherit;
    font-size: 13px;
    font-weight: 850;
}

.links a:hover,
.links button:hover,
.inline-form button:hover,
.btn.primary {
    background: linear-gradient(135deg, var(--p), var(--s));
    color: #061019;
}

.inline-form { display: inline; }

.hero {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 22px;
}

.card {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, #0b1223e8, #080d1ad6);
    box-shadow: 0 24px 80px #0006;
    backdrop-filter: blur(18px);
}

.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: .65s ease;
}

.reveal.visible {
    opacity: 1;
    transform: none;
}

.hero-inner {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 24px;
    align-items: start;
}

.photo {
    width: 180px;
    height: 220px;
    border: 1px solid var(--line);
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 22px 48px #0006;
}

.badge,
.chip {
    padding: 8px 10px;
    border: 1px solid #ffffff17;
    border-radius: 999px;
    background: #ffffff12;
    font-size: 12px;
    font-weight: 850;
}

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--p);
    font-size: 12px;
    font-weight: 950;
    letter-spacing: .8px;
    text-transform: uppercase;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--p);
    box-shadow: 0 0 18px var(--p);
    animation: pulse 1.4s infinite;
}

@keyframes pulse { 50% { transform: scale(1.65); } }

h1 {
    margin: 8px 0 16px;
    font-size: 4rem;
    line-height: .95;
    letter-spacing: 0;
}

h1 span,
.grad {
    color: transparent;
    background: linear-gradient(90deg, var(--p), var(--s), var(--y));
    -webkit-background-clip: text;
    background-clip: text;
}

h2, h3 { line-height: 1.15; }

.lead {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 850;
    line-height: 1.45;
}

.muted { color: var(--muted); }

.quick {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.quick .line strong {
    color: var(--y);
    font-size: 23px;
}

.line {
    margin: 8px 0;
    padding: 12px;
    border: 1px solid #ffffff12;
    border-radius: 8px;
    background: #00000022;
}

.success { border-color: #7cffb280; }
.error { border-color: #ff7b8a80; }

.form {
    display: grid;
    gap: 12px;
}

.form input,
.form textarea,
.form select,
.cmd input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff0f;
    color: white;
}

.form textarea { min-height: 130px; }
.form select option {
    background: #091225;
    color: var(--text);
}

.form-fieldset {
    display: grid;
    gap: 12px;
    margin: 0;
}

.form-fieldset legend {
    padding: 0 6px;
    color: var(--p);
    font-weight: 900;
}

.honeypot { position: absolute; left: -9999px; }

.grid {
    display: grid;
    gap: 16px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

section { margin: 22px 0; }

.title {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.title h2 {
    margin: 0;
    font-size: 2.35rem;
    line-height: 1;
}

.project,
.proof,
.article,
.arch-node,
.step {
    cursor: pointer;
    transition: .22s;
}

.project:hover,
.proof:hover,
.article:hover,
.arch-node:hover,
.step.live {
    transform: translateY(-4px);
    border-color: #7cffb280;
    box-shadow: 0 22px 70px #7cffb21f;
}

.proof img,
.proof video,
.project img {
    width: 100%;
    height: 190px;
    border: 1px solid var(--line);
    border-radius: 8px;
    object-fit: cover;
    background: #fff;
}

.proof.arch img {
    object-fit: contain;
    padding: 8px;
    background: white;
}

.project-card {
    display: flex;
    flex-direction: column;
}

.project-card .actions { margin-top: auto; }

.recruiter-strip .title { align-items: center; }

.case-hero {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 22px;
    align-items: start;
}

.case-cover {
    width: 100%;
    max-height: 360px;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.case-facts { margin: 18px 0; }
.case-section { margin-top: 20px; }

.contact-layout {
    display: grid;
    grid-template-columns: .9fr 1.1fr;
    gap: 26px;
}

.contact-facts { grid-template-columns: 1fr; }
.contact-facts a { color: inherit; }

.article-detail,
.prose { max-width: 900px; }

.soft-rule {
    border: 0;
    border-top: 1px solid #ffffff22;
    margin: 24px 0;
}

.arch-wrap {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 16px;
    align-items: start;
}

.arch-scroll {
    overflow-x: auto;
    padding-bottom: 10px;
    border-radius: 8px;
}

.arch-canvas {
    position: relative;
    min-width: 1180px;
    height: 760px;
    border: 1px solid #ffffff14;
    border-radius: 8px;
    background: #00000024;
    overflow: hidden;
}

.arch-canvas::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(#60d9ff11 1px, transparent 1px), linear-gradient(90deg, #60d9ff11 1px, transparent 1px);
    background-size: 42px 42px;
}

.arch-title {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 16px;
    border: 1px solid #60d9ff40;
    border-radius: 999px;
    background: #ffffff12;
    font-weight: 950;
}

.arch-node {
    position: absolute;
    width: 160px;
    min-height: 94px;
    padding: 14px;
    border: 1px solid #60d9ff3a;
    border-radius: 8px;
    background: #07101fe6;
}

.arch-node small { color: var(--muted); }
.arch-node.wide { width: 240px; }
.arch-node.tall { height: 142px; }
.arch-node b { display: block; margin-bottom: 5px; }

.arch-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.arch-svg line {
    stroke: #60d9ff99;
    stroke-width: 2;
    stroke-dasharray: 8;
    animation: dash 12s linear infinite;
}

@keyframes dash { to { stroke-dashoffset: -220; } }

.mobile-arch { display: none; }

.pipeline {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 18px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 9px;
}

.step,
.mobile-box {
    padding: 12px;
    border: 1px solid #ffffff17;
    border-radius: 8px;
    background: #ffffff12;
    text-align: center;
}

.detail {
    position: sticky;
    top: 90px;
}

.terminal {
    min-height: 200px;
    padding: 14px;
    border: 1px solid #ffffff12;
    border-radius: 8px;
    background: #00000033;
    color: #dfe7f5;
    white-space: pre-wrap;
    font-family: ui-monospace, Menlo, Consolas, monospace;
}

.metric {
    margin: 10px 0;
    padding: 12px;
    border: 1px solid #ffffff12;
    border-radius: 8px;
    background: #ffffff0f;
}

.bar {
    height: 8px;
    border-radius: 999px;
    background: #ffffff14;
    overflow: hidden;
}

.bar i {
    display: block;
    height: 100%;
    width: var(--v);
    border-radius: 999px;
    background: linear-gradient(90deg, var(--p), var(--s));
}

.dash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.spark {
    width: 100%;
    height: 70px;
}

.modal,
.cmd {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: none;
    place-items: center;
    padding: 16px;
    background: #000b;
    backdrop-filter: blur(10px);
}

.modal.open,
.cmd.open { display: grid; }

.modal-card,
.cmd-card {
    width: min(860px, 100%);
    max-height: 90vh;
    overflow: auto;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #091225;
    box-shadow: 0 30px 120px #0009;
}

.modal-media img,
.modal-media video {
    width: 100%;
    max-height: 470px;
    object-fit: contain;
    border-radius: 8px;
    background: #000;
}

.modal-media.arch img {
    padding: 10px;
    background: #fffffff0;
}

.close {
    float: right;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #ffffff14;
    color: white;
    font-size: 20px;
}

.cmd input { margin-bottom: 10px; }

.cmd a {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
    padding: 13px;
    border-radius: 8px;
    background: #ffffff10;
    text-decoration: none;
}

.table-wrap { overflow-x: auto; }

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table td,
.admin-table th {
    padding: 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

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

.link-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--s);
    cursor: pointer;
    font: inherit;
    text-decoration: underline;
}

.checkbox-line {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-card {
    max-width: 520px;
    margin: 40px auto;
}

.footer {
    padding: 34px 0;
    color: var(--muted);
}

.mobile-contact {
    position: fixed;
    left: 10px;
    right: 64px;
    bottom: 12px;
    z-index: 40;
    display: none;
    gap: 8px;
}

.mobile-contact a {
    flex: 1;
    min-width: 0;
    padding: 11px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--p), var(--s));
    color: #061019;
    text-align: center;
    text-decoration: none;
    font-weight: 900;
}

.back {
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 40;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--p), var(--s));
    color: #061019;
    text-decoration: none;
    font-weight: 900;
}

@media (max-width: 1100px) {
    .hero,
    .arch-wrap,
    .grid-3,
    .grid-2,
    .grid-4 { grid-template-columns: 1fr 1fr; }

    .arch-wrap { grid-template-columns: 1fr; }
    .detail { position: static; }
    .arch-scroll { overflow-x: auto; }
    .hero-inner { grid-template-columns: 160px 1fr; }
    .photo { width: 160px; height: 200px; }
}

@media (max-width: 760px) {
    .wrap { width: min(100% - 20px, 1240px); }

    .hero,
    .hero-inner,
    .grid-3,
    .grid-2,
    .grid-4,
    .quick,
    .dash-grid,
    .case-hero,
    .contact-layout { grid-template-columns: 1fr; }

    .nav {
        align-items: flex-start;
        flex-direction: column;
    }

    .links { width: 100%; }

    .links a,
    .links button,
    .inline-form button { padding: 9px 10px; }

    .photo {
        width: min(100%, 220px);
        height: auto;
        aspect-ratio: 4 / 5;
    }

    .title {
        align-items: flex-start;
        flex-direction: column;
    }

    .recruiter-strip .title { align-items: flex-start; }

    h1 { font-size: 2.85rem; }
    .lead { font-size: 1.125rem; }

    .arch-scroll { overflow: visible; }

    .arch-canvas {
        min-width: 0;
        width: 100%;
        height: auto;
        padding: 14px;
    }

    .arch-title,
    .arch-svg,
    .arch-node,
    .pipeline { display: none; }

    .mobile-arch {
        display: grid;
        gap: 10px;
    }

    .mobile-row {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        gap: 8px;
        align-items: center;
    }

    .case-cover { max-height: 260px; }
    .mobile-contact { display: flex; right: 10px; }
    .back { display: none; }
    .admin-table { min-width: 680px; }
}
