:root {
    --bg: #07101c;
    --bg-soft: #0d1929;
    --card: rgba(14, 28, 47, 0.82);
    --card-strong: rgba(18, 34, 57, 0.92);
    --text: #f4f7fc;
    --muted: #b7c4da;
    --accent: #d7a84d;
    --accent-2: #f1cc7a;
    --line: rgba(255, 255, 255, 0.08);
    --danger: #d95656;
    --success: #59c389;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
    --radius: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: Tahoma, Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(215, 168, 77, 0.14), transparent 24%),
        radial-gradient(circle at 85% 10%, rgba(255, 255, 255, 0.04), transparent 15%),
        linear-gradient(180deg, #08111f 0%, #0c1626 42%, #09111c 100%);
    color: var(--text);
}

a { color: inherit; text-decoration: none; }
img, video, iframe { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; }

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

.splash {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(6, 11, 21, 0.95);
    z-index: 9999;
    transition: opacity 0.9s ease, visibility 0.9s ease;
}

.splash.hidden {
    opacity: 0;
    visibility: hidden;
}

.splash-card {
    width: min(620px, calc(100% - 32px));
    padding: 38px;
    background: linear-gradient(160deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04));
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: var(--shadow);
    text-align: center;
    backdrop-filter: blur(14px);
}

.splash-badge,
.eyebrow,
.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(215, 168, 77, 0.25);
    color: var(--accent-2);
    background: rgba(215, 168, 77, 0.08);
    font-size: 13px;
}

.splash-card h1,
.hero-copy h1,
.admin-topbar h1 {
    margin: 16px 0 12px;
    line-height: 1.2;
    font-size: clamp(30px, 4vw, 54px);
}

.splash-card p,
.hero-copy p,
.intro-card p,
.mini-note p,
.admin-topbar p,
.helper-text,
.modal-header p,
.topic-body p,
.site-footer p,
.hero-stat span {
    color: var(--muted);
    line-height: 1.9;
}

.hero {
    position: relative;
    min-height: 88vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(115deg, rgba(0,0,0,0.45), rgba(0,0,0,0.18)),
        radial-gradient(circle at 12% 20%, rgba(215,168,77,0.18), transparent 24%),
        radial-gradient(circle at 80% 15%, rgba(255,255,255,0.06), transparent 14%),
        linear-gradient(135deg, #13233f 0%, #0d192d 48%, #08111f 100%);
    filter: saturate(0.96);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(8,17,31,0.12), rgba(8,17,31,0.94));
}

.hero-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 28px;
    align-items: center;
    padding: 84px 0 72px;
}

.hero-copy,
.hero-panel,
.hero-visual-card,
.intro-card,
.topic-card,
.modal-panel,
.admin-panel,
.admin-login-card,
.flash {
    background: linear-gradient(160deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.hero-copy {
    border-radius: 30px;
    padding: 38px;
}

.hero-copy h1 {
    max-width: 10ch;
}

.hero-actions,
.admin-topbar-actions,
.topics-row-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 26px;
}

.hero-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.hero-highlights span,
.tags span {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.05);
    color: #e8eefb;
    font-size: 13px;
}

.hero-visual-wrap {
    display: grid;
    gap: 16px;
}

.hero-visual-card {
    border-radius: 32px;
    padding: 18px;
    min-height: 360px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 22% 15%, rgba(215,168,77,0.18), transparent 26%),
        linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
}

.hero-car-image {
    width: 100%;
    max-width: 540px;
    height: auto;
    filter: drop-shadow(0 26px 40px rgba(0, 0, 0, 0.35));
}

.hero-panel {
    border-radius: 26px;
    padding: 18px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.hero-stat {
    padding: 18px 16px;
    border-radius: 18px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
}

.hero-stat strong {
    display: block;
    font-size: 22px;
    color: var(--accent-2);
    margin-bottom: 8px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 20px;
    border-radius: 14px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.btn:hover,
.topic-link:hover,
.modal-close:hover { transform: translateY(-1px); }

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #08111f;
    font-weight: 700;
}

.btn-secondary {
    background: rgba(255,255,255,0.06);
    color: var(--text);
    border-color: rgba(255,255,255,0.12);
}

.btn-danger {
    background: rgba(217, 86, 86, 0.14);
    color: #ffd8d8;
    border: 1px solid rgba(217, 86, 86, 0.35);
    margin-top: 14px;
}

.small-btn { min-height: 40px; padding: 9px 14px; }
.full-width { width: 100%; }

.main-content {
    margin-top: -48px;
    position: relative;
    z-index: 2;
    padding-bottom: 70px;
}

.intro-card {
    border-radius: 28px;
    padding: 28px;
    display: grid;
    grid-template-columns: 1.3fr 0.8fr;
    gap: 20px;
    align-items: start;
}

.intro-card h2 {
    margin: 14px 0 10px;
    font-size: clamp(24px, 3vw, 34px);
}

.mini-note {
    border-radius: 22px;
    padding: 20px;
    border: 1px dashed rgba(215,168,77,0.25);
    background: rgba(215,168,77,0.05);
}

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

.topic-card {
    border-radius: 24px;
    padding: 20px;
    display: grid;
    gap: 16px;
    min-height: 260px;
}

.topic-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.topic-icon,
.modal-icon {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: rgba(215,168,77,0.12);
    border: 1px solid rgba(215,168,77,0.18);
    font-size: 26px;
}

.topic-body h3 {
    margin: 0 0 10px;
    font-size: 22px;
    line-height: 1.45;
}

.tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.topic-link {
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: var(--text);
    cursor: pointer;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 999;
}

.modal.active { display: block; }

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 10, 18, 0.75);
}

.modal-panel {
    position: relative;
    z-index: 1;
    width: min(900px, calc(100% - 24px));
    margin: 32px auto;
    padding: 26px;
    border-radius: 28px;
    max-height: calc(100vh - 64px);
    overflow: auto;
}

.modal-close {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
    color: var(--text);
    cursor: pointer;
    font-size: 24px;
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
    padding-left: 50px;
}

.formatted-content {
    line-height: 2;
    color: #eef4ff;
}

.formatted-content ul,
.formatted-content ol {
    padding-right: 20px;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 26px;
}

.media-card {
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.03);
}

.media-card p {
    margin: 0;
    padding: 10px 12px 14px;
    color: var(--muted);
}

.embed-wrapper {
    position: relative;
    padding-top: 56.25%;
}

.embed-wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.site-footer {
    padding: 0 0 28px;
}

.footer-inner {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.admin-body {
    min-height: 100vh;
    padding: 28px 0 56px;
}

.admin-wrap { display: grid; gap: 22px; }

.admin-topbar {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: end;
}

.admin-grid {
    display: grid;
    grid-template-columns: 0.95fr 1.05fr;
    gap: 20px;
}

.admin-panel,
.admin-login-card {
    border-radius: 28px;
    padding: 24px;
}

.admin-login-card {
    width: min(520px, 100%);
    margin: 0 auto;
}

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

.panel-head {
    margin-bottom: 16px;
}

.stack-form {
    display: grid;
    gap: 14px;
}

label {
    display: grid;
    gap: 8px;
    color: #f7f8fd;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="url"],
textarea,
select,
input[type="file"] {
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: var(--text);
    padding: 12px 14px;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.topics-table-wrap { display: grid; gap: 16px; }

.topics-list {
    display: grid;
    gap: 12px;
}

.topics-row {
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
}

.topics-row strong {
    display: block;
    margin-bottom: 6px;
}

.flash {
    padding: 16px 18px;
    border-radius: 18px;
}

.flash-success { border-color: rgba(89, 195, 137, 0.35); }
.flash-error { border-color: rgba(217, 86, 86, 0.35); }

.existing-media-list {
    display: grid;
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255,255,255,0.03);
}

.media-keep-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255,255,255,0.04);
}

.compact-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.embed-chip {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 120px;
    border-radius: 16px;
    border: 1px dashed rgba(255,255,255,0.18);
    color: var(--muted);
}

code {
    font-family: Consolas, monospace;
    background: rgba(255,255,255,0.08);
    padding: 2px 6px;
    border-radius: 8px;
}

.mini-link {
    color: var(--accent-2);
    font-size: 14px;
}

@media (max-width: 1024px) {
    .hero-content,
    .intro-card,
    .admin-grid {
        grid-template-columns: 1fr;
    }

    .hero-copy h1 {
        max-width: none;
    }

    .cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero-panel {
        grid-template-columns: 1fr;
    }

    .compact-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .container { width: min(100% - 20px, 1180px); }

    .hero {
        min-height: auto;
    }

    .hero-content {
        padding: 74px 0 42px;
    }

    .hero-copy,
    .hero-visual-card,
    .hero-panel,
    .intro-card,
    .modal-panel,
    .admin-panel,
    .admin-login-card,
    .topic-card {
        border-radius: 22px;
    }

    .cards-grid,
    .media-grid,
    .compact-grid {
        grid-template-columns: 1fr;
    }

    .modal-panel {
        width: calc(100% - 16px);
        margin: 20px auto;
        max-height: calc(100vh - 40px);
        padding: 20px;
    }

    .admin-topbar,
    .footer-inner,
    .topics-row {
        align-items: start;
        flex-direction: column;
    }
}
