:root {
    --bg: #07070b;
    --bg-soft: #101018;
    --surface: rgba(16, 16, 24, 0.84);
    --surface-solid: #13131d;
    --text: #f7f7fb;
    --muted: #b9bac8;
    --line: rgba(255, 255, 255, 0.12);
    --pink: #ff4fd8;
    --mint: #39ffbd;
    --cyan: #5bd7ff;
    --amber: #ffd166;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
    --radius: 8px;
    color-scheme: dark;
}

[data-theme="light"] {
    --bg: #f6f8fb;
    --bg-soft: #edf2f4;
    --surface: rgba(255, 255, 255, 0.84);
    --surface-solid: #ffffff;
    --text: #10121a;
    --muted: #555b6d;
    --line: rgba(15, 18, 28, 0.14);
    --shadow: 0 20px 60px rgba(20, 25, 38, 0.12);
    color-scheme: light;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        linear-gradient(135deg, rgba(255, 79, 216, 0.08), transparent 34%),
        linear-gradient(225deg, rgba(57, 255, 189, 0.08), transparent 40%),
        var(--bg);
}

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

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

button,
input,
textarea {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 16px clamp(18px, 5vw, 72px);
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
}

.brand,
.nav,
.hero__actions,
.project-card__meta,
.card-actions,
.filter-bar,
.switch-row,
.signal-row {
    display: flex;
    align-items: center;
}

.brand {
    gap: 10px;
    min-width: max-content;
    font-weight: 800;
}

.brand__mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid color-mix(in srgb, var(--pink) 64%, var(--line));
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(255, 79, 216, 0.18), rgba(57, 255, 189, 0.14));
    box-shadow: 0 0 24px rgba(255, 79, 216, 0.22);
    color: var(--mint);
    font-size: 0.9rem;
}

.nav {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.nav a,
.theme-toggle,
.link-button {
    min-height: 40px;
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--muted);
    background: transparent;
    cursor: pointer;
}

.nav a:hover,
.theme-toggle:hover,
.link-button:hover {
    color: var(--text);
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.06);
}

.hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 440px);
    align-items: end;
    gap: clamp(24px, 5vw, 70px);
    min-height: 82svh;
    padding: clamp(72px, 10vw, 120px) clamp(18px, 5vw, 72px) clamp(46px, 7vw, 84px);
    overflow: hidden;
}

.hero__media {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(7, 7, 11, 0.94), rgba(7, 7, 11, 0.64) 52%, rgba(7, 7, 11, 0.88)),
        linear-gradient(180deg, transparent 72%, var(--bg)),
        url("../images/hero-neon-portfolio.png") center / cover;
}

[data-theme="light"] .hero__media {
    background:
        linear-gradient(90deg, rgba(246, 248, 251, 0.95), rgba(246, 248, 251, 0.66) 52%, rgba(246, 248, 251, 0.92)),
        linear-gradient(180deg, transparent 72%, var(--bg)),
        url("../images/hero-neon-portfolio.png") center / cover;
}

.hero__content {
    max-width: 760px;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--mint);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    max-width: 760px;
    margin-bottom: 18px;
    font-size: clamp(3.1rem, 4.8rem, 4.8rem);
    line-height: 0.98;
    letter-spacing: 0;
    text-shadow: 0 0 26px rgba(255, 79, 216, 0.36);
}

h2 {
    margin-bottom: 0;
    font-size: clamp(2rem, 2.8rem, 2.8rem);
    line-height: 1.05;
}

h3 {
    margin-bottom: 10px;
    font-size: 1.15rem;
}

.hero__lead {
    max-width: 620px;
    margin-bottom: 28px;
    color: var(--muted);
    font-size: 1.1rem;
}

.hero__actions {
    flex-wrap: wrap;
    gap: 12px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 11px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    font-weight: 800;
    cursor: pointer;
}

.button--primary {
    border-color: transparent;
    background: linear-gradient(135deg, var(--pink), var(--mint));
    color: #08080d;
    box-shadow: 0 0 24px rgba(57, 255, 189, 0.25), 0 0 34px rgba(255, 79, 216, 0.18);
}

.button--ghost {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.hero-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.hero-panel__label,
.project-card__meta,
.admin-item span,
.field-note,
.muted {
    color: var(--muted);
}

.hero-panel strong {
    display: block;
    margin: 6px 0 10px;
    font-size: 1.35rem;
}

.hero-panel p {
    margin-bottom: 18px;
    color: var(--muted);
}

.signal-row {
    gap: 8px;
}

.signal-row span {
    display: block;
    height: 8px;
    flex: 1;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--mint), var(--pink));
    box-shadow: 0 0 18px rgba(57, 255, 189, 0.32);
}

.stats-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-block: 1px solid var(--line);
    background: var(--surface);
}

.stats-strip div {
    padding: 22px clamp(18px, 5vw, 72px);
    border-right: 1px solid var(--line);
}

.stats-strip div:last-child {
    border-right: 0;
}

.stats-strip strong {
    display: block;
    color: var(--mint);
    font-size: 1.7rem;
}

.stats-strip span {
    color: var(--muted);
}

.section {
    padding: clamp(58px, 8vw, 96px) clamp(18px, 5vw, 72px);
}

.section__head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.filter-bar {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.filter-button {
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    cursor: pointer;
}

.filter-button.is-active,
.filter-button:hover {
    color: var(--text);
    border-color: color-mix(in srgb, var(--mint) 50%, var(--line));
    box-shadow: 0 0 18px rgba(57, 255, 189, 0.15);
}

.notice {
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--mint);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--muted);
}

.notice--success {
    border-left-color: var(--mint);
}

.notice--error {
    border-left-color: #ff5c7a;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.project-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface-solid);
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.18);
}

.project-card:hover {
    border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
    box-shadow: 0 0 28px color-mix(in srgb, var(--accent) 20%, transparent);
}

.project-card__media {
    aspect-ratio: 16 / 10;
    background: #0c0c13;
    border-bottom: 1px solid var(--line);
}

.project-card__media img,
.project-card__media video,
.media-placeholder {
    width: 100%;
    height: 100%;
}

.project-card__media img,
.project-card__media video {
    object-fit: cover;
}

.media-placeholder {
    display: grid;
    place-items: center;
    color: var(--accent);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, transparent), transparent 46%),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 16px),
        #0d0d15;
}

.media-placeholder span {
    padding: 8px 12px;
    border: 1px solid color-mix(in srgb, var(--accent) 60%, var(--line));
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.26);
}

.project-card__body {
    padding: 18px;
}

.project-card__meta {
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 0.8rem;
}

.project-card p {
    color: var(--muted);
}

.tech-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0 18px;
    padding: 0;
    list-style: none;
}

.tech-list li {
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.82rem;
    background: rgba(255, 255, 255, 0.04);
}

.card-actions {
    gap: 10px;
}

.card-actions a {
    padding: 8px 10px;
    border: 1px solid color-mix(in srgb, var(--accent) 58%, var(--line));
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.9rem;
}

.stack-section {
    background: var(--bg-soft);
}

.stack-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.stack-grid div {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-solid);
}

.stack-grid span {
    display: inline-block;
    margin-bottom: 18px;
    color: var(--pink);
    font-weight: 900;
}

.stack-grid p {
    color: var(--muted);
}

.contact-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: clamp(42px, 7vw, 78px) clamp(18px, 5vw, 72px);
    border-top: 1px solid var(--line);
    background: linear-gradient(90deg, rgba(255, 79, 216, 0.14), rgba(57, 255, 189, 0.12));
}

.contact-band p {
    margin-bottom: 0;
    color: var(--muted);
}

.admin-page {
    background:
        linear-gradient(135deg, rgba(255, 79, 216, 0.1), transparent 34%),
        linear-gradient(225deg, rgba(57, 255, 189, 0.08), transparent 44%),
        var(--bg);
}

.access-page {
    min-height: 100vh;
    background:
        linear-gradient(90deg, rgba(7, 7, 11, 0.95), rgba(7, 7, 11, 0.7)),
        url("../images/hero-neon-portfolio.png") center / cover,
        var(--bg);
}

[data-theme="light"] .access-page {
    background:
        linear-gradient(90deg, rgba(246, 248, 251, 0.94), rgba(246, 248, 251, 0.72)),
        url("../images/hero-neon-portfolio.png") center / cover,
        var(--bg);
}

.access-shell {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
}

.access-panel h1 {
    font-size: 2.4rem;
}

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

.admin-shell {
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto;
    padding: 48px 0 80px;
}

.login-panel {
    width: min(460px, 100%);
    margin: 8vh auto 0;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.admin-hero {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.admin-hero p {
    color: var(--muted);
}

.admin-status {
    min-width: max-content;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--muted);
}

.admin-status.is-online {
    color: var(--mint);
    border-color: color-mix(in srgb, var(--mint) 50%, var(--line));
}

.admin-status.is-offline {
    color: var(--amber);
    border-color: color-mix(in srgb, var(--amber) 50%, var(--line));
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
    gap: 22px;
    align-items: start;
}

.admin-form,
.admin-list {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-solid);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.16);
}

.admin-form {
    display: grid;
    gap: 16px;
    padding: 22px;
}

.admin-form label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 0.92rem;
}

.admin-form input,
.admin-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 11px 12px;
    background: color-mix(in srgb, var(--bg) 76%, transparent);
    color: var(--text);
    outline: none;
}

.admin-form input:focus,
.admin-form textarea:focus {
    border-color: color-mix(in srgb, var(--mint) 60%, var(--line));
    box-shadow: 0 0 0 3px rgba(57, 255, 189, 0.12);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.form-row--compact {
    grid-template-columns: 160px 160px;
}

.switch-row {
    flex-wrap: wrap;
    gap: 16px;
}

.switch-row label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.switch-row input {
    width: auto;
}

.field-note {
    font-size: 0.78rem;
}

.inline-form {
    margin: 0;
}

.link-button {
    display: inline-flex;
}

.admin-list {
    padding: 20px;
}

.admin-list h2 {
    margin-bottom: 18px;
    font-size: 1.5rem;
}

.admin-item {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
    border-top: 1px solid var(--line);
}

.admin-item:first-of-type {
    border-top: 0;
}

.admin-item strong {
    display: block;
    margin: 4px 0 6px;
}

.admin-item p {
    margin-bottom: 0;
    color: var(--muted);
}

.danger-button {
    min-height: 36px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 92, 122, 0.55);
    border-radius: var(--radius);
    background: rgba(255, 92, 122, 0.1);
    color: #ff8fa4;
    cursor: pointer;
}

@media (max-width: 980px) {
    .site-header,
    .section__head,
    .contact-band,
    .admin-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .nav,
    .filter-bar {
        justify-content: flex-start;
    }

    .hero {
        grid-template-columns: 1fr;
        align-items: start;
        min-height: auto;
    }

    .project-grid,
    .stack-grid,
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .site-header {
        position: static;
    }

    .nav a,
    .theme-toggle,
    .link-button {
        min-height: 36px;
        padding: 7px 9px;
    }

    h1 {
        font-size: 3.1rem;
    }

    h2 {
        font-size: 2rem;
    }

    .stats-strip {
        grid-template-columns: 1fr;
    }

    .stats-strip div {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .stats-strip div:last-child {
        border-bottom: 0;
    }

    .form-row,
    .form-row--compact {
        grid-template-columns: 1fr;
    }
}
