/* ============================================================================
   Design Tokens (Tailwind-like CSS Custom Properties)
   ============================================================================ */

:root {
    /* Colors - Primary Palette */
    --color-primary: #85929e;
    --color-primary-dark: #6c757d;
    --color-accent: #90ccef;
    --color-accent-hover: #5a9ec4;

    /* Colors - Neutrals */
    --color-gray-50: #f8f9fa;
    --color-gray-100: #f1f3f5;
    --color-gray-200: #e9ecef;
    --color-gray-300: #dee2e6;
    --color-gray-400: #ced4da;
    --color-gray-500: #adb5bd;
    --color-gray-600: #6c757d;
    --color-gray-700: #495057;
    --color-gray-800: #343a40;
    --color-gray-900: #212529;

    /* Colors - Text */
    --color-text-primary: #212529;
    --color-text-secondary: #495057;
    --color-text-muted: #6c757d;
    --color-text-body: #495057;

    /* Colors - Borders */
    --color-border-light: #e0e0e0;
    --color-border-medium: #dee2e6;
    --color-border-accent: #90ccef;

    /* Spacing Scale */
    --space-0: 0;
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-54px: 54px;

    /* Width Scale */
    --width-sidebar: 17rem;
    --width-img-profile: 10rem;
    --width-xs: 80px;
    --width-sm: 200px;
    --width-md: 400px;
    --width-container: 950px;

    /* Grid Column Widths (12-column grid) */
    --col-1: 8.333333%;
    --col-2: 16.666667%;
    --col-3: 25%;
    --col-4: 33.333333%;
    --col-6: 50%;
    --col-8: 66.666667%;
    --col-9: 75%;
    --col-10: 83.333333%;
    --col-11: 91.666667%;
    --col-12: 100%;

    /* Font Sizes */
    --text-xs: 0.75rem;
    --text-sm: 0.85rem;
    --text-base: 1rem;
    --text-md: 1.05rem;
    --text-lg: 1.15rem;
    --text-1-2: 1.2rem;
    --text-xl: 1.25rem;
    --text-1-35: 1.35rem;
    --text-2xl: 1.5rem;
    --text-1-85: 1.85rem;
    --text-3xl: 2rem;
    --text-4xl: 2.5rem;
    --text-5xl: 3rem;
    --text-6xl: 3.5rem;
    --text-huge-1: 5.5rem;
    --text-huge-2: 6rem;

    /* Font Weights */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;

    /* Line Heights */
    --leading-none: 1;
    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 2;

    /* Font Families */
    --font-sans: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Saira Extra Condensed', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Breakpoints (for reference in media queries) */
    --breakpoint-sm: 576px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 992px;
    --breakpoint-xl: 1200px;

    /* Borders */
    --border-width: 1px;
    --border-width-2: 2px;
    --border-width-4: 4px;

    /* Border Radius */
    --rounded-none: 0;
    --rounded-sm: 0.125rem;
    --rounded: 0.25rem;
    --rounded-md: 0.375rem;
    --rounded-lg: 0.5rem;
    --rounded-xl: 0.75rem;
    --rounded-2xl: 1rem;
    --rounded-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* Z-index Scale */
    --z-0: 0;
    --z-10: 10;
    --z-20: 20;
    --z-30: 30;
    --z-40: 40;
    --z-50: 50;
    --z-auto: auto;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================================
   Base Styles
   ============================================================================ */

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--color-text-body);
    padding-top: var(--space-54px);
    margin: 0;
}

@media (min-width: 992px) {
    body {
        padding-top: 0;
        padding-left: var(--width-sidebar);
    }
}

/* ============================================================================
   Typography
   ============================================================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-bold);
    text-transform: uppercase;
    color: var(--color-gray-800);
    margin-top: 0;
}

h1 {
    font-size: var(--text-huge-2);
    line-height: var(--text-huge-1);
}

h2 {
    font-size: var(--text-6xl);
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-2);
    border-bottom: 3px solid var(--color-border-accent);
    display: inline-block;
    color: var(--color-text-primary);
    letter-spacing: 0.02em;
}

h3 {
    font-size: var(--text-xl);
    margin-top: var(--space-6);
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: var(--border-width) solid var(--color-gray-300);
    font-weight: var(--font-semibold);
    text-transform: none;
    color: var(--color-text-primary);
}

h3:first-of-type {
    margin-top: 0;
}

h4 {
    font-size: var(--text-lg);
    margin-top: var(--space-5);
    margin-bottom: var(--space-3);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-primary);
}

h5 {
    font-size: 1.1rem;
    margin-top: var(--space-6);
    margin-bottom: var(--space-2);
    font-weight: var(--font-semibold);
    text-transform: none;
    color: var(--color-text-primary);
}

h6 {
    font-size: var(--text-base);
    margin-top: var(--space-4);
    margin-bottom: var(--space-2);
    font-weight: var(--font-semibold);
    text-transform: none;
    color: var(--color-text-primary);
}

p {
    margin-bottom: var(--space-3);
    line-height: var(--leading-normal);
    text-align: left;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover,
a:focus,
a:active {
    color: var(--color-accent-hover);
    text-decoration: underline;
}

strong {
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
}

/* ============================================================================
   Lists
   ============================================================================ */

ul, ol {
    margin-bottom: var(--space-4);
    padding-left: var(--space-6);
}

ul li, ol li {
    margin-bottom: var(--space-2);
    line-height: var(--leading-normal);
    text-align: left;
}

ul li p, ol li p {
    margin-bottom: var(--space-1);
    display: inline;
}

/* Nested lists */
ul ul, ol ol {
    margin-top: var(--space-1);
    margin-bottom: var(--space-1);
    padding-left: var(--space-5);
}

ul ul li, ol ol li {
    margin-bottom: var(--space-1);
}

/* ============================================================================
   Layout Components
   ============================================================================ */

.subheading {
    text-transform: uppercase;
    font-weight: var(--font-medium);
    font-family: var(--font-heading);
    font-size: var(--text-1-35);
    margin-bottom: var(--space-5);
}

.address {
    line-height: 1.8;
}

hr {
    margin-top: var(--space-6);
    margin-bottom: var(--space-6);
    border: 0;
    border-top: var(--border-width) solid var(--color-border-medium);
}

/* ============================================================================
   Navigation
   ============================================================================ */

.navbar {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-2) var(--space-4);
}

.navbar-brand {
    display: inline-block;
    padding-top: 0.3125rem;
    padding-bottom: 0.3125rem;
    margin-right: var(--space-4);
    font-size: var(--text-xl);
    line-height: inherit;
    white-space: nowrap;
}

.navbar-nav {
    display: flex;
    flex-direction: column;
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
}

.navbar-nav .nav-item {
    position: relative;
}

.nav-link {
    display: block;
    padding: var(--space-2) var(--space-4);
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-base);
}

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

.nav-link.active {
    color: var(--color-accent) !important;
}

.navbar-toggler {
    padding: 0.25rem 0.75rem;
    font-size: var(--text-xl);
    line-height: 1;
    background-color: transparent;
    border: var(--border-width) solid transparent;
    border-radius: var(--rounded);
    cursor: pointer;
}

.navbar-toggler-icon {
    display: inline-block;
    width: 1.5em;
    height: 1.5em;
    vertical-align: middle;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100%;
}

.navbar-collapse {
    flex-basis: 100%;
    flex-grow: 1;
    align-items: center;
}

.navbar-dark {
    /* Dark navbar theme */
}

.navbar-dark .navbar-brand,
.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9);
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: var(--color-accent);
}

.navbar-expand-md {
    flex-flow: row nowrap;
    justify-content: flex-start;
}

@media (min-width: 768px) {
    .navbar-expand-md .navbar-nav {
        flex-direction: row;
    }

    .navbar-expand-md .navbar-nav .nav-link {
        padding-right: var(--space-2);
        padding-left: var(--space-2);
    }

    .navbar-expand-md .navbar-toggler {
        display: none;
    }

    .navbar-expand-md .navbar-collapse {
        display: flex !important;
        flex-basis: auto;
    }
}

#sideNav .navbar-nav .nav-item .nav-link {
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    font-size: var(--text-sm);
    padding: var(--space-3) var(--space-4);
    white-space: normal;
    line-height: var(--leading-tight);
}

@media (min-width: 992px) {
    #sideNav {
        text-align: center;
        position: fixed;
        top: 0;
        left: 0;
        display: flex;
        flex-direction: column;
        width: var(--width-sidebar);
        height: 100vh;
    }

    #sideNav .navbar-brand {
        display: flex;
        margin: auto auto 0;
        padding: var(--space-2);
    }

    #sideNav .navbar-brand .img-profile {
        max-width: var(--width-img-profile);
        max-height: var(--width-img-profile);
        border: var(--space-2) solid rgba(255, 255, 255, 0.2);
    }

    #sideNav .navbar-collapse {
        display: flex;
        align-items: flex-start;
        flex-grow: 0;
        width: 100%;
        margin-bottom: auto;
    }

    #sideNav .navbar-collapse .navbar-nav {
        flex-direction: column;
        width: 100%;
    }

    #sideNav .navbar-collapse .navbar-nav .nav-item {
        display: block;
    }

    #sideNav .navbar-collapse .navbar-nav .nav-item .nav-link {
        display: block;
    }
}

/* ============================================================================
   Sections
   ============================================================================ */

section.resume-section {
    padding-top: var(--space-20);
    padding-bottom: var(--space-20);
    max-width: var(--width-container);
    border-bottom: var(--border-width) solid var(--color-border-accent);
}

section.resume-section:last-child {
    border-bottom: none;
}

@media (min-width: 768px) {
    section.resume-section {
        min-height: auto;
    }

    body {
        font-size: var(--text-md);
    }
}

@media (min-width: 992px) {
    section.resume-section {
        padding-top: var(--space-12);
        padding-bottom: var(--space-12);
    }
}

@media (max-width: 767px) {
    h2 {
        font-size: var(--text-1-85);
    }

    h3 {
        font-size: var(--text-1-2);
    }
}

/* ============================================================================
   Social Icons
   ============================================================================ */

.social-icons-grid {
    /* Grid styling is in inline styles */
}

.social-icon-link {
    color: var(--color-gray-500);
    transition: color var(--transition-base);
}

.social-icon-link:hover {
    color: var(--color-accent);
}

/* ============================================================================
   Images & Media
   ============================================================================ */

img[alt=enigma] {
    width: var(--width-sm);
}

img[alt=resource-logo] {
    width: var(--width-sm);
}

img[alt=neurofeedback] {
    width: var(--width-md);
}

img.book {
    width: var(--width-xs);
    padding: var(--space-2) var(--space-4);
}

.center {
    display: block;
    margin-left: auto;
    margin-right: auto;
    width: 50%;
}

/* Cards removed - not used */

/* ============================================================================
   Project Items
   ============================================================================ */

.project-item {
    background-color: var(--color-gray-50);
    padding: var(--space-6);
    margin-bottom: var(--space-8);
}

.project-item h3 {
    margin-top: 0;
    margin-bottom: var(--space-4);
    font-size: 1.15rem;
    font-weight: var(--font-bold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: var(--space-2);
    border-bottom: var(--border-width-2) solid var(--color-border-accent);
}

.project-item img {
    margin: var(--space-4) 0;
}

/* ============================================================================
   Related Publications
   ============================================================================ */

.related-publications {
    font-size: var(--text-sm);
    font-style: italic;
    color: var(--color-text-muted);
    line-height: var(--leading-snug);
    margin-top: var(--space-3);
    padding-left: var(--space-2);
    border-left: var(--border-width-2) solid var(--color-border-light);
}

.related-publications strong {
    font-weight: var(--font-semibold);
    font-style: normal;
}

/* Publications classes removed - not used */

/* ============================================================================
   Utility Classes
   ============================================================================ */

/* Colors */
.bg-primary {
    background-color: var(--color-primary) !important;
}

.text-primary {
    color: var(--color-primary) !important;
}

/* Positioning */
.fixed-top {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1030;
}

/* Display */
.collapse {
    display: none;
}

.collapse.show {
    display: block;
}

/* Border Radius */
.rounded-circle {
    border-radius: var(--rounded-full);
}

/* Blockquote */
.blockquote {
    margin-bottom: var(--space-4);
    font-size: var(--text-xl);
}

.blockquote-footer {
    display: block;
    font-size: 80%;
    color: var(--color-text-secondary);
}

/* Footer */
.footer {
    padding: var(--space-8) 0;
    text-align: center;
}

/* Scroll Trigger */
.js-scroll-trigger {
    cursor: pointer;
}

/* ============================================================================
   Bootstrap Grid Compatibility (minimal, using tokens)
   ============================================================================ */

.container {
    width: 100%;
    padding-right: var(--space-4);
    padding-left: var(--space-4);
    margin-right: auto;
    margin-left: auto;
}

.container-fluid {
    width: 100%;
    padding-right: var(--space-4);
    padding-left: var(--space-4);
    margin-right: auto;
    margin-left: auto;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: calc(var(--space-4) * -1);
    margin-left: calc(var(--space-4) * -1);
}

/* Grid columns */
[class*="col-"] {
    position: relative;
    width: 100%;
    padding-right: var(--space-4);
    padding-left: var(--space-4);
}

.col-1 { flex: 0 0 var(--col-1); max-width: var(--col-1); }
.col-2 { flex: 0 0 var(--col-2); max-width: var(--col-2); }
.col-8 { flex: 0 0 var(--col-8); max-width: var(--col-8); }
.col-11 { flex: 0 0 var(--col-11); max-width: var(--col-11); }

@media (min-width: 768px) {
    .col-md-2 { flex: 0 0 var(--col-2); max-width: var(--col-2); }
    .col-md-3 { flex: 0 0 var(--col-3); max-width: var(--col-3); }
    .col-md-4 { flex: 0 0 var(--col-4); max-width: var(--col-4); }
    .col-md-6 { flex: 0 0 var(--col-6); max-width: var(--col-6); }
    .col-md-8 { flex: 0 0 var(--col-8); max-width: var(--col-8); }
    .col-md-9 { flex: 0 0 var(--col-9); max-width: var(--col-9); }
    .col-md-10 { flex: 0 0 var(--col-10); max-width: var(--col-10); }
    .col-md-12 { flex: 0 0 var(--col-12); max-width: var(--col-12); }
}

/* Alignment helpers */
.align-items-center {
    align-items: center;
}

.align-items-end {
    align-items: flex-end;
}

.justify-content-center {
    justify-content: center;
}

.text-center {
    text-align: center;
}

/* Display utilities */
.d-flex {
    display: flex;
}

.d-block {
    display: block;
}

.d-none {
    display: none;
}

@media (min-width: 992px) {
    .d-lg-none {
        display: none;
    }

    .d-lg-block {
        display: block;
    }
}

/* Spacing utilities */
.mb-0 { margin-bottom: var(--space-0); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }

.mr-2 { margin-right: var(--space-2); }

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.my-auto {
    margin-top: auto;
    margin-bottom: auto;
}

.p-0 { padding: var(--space-0); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }

@media (min-width: 992px) {
    .p-lg-5 { padding: var(--space-20); }
}

/* Flexbox utilities */
.flex-column {
    flex-direction: column;
}

.d-column {
    display: flex;
    flex-direction: column;
}

/* Image utilities */
.img-fluid {
    max-width: 100%;
    height: auto;
}

.img-profile {
    max-width: 10rem;
    max-height: 10rem;
    border: 0.5rem solid rgba(255, 255, 255, 0.2);
}

/* List utilities removed - not used */

/* Typography utilities */
.small {
    font-size: var(--text-sm);
}

/* Button styles */
.btn {
    display: inline-block;
    font-weight: var(--font-normal);
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    border-radius: var(--rounded);
    transition: var(--transition-base);
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    color: #fff;
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn-primary:hover {
    background-color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
}

.btn-outline-primary {
    color: var(--color-primary);
    background-color: transparent;
    border-color: var(--color-primary);
}

.btn-outline-primary:hover {
    color: #fff;
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn-outline-secondary {
    color: var(--color-gray-600);
    background-color: transparent;
    border-color: var(--color-gray-600);
}

.btn-outline-secondary:hover {
    color: #fff;
    background-color: var(--color-gray-600);
    border-color: var(--color-gray-600);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: var(--text-sm);
    border-radius: var(--rounded-sm);
}

/* Font Awesome and Academicons are provided by vendor CSS files
   We only need to ensure the vendor files are loaded in the header */

/* ============================================================================
   Component-specific Styles
   ============================================================================ */

/* About section */
#about h1 {
    margin-bottom: var(--space-3);
}

#about ul li {
    margin-bottom: var(--space-2);
}

#about ul li p {
    margin-bottom: 0;
}

#about .col-md-4 {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* News section */
#about ul li strong {
    color: var(--color-text-primary);
    font-weight: var(--font-semibold);
}

/* Upcoming section */
#upcoming h4 {
    margin-top: var(--space-5);
    margin-bottom: var(--space-3);
    font-size: var(--text-base);
    color: var(--color-text-primary);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
