/* ============================================================
   WEAZEL NEWS — PERSONNEL DATABASE
   site.css
   ============================================================ */


/* ============================================================
   1. Variables
   ============================================================ */

:root {
    --bg: #080a0f;
    --line: #242936;

    --text: #f3f4f7;
    --muted: #8f96a6;

    --red: #e21e2b;
    --red2: #ff4651;
    --green: #52df95;
    --amber: #e9bd62;
}


/* ============================================================
   2. Reset / Base
   ============================================================ */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;

    background: var(--bg);
    color: var(--text);

    font-family: Inter, Arial, sans-serif;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;

    pointer-events: none;

    background-image:
        linear-gradient(
            rgba(255, 255, 255, 0.018) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.018) 1px,
            transparent 1px
        );

    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, black, transparent 75%);
}

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


/* ============================================================
   3. Ambient Background
   ============================================================ */

.ambient {
    position: fixed;

    border-radius: 50%;
    filter: blur(110px);

    pointer-events: none;
    opacity: 0.2;
}

.ambient-one {
    width: 460px;
    height: 460px;

    top: 40px;
    right: -180px;

    background: #d51628;
}

.ambient-two {
    width: 420px;
    height: 420px;

    left: -250px;
    bottom: 0;

    background: #4b2233;
}


/* ============================================================
   4. Header / Branding
   ============================================================ */

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;

    height: 88px;

    border-bottom: 1px solid rgba(255, 255, 255, 0.07);

    background: rgba(8, 10, 15, 0.76);
    backdrop-filter: blur(18px);
}

.topbar-inner {
    width: min(1440px, calc(100% - 56px));
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;

    margin: 0 auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 13px;
}

.brand-logo {
    display: block;

    width: auto;
    height: 46px;

    flex-shrink: 0;
    object-fit: cover;

    /* Реальное скругление bitmap, а не только рамки img. */
    border-radius: 9px;
    clip-path: inset(0 round 9px);
    overflow: hidden;

    /* Убирает артефакты по краям в Chromium/WebKit. */
    transform: translateZ(0);
    -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-copy strong {
    font: 800 14px Manrope;
    letter-spacing: 0.09em;
}

.brand-copy small {
    color: var(--muted);

    font-size: 11px;
    letter-spacing: 0.08em;
}

.topbar-meta {
    display: flex;
    align-items: center;
    gap: 9px;

    color: #a5abba;

    font-size: 12px;
}

.live-dot {
    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: var(--green);

    box-shadow: 0 0 0 5px rgba(82, 223, 149, 0.08);
}


/* ============================================================
   5. Main Layout
   ============================================================ */

.shell {
    width: min(1440px, calc(100% - 56px));
    margin: 0 auto;
}


/* ============================================================
   6. Hero
   ============================================================ */

.hero {
    position: relative;

    min-height: 390px;

    display: grid;
    grid-template-columns: 1.45fr 0.75fr;
    gap: 40px;
    align-items: start;

    padding: 70px 0 48px;

    border-bottom: 1px solid var(--line);
}

.hero::after {
    content: attr(data-code);

    position: absolute;
    right: 18px;
    bottom: -28px;

    color: rgba(255, 255, 255, 0.018);

    font: 800 180px Manrope;
    letter-spacing: -0.08em;

    pointer-events: none;
}

.eyebrow {
    margin-bottom: 18px;

    color: #9aa1b0;

    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
}

.eyebrow span {
    display: inline-block;

    width: 26px;
    height: 2px;

    margin-right: 9px;

    vertical-align: middle;

    background: var(--red);
}

.hero h1 {
    margin: 0;

    font: 800 clamp(50px, 6vw, 88px) / 0.9 Manrope;
    letter-spacing: -0.06em;
}

.hero h1 em {
    color: var(--red2);
    font-style: normal;
}

.hero-copy p {
    max-width: 650px;
    margin: 26px 0 0;

    color: #979ead;

    font-size: 15px;
    line-height: 1.7;
}

.hero-panel {
    width: min(100%, 410px);
    justify-self: end;

    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;

    padding: 24px;

    border: 1px solid #2a2f3c;
    border-radius: 28px;

    background:
        linear-gradient(
            145deg,
            rgba(26, 30, 41, 0.92),
            rgba(13, 16, 22, 0.94)
        );

    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.3);
}

.hero-stat {
    padding: 20px;

    border: 1px solid #222735;
    border-radius: 18px;

    background: #0b0e14;
}

.hero-stat span {
    color: #7f8797;

    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero-stat strong {
    display: block;

    margin-top: 7px;

    font: 800 42px Manrope;
}

.hero-caption {
    grid-column: 1 / -1;

    padding: 16px 4px 0;

    font: 700 15px Manrope;
    letter-spacing: 0.02em;
}

.hero-caption small {
    display: block;

    margin-top: 4px;

    color: #727989;

    font: 500 11px Inter;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}


/* ============================================================
   7. Toolbar / Search / Filters
   ============================================================ */

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;

    padding: 32px 0;
}

.search {
    height: 54px;
    max-width: 610px;
    flex: 1;

    display: flex;
    align-items: center;
    gap: 12px;

    padding: 0 17px;

    border: 1px solid #292e3a;
    border-radius: 16px;

    background: #0d1016;

    transition: 0.2s;
}

.search:focus-within {
    border-color: #535b6e;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.025);
}

.search-icon {
    color: #777f90;

    font-size: 22px;

    transform: rotate(-15deg);
}

.search input {
    width: 100%;

    border: 0;
    outline: 0;

    background: transparent;
    color: #fff;

    font: 500 13px Inter;
}

.search input::placeholder {
    color: #646c7c;
}

.filters {
    display: flex;
    gap: 5px;

    padding: 5px;

    border: 1px solid #262b37;
    border-radius: 15px;

    background: #0d1016;
}

.filter {
    padding: 11px 15px;

    border-radius: 10px;

    color: #858d9c;

    font-size: 12px;
    font-weight: 700;
}

.filter.active {
    background: #222733;
    color: #fff;
}


/* ============================================================
   8. Directory Header
   ============================================================ */

.directory-head {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 8px 0 18px;
}

.directory-head > div {
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-index {
    color: var(--red2);

    font: 800 11px Manrope;
}

.directory-head h2 {
    margin: 0;

    font: 700 18px Manrope;
}

.result-count {
    color: #6e7686;

    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}


/* ============================================================
   9. Employee Grid / Cards
   ============================================================ */

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

.employee-card {
    position: relative;

    display: flex;
    flex-direction: column;

    height: 100%;
    overflow: hidden;

    border: 1px solid #252a36;
    border-radius: 24px;

    background: linear-gradient(180deg, #121620 0%, #0e1118 100%);

    transition:
        transform 0.22s ease,
        border-color 0.22s ease,
        box-shadow 0.22s ease;
}

.employee-card:hover {
    transform: translateY(-4px);

    border-color: #3b4252;

    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}


/* Portrait
   ------------------------------------------------------------ */

.portrait-wrap {
    position: relative;

    height: 285px;
    overflow: hidden;

    background: #171b24;
}

.portrait-wrap::after {
    content: "";

    position: absolute;
    inset: auto 0 0;

    height: 50%;

    background:
        linear-gradient(
            to top,
            rgba(9, 11, 16, 0.95),
            transparent
        );
}

.portrait {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    filter: saturate(0.82) contrast(1.03);
}

.portrait.placeholder {
    display: grid;
    place-items: center;

    background:
        radial-gradient(
            circle at 50% 30%,
            #333a49,
            #161a23 62%
        );
}

.portrait.placeholder span {
    color: #70798c;

    font: 800 64px Manrope;
}


/* Status Badge
   ------------------------------------------------------------ */

.status {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 2;

    display: flex;
    align-items: center;
    gap: 7px;

    padding: 7px 10px;

    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 99px;

    background: rgba(7, 9, 13, 0.78);
    backdrop-filter: blur(10px);

    font-size: 10px;
    font-weight: 700;
}

.status i {
    width: 7px;
    height: 7px;

    border-radius: 50%;
}

.status-active i {
    background: var(--green);
    box-shadow: 0 0 12px rgba(82, 223, 149, 0.7);
}

.status-vacation i {
    background: var(--amber);
}

.status-inactive i {
    background: #7d8492;
}


/* Static ID Badge
   ------------------------------------------------------------ */

.static-chip {
    position: absolute;
    right: 15px;
    bottom: 14px;
    z-index: 2;

    padding: 7px 10px;

    border-radius: 9px;

    background: var(--red);
    color: #fff;

    font: 800 12px Manrope;

    box-shadow: 0 8px 25px rgba(226, 30, 43, 0.25);
}


/* Card Content
   ------------------------------------------------------------ */

.card-body {
    display: flex;
    flex-direction: column;
    flex: 1;

    padding: 21px 21px 15px;
}

.role {
    margin-bottom: 7px;

    color: var(--red2);

    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.card-body h3 {
    margin: 0 0 18px;

    font: 600 20px / 1.15 Manrope;
    letter-spacing: -0.025em;
}

.card-body h3 strong {
    font-weight: 800;
}

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

.fact-timezone,
.fact-full {
    grid-column: 1 / -1;
}

.fact {
    min-width: 0;

    padding: 11px 12px;

    border: 1px solid #242936;
    border-radius: 12px;

    background: #0b0e14;
}

.fact span {
    display: block;

    margin-bottom: 5px;

    color: #666e7e;

    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.15em;
}

.fact b {
    display: block;

    overflow: hidden;

    font-size: 11px;
    font-weight: 600;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.bio {
    height: 58px;
    min-height: 58px;
    margin: 16px 0 4px;

    display: -webkit-box;
    overflow: hidden;

    color: #9299a8;

    font-size: 12px;
    line-height: 1.6;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}


/* Card Footer
   ------------------------------------------------------------ */

.card-footer {
    flex-shrink: 0;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 13px 0 21px;

    border-top: 1px solid #202531;
}

.card-footer > span {
    color: #4d5463;

    font: 800 8px Manrope;
    letter-spacing: 0.18em;
}

.expand {
    width: 30px;
    height: 30px;

    border: 1px solid #2d3340;
    border-radius: 9px;

    background: #171b24;
    color: #aeb5c2;

    cursor: pointer;

    transition: 0.2s;
}

.expand:hover {
    border-color: var(--red);

    background: var(--red);
    color: #fff;
}


/* ============================================================
   10. Empty State
   ============================================================ */

.empty {
    padding: 90px 20px;

    border: 1px dashed #2c3240;
    border-radius: 24px;

    text-align: center;
}

.empty-mark {
    width: 64px;
    height: 64px;

    display: grid;
    place-items: center;

    margin: 0 auto 20px;

    border-radius: 18px;

    background: #171b24;
    color: var(--red);

    font: 800 18px Manrope;
}

.empty h3 {
    margin: 0 0 8px;
}

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

.empty a {
    display: inline-block;

    margin-top: 10px;

    color: var(--red2);

    font-size: 13px;
    font-weight: 700;
}


/* ============================================================
   11. Modal
   ============================================================ */

.modal {
    position: fixed;
    inset: 0;
    z-index: 50;

    display: none;
}

.modal.open {
    display: block;
}

.modal-backdrop {
    position: absolute;
    inset: 0;

    background: rgba(4, 5, 8, 0.78);
    backdrop-filter: blur(10px);
}

.modal-card {
    position: relative;

    width: min(520px, calc(100% - 32px));
    max-height: 90vh;

    margin: 5vh auto;

    overflow: auto;

    border-radius: 24px;
    background: #0e1118;

    box-shadow: 0 40px 110px rgba(0, 0, 0, 0.6);
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 9;

    width: 36px;
    height: 36px;

    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;

    background: rgba(10, 12, 17, 0.75);
    color: #fff;

    font-size: 23px;

    cursor: pointer;
}

.modal .employee-card {
    transform: none;
    border-radius: 24px;
}

.modal .portrait-wrap {
    height: 430px;
}

.modal .bio {
    min-height: 0;

    -webkit-line-clamp: unset;
}

.modal .card-footer {
    display: none;
}

.modal-open {
    overflow: hidden;
}


/* ============================================================
   12. Footer
   ============================================================ */

footer {
    display: flex;
    justify-content: space-between;

    margin-top: 50px;
    padding: 28px 0 40px;

    border-top: 1px solid var(--line);

    color: #555d6c;

    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.15em;
}


/* ============================================================
   13. Responsive — Desktop / Tablet
   ============================================================ */

@media (max-width: 1150px) {
    .grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .hero {
        grid-template-columns: 1.25fr 0.75fr;
    }

    .hero h1 {
        font-size: 64px;
    }
}


/* ============================================================
   14. Responsive — Tablet
   ============================================================ */

@media (max-width: 860px) {
    .topbar {
        padding: 0 20px;
    }

    .shell {
        width: min(100% - 32px, 1440px);
    }

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

        padding-top: 48px;
    }

    .hero-panel {
        width: 100%;

        justify-self: start;
    }

    .hero::after {
        display: none;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search {
        max-width: none;
    }

    .filters {
        align-self: flex-start;
    }

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


/* ============================================================
   15. Responsive — Mobile
   ============================================================ */

@media (max-width: 560px) {
    .topbar {
        height: 72px;
    }

    .brand-logo {
        height: 38px;

        border-radius: 8px;
        clip-path: inset(0 round 8px);
    }

    .brand-copy strong {
        font-size: 12px;
    }

    .brand-copy small {
        font-size: 9px;
    }

    .topbar-meta {
        font-size: 10px;
    }

    .shell {
        width: calc(100% - 24px);
    }

    .hero {
        min-height: 0;

        padding: 42px 0 34px;
    }

    .hero h1 {
        font-size: 49px;
    }

    .hero-copy p {
        font-size: 13px;
    }

    .hero-panel {
        padding: 14px;

        border-radius: 20px;
    }

    .hero-stat {
        padding: 15px;
    }

    .hero-stat strong {
        font-size: 34px;
    }

    .toolbar {
        gap: 14px;
    }

    .filters {
        width: 100%;

        overflow-x: auto;
    }

    .filter {
        flex: 1;

        text-align: center;
        white-space: nowrap;
    }

    .directory-head {
        padding-top: 0;
    }

    .result-count {
        display: none;
    }

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

    .portrait-wrap {
        height: 360px;
    }

    footer {
        flex-direction: column;
        gap: 12px;
    }

    .modal .portrait-wrap {
        height: 380px;
    }
}


/* ============================================================
   16. Main Navigation
   ============================================================ */

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;

    padding: 5px;

    border: 1px solid #262b37;
    border-radius: 14px;

    background: #0d1016;
}

.main-nav a {
    padding: 9px 12px;

    border-radius: 9px;

    color: #7f8797;

    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;

    transition:
        color 0.2s ease,
        background 0.2s ease;
}

.main-nav a:hover {
    color: #fff;
}

.main-nav a.active {
    background: #222733;
    color: #fff;
}


/* ============================================================
   17. Home / Department Cards
   ============================================================ */

.home-hero {
    min-height: 360px;
}

.department-title {
    max-width: 880px;

    font-size: clamp(46px, 5vw, 76px) !important;
    line-height: 0.98 !important;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 38px 0 20px;
}

.section-heading > div {
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-heading h2 {
    margin: 0;

    font: 700 20px Manrope;
}

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

.department-card {
    min-height: 330px;

    display: flex;
    flex-direction: column;

    padding: 26px;

    overflow: hidden;
    position: relative;

    border: 1px solid #252a36;
    border-radius: 24px;

    background:
        radial-gradient(
            circle at 95% 0%,
            rgba(226, 30, 43, 0.13),
            transparent 38%
        ),
        linear-gradient(180deg, #121620 0%, #0e1118 100%);

    transition:
        transform 0.22s ease,
        border-color 0.22s ease,
        box-shadow 0.22s ease;
}

.department-card:hover {
    transform: translateY(-4px);

    border-color: #41495a;

    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.department-code {
    position: absolute;
    top: -12px;
    right: 16px;

    color: rgba(255, 255, 255, 0.035);

    font: 800 116px / 1 Manrope;
    letter-spacing: -0.08em;

    pointer-events: none;
}

.department-card-content {
    position: relative;
    z-index: 1;
}

.department-kicker {
    color: var(--red2);

    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.department-card h3 {
    max-width: 310px;

    margin: 18px 0 12px;

    font: 800 28px / 1.05 Manrope;
    letter-spacing: -0.035em;
}

.department-card p {
    max-width: 360px;
    margin: 0;

    color: #8f96a6;

    font-size: 12px;
    line-height: 1.65;
}

.department-card-footer {
    position: relative;
    z-index: 1;

    display: grid;
    grid-template-columns: auto auto 1fr;
    align-items: end;
    gap: 22px;

    margin-top: auto;
    padding-top: 24px;

    border-top: 1px solid #202531;
}

.department-card-footer > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.department-card-footer strong {
    font: 800 23px Manrope;
}

.department-card-footer span:not(.department-arrow) {
    color: #646c7c;

    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.department-arrow {
    justify-self: end;

    width: 36px;
    height: 36px;

    display: grid;
    place-items: center;

    border: 1px solid #2d3340;
    border-radius: 10px;

    background: #171b24;
    color: #aeb5c2;

    transition:
        color 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease;
}

.department-card:hover .department-arrow {
    border-color: var(--red);

    background: var(--red);
    color: #fff;
}


/* ============================================================
   18. Employee Fact Layout
   ============================================================ */

.fact-timezone b {
    overflow: visible;

    white-space: normal;
    text-overflow: unset;
    line-height: 1.45;
}


/* ============================================================
   19. Responsive — Navigation / Departments
   ============================================================ */

@media (max-width: 1100px) {
    .topbar-meta {
        display: none;
    }

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

@media (max-width: 860px) {
    .topbar-inner {
        width: calc(100% - 32px);
        gap: 18px;
    }

    .brand-copy {
        display: none;
    }

    .main-nav {
        margin-left: auto;
        overflow-x: auto;
    }

    .main-nav a {
        padding: 8px 10px;
    }
}

@media (max-width: 620px) {
    .topbar {
        height: auto;
        min-height: 76px;

        padding: 10px 0;
    }

    .topbar-inner {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .brand-logo {
        height: 38px;
    }

    .main-nav {
        width: 100%;
        order: 3;

        justify-content: flex-start;
    }

    .main-nav a {
        flex: 0 0 auto;
    }

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

    .department-card {
        min-height: 290px;
    }

    .department-title {
        font-size: 43px !important;
    }
}


/* ============================================================
   20. Home Directory
   ============================================================ */

/*
 * Главная использует те же базовые компоненты, что и страницы отделов:
 * .toolbar, .directory-head, .grid и .employee-card.
 * Здесь остаются только правила, которых нет на странице отдела.
 */

.home-search-toolbar .search {
    width: 100%;
    max-width: none;
}

.home-search-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 42px;
    padding: 0 16px;

    border: 1px solid #2a303d;
    border-radius: 12px;

    background: #11151d;

    color: #a9afbc;

    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}

.home-search-reset:hover {
    border-color: #3a4252;
    color: #fff;
}

.home-search-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin: -14px 0 24px;
    padding: 11px 14px;

    border: 1px solid #222834;
    border-radius: 12px;

    background: rgba(15, 18, 26, 0.72);

    color: #7f8796;

    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.home-search-summary strong {
    color: #f0f2f6;
    font-size: 12px;
}

.home-directory-section + .home-directory-section {
    margin-top: 46px;
}

.home-directory-section .directory-head {
    padding: 8px 0 18px;
}

.home-directory-section .grid,
.home-directory-section .department-grid {
    margin: 0;
}

.home-directory-section .empty {
    margin-top: 0;
}

.home-directory-section:last-of-type {
    margin-bottom: 10px;
}


/* ============================================================
   Employee facts / card height refinement
   ============================================================ */

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

.fact-timezone,
.fact-full {
    grid-column: 1 / -1;
}

/*
 * Do not stretch the card body just to match the tallest card in the row.
 * Cards keep their natural content height; the grid row no longer creates
 * a large empty area under shorter bios.
 */
.grid {
    align-items: start;
}

.employee-card {
    height: auto;
}

.card-body {
    flex: 0 0 auto;
}

.card-footer {
    margin-top: 0;
}
