:root {
    --ink: #141821;
    --text: #263142;
    --muted: #6f7785;
    --line: #dfe4ea;
    --paper: #ffffff;
    --soft: #f4f6f8;
    --deep: #101720;
    --brand: #08756f;
    --brand-2: #0f8f83;
    --accent: #c9902e;
    --danger: #bc3b35;
    --ok: #20855f;
    --shadow: 0 24px 70px rgba(16, 23, 32, .14);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--soft);
}

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

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

button,
input,
textarea {
    font: inherit;
}

button {
    color: inherit;
}

.site-hero {
    min-height: 82vh;
    color: #fff;
    background:
        linear-gradient(90deg, rgba(8, 11, 15, .88) 0%, rgba(8, 11, 15, .6) 42%, rgba(8, 11, 15, .18) 100%),
        var(--hero-image) center/cover no-repeat;
    position: relative;
    isolation: isolate;
}

.site-hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 180px;
    background: linear-gradient(180deg, rgba(244, 246, 248, 0), var(--soft));
    z-index: -1;
}

.site-nav,
.hero-content,
.page-shell {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

.site-nav {
    min-height: 84px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    font-weight: 850;
    letter-spacing: 0;
}

.brand-mark {
    min-width: 52px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    letter-spacing: 0;
    background: var(--brand);
    box-shadow: 0 14px 30px rgba(8, 117, 111, .28);
}

.nav-link {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border: 1px solid rgba(255, 255, 255, .34);
    border-radius: 8px;
    color: #fff;
    font-weight: 800;
    background: rgba(255, 255, 255, .08);
}

.hero-content {
    min-height: calc(82vh - 84px);
    display: grid;
    align-content: center;
    padding: 48px 0 96px;
}

.eyebrow,
.section-kicker {
    margin: 0 0 12px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.hero-content h1 {
    max-width: 860px;
    margin: 0;
    color: #fff;
    font-size: clamp(56px, 11vw, 132px);
    line-height: .84;
    letter-spacing: 0;
}

.hero-copy {
    max-width: 610px;
    margin: 26px 0 0;
    color: rgba(255, 255, 255, .86);
    font-size: clamp(18px, 2.2vw, 25px);
    line-height: 1.45;
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 36px;
}

.hero-stats span {
    min-width: 132px;
    padding: 14px 16px;
    border-left: 3px solid var(--accent);
    color: rgba(255, 255, 255, .8);
    background: rgba(16, 23, 32, .42);
    backdrop-filter: blur(12px);
}

.hero-stats strong {
    display: block;
    margin-bottom: 2px;
    color: #fff;
    font-size: 30px;
    line-height: 1;
}

.page-shell {
    padding: 34px 0 84px;
}

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

.toolbar h2,
.admin-topbar h1,
.panel-form h2,
.project-list-panel h2 {
    margin: 0;
    color: var(--ink);
    letter-spacing: 0;
}

.toolbar h2 {
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 9px;
}

.filter-btn,
.button,
.icon-btn,
.thumb {
    border: 0;
    cursor: pointer;
}

.filter-btn {
    min-height: 40px;
    padding: 0 15px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    font-weight: 850;
    background: var(--paper);
    transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.filter-btn:hover {
    border-color: var(--brand);
}

.filter-btn.is-active {
    color: #fff;
    border-color: var(--brand);
    background: var(--brand);
}

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

.project-card {
    grid-column: span 4;
    min-height: 440px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--paper);
    box-shadow: 0 10px 34px rgba(16, 23, 32, .09);
    position: relative;
    transition: transform .2s ease, box-shadow .2s ease;
}

.project-card:nth-child(1),
.project-card:nth-child(7n) {
    grid-column: span 8;
}

.project-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.project-card.is-hidden {
    display: none;
}

.card-media {
    width: 100%;
    height: 100%;
    min-height: 440px;
    padding: 0;
    border: 0;
    background: #d8dde5;
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.card-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(16, 23, 32, .05) 0%, rgba(16, 23, 32, .18) 44%, rgba(16, 23, 32, .84) 100%);
}

.card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s ease;
}

.project-card:hover .card-media img {
    transform: scale(1.045);
}

.play-badge {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 2;
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    font-size: 17px;
    background: rgba(8, 117, 111, .92);
    box-shadow: 0 16px 34px rgba(0, 0, 0, .22);
}

.media-count {
    position: absolute;
    left: 18px;
    top: 18px;
    z-index: 2;
    padding: 8px 11px;
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    background: rgba(16, 23, 32, .68);
}

.card-body {
    min-height: 440px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 28px;
    color: #fff;
    position: relative;
    pointer-events: none;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.card-meta span {
    padding: 6px 9px;
    border-radius: 8px;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    background: rgba(255, 255, 255, .16);
    backdrop-filter: blur(8px);
}

.card-body h3 {
    max-width: 720px;
    margin: 0 0 10px;
    color: #fff;
    font-size: clamp(24px, 2.8vw, 38px);
    line-height: 1.02;
    letter-spacing: 0;
}

.project-card:not(:nth-child(1)):not(:nth-child(7n)) .card-body h3 {
    font-size: 27px;
}

.card-body p {
    max-width: 680px;
    margin: 0;
    color: rgba(255, 255, 255, .82);
    line-height: 1.55;
}

.open-detail {
    width: fit-content;
    margin-top: 18px;
    padding-bottom: 4px;
    border-bottom: 2px solid var(--accent);
    color: #fff;
    font-weight: 900;
}

.empty-state {
    padding: 74px 24px;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
}

.empty-state h2 {
    margin: 0 0 10px;
}

.empty-state p {
    margin: 0;
    color: var(--muted);
}

.button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 17px;
    border-radius: 8px;
    color: var(--ink);
    font-weight: 900;
    background: #e8edf2;
}

.button.primary {
    color: #fff;
    background: var(--brand);
}

.button.primary:hover {
    background: var(--brand-2);
}

.button.ghost {
    border: 1px solid var(--line);
    background: #fff;
}

.button.mini {
    min-height: 34px;
    padding: 0 12px;
    font-size: 13px;
}

.button.danger {
    color: #fff;
    background: var(--danger);
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(5, 8, 12, .82);
}

.lightbox.is-open {
    display: flex;
}

.lightbox-panel {
    width: min(1120px, 100%);
    max-height: calc(100vh - 48px);
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, .75fr);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    position: relative;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .36);
}

.lightbox-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    color: #fff;
    font-size: 30px;
    line-height: 1;
    background: rgba(16, 23, 32, .84);
}

.lightbox-media {
    min-height: 560px;
    background: #0b1017;
}

.lightbox-media img,
.lightbox-media video,
.video-frame {
    width: 100%;
    height: 100%;
    max-height: calc(100vh - 48px);
    object-fit: contain;
}

.video-frame {
    min-height: 560px;
    border: 0;
    background: #0b1017;
}

.external-video {
    width: 100%;
    min-height: 560px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 22px;
    font-weight: 900;
    background: var(--brand);
}

.lightbox-info {
    padding: 34px;
    overflow: auto;
}

.lightbox-info h2 {
    margin: 8px 0 12px;
    color: var(--ink);
    font-size: 30px;
    line-height: 1.05;
}

.lightbox-info p {
    color: var(--muted);
    line-height: 1.65;
}

.thumb-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.thumb {
    min-width: 42px;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    font-weight: 900;
}

.thumb.is-active {
    color: #fff;
    border-color: var(--brand);
    background: var(--brand);
}

.admin-body,
.login-body {
    min-height: 100vh;
    background:
        linear-gradient(180deg, #f7f9fb 0%, #edf1f5 100%);
}

.admin-body {
    display: grid;
    grid-template-columns: 272px minmax(0, 1fr);
}

.admin-sidebar {
    min-height: 100vh;
    padding: 24px;
    color: #fff;
    background: linear-gradient(180deg, #101720 0%, #182334 100%);
    position: sticky;
    top: 0;
}

.admin-brand {
    margin-bottom: 34px;
}

.admin-menu {
    display: grid;
    gap: 8px;
}

.admin-menu a {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0 14px;
    border-radius: 8px;
    color: rgba(255, 255, 255, .74);
    font-weight: 850;
}

.admin-menu a.is-active,
.admin-menu a:hover {
    color: #fff;
    background: rgba(255, 255, 255, .1);
}

.admin-main {
    padding: 32px;
}

.admin-topbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.admin-topbar h1 {
    font-size: 36px;
    line-height: 1;
}

.notice {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 8px;
    color: #0f5132;
    font-weight: 800;
    background: #d9f1e7;
}

.notice.error {
    color: #842029;
    background: #f8d7da;
}

.admin-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 430px;
    gap: 22px;
    align-items: start;
}

.panel-form,
.project-list-panel,
.login-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(16, 23, 32, .09);
}

.panel-form {
    display: grid;
    gap: 18px;
    padding: 24px;
}

.form-head,
.list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.field-grid,
.upload-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

label {
    display: grid;
    gap: 8px;
    color: var(--ink);
    font-weight: 850;
}

label span,
.upload-box span {
    font-size: 14px;
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 13px;
    color: var(--ink);
    background: #fff;
    outline: none;
}

input:focus,
textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(8, 117, 111, .13);
}

textarea {
    resize: vertical;
}

.switch {
    display: inline-flex;
    grid-template-columns: auto auto;
    align-items: center;
    gap: 9px;
}

.switch input {
    width: 18px;
    height: 18px;
    accent-color: var(--brand);
}

.upload-box {
    padding: 16px;
    border: 1px dashed #b7c2cf;
    border-radius: 8px;
    background: #f8fafc;
}

.upload-box small {
    color: var(--muted);
    font-weight: 600;
}

.current-media h3 {
    margin: 0 0 12px;
}

.media-admin-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.media-admin-grid figure {
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.media-admin-grid img,
.media-admin-grid video {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: #e8edf2;
}

.media-admin-grid button {
    width: 100%;
    min-height: 34px;
    border: 0;
    color: #fff;
    background: var(--danger);
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 10px;
}

.project-list-panel {
    padding: 18px;
}

.admin-project-list {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.admin-project-item {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.admin-project-item img {
    width: 74px;
    height: 64px;
    border-radius: 8px;
    object-fit: cover;
    background: #e8edf2;
}

.admin-project-item h3 {
    margin: 0 0 3px;
    color: var(--ink);
    font-size: 15px;
}

.admin-project-item p,
.muted {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.status-on,
.status-off {
    display: inline-flex;
    margin-top: 8px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.status-on {
    color: #0f5132;
    background: #d9f1e7;
}

.status-off {
    color: #842029;
    background: #f8d7da;
}

.item-actions {
    display: grid;
    gap: 8px;
}

.login-body {
    display: grid;
    place-items: center;
    padding: 20px;
}

.login-card {
    width: min(430px, 100%);
    display: grid;
    gap: 20px;
    padding: 28px;
}

.login-card form {
    display: grid;
    gap: 16px;
}

@media (max-width: 1080px) {
    .project-card,
    .project-card:nth-child(1),
    .project-card:nth-child(7n) {
        grid-column: span 6;
    }

    .admin-layout {
        grid-template-columns: 1fr;
    }

    .lightbox-panel {
        grid-template-columns: 1fr;
        overflow: auto;
    }

    .lightbox-media,
    .video-frame {
        min-height: 420px;
    }
}

@media (max-width: 760px) {
    .site-nav,
    .page-shell,
    .hero-content {
        width: min(100% - 28px, 1180px);
    }

    .site-hero {
        min-height: 680px;
    }

    .site-nav {
        min-height: 76px;
    }

    .hero-content {
        min-height: 604px;
        padding: 32px 0 84px;
    }

    .hero-content h1 {
        font-size: clamp(52px, 18vw, 78px);
    }

    .hero-copy {
        font-size: 18px;
    }

    .toolbar,
    .admin-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .filters {
        justify-content: flex-start;
    }

    .project-grid {
        display: grid;
        grid-template-columns: 1fr;
    }

    .project-card,
    .project-card:nth-child(1),
    .project-card:nth-child(7n) {
        grid-column: 1;
        min-height: 390px;
    }

    .card-media,
    .card-body {
        min-height: 390px;
    }

    .card-body {
        padding: 22px;
    }

    .card-body h3,
    .project-card:not(:nth-child(1)):not(:nth-child(7n)) .card-body h3 {
        font-size: 25px;
    }

    .field-grid,
    .upload-grid,
    .media-admin-grid {
        grid-template-columns: 1fr;
    }

    .admin-body {
        display: block;
    }

    .admin-sidebar {
        min-height: auto;
        position: static;
    }

    .admin-main {
        padding: 18px;
    }

    .admin-project-item {
        grid-template-columns: 64px minmax(0, 1fr);
    }

    .item-actions {
        grid-column: 1 / -1;
        grid-template-columns: repeat(2, 1fr);
    }

    .lightbox {
        padding: 12px;
    }

    .lightbox-media,
    .external-video,
    .video-frame {
        min-height: 310px;
    }
}
