/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --navy-dark: #030810;
    --navy-medium: #07111f;
    --navy-light: #0c1a2e;
    --blue-accent: #4a7ba7;
    --blue-bright: #6ba3d4;
    --text-light: #e8f1f8;
    --text-dim: #a8c5e0;
    --text-subtle: #6b8ba8;
}

body {
    font-family: 'EB Garamond', Georgia, serif;
    background: var(--navy-dark);
    color: var(--text-light);
    line-height: 1.7;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    font-size: 0.95rem;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 40%, rgba(74, 123, 167, 0.18) 0%, transparent 30%),
        radial-gradient(circle at 70% 60%, rgba(107, 163, 212, 0.14) 0%, transparent 35%);
    animation: slowDrift 60s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes slowDrift {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(3%, 4%) rotate(1deg);
    }
    50% {
        transform: translate(-2%, 5%) rotate(-1deg);
    }
    75% {
        transform: translate(4%, -3%) rotate(0.5deg);
    }
}

/* Abstract Background Shapes */
.bg-shape {
    position: fixed;
    border-radius: 50%;
    opacity: 0.12;
    filter: blur(100px);
    pointer-events: none;
    z-index: 0;
}

.shape-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--blue-bright), transparent);
    top: -200px;
    right: -200px;
    animation: float 20s infinite ease-in-out;
}

.shape-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--blue-accent), transparent);
    bottom: -150px;
    left: -150px;
    animation: float 25s infinite ease-in-out reverse;
}

.shape-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--blue-bright), transparent);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 15s infinite ease-in-out;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, 30px); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.06; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.12; transform: translate(-50%, -50%) scale(1.2); }
}

/* Flowing Light Effect */
.flowing-light {
    position: fixed;
    top: -20%;
    left: -20%;
    width: 140%;
    height: 140%;
    border-radius: 50%;
    background:
        radial-gradient(ellipse 800px 400px at 0% 0%, rgba(107, 163, 212, 0.1) 0%, transparent 50%);
    animation: flowAcross 80s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes flowAcross {
    0% {
        transform: translate(0%, 0%);
        opacity: 0.5;
    }
    25% {
        transform: translate(20%, 15%);
        opacity: 0.7;
    }
    50% {
        transform: translate(10%, 30%);
        opacity: 0.6;
    }
    75% {
        transform: translate(30%, 10%);
        opacity: 0.8;
    }
    100% {
        transform: translate(0%, 0%);
        opacity: 0.5;
    }
}

/* Container */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem 2rem;
    position: relative;
    z-index: 1;
}

/* Hero Content */
.hero-content {
    display: flex;
    align-items: stretch;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 1rem;
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.hero-text {
    flex: 1;
    padding: 0.9rem 1.5rem;
    background: var(--navy-dark);
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 1;
}

.hero-image {
    flex: 0 0 38%;
    position: relative;
    overflow: hidden;
    max-height: 130px;
}

.hero-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 60%;
    height: 100%;
    background: linear-gradient(to right, var(--navy-dark), transparent);
    z-index: 1;
    pointer-events: none;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 42% center;
    display: block;
}

body.light-mode .hero-content {
    border: 1px solid rgba(74, 123, 167, 0.3);
}

body.light-mode .hero-text {
    background: #2a3f55;
}

body.light-mode .hero-image::before {
    background: linear-gradient(to right, #2a3f55, transparent);
}

.name {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
    background: linear-gradient(135deg, var(--text-light), var(--blue-bright));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
}

.tagline {
    font-size: 1rem;
    color: var(--text-dim);
    font-weight: 400;
    font-style: italic;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

/* Two-column layout */
.layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 4rem;
    align-items: start;
}

/* Main Column */
.main-column section {
    margin-bottom: 1.2rem;
    padding: 0.8rem 0;
    position: relative;
}

.main-column section:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: -1.75rem;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(107, 163, 212, 0.3) 20%,
        rgba(107, 163, 212, 0.6) 50%,
        rgba(107, 163, 212, 0.3) 80%,
        transparent 100%);
}

.main-column section:not(:last-child)::before {
    content: '◆';
    position: absolute;
    bottom: -2.25rem;
    left: 0;
    right: 0;
    text-align: center;
    color: var(--blue-accent);
    font-size: 0.6rem;
    opacity: 0.5;
    z-index: 1;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 2rem;
}

.sidebar-section {
    margin-bottom: 2.5rem;
}

.sidebar-heading {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--blue-bright);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(107, 163, 212, 0.2);
}

.sidebar-item {
    font-size: 1rem;
    color: var(--text-dim);
    margin-bottom: 0.6rem;
    line-height: 1.6;
}

.sidebar-item a {
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-item a:hover {
    color: var(--blue-bright);
}

.sidebar-item a.inline-link {
    color: var(--blue-bright);
    text-decoration: underline;
}

.links-section .sidebar-item a,
.contact-section .sidebar-item a.meeting-link {
    color: var(--text-dim);
    text-decoration: none;
}

.links-section .sidebar-item a span,
.contact-section .sidebar-item a.meeting-link span {
    text-decoration: underline;
}

.sidebar-item i {
    font-size: 0.9rem;
    color: var(--blue-accent);
}

h2 {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--blue-bright);
    letter-spacing: -0.01em;
}

/* About Section */
.about p {
    font-size: 1rem;
    margin-bottom: 0.6rem;
    color: var(--text-dim);
}

.about p:last-child {
    margin-bottom: 0;
}

.about p.research-interests {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(107, 163, 212, 0.35);
}

/* Research Experience */
.experience-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(107, 163, 212, 0.15);
}

.experience-item:last-of-type {
    border-bottom: none;
    margin-bottom: 1.5rem;
}

.experience-item h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0.4rem;
}

.h3-link {
    color: inherit;
    text-decoration: none;
    font-weight: inherit;
}

.role {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 1rem;
    color: var(--blue-bright);
    margin-bottom: 0.6rem;
    font-weight: 500;
}

.period {
    color: var(--text-subtle);
    font-weight: 400;
    font-size: 0.95rem;
}

.description {
    color: var(--text-dim);
    font-size: 1rem;
    line-height: 1.7;
}

/* Footnote tooltips */
.footnote-ref {
    position: relative;
    cursor: pointer;
    color: var(--blue-bright);
    font-size: 0.7em;
    vertical-align: super;
    display: inline-block;
}

.footnote-tooltip {
    display: none;
    position: absolute;
    top: 1.6em;
    left: 0;
    transform: none;
    background: #0d2035;
    border: 1px solid rgba(107, 163, 212, 0.35);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    width: 480px;
    font-size: 0.92rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-dim);
    z-index: 200;
    pointer-events: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    white-space: normal;
    vertical-align: baseline;
}

.footnote-ref:hover .footnote-tooltip,
.footnote-ref.active .footnote-tooltip {
    display: block;
}

.footnote-tooltip::before {
    content: '';
    position: absolute;
    top: -1.8em;
    left: 0;
    right: 0;
    height: 1.8em;
}

.footnote-link {
    color: var(--blue-bright);
    text-decoration: underline;
}

body.light-mode .footnote-ref {
    color: #2c5f8a;
}

body.light-mode .footnote-tooltip {
    background: #1e3a55;
    color: #c8dff0;
    border-color: rgba(74, 123, 167, 0.4);
}

.clinical-note {
    margin-top: 2rem;
}

.clinical-note p {
    margin: 0;
    color: var(--text-dim);
    font-size: 1rem;
    line-height: 1.7;
}

.clinical-note a,
.clinical-note-link {
    color: var(--blue-bright);
    text-decoration: underline;
    transition: color 0.2s;
}

.clinical-note a:hover {
    color: var(--text-light);
}

/* Research Interests */
.interests ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.interests li {
    padding: 1rem 1.25rem;
    background: rgba(74, 123, 167, 0.15);
    border-radius: 10px;
    color: var(--text-dim);
    font-size: 1rem;
    border-left: 3px solid var(--blue-accent);
    transition: all 0.3s ease;
}

.interests li:hover {
    background: rgba(74, 123, 167, 0.25);
    transform: translateX(5px);
}

/* Education */
.education-item {
    margin-bottom: 1.5rem;
}

.education-item:last-child {
    margin-bottom: 0;
}

.education-item h3 {
    font-size: 1.2rem;
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.education-item p {
    color: var(--text-subtle);
    font-size: 1rem;
}

/* Connect Section */
.connect-intro {
    font-size: 1.1rem;
    color: var(--text-dim);
    margin-bottom: 2rem;
    text-align: center;
}

.connect-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.connect-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.25rem;
    background: rgba(74, 123, 167, 0.15);
    border: 1px solid rgba(107, 163, 212, 0.2);
    border-radius: 12px;
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.connect-link:hover {
    background: rgba(74, 123, 167, 0.3);
    border-color: var(--blue-bright);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.connect-link i {
    font-size: 1.5rem;
}

.contact-info {
    padding: 2rem;
    background: rgba(74, 123, 167, 0.1);
    border-radius: 12px;
    text-align: center;
}

.contact-info p {
    margin: 0.75rem 0;
    font-size: 1rem;
    color: var(--text-dim);
}

.contact-info strong {
    color: var(--blue-bright);
    font-weight: 600;
}

.contact-info a {
    color: var(--text-light);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-bottom-color 0.2s;
}

.contact-info a:hover {
    border-bottom-color: var(--blue-bright);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-subtle);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 860px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        border-top: 2px solid rgba(107, 163, 212, 0.2);
        padding-top: 2rem;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 2rem 1.5rem;
    }

    .hero {
        margin-bottom: 1.5rem;
    }

    .hero-banner {
        height: 150px;
    }

    .name {
        font-size: 1.8rem;
    }

    .tagline {
        font-size: 1rem;
    }

    h2 {
        font-size: 1.6rem;
    }

    .hero-content {
        border-radius: 0;
        box-shadow: none;
        margin-left: -1.5rem;
        margin-right: -1.5rem;
        margin-bottom: 1.5rem;
    }

    .theme-toggle {
        top: 0.6rem;
        right: 0.6rem;
        width: 2rem;
        height: 2rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .name {
        font-size: 1.7rem;
    }

    .hero-banner {
        height: 120px;
    }

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

    .hero-content {
        border-radius: 0;
        box-shadow: none;
        margin-bottom: 0;
    }

    .container {
        padding: 0;
    }

    .main-column, .layout {
        padding-left: 1.2rem;
        padding-right: 1.2rem;
    }

    .theme-toggle {
        top: 0.75rem;
        right: 0.75rem;
    }
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 100;
    background: rgba(74, 123, 167, 0.15);
    border: 1px solid rgba(107, 163, 212, 0.25);
    color: var(--text-dim);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.theme-toggle:hover {
    background: rgba(74, 123, 167, 0.3);
    border-color: var(--blue-bright);
    color: var(--text-light);
}

/* Light Mode */
body.light-mode {
    background: #f4f1ec;
    color: #1a2e45;
}

body.light-mode::before {
    background:
        radial-gradient(circle at 30% 40%, rgba(74, 123, 167, 0.07) 0%, transparent 30%),
        radial-gradient(circle at 70% 60%, rgba(107, 163, 212, 0.05) 0%, transparent 35%);
}

body.light-mode .name {
    background: linear-gradient(135deg, #1a2e45, #4a7ba7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.light-mode .tagline {
    color: #4a6580;
}

/* Keep hero panel text light in light mode since it sits on dark background */
body.light-mode .hero-text .name {
    background: linear-gradient(135deg, var(--text-light), var(--blue-bright));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.light-mode .hero-text .tagline {
    color: var(--text-dim);
}

body.light-mode h2 {
    color: #2c5f8a;
}

body.light-mode .about p,
body.light-mode .description,
body.light-mode .clinical-note p,
body.light-mode .connect-intro,
body.light-mode .contact-info p {
    color: #2e4a62;
}

body.light-mode .about strong {
    color: #1a2e45;
}

body.light-mode .experience-item h3 {
    color: #1a2e45;
}

body.light-mode .role {
    color: #2c5f8a;
}

body.light-mode .period {
    color: #6b8ba8;
}

body.light-mode .experience-item {
    border-bottom-color: rgba(74, 123, 167, 0.2);
}

body.light-mode section:not(:last-of-type)::after {
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(74, 123, 167, 0.25) 20%,
        rgba(74, 123, 167, 0.5) 50%,
        rgba(74, 123, 167, 0.25) 80%,
        transparent 100%);
}

body.light-mode section:not(:last-of-type)::before {
    color: #4a7ba7;
}

body.light-mode .connect-link {
    background: rgba(74, 123, 167, 0.08);
    border-color: rgba(74, 123, 167, 0.2);
    color: #1a2e45;
}

body.light-mode .connect-link:hover {
    background: rgba(74, 123, 167, 0.18);
}

body.light-mode .contact-info {
    background: rgba(74, 123, 167, 0.08);
}

body.light-mode .contact-info strong {
    color: #2c5f8a;
}

body.light-mode .contact-info a,
body.light-mode .clinical-note a {
    color: #2c5f8a;
}

body.light-mode .theme-toggle {
    background: rgba(74, 123, 167, 0.1);
    border-color: rgba(74, 123, 167, 0.3);
    color: #2c5f8a;
}

body.light-mode footer p {
    color: #6b8ba8;
}

body.light-mode .sidebar-heading {
    color: #2c5f8a;
    border-bottom-color: rgba(74, 123, 167, 0.3);
}

body.light-mode .sidebar-item {
    color: #2e4a62;
}

body.light-mode .sidebar-item a {
    color: #2e4a62;
}

body.light-mode .contact-section .sidebar-item a.meeting-link,
body.light-mode .contact-section .sidebar-item a.meeting-link span {
    color: #2c5f8a;
}

body.light-mode .sidebar-item a:hover {
    color: #2c5f8a;
}

body.light-mode .sidebar-item i {
    color: #4a7ba7;
}

body.light-mode .sidebar {
    border-top-color: rgba(74, 123, 167, 0.2);
}
