/* ===== CSS Custom Properties (Slate Theme — Dark-First) ===== */
:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --text-muted: #484f58;
    --accent: #58a6ff;
    --accent-hover: #79c0ff;
    --accent-light: rgba(88, 166, 255, 0.1);
    --border: #30363d;
    --card-bg: #161b22;
    --card-shadow: none;
    --card-shadow-hover: 0 2px 8px rgba(0, 0, 0, 0.3);
    --nav-bg: rgba(13, 17, 23, 0.92);
    --tag-bg: transparent;
    --tag-text: #8b949e;
    --tag-border: #30363d;
    --timeline-line: #30363d;
    --timeline-marker: #58a6ff;

    --max-width: 900px;
    --nav-height: 56px;

    --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', 'Consolas', monospace;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
        Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f6f8fa;
    --text-primary: #1f2328;
    --text-secondary: #59636e;
    --text-muted: #8b949e;
    --accent: #0969da;
    --accent-hover: #0550ae;
    --accent-light: rgba(9, 105, 218, 0.08);
    --border: #d1d9e0;
    --card-bg: #ffffff;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    --card-shadow-hover: 0 3px 12px rgba(0, 0, 0, 0.08);
    --nav-bg: rgba(255, 255, 255, 0.92);
    --tag-bg: transparent;
    --tag-text: #59636e;
    --tag-border: #d1d9e0;
    --timeline-line: #d1d9e0;
    --timeline-marker: #0969da;
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
}

body {
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* ===== Layout ===== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 80px 0;
}

.section-alt {
    background-color: var(--bg-secondary);
}

.section-title {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 36px;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.section-title::after {
    content: '';
    display: block;
    width: 32px;
    height: 2px;
    background-color: var(--accent);
    margin-top: 8px;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-top: -24px;
    margin-bottom: 32px;
}

/* ===== Navigation ===== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background-color: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--font-mono);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.5px;
}

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

.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 400;
    padding: 6px 10px;
    border-radius: 4px;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent);
    background-color: var(--accent-light);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background-color: var(--text-primary);
    border-radius: 1px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

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

.nav-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
    background-color: var(--accent-light);
}

[data-theme="dark"] .icon-moon,
[data-theme="light"] .icon-sun {
    display: none;
}

/* ===== Hero ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: var(--nav-height);
}

.hero-content {
    padding: 60px 0;
}

.hero-name {
    font-family: var(--font-mono);
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -1px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.hero-title {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 400;
}

.hero-location {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.hero-links {
    display: flex;
    gap: 12px;
    margin-bottom: 36px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.social-link:hover {
    color: var(--accent);
    border-color: var(--accent);
    background-color: var(--accent-light);
}

.hero-cta {
    font-family: var(--font-mono);
    display: inline-block;
    padding: 10px 24px;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.hero-cta:hover {
    background-color: var(--accent);
    color: #ffffff;
}

/* ===== About ===== */
.about-content p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 0.9375rem;
    line-height: 1.8;
}

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

/* ===== How I Work (Process) ===== */
.process-steps {
    display: flex;
    align-items: flex-start;
    gap: 0;
}

.process-step {
    flex: 1;
    text-align: center;
    padding: 0 12px;
}

.process-number {
    font-family: var(--font-mono);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 2px solid var(--accent);
    border-radius: 4px;
    color: var(--accent);
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 14px;
}

.process-step-title {
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.process-step-desc {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    line-height: 1.6;
}

.process-connector {
    width: 32px;
    min-width: 32px;
    height: 1px;
    background-color: var(--border);
    margin-top: 18px;
}

/* ===== Experience (Timeline) ===== */
.timeline {
    position: relative;
    padding-left: 28px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 1px;
    background-color: var(--timeline-line);
}

.timeline-item {
    position: relative;
    margin-bottom: 32px;
}

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

.timeline-marker {
    position: absolute;
    left: -33px;
    top: 8px;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    background-color: var(--bg-primary);
    border: 2px solid var(--timeline-marker);
    transition: background-color 0.3s ease;
}

.timeline-content {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 20px 24px;
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.timeline-content:hover {
    box-shadow: var(--card-shadow-hover);
}

.timeline-header h3 {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.timeline-company {
    display: inline;
    color: var(--accent);
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 0.875rem;
}

.timeline-date {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-left: 12px;
}

.timeline-details {
    list-style: none;
    padding-left: 0;
    margin-top: 12px;
}

.timeline-details li {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 6px;
    line-height: 1.6;
    padding-left: 16px;
    position: relative;
}

.timeline-details li::before {
    content: '-';
    position: absolute;
    left: 0;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.timeline-details li:last-child {
    margin-bottom: 0;
}

/* ===== Skills ===== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.skill-category {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 20px 24px;
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.skill-category:hover {
    box-shadow: var(--card-shadow-hover);
}

.skill-category-title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-tag {
    font-family: var(--font-mono);
    display: inline-block;
    padding: 3px 10px;
    background-color: var(--tag-bg);
    color: var(--tag-text);
    font-size: 0.8125rem;
    border: 1px solid var(--tag-border);
    border-radius: 2px;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ===== Projects ===== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.project-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}

.project-card:hover {
    box-shadow: var(--card-shadow-hover);
    border-color: var(--accent);
}

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
    color: var(--accent);
}

.project-title {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.project-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.project-tags span {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.project-tags span::before {
    content: '#';
    color: var(--accent);
}

/* ===== Case Studies ===== */
.case-studies-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.case-study {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 28px;
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.case-study:hover {
    box-shadow: var(--card-shadow-hover);
}

.case-study-title {
    font-family: var(--font-mono);
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.case-study-body {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.case-study-section {
    padding-top: 12px;
    border-top: 2px solid var(--border);
}

.case-study-section:first-child {
    border-top-color: var(--accent);
}

.case-study-label {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 8px;
}

.case-study-section p {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    line-height: 1.6;
}

.case-study-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.case-study-tags span {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.case-study-tags span::before {
    content: '#';
    color: var(--accent);
}

/* ===== Publications ===== */
.publications-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.publication-item {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 20px 24px;
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.publication-item:hover {
    box-shadow: var(--card-shadow-hover);
}

.publication-title {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.publication-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
}

/* ===== Education ===== */
.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.education-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.education-card:hover {
    box-shadow: var(--card-shadow-hover);
}

.education-degree {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.education-school {
    color: var(--accent);
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 4px;
}

.education-year {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

/* ===== Philosophy ===== */
.philosophy-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.philosophy-item {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 4px;
    padding: 20px 24px;
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.philosophy-item:hover {
    box-shadow: var(--card-shadow-hover);
}

.philosophy-item:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    max-width: calc(50% - 10px);
}

.philosophy-statement {
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.philosophy-detail {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    line-height: 1.6;
}

/* ===== Contact ===== */
.contact-content {
    max-width: 600px;
}

.contact-content > p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.8;
    margin-bottom: 28px;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact-link {
    font-family: var(--font-mono);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding: 10px 16px;
    border-radius: 4px;
    border: 1px solid var(--border);
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
    width: fit-content;
}

.contact-link:hover {
    color: var(--accent);
    border-color: var(--accent);
    background-color: var(--accent-light);
}

/* ===== Footer ===== */
.footer {
    padding: 20px 0;
    text-align: center;
    border-top: 1px solid var(--border);
}

.footer p {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ===== Animations ===== */
.fade-in {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background-color: var(--nav-bg);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        flex-direction: column;
        padding: 12px 24px;
        border-bottom: 1px solid var(--border);
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    .nav-menu.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }

    .nav-link {
        padding: 10px 12px;
        font-size: 0.875rem;
    }

    .section {
        padding: 60px 0;
    }

    .hero-name {
        font-size: 2rem;
    }

    .hero-title {
        font-size: 0.875rem;
    }

    .section-title {
        font-size: 1.125rem;
    }

    .process-steps {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .process-step {
        text-align: left;
        display: flex;
        gap: 16px;
        align-items: flex-start;
        padding: 0;
    }

    .process-number {
        min-width: 36px;
        margin-bottom: 0;
        margin-top: 2px;
    }

    .process-connector {
        width: 1px;
        min-width: 1px;
        height: 16px;
        margin-top: 0;
        margin-left: 18px;
    }

    .case-study-body {
        grid-template-columns: 1fr;
        gap: 16px;
    }

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

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

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

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

    .philosophy-item:last-child:nth-child(odd) {
        max-width: none;
    }

    .timeline {
        padding-left: 20px;
    }

    .timeline-marker {
        left: -25px;
        width: 8px;
        height: 8px;
    }

    .timeline-content {
        padding: 16px 20px;
    }

    .timeline-date {
        display: block;
        margin-left: 0;
        margin-top: 2px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero-name {
        font-size: 1.75rem;
    }
}

/* ===== Print ===== */
@media print {
    .nav,
    .theme-toggle,
    .hero-cta,
    .nav-toggle {
        display: none !important;
    }

    .hero {
        min-height: auto;
        padding-top: 0;
    }

    .section {
        padding: 24px 0;
    }

    body {
        font-size: 11pt;
        color: #000;
        background: #fff;
    }
}
