/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Import fonts: JetBrains Mono for a markdown-like, monospaced feel */
@import url('https://fonts.googleapis.com/css2?family=Istok+Web:wght@400;700&family=Sofia+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* Modern Sophisticated Theme Variables */
:root {
    /* Light Theme - Off-White & Improved Contrast */
    --bg-color: #fafafa;
    --bg-secondary: #f5f5f5;
    --text-color: #1a1a1a;
    --text-secondary: #2d2d2d;
    --text-muted: #525252;
    --text-light: #737373;

    /* Consistent Accent */
    --accent-color: #0f172a;

    /* Grey Neutrals with Better Contrast */
    --border-color: #d4d4d8;
    --border-light: #e4e4e7;
    --surface-color: #f1f1f3;
    --surface-hover: #e8e8ea;
    --surface-elevated: #ffffff;

    /* Interactive States */
    --input-bg: #ffffff;
    --input-border: #d1d5db;
    --input-focus: #0f172a;

    /* Code & Technical */
    --code-bg: #f1f1f3;
    --code-border: #d4d4d8;

    /* Consistent Highlight Color */
    --highlight-color: #3b82f6;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --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);
}

[data-theme="dark"] {
    /* Dark Theme - Neutral Greys */
    --bg-color: #1a1a1a;
    --bg-secondary: #262626;
    --text-color: #d2d0d0;
    --text-secondary: #c8c6c6;
    --text-muted: #a3a3a3;
    --text-light: #737373;

    /* Consistent Dark Accent */
    --accent-color: #e5e7eb;

    /* Dark Grey Neutrals */
    --border-color: #525252;
    --border-light: #404040;
    --surface-color: #262626;
    --surface-hover: #404040;
    --surface-elevated: #525252;

    /* Dark Interactive States */
    --input-bg: #262626;
    --input-border: #525252;
    --input-focus: #e5e7eb;

    /* Dark Code & Technical */
    --code-bg: #262626;
    --code-border: #525252;

    /* Consistent Highlight Color for Dark */
    --highlight-color: #60a5fa;

    /* Dark Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
}

/* Base typography */
body {
    /* Use Menlo across the main body */
    font-family: Menlo, 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.22s ease, transform 0.22s ease;
    font-weight: 450;
}

/* Page transition states */
body.page-enter {
    opacity: 0;
    transform: translateY(6px);
}

body.page-exit {
    opacity: 0;
    transform: translateY(6px);
}

/* Navigation as left sidebar (also support legacy .top-nav markup) */
.top-nav {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.5rem;
    /* vertical divider is applied on #navbar-container */
    gap: 1rem;
}

/* Brand - Simple Text */
.nav-brand {
    font-family: Menlo, 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-color);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-brand:hover {
    opacity: 0.8;
}

/* Remove icon styles */
.avatar-icon,
.brand-initials {
    display: none;
}

.nav-links {
    display: flex;
    flex-direction: column;
    list-style: none;
    gap: 0.5rem;
    align-items: center; /* center items horizontally */
    margin: 0;
    padding: 0;
}

.nav-links li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links li::before {
    display: none;
}

.nav-links a {
    font-family: Menlo, 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.02rem;
    transition: color 0.2s ease;
    display: block;
    padding: 0.25rem 0.25rem;
}

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

.nav-links a.active {
    color: var(--accent-color);
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 2px;
}

.nav-brand.active { color: var(--accent-color); }

.theme-toggle {
    font-family: Menlo, 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 400;
    transition: opacity 0.2s ease;
    margin-left: 0;
}

.theme-toggle:hover {
    opacity: 0.7;
}

.nav-right { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }

/* Container and Layout */
/* Two-column layout: 20% sidebar, 80% content (responsive min widths) */
.container {
    width: 100%;
    margin: 0 auto;
    padding: 0; /* outer padding handled by columns */
    display: grid;
    grid-template-columns: minmax(180px, 20%) minmax(0, 80%);
    column-gap: 0; /* divider draws separation */
    align-items: start;
    justify-items: stretch;
}

/* Place main content in second column */
.container main {
    grid-column: 2;
    width: 100%;
    max-width: 1024px; /* keep readable line length */
    margin: 0 auto; /* equal left/right within the 80% column */
    padding: 2.5rem 2rem 0 2rem; /* equal horizontal padding */
    justify-self: center;
}
/* Home page: vertically and horizontally center the hero within content area */
body.page-home .container main {
    padding-top: clamp(10rem, 16vh, 18rem);
}
body.page-home .hero { margin-bottom: 0; }
/* Footer aligns with content column */
.container > #footer-container { grid-column: 2; justify-self: center; width: 100%; padding: 0 2rem; box-sizing: border-box; }

/* Sidebar container */
#navbar-container {
    position: sticky;
    top: 0;
    height: 100vh;
    align-self: stretch;
    padding-left: 1rem; /* small left padding per request */
    padding-right: 0;   /* right edge sits on divider */
    margin-left: 0;
    display: grid;
    place-items: center; /* center content perfectly */
    width: 100%;
    box-sizing: border-box;
}
#navbar-container::after { /* draw divider without affecting layout */
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 2px; /* slightly thicker divider */
    height: 100%;
    background: var(--border-light);
}
.sidebar { 
    position: sticky;
    top: 0;
    height: 100vh;
    /* divider handled by #navbar-container */
    display: flex;
    flex-direction: column;
    justify-content: center; /* vertical center */
    align-items: center;      /* horizontal center */
    gap: 1rem;
    padding: 1rem 0; /* remove horizontal padding to avoid visual shift */
    width: 100%;
    text-align: center;
}

.sidebar .nav-brand { margin-bottom: 0.5rem; display: block; width: 100%; text-align: center; }
.sidebar nav { width: 100%; display: flex; justify-content: center; }
.sidebar .nav-links {
    display: flex;
    flex-direction: column;
    align-items: center; /* center items horizontally */
    gap: 0.5rem;
    padding: 0;
    width: 100%;
}
.sidebar .nav-links a { text-align: center; border: none; background: transparent; padding: 0.2rem 0.25rem; width: 100%; box-sizing: border-box; text-transform: uppercase; letter-spacing: 0.06em; font-family: Menlo, 'SFMono-Regular', Consolas, 'Liberation Mono', monospace; }
.sidebar .nav-links a:hover { color: var(--accent-color); background: transparent; }
.sidebar .nav-links a.active { color: var(--accent-color); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.sidebar .theme-toggle {
    margin: 0;
    align-self: center;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
}
.sidebar .theme-toggle:hover { opacity: 0.8; }

.content {
    /* Narrower column like a doc page */
    max-width: 760px;
    margin: 0 auto;
}

/* Hero Section */
/* Hero with side image (doc-like, compact) */
.hero {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 2.5rem;
    align-items: center;
    margin-bottom: 3rem;
    min-height: auto;
    max-width: 950px;
    margin-left: auto;
    margin-right: auto;
}

.hero-content h1 { font-family: Menlo, 'SFMono-Regular', Consolas, 'Liberation Mono', monospace; font-size: 2.6rem; font-weight: 800; line-height: 1.2; margin-bottom: 0.75rem; color: var(--text-color); letter-spacing: -0.01em; }

.highlight {
    color: var(--highlight-color);
}

.hero-description { font-size: 1.02rem; line-height: 1.8; color: var(--text-color); margin-bottom: 0; font-weight: 450; max-width: 68ch; }

.hero-photo { position: relative; width: 280px; height: 280px; border-radius: 12px; overflow: hidden; background-color: var(--surface-color); border: 1px solid var(--border-light); box-shadow: var(--shadow-sm); display: flex; align-items: center; justify-content: center; transition: transform 180ms ease, box-shadow 180ms ease; }
.hero-photo:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.hero-photo img {
    width: 110%;
    height: 110%;
    object-fit: cover;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
}

/* Theme-based image switching */
.hero-photo-light {
    opacity: 1;
}

.hero-photo-dark {
    opacity: 0;
}

[data-theme="dark"] .hero-photo-light {
    opacity: 0;
}

[data-theme="dark"] .hero-photo-dark {
    opacity: 1;
}

.photo-placeholder {
    color: var(--text-muted);
    text-align: center;
    font-size: 0.9rem;
    padding: 2rem;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-family: Menlo, 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-color);
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

h1 {
    font-size: 2rem;
    margin-top: 0.25rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

h2 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.25;
}

h3 {
    font-size: 1.25rem;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

h4 {
    font-size: 1.1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    line-height: 1.35;
}

p {
    font-size: 0.98rem;
    line-height: 1.8;
    margin-bottom: 1rem;
    color: var(--text-color);
    font-weight: 450;
}

.lead {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-muted);
    margin-bottom: 1.75rem;
    font-weight: 500;
}

/* Links */
a {
    color: var(--accent-color);
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

a:hover {
    opacity: 0.8;
}

/* Link underline animation for a subtle UX touch */
a {
    text-underline-offset: 3px;
}
a:not(.nav-brand):not(.theme-toggle):not(.nav-links a) {
    text-decoration: none;
}
a:not(.nav-brand):not(.theme-toggle):not(.nav-links a)::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 1px;
    background: var(--accent-color);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 180ms ease;
}
a:not(.nav-brand):not(.theme-toggle):not(.nav-links a):hover::after {
    transform: scaleX(1);
}

/* Inline and block code styles */
code {
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-size: 0.92em;
}

pre {
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 6px;
    padding: 0.9rem 1rem;
    overflow: auto;
    margin: 1rem 0;
}

blockquote {
    border-left: 3px solid var(--border-color);
    padding-left: 1rem;
    color: var(--text-muted);
    margin: 1rem 0;
}

/* Subtle fade-up animation */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero, .content > * {
    animation: fadeUp 240ms ease both;
}
.content > * { animation-delay: 40ms; }

/* Sections */
.section {
    margin-bottom: 4rem;
}

.section:first-child {
    margin-bottom: 3rem;
}

/* Clean headings without visible # prefixes */
.section h2 { margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border-color); }
.section h2::after { display: none; }

/* Project and experience items */
.project,
.job {
    margin-bottom: 1.25rem;
    padding: 1rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 180ms ease, transform 180ms ease;
}

.project:hover,
.job:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.project:last-child,
.job:last-child {
    margin-bottom: 0;
}

.project h3,
.job h3 {
    margin-bottom: 0.35rem;
    margin-top: 0;
    font-size: 1.15rem;
    font-weight: 700;
    font-family: Menlo, 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    color: var(--text-color);
    line-height: 1.3;
}

.project-meta,
.job-meta {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    letter-spacing: 0.02em;
}

.job-meta a.org-link {
    color: var(--accent-color);
    font-weight: 650;
    text-decoration: none;
    padding: 0;
    margin-right: 0.35rem;
    border: none;
    background: transparent;
    box-shadow: none;
    position: relative;
}
.job-meta a.org-link::after {
    content: '↗';
    font-size: 0.85em;
    margin-left: 4px;
    opacity: 0.7;
    transition: transform 150ms ease, opacity 150ms ease;
}
.job-meta a.org-link:hover::after {
    transform: translate(1px, -1px);
    opacity: 1;
}

.project p,
.job p {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.project-links {
    margin-top: 0.9rem;
    display: flex;
    gap: 0.75rem;
}

.project-links a {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-elevated);
    display: inline-block;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}

/* Remove global underline pseudo-element */
.project-links a::after { content: none !important; }

.project-links a:hover {
    color: var(--text-color);
    border-color: var(--accent-color);
    background-color: var(--surface-hover);
    box-shadow: var(--shadow-md);
}

.project-links a:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Lists */
/* Markdown-like lists inside content */
.content ul {
    margin-bottom: 1rem;
    padding-left: 1.25rem;
    list-style: disc;
}

.content li {
    margin-bottom: 0.4rem;
    color: var(--text-color);
    font-size: 0.98rem;
    line-height: 1.7;
}

/* Override any global list styling that might be causing dots */
.nav-links li {
    list-style: none !important;
    padding-left: 0 !important;
}

.nav-links li::before {
    content: none !important;
    display: none !important;
}





/* Footer */
.footer { margin-top: 2rem; padding: 2rem 0 2rem 0; border-top: 1px solid var(--border-color); text-align: center; }

.footer-content { max-width: 720px; margin: 0 auto; padding: 0.75rem 1rem 1.75rem; background: var(--surface-color); border: 1px solid var(--border-color); border-radius: 8px; box-shadow: var(--shadow-sm); }

.footer {
    /* Footer uses JetBrains Mono for a distinct look */
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.footer h3 { font-size: 0.95rem; margin-bottom: 0.25rem; margin-top: 0; color: var(--text-color); font-weight: 700; }

.footer-quote { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 0.75rem; line-height: 1.4; }

.footer-social-links { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; margin-bottom: 0.75rem; }

.footer-social-links a { color: var(--text-color); font-size: 0.85rem; padding: 0.25rem 0.5rem; border: 1px solid var(--border-color); border-radius: 6px; text-decoration: none; background-color: var(--surface-elevated); box-shadow: var(--shadow-sm); transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; }
.footer-social-links a::after { content: none !important; }

.footer-social-links a:hover {
    color: var(--text-color);
    border-color: var(--accent-color);
    background-color: var(--surface-hover);
    box-shadow: var(--shadow-md);
}

.footer-social-links a:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 0;
    padding-top: 1rem;
    border-top: 1px dashed var(--border-color);
}

/* Responsive design */
@media (max-width: 768px) {
    .container { padding: 0 1.5rem; display: block; }
    #navbar-container { position: static; margin-bottom: 1rem; }
    .sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border-color); padding: 0.75rem 0; }
    .sidebar .nav-links { flex-direction: row; justify-content: center; flex-wrap: wrap; }
    .sidebar .nav-links a { display: inline-block; }

    .top-nav {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1.5rem 0 2rem 0;
        text-align: center;
    }

    .nav-brand {
        font-size: 1.3rem;
    }

    .nav-links { gap: 0.5rem; }

    .nav-links a {
        font-size: 0.95rem;
    }

    .theme-toggle {
        margin-left: 0;
        font-size: 0.95rem;
    }

    .hero {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
        margin-bottom: 4rem;
    }

    .hero-photo {
        width: 280px;
        height: 280px;
        margin: 0 auto;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.15rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.65rem;
    }

    h3 {
        font-size: 1.3rem;
    }

    h4 {
        font-size: 1.1rem;
    }

    p {
        font-size: 1rem;
    }

    .lead {
        font-size: 1.1rem;
    }

    .project h3,
    .job h3 {
        font-size: 1.25rem;
    }

    .project-links {
        flex-direction: column;
        gap: 1rem;
    }

    .footer-social-links {
        gap: 1rem;
    }
}
html {
    background-color: var(--bg-color);
}
