:root {
    --primary-red: #8B0000;
    --dark-red: #500000;
    --bg-light: #f7f9fc;
    --card-bg: #ffffff;
    --text-main: #2b2d42;
    --text-muted: #6c757d;
    --cross-size: min(560px, 85vw);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
}

.container {
    width: 92%;
    max-width: 1200px;
    margin: 0 auto;
}

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #0d0f12;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 1;
    transition: opacity 0.5s ease-out;
    overflow: hidden;
}

.cross-wrapper {
    position: relative;
    width: var(--cross-size);
    height: var(--cross-size);
    display: flex;
    filter: drop-shadow(0 0 35px rgba(139, 0, 0, 0.9));
}

.cross-half {
    width: 50%;
    height: 100%;
    overflow: hidden;
    position: relative;
    transition: transform 1s cubic-bezier(0.77, 0, 0.175, 1), opacity 0.8s ease;
}

.cross-left::before,
.cross-right::before {
    content: '';
    position: absolute;
    top: 0;
    width: var(--cross-size);
    height: var(--cross-size);
    background-color: var(--primary-red);
    clip-path: polygon(
        35% 0%, 65% 0%, 65% 35%, 100% 35%, 
        100% 65%, 65% 65%, 65% 100%, 35% 100%, 
        35% 65%, 0% 65%, 0% 35%, 35% 35%
    );
}

.cross-left::before {
    left: 0;
}

.cross-right::before {
    left: calc(var(--cross-size) * -0.5);
}

.cross-wrapper.split .cross-left {
    transform: translateX(-60vw) rotate(-20deg);
    opacity: 0;
}

.cross-wrapper.split .cross-right {
    transform: translateX(60vw) rotate(20deg);
    opacity: 0;
}

.site-header {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.branding {
    display: flex;
    flex-direction: column;
}

.logo-box {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-red);
}

.logo-mark {
    background: var(--primary-red);
    color: #fff;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 1.3rem;
    font-weight: 900;
    flex-shrink: 0;
}

.tagline {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    margin-top: 2px;
}

.main-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.main-nav a:hover {
    color: var(--primary-red);
}

.hero-section {
    background: linear-gradient(135deg, #16181f 0%, #0d0f12 100%);
    color: #ffffff;
    padding: 3.5rem 0 2.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section h1 {
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    font-weight: 800;
    margin-bottom: 0.8rem;
    line-height: 1.2;
}

.hero-section p {
    font-size: clamp(0.95rem, 2.5vw, 1.15rem);
    color: #bac0cb;
    max-width: 650px;
    margin: 0 auto 2rem;
    padding: 0 10px;
}

.ecg-container {
    width: 100%;
    max-width: 900px;
    height: 75px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.ecg-svg {
    width: 1800px;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    animation: ecg-scroll 3s linear infinite;
}

.ecg-path {
    fill: none;
    stroke: #ff2a2a;
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 8px rgba(255, 42, 42, 0.9));
}

@keyframes ecg-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-900px);
    }
}

.section-title {
    text-align: center;
    margin: 2.8rem 0 1.8rem;
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: var(--text-main);
}

.cards-grid-3d {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    perspective: 1200px;
    margin-bottom: 3.5rem;
}

.card-3d-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.card-3d {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 2rem 1.5rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    transform-style: preserve-3d;
    border-bottom: 4px solid var(--primary-red);
    height: 100%;
}

@media (hover: hover) and (pointer: fine) {
    .card-3d:hover {
        transform: translateY(-8px) rotateX(8deg) rotateY(4deg) scale(1.02);
        box-shadow: 0 18px 30px rgba(139, 0, 0, 0.18);
    }
}

.card-3d .card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    transform: translateZ(30px);
}

.card-3d h3 {
    margin-bottom: 0.6rem;
    font-size: 1.25rem;
    transform: translateZ(25px);
}

.card-3d p {
    color: var(--text-muted);
    font-size: 0.92rem;
    transform: translateZ(15px);
}

.card-cta {
    margin-top: 1.2rem;
    display: inline-block;
    color: var(--primary-red);
    font-weight: 700;
    font-size: 0.95rem;
    transform: translateZ(15px);
}

.doctors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 3.5rem;
}

.doctor-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #ebebeb;
}

.doctor-photo-placeholder {
    width: 120px;
    height: 140px;
    margin: 0 auto 1.2rem;
    border-radius: 18px;
    border: 2px dashed #b0b4b8;
    background-color: #f1f3f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9aa0a6;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.doctor-card h4 {
    font-size: 1.15rem;
    margin-bottom: 0.3rem;
}

.doctor-card .degree {
    font-size: 0.82rem;
    color: var(--primary-red);
    font-weight: 600;
    margin-bottom: 0.4rem;
    word-break: break-word;
}

.doctor-card .spec {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.dept-header-card {
    background: #fff;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-bottom: 2.5rem;
}

.site-footer {
    background: #18191c;
    color: #a4a7af;
    text-align: center;
    padding: 1.8rem 1rem;
    margin-top: 4rem;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .branding {
        align-items: center;
    }

    .main-nav {
        justify-content: center;
        gap: 15px;
    }

    .main-nav a {
        font-size: 0.9rem;
    }

    .hero-section {
        padding: 2.8rem 0 2rem;
    }

    .ecg-container {
        height: 60px;
    }

    .cards-grid-3d,
    .doctors-grid {
        grid-template-columns: 1fr;
    }

    .card-3d:active {
        background-color: #fcfcfc;
        transform: scale(0.98);
    }
}