/* =========================================================
   Theme tokens
   Palette: EBYÜ navy + signal teal.
   Light is the default. Dark applies when:
   - the visitor chose dark via the toggle  → [data-theme="dark"]
   - or no choice was made and the OS prefers dark
   ========================================================= */
:root {
    color-scheme: light;

    --font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-head: 'Manrope', 'Inter', 'Segoe UI', system-ui, sans-serif;

    --navy: #23366f;
    --teal: #0d7f72;
    --white: #ffffff;                 /* text on gradient – same in both themes */

    /* Buttons / filled surfaces: always dark enough for white text */
    --gradient: linear-gradient(135deg, #23366f 0%, #0d7f72 100%);
    /* Gradient text & accent bars: theme-dependent */
    --gradient-text: linear-gradient(135deg, #23366f 0%, #0d7f72 100%);

    --primary-color: #1b2a4e;         /* headings, logo */
    --text-color: #1f2937;
    --accent-color: #0d7f72;
    --accent-soft: rgba(13, 127, 114, 0.10);
    --signal-color: #0d7f72;          /* hero EEG traces */

    --bg: #ffffff;
    --surface: #ffffff;
    --surface-alt: #f4f7fa;
    --surface-muted: #eef3f7;
    --abstract-bg: #f4f7fa;
    --border: rgba(27, 42, 78, 0.10);

    --heading: #1b2a4e;
    --text-strong: #1f2937;
    --text-soft: #475569;
    --text-muted: #64748b;

    --link: #23508f;
    --btn-bg: #23366f;
    --btn-bg-hover: #1a2a57;

    --nav-bg: rgba(255, 255, 255, 0.88);
    --nav-bg-mobile: rgba(255, 255, 255, 0.98);

    --shadow-sm: rgba(15, 23, 42, 0.05);
    --shadow: rgba(15, 23, 42, 0.10);
    --shadow-lg: rgba(15, 23, 42, 0.14);
    --shadow-accent: rgba(13, 127, 114, 0.25);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;

        --gradient-text: linear-gradient(135deg, #8fb1ff 0%, #3dd9c1 100%);

        --primary-color: #e5e9f2;
        --text-color: #e5e9f2;
        --accent-color: #3dd9c1;
        --accent-soft: rgba(61, 217, 193, 0.12);
        --signal-color: #3dd9c1;

        --bg: #0b1020;
        --surface: #121a2e;
        --surface-alt: #0e1527;
        --surface-muted: #18223a;
        --abstract-bg: #0e1527;
        --border: rgba(229, 233, 242, 0.10);

        --heading: #f3f5fa;
        --text-strong: #eef1f7;
        --text-soft: #b4bdd0;
        --text-muted: #8b95ab;

        --link: #8fb4ff;
        --btn-bg: #2f4f9e;
        --btn-bg-hover: #3a5db0;

        --nav-bg: rgba(11, 16, 32, 0.85);
        --nav-bg-mobile: rgba(11, 16, 32, 0.97);

        --shadow-sm: rgba(0, 0, 0, 0.30);
        --shadow: rgba(0, 0, 0, 0.40);
        --shadow-lg: rgba(0, 0, 0, 0.50);
        --shadow-accent: rgba(61, 217, 193, 0.18);
    }
}

:root[data-theme="dark"] {
    color-scheme: dark;

    --gradient-text: linear-gradient(135deg, #8fb1ff 0%, #3dd9c1 100%);

    --primary-color: #e5e9f2;
    --text-color: #e5e9f2;
    --accent-color: #3dd9c1;
    --accent-soft: rgba(61, 217, 193, 0.12);
    --signal-color: #3dd9c1;

    --bg: #0b1020;
    --surface: #121a2e;
    --surface-alt: #0e1527;
    --surface-muted: #18223a;
    --abstract-bg: #0e1527;
    --border: rgba(229, 233, 242, 0.10);

    --heading: #f3f5fa;
    --text-strong: #eef1f7;
    --text-soft: #b4bdd0;
    --text-muted: #8b95ab;

    --link: #8fb4ff;
    --btn-bg: #2f4f9e;
    --btn-bg-hover: #3a5db0;

    --nav-bg: rgba(11, 16, 32, 0.85);
    --nav-bg-mobile: rgba(11, 16, 32, 0.97);

    --shadow-sm: rgba(0, 0, 0, 0.30);
    --shadow: rgba(0, 0, 0, 0.40);
    --shadow-lg: rgba(0, 0, 0, 0.50);
    --shadow-accent: rgba(61, 217, 193, 0.18);
}

/* =========================================================
   Base
   ========================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    line-height: 1.65;
    color: var(--text-color);
    background-color: var(--bg);
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--font-head);
    color: var(--heading);
    letter-spacing: -0.01em;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
}

/* =========================================================
   Navigation
   ========================================================= */
nav {
    padding: 1.25rem 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: padding 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
}

nav.scrolled {
    padding: 0.85rem 0;
    box-shadow: 0 1px 0 var(--border), 0 8px 24px var(--shadow-sm);
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo {
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 1.35rem;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: -0.02em;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.logo i {
    font-size: 0.85em;
    color: var(--accent-color);
    transition: transform 0.2s ease;
}

.logo:hover i {
    transform: translateY(-2px);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    padding: 4px;
    z-index: 1000;
}

.hamburger span {
    display: block;
    width: 28px;
    height: 2px;
    background: var(--primary-color);
    transition: all 0.3s ease;
}

/* Theme toggle */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--primary-color);
    font-size: 1.05rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease;
    flex-shrink: 0;
}

.theme-toggle:hover {
    transform: rotate(15deg);
    background: var(--gradient);
    color: var(--white);
}

/* moon in light mode, sun in dark mode */
.theme-toggle .fa-sun { display: none; }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .fa-sun { display: inline-block; }
    :root:not([data-theme="light"]) .theme-toggle .fa-moon { display: none; }
}

:root[data-theme="dark"] .theme-toggle .fa-sun { display: inline-block; }
:root[data-theme="dark"] .theme-toggle .fa-moon { display: none; }

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a:hover {
    color: var(--accent-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background: var(--gradient-text);
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Dropdown */
.nav-links > li {
    position: relative;
}

.dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--nav-bg-mobile);
    box-shadow: 0 10px 30px var(--shadow);
    border: 1px solid var(--border);
    z-index: 1000;
    padding: 0.35rem 0;
    margin: 0;
    border-radius: 10px;
    list-style: none;
}

.dropdown li {
    width: 100%;
}

.dropdown a {
    display: block;
    padding: 0.6rem 1.25rem;
    color: var(--text-color);
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s ease;
}

.dropdown a::after { display: none; }

.nav-links > li:hover .dropdown {
    display: block;
}

.dropdown a:hover {
    background: var(--accent-soft);
    color: var(--accent-color);
}

/* =========================================================
   Hero
   ========================================================= */
header {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: var(--bg);
    position: relative;
    overflow: hidden;
}

/* Animated EEG traces behind the hero (drawn by js/main.js) */
.hero-signal {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 12%, #000 88%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 12%, #000 88%, transparent 100%);
}

header .container {
    position: relative;
    z-index: 1;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
    padding: 6rem 0 2rem;
}

.profile-text {
    flex: 1.15;
}

.profile-image-container {
    flex: 0.85;
    display: flex;
    justify-content: center;
    position: relative;
}

/* Soft accent shape behind the photo */
.profile-image-container::before {
    content: '';
    position: absolute;
    width: 380px;
    height: 480px;
    border-radius: 30px;
    background: var(--gradient);
    opacity: 0.18;
    transform: translate(18px, 18px) rotate(3deg);
    z-index: -1;
}

.profile-image {
    width: 380px;
    height: 480px;
    object-fit: cover;
    border-radius: 30px;
    box-shadow: 0 24px 48px var(--shadow);
}

.profile-text h1 {
    font-size: clamp(2.2rem, 4.5vw, 3.2rem);
    font-weight: 800;
    margin-bottom: 0.75rem;
    line-height: 1.1;
    letter-spacing: -0.03em;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--heading);
    margin-bottom: 0.15rem;
}

.hero-role {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--accent-color);
    margin-bottom: 1.25rem;
}

.hero-bio {
    color: var(--text-soft);
    max-width: 62ch;
}

/* Stat badges */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1.75rem;
    max-width: 560px;
}

.hero-stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.85rem 0.75rem;
    text-align: center;
    box-shadow: 0 6px 18px var(--shadow-sm);
}

.hero-stat[hidden] { display: none; }

.hero-stat-num {
    display: block;
    font-family: var(--font-head);
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--accent-color);
    font-variant-numeric: tabular-nums;
}

.hero-stat-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 0.2rem;
}

/* =========================================================
   Sections
   ========================================================= */
section {
    padding: 7rem 0;
    position: relative;
}

.section-title {
    font-size: clamp(1.9rem, 3.5vw, 2.4rem);
    font-weight: 800;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 56px;
    height: 4px;
    border-radius: 2px;
    background: var(--gradient-text);
}

/* =========================================================
   Research grid
   ========================================================= */
.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.research-item {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1.75rem;
    border-radius: 18px;
    box-shadow: 0 8px 24px var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.research-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px var(--shadow);
    border-color: var(--accent-soft);
}

.research-item h3 {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--heading);
    margin-bottom: 0.85rem;
}

.research-item p {
    color: var(--text-soft);
}

.research-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--accent-soft);
    color: var(--accent-color);
    font-size: 1.2rem;
}

/* =========================================================
   Publications
   ========================================================= */
.publication-list {
    margin: 2rem 0;
    padding: 1rem;
}

.publication-item {
    margin-bottom: 1rem;
    padding: 1.1rem 1.25rem;
    border-radius: 14px;
    background-color: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 6px 14px var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.publication-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px var(--shadow);
}

.publication-year {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent-color);
    margin-bottom: 0.35rem;
}

.publication-item h3 {
    margin: 0.35rem 0;
    font-size: 1.08rem;
    line-height: 1.4;
    color: var(--text-strong);
}

.publication-item h3 a {
    color: var(--link);
    text-decoration: none;
}

.publication-item h3 a:hover {
    text-decoration: underline;
}

.publication-authors {
    color: var(--text-soft);
    font-size: 0.95rem;
    margin: 2px 0 2px;
}

.publication-authors strong {
    color: var(--text-strong);
    font-weight: 700;
}

.Journal {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.95rem;
    margin: 2px 0 10px;
}

.abstract-toggle {
    background-color: var(--btn-bg);
    color: var(--white);
    border: 0;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    margin: 0.5rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-body);
    transition: background-color 0.2s ease;
}

.abstract-toggle:hover {
    background-color: var(--btn-bg-hover);
}

.abstract {
    margin-top: 10px;
    padding: 1rem;
    background-color: var(--abstract-bg);
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-soft);
}

.scholar-stats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 2em 0;
}

.stat-box {
    text-align: center;
    padding: 1em 1.5em;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 14px;
    min-width: 160px;
}

.stat-box h3 {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.stat-box p {
    font-family: var(--font-head);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--accent-color);
}

.update-time {
    width: 100%;
    text-align: center;
    font-size: 0.8em;
    color: var(--text-muted);
}

/* =========================================================
   Buttons
   ========================================================= */
.cv-button {
    display: inline-block;
    margin-top: 2rem;
    padding: 0.9rem 1.9rem;
    background: var(--gradient);
    color: var(--white);
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 10px 22px var(--shadow-accent);
}

.cv-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 28px var(--shadow-accent);
}

/* =========================================================
   Contact
   ========================================================= */
.contact-section {
    background: var(--surface-alt);
    position: relative;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 4rem;
    align-items: center;
}

.contact-info {
    text-align: left;
}

.contact-info h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.contact-info p {
    color: var(--text-soft);
}

.contact-links {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.contact-links a {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.15rem;
    text-decoration: none;
    transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
    box-shadow: 0 5px 15px var(--shadow-sm);
}

.contact-links a:hover {
    transform: translateY(-3px);
    background: var(--gradient);
    color: var(--white);
}

/* =========================================================
   CV page — vertical timeline
   ========================================================= */
.CV-section {
    padding: 100px 2rem 0;
    max-width: 900px;
    margin: 0 auto;
}

.timeline {
    position: relative;
}

/* The vertical line */
.timeline::before {
    content: '';
    position: absolute;
    left: 27px;
    top: 12px;
    bottom: 12px;
    width: 2px;
    border-radius: 1px;
    background: linear-gradient(180deg, var(--accent-color) 0%, var(--border) 100%);
}

.timeline .CV-item {
    position: relative;
    margin: 0 0 1.25rem 76px;
    padding: 1.25rem 1.5rem;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 6px 18px var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timeline .CV-item:hover {
    transform: translateX(3px);
    box-shadow: 0 10px 26px var(--shadow);
}

/* Logo sits on the line as the timeline node */
.timeline .cv-logo {
    position: absolute;
    left: -76px;
    top: 1rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: contain;
    background: #ffffff;
    padding: 7px;
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 0 5px var(--bg);
}

.degree-header {
    margin-bottom: 0.35rem;
}

.degree-title {
    font-family: var(--font-head);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--heading);
}

.degree-subject {
    font-size: 1rem;
    color: var(--accent-color);
    font-weight: 600;
}

.CV-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.CV-name {
    color: var(--text-soft);
}

.graduation-year {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent-color);
    background: var(--accent-soft);
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    white-space: nowrap;
}

.advisor-info {
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px dashed var(--border);
    color: var(--text-soft);
    font-size: 0.95rem;
}

.advisor-label b {
    color: var(--text-strong);
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 3rem 0 1.5rem;
    font-size: 0.95rem;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}

.footer-name {
    display: block;
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--heading);
}

.footer-role {
    display: block;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.75rem;
    list-style: none;
}

.footer-links a {
    color: var(--text-soft);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--accent-color);
}

.footer-social {
    display: flex;
    gap: 0.6rem;
}

.footer-social a {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-soft);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.footer-social a:hover {
    background: var(--gradient);
    color: var(--white);
    border-color: transparent;
}

.footer-bottom {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 900px) {
    .hero-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-right {
        gap: 1rem;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: var(--nav-bg-mobile);
        backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.3s ease;
        gap: 2rem;
    }

    .nav-links.active {
        right: 0;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    .header-content {
        flex-direction: column-reverse;
        text-align: center;
        gap: 2.5rem;
    }

    .hero-bio {
        margin: 0 auto;
    }

    .hero-stats {
        margin-left: auto;
        margin-right: auto;
    }

    .profile-image,
    .profile-image-container::before {
        width: 280px;
        height: 350px;
    }

    .footer-inner {
        flex-direction: column;
    }
}

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

    .header-content {
        padding-top: 5.5rem;
    }

    .profile-image,
    .profile-image-container::before {
        width: 240px;
        height: 300px;
    }

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

    .CV-section {
        padding: 90px 0.5rem 0;
    }

    .timeline::before {
        left: 21px;
    }

    .timeline .CV-item {
        margin-left: 58px;
        padding: 1rem 1.1rem;
    }

    .timeline .cv-logo {
        left: -58px;
        width: 44px;
        height: 44px;
        padding: 5px;
    }
}

/* Visitors who ask for less motion get none */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
