/* Root Variables - Black & White Only */
:root {
    /* Dark mode colors (default) */
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #141414;
    --text-primary: #ffffff;
    --text-secondary: #a3a3a3;
    --text-tertiary: #737373;
    --accent: #ffffff;
    --accent-hover: #d4d4d4;
    --border: #262626;
    --card-bg: #0a0a0a;
    --card-hover: #141414;

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', sans-serif;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
    --space-3xl: 6rem;
}

/* Light mode colors */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #fafafa;
    --bg-tertiary: #f5f5f5;
    --text-primary: #0a0a0a;
    --text-secondary: #525252;
    --text-tertiary: #a3a3a3;
    --accent: #000000;
    --accent-hover: #404040;
    --border: #e5e5e5;
    --card-bg: #ffffff;
    --card-hover: #fafafa;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "kern" 1;
    font-kerning: normal;
    transition: background 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* Theme Toggle Button */
.theme-toggle {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: var(--space-lg) auto 0;
}

.theme-toggle:hover {
    transform: scale(1.05);
    background: var(--card-hover);
}

.theme-toggle svg {
    transition: all 0.3s ease;
}

.sun-icon {
    display: block;
}

.moon-icon {
    display: none;
}

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

[data-theme="light"] .moon-icon {
    display: block;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3xl) var(--space-lg);
}

.hero-content {
    max-width: 800px;
    text-align: center;
}

.hero-image {
    width: 120px;
    height: 120px;
    margin: 0 auto var(--space-lg);
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--border);
    transition: all 0.3s ease;
}

.hero-image:hover {
    transform: scale(1.05);
    border-color: var(--text-primary);
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 400;
    margin-bottom: var(--space-md);
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.hero-tagline {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
    font-weight: 400;
    line-height: 1.8;
}

.hero-quote {
    margin: var(--space-xl) 0;
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.hero-quote blockquote {
    font-style: italic;
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.hero-quote cite {
    display: block;
    margin-top: var(--space-md);
    font-size: 0.9rem;
    color: var(--text-tertiary);
    font-style: normal;
}

.hero-philosophy {
    margin: var(--space-xl) 0;
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.social-links {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    margin-top: var(--space-xl);
}

.social-link {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.social-link:hover {
    transform: translateY(-2px);
    color: var(--text-primary);
    border-color: var(--text-primary);
}

.hero-theme-toggle {
    margin: 0;
    color: var(--text-secondary);
}

.hero-theme-toggle:hover {
    transform: translateY(-2px);
    color: var(--text-primary);
    border-color: var(--text-primary);
    background: var(--card-hover);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* Section Title */
.section-header {
    margin-bottom: var(--space-2xl);
    text-align: center;
}

.section-title {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 400;
    letter-spacing: -0.02em;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: var(--text-primary);
}

/* Experience Section */
.experience {
    padding: var(--space-3xl) 0;
    background: var(--bg-secondary);
}

/* Volunteer Section */
.volunteer {
    padding: var(--space-3xl) 0;
    background: var(--bg-primary);
}

.timeline {
    position: relative;
    padding-left: 40px;
    max-width: 900px;
    margin: 0 auto;
}

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

.timeline-item {
    position: relative;
    margin-bottom: var(--space-2xl);
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }
.timeline-item:nth-child(4) { animation-delay: 0.4s; }
.timeline-item:nth-child(5) { animation-delay: 0.5s; }
.timeline-item:nth-child(6) { animation-delay: 0.6s; }
.timeline-item:nth-child(7) { animation-delay: 0.7s; }

.timeline-item.hidden {
    display: none;
}

.timeline-dot {
    position: absolute;
    left: -35px;
    top: 5px;
    width: 20px;
    height: 20px;
    background: var(--bg-primary);
    border: 2px solid var(--text-primary);
    border-radius: 50%;
}

.timeline-content {
    background: var(--card-bg);
    padding: var(--space-lg);
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.timeline-content:hover {
    transform: translateX(5px);
    border-color: var(--text-primary);
}

.timeline-header h3 {
    font-size: 1.3rem;
    margin-bottom: var(--space-xs);
    font-weight: 500;
}

.timeline-header .company {
    display: block;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: var(--space-xs);
}

.timeline-header .company-link {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease, transform 0.2s ease;
    vertical-align: middle;
}

.timeline-header .company-link:hover {
    color: var(--text-primary);
    transform: translateY(-1px);
}

.timeline-header .company-link svg {
    display: inline-block;
}

.timeline-header .date {
    display: block;
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

.timeline-details {
    margin-top: var(--space-md);
    padding-left: var(--space-md);
    list-style: none;
}

.timeline-details li {
    position: relative;
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
    line-height: 1.7;
}

.timeline-details li::before {
    content: '—';
    position: absolute;
    left: -20px;
    color: var(--text-primary);
}

/* Projects Section */
.projects {
    padding: var(--space-3xl) 0;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: var(--space-lg);
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    display: flex;
    flex-direction: column;
}

.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }
.project-card:nth-child(4) { animation-delay: 0.4s; }
.project-card:nth-child(5) { animation-delay: 0.5s; }
.project-card:nth-child(6) { animation-delay: 0.6s; }

.project-card.hidden {
    display: none;
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--text-primary);
}

.project-status {
    font-size: 0.75rem;
    padding: 4px 10px;
    background: var(--text-primary);
    color: var(--bg-primary);
    border-radius: 4px;
    font-weight: 500;
    align-self: flex-start;
    margin-bottom: var(--space-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.project-header {
    margin-bottom: var(--space-md);
}

.project-header h3 {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    font-weight: 500;
}

.project-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.project-description {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-md);
    flex-grow: 1;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}

.project-tech span {
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.project-links {
    display: flex;
    gap: var(--space-md);
}

.project-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.project-links a svg {
    flex-shrink: 0;
}

.project-links a:hover {
    opacity: 0.7;
}

.view-more-btn {
    display: block;
    margin: 0 auto;
    padding: 12px 32px;
    background: var(--text-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-sans);
}

.view-more-btn:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

.view-more-btn .arrow {
    display: inline-block;
    transition: transform 0.3s ease;
}

.view-more-btn:hover .arrow {
    transform: translateX(3px);
}

/* Books Section */
.books {
    padding: var(--space-3xl) 0;
    background: var(--bg-primary);
}

.books-list {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.book-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    transition: all 0.3s ease;
}

.book-item:hover {
    opacity: 0.8;
}

.book-arrow {
    color: var(--text-primary);
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 4px;
}

.book-text {
    display: inline;
}

.book-title {
    color: var(--text-primary);
    font-weight: 400;
    font-size: 1.1rem;
}

.book-description {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 1.1rem;
}

/* Road Trip Section */
.roadtrip {
    padding: var(--space-3xl) 0;
    background: var(--bg-secondary);
}

.roadtrip-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: var(--space-sm);
    text-align: center;
}

.map-container {
    width: 100%;
    height: 500px;
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: var(--space-xl);
    background: var(--card-bg);
}

/* Leaflet popup styling */
.leaflet-popup-content-wrapper {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.leaflet-popup-content {
    margin: 10px 14px;
    color: var(--text-primary);
}

.leaflet-popup-tip {
    background: var(--card-bg);
    border: 1px solid var(--border);
}

/* Elevation Profile Panel */
.elevation-panel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: var(--space-lg);
    margin-top: var(--space-lg);
    overflow: hidden;
}

.elevation-header {
    margin-bottom: var(--space-md);
}

.elevation-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
}

.elevation-stat {
    text-align: center;
    padding: var(--space-sm) var(--space-xs);
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.elevation-stat:hover {
    border-color: var(--text-tertiary);
}

.elevation-stat.highlight {
    background: var(--text-primary);
}

.elevation-stat.highlight .stat-value,
.elevation-stat.highlight .stat-unit,
.elevation-stat.highlight .stat-name {
    color: var(--bg-primary);
}

.elevation-stat .stat-value {
    font-size: 1.8rem;
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    display: inline;
    font-variant-numeric: tabular-nums;
    transition: transform 0.15s ease, color 0.15s ease;
}

.elevation-stat .stat-value.pulse {
    transform: scale(1.05);
}

.elevation-stat .stat-unit {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-left: 2px;
}

.elevation-stat .stat-name {
    display: block;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: var(--space-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.elevation-chart-container {
    position: relative;
    margin-top: var(--space-md);
}

#elevation-chart {
    width: 100%;
    height: 150px;
    display: block;
}

#elevation-chart path {
    transition: d 0.1s ease-out;
}

#elevation-active {
    filter: drop-shadow(0 0 3px var(--text-primary));
}

#elevation-indicator {
    transition: cx 0.1s ease-out, cy 0.1s ease-out, opacity 0.3s ease;
    filter: drop-shadow(0 0 4px var(--text-primary));
}

.peak-label {
    font-family: var(--font-sans);
    font-weight: 500;
    opacity: 0.7;
}

.peak-marker {
    opacity: 0.5;
}

.elevation-axis {
    display: flex;
    justify-content: space-between;
    padding: var(--space-xs) var(--space-xs) 0;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* Responsive elevation panel */
@media (max-width: 768px) {
    .elevation-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .elevation-stat .stat-value {
        font-size: 1.4rem;
    }
    
    #elevation-chart {
        height: 120px;
    }
}

@media (max-width: 480px) {
    .elevation-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-xs);
    }
    
    .elevation-stat {
        padding: var(--space-xs);
    }
    
    .elevation-stat .stat-value {
        font-size: 1.2rem;
    }
    
    .elevation-stat .stat-name {
        font-size: 0.65rem;
    }
    
    #elevation-chart {
        height: 100px;
    }
    
    .elevation-axis {
        font-size: 0.65rem;
    }
    
    .peak-label {
        font-size: 8px !important;
    }
}

/* Hackathons Section */
.hackathons {
    padding: var(--space-3xl) 0;
    background: var(--bg-secondary);
}

.hackathon-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.stat-card {
    text-align: center;
    padding: var(--space-xl);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--text-primary);
}

.stat-number {
    display: block;
    font-size: 3rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    letter-spacing: -0.02em;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

.hackathon-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.hackathon-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    position: relative;
}

.hackathon-card:hover {
    transform: translateY(-3px);
    border-color: var(--text-primary);
}

.hackathon-card.winner {
    border: 2px solid var(--text-primary);
}

.hackathon-badge {
    position: absolute;
    top: -10px;
    right: 10px;
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hackathon-content h3 {
    font-size: 1.1rem;
    margin-bottom: 4px;
    font-weight: 500;
}

.hackathon-content p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Skills Section */
.skills {
    padding: var(--space-3xl) 0;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.skill-category {
    background: var(--card-bg);
    padding: var(--space-lg);
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.skill-category:hover {
    transform: translateY(-3px);
    border-color: var(--text-primary);
}

.skill-category h3 {
    font-size: 1.1rem;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
    font-weight: 500;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.skill-tags span {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.skill-tags span:hover {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
}

/* Footer */
.footer {
    padding: var(--space-2xl) 0;
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
}

.footer-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
}

.footer-quotes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.quote-box {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: var(--space-lg);
    transition: all 0.3s ease;
}

.quote-box:hover {
    transform: translateY(-3px);
    border-color: var(--text-primary);
}

.quote-box p {
    font-style: italic;
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 1rem;
    margin: 0;
}

.footer-info {
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

.footer-info p {
    margin-bottom: 0.5rem;
}

.footer-social-links {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    align-items: center;
}

.footer-social-links .social-link {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.footer-social-links .social-link:hover {
    transform: translateY(-2px);
    color: var(--text-primary);
    border-color: var(--text-primary);
}

.footer-social-links .theme-toggle {
    margin: 0;
    color: var(--text-secondary);
}

.footer-social-links .theme-toggle:hover {
    transform: translateY(-2px);
    color: var(--text-primary);
    border-color: var(--text-primary);
    background: var(--card-hover);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 968px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hackathon-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hero {
        padding: var(--space-3xl) var(--space-md);
    }

    .container {
        padding: 0 var(--space-md);
    }

    .social-links {
        gap: var(--space-sm);
    }

    .footer-social-links {
        gap: var(--space-sm);
    }

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

    .hero-tagline {
        font-size: 1.1rem;
    }

    .timeline {
        padding-left: 30px;
    }

    .timeline-dot {
        left: -25px;
    }

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

    .hackathon-stats {
        grid-template-columns: 1fr;
    }

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

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

    .footer-quotes {
        grid-template-columns: 1fr;
    }

    .map-container {
        height: 400px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: var(--space-2xl) var(--space-sm);
    }

    .container {
        padding: 0 var(--space-sm);
    }

    .social-links {
        gap: var(--space-xs);
    }

    .footer-social-links {
        gap: var(--space-xs);
    }

    .social-link {
        width: 40px;
        height: 40px;
    }

    .theme-toggle {
        width: 40px;
        height: 40px;
    }

    .footer-social-links .social-link {
        width: 40px;
        height: 40px;
    }

    .footer-social-links .theme-toggle {
        width: 40px;
        height: 40px;
    }

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

    .stat-card {
        padding: var(--space-md);
    }

    .stat-number {
        font-size: 2.5rem;
    }

    .map-container {
        height: 300px;
    }

    .roadtrip-subtitle {
        font-size: 0.95rem;
    }

    .book-title {
        font-size: 1rem;
    }

    .book-description {
        font-size: 1rem;
    }

    .books-list {
        gap: var(--space-md);
    }
}