:root {
    --bg: #000;
    --surface: #111;
    --text: #fff;
    --text-dim: #999;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;

    --stripe: linear-gradient(90deg, var(--accent), #a855f7, var(--accent));
}

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

/* ─── matrix background ─── */
#matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0.35;
}

body {
    font-family: system-ui, sans-serif;
    background:
        radial-gradient(ellipse at top, rgba(96, 165, 250, 0.22), transparent 55%),
        radial-gradient(ellipse at bottom, rgba(168, 85, 247, 0.22), transparent 55%),
        var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ─── accent stripes ─── */
body::before,
body::after {
    content: '';
    display: block;
    background: var(--stripe);
}

body::before {
    height: 4px;
}

body::after {
    height: 4px;
}

header {
    background: var(--surface);
    border-bottom: 4px solid transparent;
    border-image: var(--stripe) 1;
}

nav {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    gap: 16px;
    padding: 16px 20px;
}

nav a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    padding: 6px 16px;
    border: 1px solid #fff;
    border-radius: 6px;
    transition: all 0.2s;
}

nav a:hover {
    color: var(--accent-hover);
    border-color: var(--accent-hover);
    background: rgba(59, 130, 246, 0.08);
}

main {
    max-width: 900px;
    width: 100%;
    margin: 40px auto;
    padding: 0 20px;
    flex: 1;
}

h1 {
    margin-bottom: 20px;
    font-size: 2rem;
}

h1+p {
    color: var(--text-dim);
    font-size: 1.1rem;
}

/* ─── links ─── */
a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-hover);
}

/* ─── page header ─── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.page-header h1 {
    margin-bottom: 0;
}

h2 {
    margin-bottom: 16px;
    color: #fff;
}

/* ─── archive link ─── */
.archive-link {
    margin: 0;
}

.archive-link a {
    display: inline-block;
    padding: 8px 22px;
    border: 1px solid #eab308;
    border-radius: 6px;
    color: #eab308;
    font-weight: 600;
    transition: all 0.2s;
}

.archive-link a:hover {
    color: #facc15;
    border-color: #facc15;
    background: rgba(234, 179, 8, 0.08);
}

/* ─── projects list ─── */
ul {
    list-style: none;
}

ul li {
    padding: 12px 0;
    border-bottom: 4px solid transparent;
    border-image: var(--stripe) 1;
}

/* ─── certificates grid ─── */
.certificates {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.cert-card {
    text-align: center;
    position: relative;
    cursor: pointer;
}

.cert-card img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    border-radius: 8px;
    background: var(--stripe);
    transition: transform 0.2s;
}

.cert-card p {
    margin-top: 8px;
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
}

.cert-portfolio .cert-card p {
    white-space: pre-line;
}

.cert-close {
    display: none;
}

.cert-card.zoomed {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    cursor: default;
}

.cert-card.zoomed img {
    height: auto;
    max-height: 80vh;
    max-width: 90vw;
    object-fit: contain;
    border-radius: 8px;
    background: none;
}

.cert-card.zoomed p {
    color: #fff;
    font-size: 1.1rem;
    margin-top: 16px;
}

.cert-card.zoomed .cert-close {
    display: block;
    position: absolute;
    top: 16px;
    right: 24px;
    font-size: 2.5rem;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.cert-card.zoomed .cert-close:hover {
    color: var(--accent-hover);
}

/* ─── hero ─── */
.hero {
    margin-bottom: 40px;
    padding-bottom: 28px;
    display: flex;
    align-items: flex-start;
    gap: 32px;
}

.hero__avatar {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--stripe);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #fff;
    overflow: hidden;
}

.hero__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero__text {
    flex: 1;
    padding-top: 0;
}

.hero__title {
    margin-bottom: 14px;
    font-size: 2.6rem;
    line-height: 1.15;
    background: var(--stripe);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.stripe-divider {
    width: 420px;
    height: 4px;
    background: var(--stripe);
    border-radius: 2px;
    margin-bottom: 16px;
}

/* ─── about ─── */
.about p {
    color: #fff;
    font-weight: 500;
    font-size: 1.05rem;
    max-width: 80ch;
}

/* ─── contacts ─── */
.contact-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
    max-width: 560px;
}
.contact-card--neon {
    display: block;
}

.contact-card--neon .contact-card-slot {
    width: 100%;
    background: var(--stripe);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: left;
    justify-content: center;
    gap: 4px;
    padding: 8px 20px;
   
}

.contact-card--neon .contact-card-slot p {
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    text-shadow: 0 0 12px rgba(59, 130, 246, 0.9);
    word-break: break-word;
    margin: 0;
}

.contact-card--neon .contact-card-slot a {
    color: #fff;
    text-decoration: underline;
    text-shadow: 0 0 12px rgba(59, 130, 246, 0.9);
}


.contact-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    font-size: 1.4rem;
    color: var(--accent);
    background: rgba(59, 130, 246, 0.08);
    margin-bottom: 14px;
}

.contact-card h2 {
    margin-bottom: 10px;
    color: #fff;
    font-size: 1.2rem;
}

.card p {
    margin: 6px 0 0;
    font-size: 0.95rem;
}

.contact-card a {
    color: var(--accent);
}

.contact-card a:hover {
    color: var(--accent-hover);
}

/* ─── contact form ─── */
.contact-form {
    max-width: 560px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 8px;
}

.contact-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
}

.contact-form input,
.contact-form textarea {
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: var(--stripe);
    color: #fff;
    font: inherit;
    transition: box-shadow 0.2s;
    resize: none;
    min-height: 40px;
     max-height: 130px;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    box-shadow: 0 0 14px rgba(168, 85, 247, 0.9);
    border-color: transparent;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.contact-form button {
    align-self: flex-start;
    padding: 8px 22px;
    border: 1px solid #eab308;
    border-radius: 6px;
    background: none;
    color: #eab308;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.contact-form button:hover {
   color: #facc15;
    border-color: #facc15;
    background: rgba(234, 179, 8, 0.08);
}

/* ─── contacts ─── */
p {
    margin-bottom: 8px;
}

/* ─── footer ─── */
footer {
    background: var(--surface);
    text-align: center;
    padding: 14px 20px;
    color: #d4d4d8;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    border-top: 4px solid transparent;
    border-image: var(--stripe) 1;
}

/* ─── mobile ─── */
@media (max-width: 560px) {
    .hero {
        flex-direction: column;
        text-align: center;
    }

    .hero__avatar {
        width: 100px;
        height: 100px;
        font-size: 1.8rem;
    }

    .hero__title {
        font-size: 1.8rem;
    }

    .stripe-divider {
        width: 100%;
    }

    nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        padding: 12px 12px;
    }

    nav a {
        padding: 5px 10px;
        font-size: 0.9rem;
    }

    .lab-wrap {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .lab-map {
        max-width: 100%;
    }

    .cert-card.zoomed {
        padding: 16px;
    }

    .contact-form {
        width: 100%;
    }
}
/* ─── toast (неоновое всплытие) ─── */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: var(--stripe);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    padding: 14px 22px;
    box-shadow: 0 0 24px rgba(59, 130, 246, 0.7);
    animation: toast-in 0.3s ease;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ═══ Интерактивная карта (lab) ═══ */
.lab-wrap {
    max-width: 1020px;
    margin: 8px auto 40px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 22px;
}
.lab-map {
    justify-self: center;
    width: 100%;
    max-width: 470px;
    background: var(--stripe);
    border-radius: 14px;
    padding: 10px;
}

.lab-edge {
    stroke: rgba(30, 64, 175, 0.85);
    stroke-width: 2;
    transition: stroke 0.25s, stroke-width 0.25s;
}

.lab-zone {
    fill: none;
    stroke: rgba(148, 163, 184, 0.22);
    stroke-width: 1.2;
    stroke-dasharray: 5 4;
}

.lab-zone--lan {
    stroke: rgba(6, 95, 70, 0.9);
    stroke-width: 3;
}

.lab-node-oval {
    fill: rgba(30, 41, 59, 1);
    stroke: rgba(255, 255, 255, 0.85);
    stroke-width: 3;
    stroke-dasharray: 6 5;
}

.lab-node-name {
    fill: #fff;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.02em;
}

.lab-cloud-shape {
    fill: rgba(30, 41, 59, 1);
}

.lab-zone-label {
    fill: rgba(226, 232, 240, 0.75);
    font-size: 12px;
    letter-spacing: 0.05em;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.lab-zone-label--black {
    fill: #000;
    font-weight: 700;
}

.lab-zone-label--white {
    fill: #fff;
    font-weight: 700;
}

.lab-edge--wg {
    stroke: rgba(250, 204, 21, 0.9);
    stroke-width: 3;
    stroke-dasharray: 6 5;
}

.lab-edge--internet {
    stroke: rgba(185, 28, 28, 0.85);
    stroke-width: 3;
    stroke-dasharray: 7 5;
}

.lab-edge--tunnel {
    stroke: rgba(249, 115, 22, 0.9);
    stroke-width: 3;
    stroke-dasharray: 4 5;
}

.lab-full {
    color: rgba(226, 232, 240, 0.85);
    font-size: 17px;
    font-weight: 700;
    text-align: center;
    margin-top: 12px;
}

.lab-full a {
    color: #60a5fa;
}

.lab-legend {
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 11px;
    fill: rgba(148, 163, 184, 0.7);
}

.lab-detail {
    background: var(--stripe);
    border-radius: 14px;
    padding: 18px;
    color: #fff;
    box-shadow: 0 0 26px rgba(59, 130, 246, 0.35);
    min-height: 280px;
}
.lab-detail h2 { margin: 0 0 4px; color: #fff; font-size: 20px; }
.lab-detail h3 { margin: 14px 0 4px; color: #eab308; font-size: 15px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.lab-detail .host { color: #22d3ee; font-weight: 600; }
.lab-detail .role { color: #a5f3fc; margin: 0 0 10px; }
.lab-detail .po { color: #cbd5e1; margin: 0; line-height: 1.55; white-space: pre-line; }
.lab-detail .disks { margin: -10px 0 0; padding-left: 0; list-style: none; color: #e2e8f0; }
.lab-detail .disks li { margin: -20px 0; border: none; }
.lab-placeholder { color: #fff; text-align: center; margin: 10px 0; font-style: italic; }

.lab-node { cursor: crosshair; }

.lab-tname {
    fill: #fff;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.03em;
}

.lab-pic {
    font-size: 24px;
}

.lab-pic--router {
    filter: grayscale(1) brightness(0.35);
}

/* ═══ lab: мобильная раскладка (позже базовых lab-правил, побеждает по каскаду) ═══ */
@media (max-width: 560px) {
    .lab-wrap {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .lab-map {
        max-width: 100%;
    }

    .lab-detail {
        min-height: 0;
    }
}
