:root {
    --navy: #0a1628;
    --navy-mid: #102240;
    --navy-light: #1a3460;
    --gold: #c9a84c;
    --gold-light: #e8c97a;
    --gold-pale: #f5e9c8;
    --cream: #faf8f3;
    --white: #ffffff;
    --gray-100: #f4f4f7;
    --gray-200: #e8e8ed;
    --gray-400: #9898a8;
    --gray-600: #585868;
    --text-dark: #12121e;
    --ph-blue: #1a2fa0;
    --ph-blue-dark: #111f7a;
    --ph-blue-glow: rgba(26, 47, 160, 0.35);
}

html {
    scroll-behavior: smooth;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Sarabun', sans-serif;
    background: var(--cream);
    color: var(--text-dark);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ─── FORMAL BACKGROUND PATTERN ─── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        repeating-linear-gradient(-55deg,
            transparent,
            transparent 30px,
            rgba(26, 47, 160, 0.03) 30px,
            rgba(26, 47, 160, 0.03) 32px);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(26, 47, 160, 0.13) 1.5px, transparent 1.5px),
        radial-gradient(circle, rgba(201, 168, 76, 0.10) 1px, transparent 1px);
    background-size: 28px 28px, 56px 56px;
    background-position: 0 0, 14px 14px;
    animation: bgDrift 16s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes bgDrift {
    from {
        background-position: 0 0, 14px 14px;
    }

    to {
        background-position: 28px 28px, 42px 42px;
    }
}

/* ─── ORG SECTION ─── */
.org-section {
    flex: 1;
    padding: 60px 20px 100px;
    background: transparent;
    position: relative;
    z-index: 1;
}

.tree-wrap {
    position: relative;
    width: 100%;
}

#line-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
    z-index: 0;
}

/* ─── CARD (same as hospital.html) ─── */
.card {
    position: absolute;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(26, 47, 160, 0.13);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 2px solid #c5cbee;
    width: 200px;
    z-index: 2;
    cursor: pointer;

    opacity: 0;
    transform: translateY(30px) scale(0.96);
    transition:
        opacity 0.5s ease,
        transform 0.5s ease,
        box-shadow 0.3s ease,
        border-color 0.3s ease;
}

.card.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow:
        0 16px 40px var(--ph-blue-glow),
        0 0 0 1px var(--gold-light);
    border-color: var(--ph-blue);
    z-index: 10;
}

/* Director card blue border */
#c-dir {
    border-color: var(--ph-blue);
}

#c-dir:hover {
    border-color: var(--ph-blue);
}

/* ─── SHIMMER OVERLAY on hover ─── */
.card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg,
            transparent 0%,
            rgba(255, 255, 255, 0.18) 40%,
            rgba(255, 255, 255, 0.45) 50%,
            rgba(255, 255, 255, 0.18) 60%,
            transparent 100%);
    background-size: 250% 100%;
    background-position: -100% 0;
    z-index: 5;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.card:hover::before {
    opacity: 1;
    animation: shimmer 0.75s ease forwards;
}

@keyframes shimmer {
    0% {
        background-position: -100% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* ─── PHOTO WRAP ─── */
.card-photo-wrap {
    position: relative;
    width: 100%;
    flex-shrink: 0;
}

.card-photo {
    width: 100%;
    height: 210px;
    overflow: hidden;
    background: #e8ecf8;
}

.card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    transition: transform 0.5s ease;
    filter: saturate(0.9);
}

.card:hover .card-photo img {
    transform: scale(1.08);
    filter: saturate(1.15) brightness(1.04);
}

/* ─── LOGO BADGE ─── */
.card-logo {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover .card-logo {
    transform: scale(1.15) rotate(-5deg);
    box-shadow: 0 4px 14px rgba(201, 168, 76, 0.5);
}

.card-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ─── ROLE RIBBON (top-right corner) ─── */
.card-ribbon {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--gold);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 3px 8px 3px 14px;
    clip-path: polygon(10px 0%, 100% 0%, 100% 100%, 0% 100%);
    z-index: 4;
    opacity: 0;
    transform: translateX(8px);
    transition: opacity 0.3s, transform 0.3s;
}

.card:hover .card-ribbon {
    opacity: 1;
    transform: translateX(0);
}

/* placeholder silhouette */
.card-photo-ph {
    width: 100%;
    height: 210px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: linear-gradient(180deg, #dce2f7 0%, #b0bcee 100%);
}

.card-photo-ph svg {
    width: 65%;
    height: 80%;
    opacity: 0.30;
    fill: var(--ph-blue);
}

/* ─── INFO BAR ─── */
.card-info {
    padding: 10px 12px 12px;
    text-align: center;
    width: 100%;
    background: var(--ph-blue);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 72px;
    transition: background 0.3s ease;
}

.card:hover .card-info {
    background: var(--ph-blue-dark);
}

/* Director card: blue accent top border */
#c-dir .card-info {
    background: linear-gradient(145deg, var(--ph-blue) 0%, var(--ph-blue-dark) 100%);
    border-top: 2px solid var(--ph-blue-glow);
}

.card-name {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.4;
    margin-bottom: 4px;
    transition: color 0.3s;
}

.card:hover .card-name {
    color: var(--gold-light);
}

.card-pos {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.4;
    display: block;
    white-space: nowrap;
    margin-bottom: 3px;

}

/* ─── PULSE RING for director card ─── */
#c-dir::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 16px;
    border: 2px solid var(--ph-blue);
    opacity: 0;
    animation: pulse-ring 3s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes pulse-ring {
    0% {
        opacity: 0;
        transform: scale(1);
    }

    40% {
        opacity: 0.55;
    }

    100% {
        opacity: 0;
        transform: scale(1.06);
    }
}

/* ─── STAGGER delays ─── */
#c-dir {
    transition-delay: 0.05s;
}

#c-r1 {
    transition-delay: 0.15s;
}

#c-r2 {
    transition-delay: 0.22s;
}

#c-r3 {
    transition-delay: 0.29s;
}

#c-r4 {
    transition-delay: 0.38s;
}

#c-r5 {
    transition-delay: 0.45s;
}

#c-r6 {
    transition-delay: 0.52s;
}

/* ─── SVG connectors hidden ─── */
#line-canvas {
    display: none;
}