:root {
    --bg: #050914;
    --card: #0b1223e8;
    --line: #ffffff1f;
    --text: #f8fbff;
    --muted: #b8c0d0;
    --p: #7cffb2;
    --s: #60d9ff;
    --y: #ffd36a;
    --r: #ff7b8a;
    --radius: 8px;
    --radius-pill: 999px;
    --shadow-card: 0 24px 80px #0006;
    --shadow-hover: 0 22px 70px #7cffb21f;
    --space-1: 8px;
    --space-2: 16px;
    --space-3: 24px;
    --ease: .22s ease;
    --font-sans: Inter, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    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: var(--radius);
    background: var(--p);
    color: #061019;
    font-weight: 900;
}

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

.read-progress {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--p), var(--s));
    transition: width .1s linear;
}

.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: var(--radius);
    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: var(--radius-pill);
}

.lang-switch a {
    padding: 7px 9px;
    border-radius: var(--radius-pill);
}

.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: var(--radius-pill);
    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; }

.links a.active {
    background: #ffffff14;
    color: var(--p);
}

.admin-email {
    display: inline-flex;
    align-items: center;
    max-width: 180px;
    overflow: hidden;
    padding: 0 6px;
    font-size: 12px;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.card {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #0b1223e8, #080d1ad6);
    box-shadow: var(--shadow-card);
    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: var(--radius);
    object-fit: cover;
    box-shadow: 0 22px 48px #0006;
}

.badge,
.chip {
    padding: 8px 10px;
    border: 1px solid #ffffff17;
    border-radius: var(--radius-pill);
    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: var(--radius);
    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: var(--radius);
    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: var(--shadow-hover);
}

.proof img,
.proof video,
.project img {
    width: 100%;
    height: 190px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    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; }

.demo-badge {
    margin-left: 8px;
    padding: 3px 8px;
    color: var(--y);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .6px;
}

.actions-label {
    align-self: center;
    margin-right: 4px;
    font-size: 12px;
    font-weight: 850;
}

.link-inline {
    align-self: center;
    color: var(--s);
    font-size: 13px;
    font-weight: 850;
    text-decoration: none;
}

.link-inline:hover { text-decoration: underline; }

.filter-count {
    margin: 4px 0 0;
    font-size: 13px;
}

.empty-state {
    text-align: center;
    color: var(--muted);
}

.card-more {
    display: block;
    margin-top: 12px;
    color: var(--s);
    font-size: 13px;
    font-weight: 850;
    opacity: .8;
}

.project:hover .card-more { opacity: 1; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

.project { animation: fadeUp .25s ease; }
.project.hide { display: none; }

.testimonial {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0;
}

.testimonial blockquote {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.6;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
}

.testimonial-author .avatar { width: 44px; height: 44px; }

.cta-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    border-color: #7cffb240;
    background: linear-gradient(135deg, #0d1b2eea, #0a1422d6);
}

.cta-band h2 { margin: 0 0 8px; }
.cta-facts { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 16px; }
.cta-button { flex-shrink: 0; font-size: 15px; padding: 14px 22px; }

@media (max-width: 760px) {
    .cta-band { flex-direction: column; align-items: flex-start; }
    .cta-button { width: 100%; text-align: 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: var(--radius);
    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; }

.prose p,
.article-detail p {
    font-size: 1.05rem;
    line-height: 1.75;
    margin: 0 0 18px;
}

.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: var(--radius);
}

.arch-canvas {
    position: relative;
    min-width: 1180px;
    height: 760px;
    border: 1px solid #ffffff14;
    border-radius: var(--radius);
    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: var(--radius-pill);
    background: #ffffff12;
    font-weight: 950;
}

.arch-node {
    position: absolute;
    width: 160px;
    min-height: 94px;
    padding: 14px;
    border: 1px solid #60d9ff3a;
    border-radius: var(--radius);
    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: var(--radius);
    background: #ffffff12;
    text-align: center;
}

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

.terminal {
    min-height: 200px;
    padding: 14px;
    border: 1px solid #ffffff12;
    border-radius: var(--radius);
    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: var(--radius);
    background: #ffffff0f;
}

.bar {
    height: 8px;
    border-radius: var(--radius-pill);
    background: #ffffff14;
    overflow: hidden;
}

.bar i {
    display: block;
    height: 100%;
    width: var(--v);
    border-radius: var(--radius-pill);
    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; animation: overlayIn .15s ease; }

.modal.open .modal-card,
.cmd.open .cmd-card { animation: cardIn .2s ease; }

@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

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

.modal-media img,
.modal-media video {
    width: 100%;
    max-height: 470px;
    object-fit: contain;
    border-radius: var(--radius);
    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: var(--radius);
    background: #ffffff10;
    text-decoration: none;
}

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

.cmd a[hidden] { display: 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: var(--radius-pill);
    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; }
    .admin-table { min-width: 680px; }
}

:focus-visible {
    outline: 2px solid var(--s);
    outline-offset: 2px;
}

/* ---------- Admin ---------- */
.admin-body .nav { border-color: #60d9ff3a; }

.nav-badge {
    display: inline-block;
    min-width: 18px;
    padding: 1px 6px;
    border-radius: var(--radius-pill);
    background: var(--r);
    color: #1a0509;
    font-size: 11px;
    font-weight: 900;
    text-align: center;
}

.admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
}

.admin-toolbar .toolbar-search {
    flex: 1;
    min-width: 220px;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff0f;
    color: white;
}

.admin-toolbar select {
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff0f;
    color: white;
}

.admin-toolbar select option { background: #091225; }

.admin-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.pagination-links { display: flex; gap: 8px; }

.field-err {
    display: block;
    margin-top: 4px;
    color: var(--r);
    font-weight: 850;
}

[aria-invalid="true"] {
    border-color: var(--r) !important;
    outline-color: var(--r);
}

.edit-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    border-color: #60d9ff55;
    background: #60d9ff14;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.status-new { background: var(--y); color: #221a00; }
.status-discussion { background: var(--s); color: #04161f; }
.status-replied { background: var(--p); color: #04190f; }
.status-closed { background: #ffffff22; color: var(--muted); }

.empty-row td {
    padding: 28px 10px;
    color: var(--muted);
    text-align: center;
}

.md-editor { display: grid; gap: 10px; }

.md-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.md-toolbar button {
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff12;
    color: inherit;
    cursor: pointer;
    font-weight: 850;
}

.md-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.md-preview {
    padding: 14px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    background: #00000022;
    overflow: auto;
    max-height: 360px;
}

.md-preview :first-child { margin-top: 0; }

.img-preview {
    margin-top: 8px;
    max-height: 140px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: #fff;
}

.pw-meter {
    height: 6px;
    margin-top: 8px;
    border-radius: var(--radius-pill);
    background: #ffffff14;
    overflow: hidden;
}

.pw-meter i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: var(--radius-pill);
    transition: width .2s, background .2s;
}

.pw-weak i { width: 33%; background: var(--r); }
.pw-medium i { width: 66%; background: var(--y); }
.pw-strong i { width: 100%; background: var(--p); }

.input-reveal { position: relative; }
.input-reveal input { padding-right: 70px; }

.input-reveal .reveal-btn {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    padding: 4px 8px;
    border: 0;
    border-radius: var(--radius);
    background: #ffffff1a;
    color: inherit;
    cursor: pointer;
    font-size: 12px;
    font-weight: 850;
}

.slug-status { margin-top: 4px; font-weight: 850; }
.slug-ok { color: var(--p); }
.slug-taken { color: var(--r); }

.admin-footer { text-align: center; }

@media (max-width: 760px) {
    .md-split { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }

    html { scroll-behavior: auto; }
}
