:root {
    --bg: #0d1117;
    --panel: #131922;
    --panel-2: #181f2a;
    --line: #28313e;
    --text: #f4f7fb;
    --muted: #9aa7b6;
    --accent: #6ee7b7;
    --accent-dark: #09291f;
    --danger: #fb7185;
    --shadow: 0 24px 70px rgba(0, 0, 0, .28);
    --radius: 20px;
}

* { 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.55;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.container { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(13,17,23,.82);
    border-bottom: 1px solid rgba(255,255,255,.06);
    backdrop-filter: blur(18px);
}
.nav { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 800; letter-spacing: -.02em; }
.brand-mark {
    width: 36px; height: 36px; display: grid; place-items: center;
    border-radius: 11px; background: var(--accent); color: #07130f;
    font-size: 13px; font-weight: 900; letter-spacing: -.04em;
}
.nav-link { color: var(--muted); font-weight: 650; transition: .2s ease; }
.nav-link:hover { color: var(--text); }

.hero {
    min-height: 620px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--line);
    background:
        radial-gradient(circle at 82% 20%, rgba(110,231,183,.13), transparent 32%),
        radial-gradient(circle at 10% 80%, rgba(96,165,250,.08), transparent 28%);
}
.hero-inner { padding: 110px 0 120px; }
.eyebrow {
    display: inline-block;
    margin-bottom: 16px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.hero h1 {
    max-width: 800px;
    margin: 0;
    font-size: clamp(54px, 8vw, 108px);
    line-height: .92;
    letter-spacing: -.065em;
}
.hero-text {
    max-width: 650px;
    margin: 28px 0 34px;
    color: var(--muted);
    font-size: clamp(18px, 2vw, 22px);
}
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-weight: 760;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--accent); color: #07130f; }
.button-secondary { background: transparent; color: var(--text); border-color: var(--line); }
.button-full { width: 100%; }

.portfolio-section { padding: 90px 0 110px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 34px; }
.section-head h2, .admin-title-row h1 { margin: 0; font-size: clamp(34px, 4vw, 52px); line-height: 1; letter-spacing: -.045em; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.filter {
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    border-radius: 999px;
    padding: 9px 14px;
    font-weight: 700;
}
.filter:hover, .filter.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }

.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.project-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: 0 0 0 rgba(0,0,0,0);
    transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.project-card:hover { transform: translateY(-4px); border-color: #3c4859; box-shadow: var(--shadow); }
.project-media { aspect-ratio: 16/9; overflow: hidden; background: #0a0e13; }
.project-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.project-card:hover .project-media img { transform: scale(1.025); }
.project-placeholder {
    width: 100%; height: 100%; display: grid; place-items: center;
    background: linear-gradient(135deg, #151d28, #0d1219);
}
.project-placeholder span { font-size: 72px; font-weight: 900; color: #2c3745; }
.project-body { padding: 24px; }
.project-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.project-meta span {
    padding: 5px 9px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}
.project-body h3 { margin: 0; font-size: 25px; letter-spacing: -.03em; }
.project-body p { margin: 10px 0 18px; color: var(--muted); }
.project-link { display: inline-flex; gap: 8px; align-items: center; color: var(--accent); font-weight: 760; }
.project-link span { transition: transform .18s ease; }
.project-link:hover span { transform: translate(2px,-2px); }
.empty-public {
    padding: 70px 24px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    text-align: center;
    color: var(--muted);
}
.empty-public strong, .empty-public span { display: block; }
.empty-public strong { color: var(--text); font-size: 20px; margin-bottom: 6px; }

.site-footer { border-top: 1px solid var(--line); }
.footer-inner { min-height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: #738092; font-size: 13px; }
.footer-inner a:hover { color: var(--text); }

.setup-page {
    display: grid;
    place-items: center;
    padding: 40px 20px;
    background:
        radial-gradient(circle at 50% -10%, rgba(110,231,183,.13), transparent 35%),
        var(--bg);
}
.setup-shell { width: min(480px, 100%); }
.setup-shell > .brand { margin: 0 0 22px 6px; }
.setup-card {
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--panel);
    box-shadow: var(--shadow);
}
.setup-card h1 { margin: 0; font-size: 34px; letter-spacing: -.04em; }
.muted { color: var(--muted); }
.form-stack { display: grid; gap: 18px; margin-top: 26px; }
.form-stack label, .form-grid label { display: grid; gap: 8px; }
label > span { color: #c8d1dc; font-size: 13px; font-weight: 750; }
input, textarea, select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #0e141c;
    color: var(--text);
    outline: none;
    padding: 12px 13px;
    transition: border-color .18s ease, box-shadow .18s ease;
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(110,231,183,.08); }
.back-link { display: inline-block; margin-top: 22px; color: var(--muted); font-size: 13px; }
.alert { margin: 20px 0; padding: 13px 15px; border-radius: 11px; border: 1px solid; font-size: 14px; }
.alert-error { color: #fecdd3; border-color: rgba(251,113,133,.35); background: rgba(251,113,133,.08); }
.alert-success { color: #bbf7d0; border-color: rgba(74,222,128,.35); background: rgba(74,222,128,.08); }

.admin-page { background: #0b0f14; }
.admin-topbar {
    position: sticky; top: 0; z-index: 30;
    border-bottom: 1px solid var(--line);
    background: rgba(11,15,20,.92);
    backdrop-filter: blur(16px);
}
.admin-topbar-inner {
    min-height: 68px;
    padding: 0 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.admin-user { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 13px; }
.admin-user a:hover { color: var(--text); }
.admin-layout { display: grid; grid-template-columns: 230px minmax(0,1fr); min-height: calc(100vh - 69px); }
.admin-sidebar { border-right: 1px solid var(--line); padding: 26px 14px; }
.admin-sidebar nav { position: sticky; top: 95px; display: grid; gap: 5px; }
.admin-sidebar a {
    padding: 11px 13px;
    border-radius: 10px;
    color: var(--muted);
    font-weight: 700;
    font-size: 14px;
}
.admin-sidebar a:hover { color: var(--text); background: var(--panel); }
.admin-sidebar a.is-active { color: #07130f; background: var(--accent); }
.admin-main { min-width: 0; padding: 42px; }
.admin-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; margin-bottom: 22px; }
.stat { padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.stat strong { display: block; font-size: 36px; line-height: 1; letter-spacing: -.04em; }
.stat span { display: block; margin-top: 8px; color: var(--muted); font-size: 13px; }
.admin-card { padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.admin-card h2 { margin-top: 0; letter-spacing: -.025em; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.card-head p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.card-head > a { color: var(--accent); font-size: 13px; font-weight: 750; }
.admin-list { display: grid; }
.admin-list-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 0; border-top: 1px solid var(--line); }
.admin-list-item div { display: grid; gap: 2px; }
.admin-list-item span:not(.status) { color: var(--muted); font-size: 12px; }
.status { display: inline-flex; width: max-content; padding: 5px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.status-on { background: rgba(74,222,128,.1); color: #86efac; }
.status-off { background: rgba(148,163,184,.1); color: #94a3b8; }
.admin-empty { padding: 30px 0; color: var(--muted); text-align: center; }
.project-table-wrap { overflow-x: auto; }
.project-table { width: 100%; border-collapse: collapse; }
.project-table th, .project-table td { padding: 14px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.project-table th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.table-project { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.table-project img, .table-thumb-placeholder { width: 52px; height: 38px; border-radius: 7px; object-fit: cover; background: #222c39; flex: 0 0 auto; }
.table-project div { display: grid; }
.table-project small { color: var(--muted); }
.actions { display: flex; gap: 12px; align-items: center; justify-content: flex-end; }
.actions a { color: var(--accent); font-weight: 700; font-size: 13px; }
.actions form { margin: 0; }
.link-danger { padding: 0; border: 0; background: none; color: var(--danger); font-weight: 700; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.span-2 { grid-column: 1 / -1; }
.form-actions { padding-top: 4px; }
.check-row { display: flex !important; align-items: center; grid-template-columns: none !important; gap: 9px !important; color: var(--muted); }
.check-row input { width: auto; accent-color: var(--accent); }
.current-image { display: flex; align-items: center; gap: 18px; padding: 14px; background: #0e141c; border: 1px solid var(--line); border-radius: 12px; }
.current-image img { width: 120px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; }
.admin-columns { display: grid; grid-template-columns: minmax(260px,.7fr) minmax(0,1.3fr); gap: 22px; align-items: start; }
.category-list { display: grid; }
.category-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; border-top: 1px solid var(--line); }
.category-row div { display: grid; }
.category-row small { color: var(--muted); }

@media (max-width: 900px) {
    .hero { min-height: 520px; }
    .project-grid { grid-template-columns: 1fr; }
    .section-head { align-items: flex-start; flex-direction: column; }
    .filters { justify-content: flex-start; }
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 18px; overflow-x: auto; }
    .admin-sidebar nav { position: static; display: flex; min-width: max-content; }
    .admin-main { padding: 28px 20px 50px; }
    .admin-columns { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .container { width: min(100% - 28px, 1180px); }
    .nav { min-height: 64px; }
    .hero-inner { padding: 90px 0; }
    .hero h1 { font-size: clamp(50px, 17vw, 78px); }
    .portfolio-section { padding: 68px 0 80px; }
    .project-body { padding: 20px; }
    .footer-inner { align-items: flex-start; flex-direction: column; justify-content: center; padding: 18px 0; gap: 5px; }
    .setup-card { padding: 25px 20px; }
    .admin-topbar-inner { padding: 0 16px; }
    .admin-user span { display: none; }
    .admin-user { gap: 10px; }
    .admin-title-row { align-items: flex-start; flex-direction: column; }
    .admin-title-row .button { width: 100%; }
    .stats { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .current-image { align-items: flex-start; flex-direction: column; }
}
