:root {
    --landing-bg: #f6f8fc;
    --landing-surface: rgba(255, 255, 255, 0.84);
    --landing-surface-strong: rgba(255, 255, 255, 0.96);
    --landing-border: rgba(148, 163, 184, 0.24);
    --landing-text: #0f172a;
    --landing-muted: #475569;
    --landing-subtle: #64748b;
    --landing-accent: #7c3aed;
    --landing-accent-soft: rgba(124, 58, 237, 0.12);
    --landing-accent-strong: #7c3aed;
    --landing-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
    --landing-hover-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
    --landing-shadow-sm: 0 12px 28px rgba(15, 23, 42, 0.08);
    --landing-card-bg: #ffffff;
    --landing-card-border: #e2e8f0;
    --landing-card-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --landing-card-hover-shadow: 0 10px 30px rgba(139, 92, 246, 0.15);
    --landing-code-bg: rgba(243, 244, 246, 0.6);
    --landing-code-border: #e2e8f0;
    --landing-code-text: #1e293b;
    --landing-link-chip-bg: rgba(148, 163, 184, 0.12);
    --landing-link-chip-border: rgba(148, 163, 184, 0.24);
    --landing-link-chip-text: #475569;
    --landing-divider: #e2e8f0;
    --landing-radius-xl: 28px;
    --landing-radius-lg: 22px;
    --landing-radius-md: 18px;
    --landing-radius-sm: 14px;
    --landing-hero-bg:
        radial-gradient(circle at top left, rgba(124, 58, 237, 0.12), transparent 34%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.92));
    --landing-page-bg:
        radial-gradient(circle at top left, rgba(124, 58, 237, 0.1), transparent 32%),
        radial-gradient(circle at top right, rgba(14, 165, 233, 0.1), transparent 28%),
        linear-gradient(180deg, #f8fafc 0%, #eef2ff 58%, #f8fafc 100%);
    --landing-grid-line: rgba(15, 23, 42, 0.05);
}

html.dark {
    --landing-bg: #060816;
    --landing-surface: rgba(13, 19, 40, 0.72);
    --landing-surface-strong: rgba(15, 23, 42, 0.9);
    --landing-border: rgba(148, 163, 184, 0.22);
    --landing-text: #eef2ff;
    --landing-muted: #cbd5e1;
    --landing-subtle: #94a3b8;
    --landing-accent: #8b5cf6;
    --landing-accent-soft: rgba(139, 92, 246, 0.15);
    --landing-accent-strong: #c4b5fd;
    --landing-shadow: 0 24px 60px rgba(3, 7, 18, 0.38);
    --landing-hover-shadow: 0 18px 42px rgba(15, 23, 42, 0.32);
    --landing-shadow-sm: 0 14px 30px rgba(2, 6, 23, 0.26);
    --landing-card-bg: #1e293b;
    --landing-card-border: #334155;
    --landing-card-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    --landing-card-hover-shadow: 0 10px 30px rgba(139, 92, 246, 0.2);
    --landing-code-bg: rgba(15, 23, 42, 0.6);
    --landing-code-border: #334155;
    --landing-code-text: #f1f5f9;
    --landing-link-chip-bg: rgba(15, 23, 42, 0.5);
    --landing-link-chip-border: rgba(71, 85, 105, 0.9);
    --landing-link-chip-text: #cbd5e1;
    --landing-divider: #334155;
    --landing-hero-bg:
        radial-gradient(circle at top left, rgba(124, 58, 237, 0.26), transparent 34%),
        linear-gradient(145deg, rgba(12, 19, 40, 0.92), rgba(10, 14, 26, 0.84));
    --landing-page-bg:
        radial-gradient(circle at top left, rgba(124, 58, 237, 0.26), transparent 34%),
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.18), transparent 28%),
        linear-gradient(180deg, #0b1022 0%, #060816 58%, #04050b 100%);
    --landing-grid-line: rgba(255, 255, 255, 0.02);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Plus Jakarta Sans", sans-serif;
    color: var(--landing-text);
    background: var(--landing-page-bg);
    transition: background 0.25s ease, color 0.25s ease;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(var(--landing-grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--landing-grid-line) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 88%);
}

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

button,
input {
    font: inherit;
}

.hidden {
    display: none !important;
}

.landing-shell {
    position: relative;
    max-width: 1320px;
    margin: 0 auto;
    padding: 28px 24px 48px;
}

.landing-header,
.landing-header__actions,
.landing-controls,
.landing-brand,
.landing-nav a,
.landing-toggle {
    display: flex;
    align-items: center;
}

.landing-header {
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 30px;
}

.landing-header__actions,
.landing-controls {
    gap: 12px;
}

.landing-brand {
    gap: 16px;
}

.landing-brand img {
    width: 52px;
    height: 52px;
    display: block;
    object-fit: contain;
}

.landing-brand__eyebrow,
.hero__eyebrow,
.finder__eyebrow {
    display: inline-block;
    margin-bottom: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--landing-accent-strong);
}

.landing-brand h1 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 800;
}

.landing-nav a,
.landing-toggle {
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 999px;
    color: var(--landing-text);
    background: var(--landing-surface);
    border: 1px solid var(--landing-border);
    box-shadow: var(--landing-shadow-sm);
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.landing-toggle {
    min-width: 46px;
    padding: 0 14px;
    cursor: pointer;
}

.landing-toggle--text {
    min-width: 54px;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.landing-nav a:hover,
.landing-toggle:hover {
    transform: translateY(-1px);
    background: var(--landing-surface-strong);
    border-color: rgba(124, 58, 237, 0.3);
}

.landing-toggle .icon-sun {
    display: none;
}

html.dark .landing-toggle .icon-sun {
    display: block;
}

html.dark .landing-toggle .icon-moon {
    display: none;
}

.hero,
.finder {
    border-radius: 20px;
    border: 1px solid var(--landing-border);
    box-shadow: var(--landing-shadow);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
    gap: 28px;
    align-items: stretch;
    padding: 24px;
    background: var(--landing-hero-bg);
    overflow: hidden;
}

.hero__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 12px 6px 12px 8px;
}

.hero__content h2 {
    margin: 0 0 16px;
    font-size: clamp(2.2rem, 4vw, 3.7rem);
    line-height: 1.02;
    letter-spacing: -0.04em;
}

.hero__content p {
    max-width: 58ch;
    margin: 0;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--landing-muted);
}

.hero__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 26px;
}

.hero-stat {
    min-width: 150px;
    padding: 14px 16px;
    border-radius: var(--landing-radius-md);
    background: var(--landing-surface);
    border: 1px solid var(--landing-border);
    box-shadow: var(--landing-shadow-sm);
    backdrop-filter: blur(10px);
}

.hero-stat__label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.82rem;
    color: var(--landing-subtle);
}

.hero-stat strong {
    font-size: 1.1rem;
    font-weight: 800;
}

.hero__visual {
    position: relative;
    min-height: 380px;
    border-radius: calc(var(--landing-radius-xl) - 8px);
    overflow: hidden;
}

.hero__visual::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(6, 10, 24, 0.12), rgba(6, 10, 24, 0.52)),
        linear-gradient(135deg, rgba(139, 92, 246, 0.08), transparent 48%);
}

.hero__visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero__badge {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 20px;
    z-index: 1;
    padding: 16px 18px;
    border-radius: var(--landing-radius-md);
    background: rgba(10, 16, 34, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #f8fafc;
    backdrop-filter: blur(12px);
}

.hero__badge span {
    display: block;
    margin-bottom: 4px;
    font-size: 0.78rem;
    color: #ddd6fe;
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.hero__badge strong {
    font-size: 1rem;
    font-weight: 700;
}

.finder {
    margin-top: 30px;
    padding: 26px;
    background: var(--landing-surface-strong);
}

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

.finder__header h2 {
    margin: 0;
    font-size: clamp(1.6rem, 2vw, 2.2rem);
    letter-spacing: -0.03em;
}

.finder__search {
    width: min(100%, 360px);
}

.finder__search-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.82rem;
    color: var(--landing-subtle);
}

.finder__search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 54px;
    padding: 0 16px;
    border-radius: 18px;
    background: var(--landing-surface);
    border: 1px solid var(--landing-border);
    box-shadow: var(--landing-shadow-sm);
}

.finder__search-box input {
    width: 100%;
    color: var(--landing-text);
    background: transparent;
    border: 0;
    outline: 0;
}

.finder__search-box input::placeholder {
    color: var(--landing-subtle);
}

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

.department-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 316px;
    padding: 24px;
    border-radius: 1.5rem;
    background: var(--landing-card-bg);
    border: 1px solid var(--landing-card-border);
    box-shadow: var(--landing-card-shadow);
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.department-card:hover {
    transform: translateY(-4px);
    border-color: var(--dept-tag-border, #8b5cf6);
    box-shadow: var(--landing-card-hover-shadow);
}

.department-card__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 20px;
}

.department-card__category {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.625rem;
    border-radius: 0.375rem;
    background: var(--dept-tag-bg, var(--landing-accent-soft));
    border: 1px solid var(--dept-tag-border, rgba(124, 58, 237, 0.3));
    color: var(--dept-tag-text, var(--landing-accent-strong));
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.department-card__category-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: currentColor;
}

.department-card__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--landing-link-chip-border);
    background: var(--landing-link-chip-bg);
    color: var(--landing-link-chip-text);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    flex-shrink: 0;
}

.department-card__code-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.department-card__code {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.025em;
    background: var(--landing-code-bg);
    border: 1px solid var(--landing-code-border);
    color: var(--landing-code-text);
}

.department-card__content {
    min-width: 0;
}

.department-card h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.department-card p {
    margin: 0.5rem 0 0;
    color: var(--landing-muted);
    line-height: 1.45;
    font-size: 0.875rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.department-card__leader {
    margin-top: 16px;
}

.department-card__leader-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--landing-subtle);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.department-card__leader strong {
    display: block;
    font-size: 0.98rem;
    line-height: 1.5;
}

.department-card__leader small {
    display: block;
    margin-top: 4px;
    color: var(--landing-muted);
    line-height: 1.5;
}

.department-card__stats-section {
    margin-top: auto;
    border-top: 1px solid var(--landing-divider);
    padding-top: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 14px;
}

.department-card__stat-group {
    display: flex;
    flex-direction: column;
}

.department-card__stat-group--right {
    text-align: right;
}

.department-card__stat-label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--landing-subtle);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.department-card__stat-value {
    display: block;
    font-size: 1.875rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1;
}

.department-card__stat-value--primary {
    color: var(--landing-text);
}

.department-card__stat-value--secondary {
    color: var(--landing-muted);
}

.finder__empty {
    margin: 24px 0 0;
    padding: 18px;
    border-radius: 18px;
    text-align: center;
    background: rgba(148, 163, 184, 0.08);
    border: 1px dashed rgba(148, 163, 184, 0.28);
    box-shadow: var(--landing-shadow-sm);
    color: var(--landing-muted);
}

@media (max-width: 1160px) {
    .department-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 960px) {
    .landing-header,
    .landing-header__actions,
    .finder__header {
        flex-direction: column;
        align-items: start;
    }

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

    .hero__visual {
        min-height: 300px;
    }

    .finder__search {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .landing-shell {
        padding: 18px 16px 32px;
    }

    .hero,
    .finder {
        padding: 18px;
    }

    .department-grid {
        grid-template-columns: 1fr;
    }

    .department-card {
        min-height: 0;
        padding: 20px;
    }

    .department-card__stats-section {
        flex-direction: column;
        align-items: flex-start;
    }

    .department-card__stat-group--right {
        text-align: left;
    }

    .hero__content h2 {
        font-size: 2rem;
    }

    .landing-controls {
        width: 100%;
    }

    .landing-nav,
    .landing-nav a,
    .landing-toggle {
        width: 100%;
    }
}
