/* ========================================
   Design Tokens
   ======================================== */
:root {
    --color-bg: #F5F0E8;
    --color-bg-alt: #EDE6D8;
    --color-surface: #FFFFFF;
    --color-text: #2D2D2D;
    --color-text-muted: #6B6459;
    --color-heading: #2D2D2D;
    --color-primary: #3C4A3E;
    --color-primary-light: #4E6050;
    --color-accent: #C07850;
    --color-accent-light: #D4915F;
    --color-sand: #D4C5A9;
    --color-sand-light: #E8DCC4;
    --color-cream: #F5F0E8;
    --color-border: #D4C5A980;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --shadow-sm: 0 1px 3px rgba(45,45,45,.06);
    --shadow-md: 0 4px 16px rgba(45,45,45,.08);
    --shadow-lg: 0 8px 32px rgba(45,45,45,.10);
    --shadow-xl: 0 16px 48px rgba(45,45,45,.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --max-width: 1100px;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-main);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.7;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-accent-light); }
ul { list-style: none; }

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

.section {
    padding: 100px 0;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-heading);
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.section-subtitle {
    font-size: 1.05rem;
    color: var(--color-text-muted);
    margin-bottom: 48px;
    max-width: 600px;
    line-height: 1.6;
}

/* ========================================
   Reveal Animation
   ======================================== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   Navbar
   ======================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(245, 240, 232, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
    transition: background var(--transition), box-shadow var(--transition);
}

.navbar.scrolled {
    background: rgba(245, 240, 232, 0.95);
    box-shadow: var(--shadow-sm);
}

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

.nav-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: -0.02em;
}
.nav-logo:hover { color: var(--color-accent); }

.nav-menu {
    display: flex;
    gap: 8px;
}

.nav-link {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.nav-link:hover {
    color: var(--color-primary);
    background: var(--color-sand-light);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.nav-toggle span {
    width: 22px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: all var(--transition);
}

/* ========================================
   Hero (with integrated About)
   ======================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(160deg, var(--color-primary) 0%, #2A3A2C 40%, #3C4A3E 100%);
    overflow: hidden;
}

.hero-grain {
    position: absolute;
    inset: 0;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px;
    pointer-events: none;
}

.hero-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    text-align: center;
    padding: 120px 24px 80px;
    position: relative;
    z-index: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    width: 100%;
}

.hero-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 36px;
    margin-bottom: 56px;
}

.hero-image-wrapper {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid rgba(212, 197, 169, 0.4);
    box-shadow: 0 8px 40px rgba(0,0,0,0.2);
}

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

.hero-text h1 {
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-cream);
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 16px;
}

.hero-tagline {
    font-size: 1.15rem;
    color: var(--color-sand);
    max-width: 520px;
    margin: 0 auto 8px;
    line-height: 1.6;
    font-weight: 300;
}

.hero-location {
    font-size: 0.9rem;
    color: var(--color-sand-light);
    opacity: 0.7;
    margin-bottom: 24px;
}

.hero-links {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.hero-link {
    color: var(--color-sand);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(212, 197, 169, 0.3);
    transition: all var(--transition);
}
.hero-link:hover {
    color: var(--color-cream);
    background: rgba(212, 197, 169, 0.15);
    border-color: rgba(212, 197, 169, 0.5);
    transform: translateY(-2px);
}

/* Hero About (integrated) */
.hero-about {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(212, 197, 169, 0.15);
    border-radius: var(--radius-lg);
    padding: 40px 44px;
    max-width: 740px;
    text-align: left;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.hero-about-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--color-cream);
    margin-bottom: 20px;
    letter-spacing: -0.01em;
}

.hero-about-text p {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--color-sand);
    margin-bottom: 16px;
}
.hero-about-text p:last-child { margin-bottom: 0; }

.scroll-indicator {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

.scroll-arrow {
    width: 24px;
    height: 24px;
    border-right: 2px solid var(--color-sand);
    border-bottom: 2px solid var(--color-sand);
    transform: rotate(45deg);
    opacity: 0.4;
    animation: scrollBounce 2s infinite;
}

@keyframes scrollBounce {
    0%,100% { transform: rotate(45deg) translate(0,0); opacity: 0.4; }
    50% { transform: rotate(45deg) translate(6px,6px); opacity: 0.7; }
}

/* ========================================
   Timeline
   ======================================== */
.timeline-section { background: var(--color-bg-alt); }

.timeline-section .section-title { margin-bottom: 56px; }

.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--color-sand), var(--color-primary), var(--color-sand));
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    width: 50%;
    padding: 0 48px 60px;
}

.timeline-item[data-side="right"] {
    margin-left: 50%;
}
.timeline-item[data-side="left"] {
    text-align: right;
}
.timeline-item[data-side="left"] .timeline-details {
    direction: rtl;
}
.timeline-item[data-side="left"] .timeline-details li {
    direction: ltr;
    text-align: left;
}

.timeline-marker {
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--color-primary);
    border: 3px solid var(--color-bg-alt);
    border-radius: 50%;
    top: 4px;
    z-index: 2;
    box-shadow: var(--shadow-sm);
}

.timeline-item[data-side="right"] .timeline-marker { left: -8px; }
.timeline-item[data-side="left"] .timeline-marker { right: -8px; }

.marker-award {
    background: var(--color-accent);
    width: 20px;
    height: 20px;
    border-width: 3px;
}
.timeline-item[data-side="right"] .marker-award { left: -10px; }
.timeline-item[data-side="left"] .marker-award { right: -10px; }

.marker-education {
    background: var(--color-sand);
}

.timeline-content {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: 28px;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition), box-shadow var(--transition);
    text-align: left;
}
.timeline-content:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.timeline-image-slot {
    width: 100%;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 16px;
    position: relative;
    max-height: 220px;
}
.timeline-image-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.timeline-date {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-accent);
    letter-spacing: 0.02em;
    margin-bottom: 8px;
}

.timeline-content h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-heading);
    margin-bottom: 4px;
}

.timeline-company {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 14px;
}

.award-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-light));
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 8px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.timeline-details {
    list-style: disc;
    padding-left: 18px;
}
.timeline-details li {
    font-size: 0.88rem;
    color: var(--color-text);
    line-height: 1.6;
    margin-bottom: 8px;
}
.timeline-details li:last-child { margin-bottom: 0; }
.timeline-details strong { color: var(--color-primary); }

.timeline-highlight .timeline-content {
    border: 1px solid var(--color-accent);
    border-top: 3px solid var(--color-accent);
}

/* ========================================
   Skills
   ======================================== */
.skills-section { background: var(--color-bg); }

.skills-section .section-title { margin-bottom: 48px; }

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

.skill-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}
.skill-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.skill-icon {
    width: 48px;
    height: 48px;
    background: var(--color-sand-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--color-primary);
}

.skill-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--color-heading);
}

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

.skill-tag {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-primary);
    background: var(--color-sand-light);
    padding: 5px 12px;
    border-radius: 20px;
    transition: all var(--transition);
}
.skill-tag:hover {
    background: var(--color-primary);
    color: var(--color-cream);
}

/* ========================================
   Volunteering
   ======================================== */
.volunteering-section { background: var(--color-bg-alt); }

.volunteering-section .section-title { margin-bottom: 12px; }

.volunteer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.volunteer-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border-left: 3px solid var(--color-primary);
    transition: transform var(--transition), box-shadow var(--transition);
}
.volunteer-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.volunteer-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-heading);
    margin-bottom: 4px;
}

.volunteer-org {
    font-size: 0.88rem;
    color: var(--color-accent);
    font-weight: 500;
    margin-bottom: 4px;
}

.volunteer-date {
    display: inline-block;
    font-size: 0.78rem;
    color: var(--color-text-muted);
    margin-bottom: 10px;
}

.volunteer-card > p:last-child {
    font-size: 0.88rem;
    color: var(--color-text);
    line-height: 1.6;
}

/* ========================================
   Hobbies / Life
   ======================================== */
.hobbies-section { background: var(--color-bg); }

.hobbies-section .section-title { margin-bottom: 24px; }

.hobbies-intro p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--color-text);
    max-width: 700px;
    margin-bottom: 24px;
}

.hobby-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 48px;
}

.hobby-tag {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-cream);
    background: var(--color-primary);
    padding: 8px 18px;
    border-radius: 24px;
    transition: all var(--transition);
}
.hobby-tag:hover {
    background: var(--color-accent);
    transform: translateY(-2px);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.gallery-item {
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition), box-shadow var(--transition);
    aspect-ratio: 4/3;
}
.gallery-item:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: var(--shadow-xl);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.gallery-item:hover img { transform: scale(1.05); }

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 16px 14px;
    background: linear-gradient(transparent, rgba(45,45,45,.7));
    opacity: 0;
    transition: opacity var(--transition);
}
.gallery-item:hover .gallery-caption { opacity: 1; }
.gallery-caption p {
    font-size: 0.85rem;
    color: var(--color-cream);
    font-weight: 500;
}

/* ========================================
   GitHub
   ======================================== */
.github-section {
    background: var(--color-primary);
    color: var(--color-cream);
}

.github-section .section-title { color: var(--color-cream); margin-bottom: 12px; }
.github-section .section-subtitle { color: var(--color-sand); margin-bottom: 40px; }

.github-card {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: var(--radius-lg);
    padding: 36px;
    text-align: center;
}

.github-chart-wrapper {
    overflow-x: auto;
    margin-bottom: 24px;
    padding: 8px 0;
}

.github-chart {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    filter: brightness(1.2);
}

.github-profile-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--color-cream);
    font-weight: 500;
    padding: 12px 24px;
    border: 1px solid rgba(212,197,169,.3);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.github-profile-link:hover {
    background: rgba(212,197,169,.1);
    border-color: rgba(212,197,169,.5);
    color: var(--color-cream);
    transform: translateY(-2px);
}

.github-note {
    font-size: 0.8rem;
    color: var(--color-sand);
    opacity: 0.7;
    margin-top: 16px;
}
.github-note a { color: var(--color-sand-light); }

/* ========================================
   Footer
   ======================================== */
.footer {
    background: var(--color-text);
    color: var(--color-sand);
    padding: 60px 0 32px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 32px;
    margin-bottom: 40px;
}

.footer-name {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-cream);
    margin-bottom: 4px;
}

.footer-location {
    font-size: 0.88rem;
    color: var(--color-sand);
    opacity: 0.7;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: right;
}
.footer-links a {
    font-size: 0.88rem;
    color: var(--color-sand);
    transition: color var(--transition);
}
.footer-links a:hover { color: var(--color-cream); }

.footer-bottom {
    border-top: 1px solid rgba(212,197,169,.15);
    padding-top: 24px;
    text-align: center;
}
.footer-bottom p {
    font-size: 0.8rem;
    color: var(--color-sand);
    opacity: 0.5;
}

/* ========================================
   Lightbox
   ======================================== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(45,45,45,.92);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}
.lightbox.active {
    opacity: 1;
    pointer-events: all;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 28px;
    font-size: 2rem;
    color: var(--color-cream);
    background: none;
    border: none;
    cursor: pointer;
    transition: transform var(--transition);
}
.lightbox-close:hover { transform: scale(1.15); }

.lightbox-img {
    max-width: 90%;
    max-height: 80vh;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
}

.lightbox-caption {
    margin-top: 16px;
    font-size: 0.9rem;
    color: var(--color-sand);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 900px) {
    .timeline::before { left: 24px; }
    .timeline-item { width: 100%; margin-left: 0 !important; padding: 0 0 48px 56px; text-align: left !important; }
    .timeline-item[data-side="left"] .timeline-details { direction: ltr; }
    .timeline-marker { left: 16px !important; right: auto !important; }
    .marker-award { left: 14px !important; }
    .skills-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        background: rgba(245, 240, 232, 0.97);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 16px 24px;
        border-bottom: 1px solid var(--color-border);
        transform: translateY(-120%);
        transition: transform 0.35s ease, visibility 0.35s ease;
        visibility: hidden;
    }
    .nav-menu.open { transform: translateY(0); visibility: visible; }
    .nav-toggle { display: flex; }
    .nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
    .nav-toggle.active span:nth-child(2) { opacity: 0; }
    .nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

    .hero-text h1 { font-size: 2.2rem; }
    .hero-tagline { font-size: 1rem; }
    .hero-about { padding: 28px 24px; }
    .section { padding: 72px 0; }
    .section-title { font-size: 1.65rem; }
    .footer-content { flex-direction: column; }
    .footer-links { text-align: left; }
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    .volunteer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .hero-text h1 { font-size: 1.75rem; }
    .hero-image-wrapper { width: 120px; height: 120px; }
    .timeline-content { padding: 20px; }
    .github-card { padding: 20px; }
}
