/* ============================================
   RESET & BASE STYLES
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: Georgia, 'Times New Roman', serif;
    background: #f9f9f9;
    height: 100vh;
    height: 100dvh;
    display: grid;
    grid-template-columns: 250px 1fr;
    grid-template-rows: 1fr;
    color: #1a1a1a;
    margin: 0;
    overflow: hidden;
}


/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shakeGlow {
    0%, 100% {
        transform: translate(0, 0);
        color: #888;
        text-shadow: none;
        opacity: 1;
    }
    10%, 50%, 90% {
        transform: translate(-5px, 2px);
        opacity: 1;
    }
    20%, 60% {
        transform: translate(5px, -2px);
        opacity: 1;
    }
    30%, 70% {
        transform: translate(-5px, -2px);
        opacity: 1;
    }
    40%, 80% {
        transform: translate(5px, 2px);
        opacity: 1;
    }
    50% {
        color: #e74c3c;
        text-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
        opacity: 1;
    }
}


/* ============================================
   LAYOUT - SIDEBAR
   ============================================ */

.sidebar {
    background: #fff;
    padding: 2rem 0 0 0;
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    animation: slideInLeft 0.6s ease-out;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 1.5rem;
}

.sidebar nav a {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    color: #333;
    text-decoration: none;
    padding: 0.75rem 1rem;
    margin: 0 -1.5rem;
    padding-left: 2.5rem;
    padding-right: 2.5rem;
    transition: background 0.2s ease;
    font-size: 0.95rem;
}

.sidebar nav a:hover {
    background: #f4f4f4;
}

.sidebar-footer {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
}

.sidebar-footer a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s ease;
    font-size: 0.75rem;
}

.sidebar-footer a:hover {
    color: #1a1a1a;
}

.sidebar-footer p {
    margin: 0;
    font-size: 0.75rem;
    color: #666;
    padding: 0;
}


/* ============================================
   LAYOUT - HAMBURGER MENU
   ============================================ */

.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding: 0.5rem;
    background: none;
    border: none;
    z-index: 1000;
}

.hamburger span {
    width: 24px;
    height: 3px;
    background: #333;
    transition: all 0.3s ease;
    border-radius: 2px;
    will-change: transform;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

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

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}


/* ============================================
   LAYOUT - MAIN CONTAINER
   ============================================ */

.container {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    margin: 0 auto;
    width: 100%;
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    overflow: hidden;
    height: 100%;
}

.container:has(#projects.active), .container:has(#experience.active) {
    overflow-y: auto;
    align-items: flex-start;
}

.content-wrapper {
    width: 100%;
}


/* ============================================
   TYPOGRAPHY - HOME PAGE
   ============================================ */

h1 {
    font-size: clamp(3rem, 8vw, 4.5rem);
    font-weight: 600;
    color: #1a1a1a;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    line-height: 1.1;
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
    animation: slideInUp 0.8s ease-out 0.3s backwards;
}

.subtitle {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: clamp(0.9rem, 2vw, 1.3rem);
    font-weight: 400;
    color: #666;
    letter-spacing: 0.02em;
    margin-bottom: 2rem;
    animation: slideInUp 0.8s ease-out 0.5s backwards;
}

.divider {
    width: 60px;
    height: 2px;
    background: #333;
    margin: 2rem auto;
    animation: fadeIn 0.6s ease-out 0.7s backwards;
}

.tagline {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: clamp(0.85rem, 1.8vw, 1.1rem);
    font-weight: 400;
    color: #888;
    letter-spacing: 0.01em;
    margin-top: 1.5rem;
    animation: fadeIn 0.6s ease-out 0.9s backwards;
}

.tagline.visible {
    opacity: 1;
    animation: none;
}

.tagline.visible.shake {
    animation: shakeGlow 0.6s ease-in-out;
}


/* ============================================
   COMPONENTS - SECTIONS
   ============================================ */

.section {
    padding: 3rem 2rem;
    margin: 0 auto;
    width: 100%;
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.6s ease-out;
    animation-fill-mode: forwards;
}

.section.fade-out {
    display: block;
    animation: fadeOut 0.3s ease-out;
    animation-fill-mode: forwards;
}

.section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #1a1a1a;
    text-align: center;
}


/* ============================================
   COMPONENTS - SOCIAL CARDS
   ============================================ */

.socials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.social-card {
    background: #666;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.social-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.social-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
}

.social-name {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
}


/* ============================================
   COMPONENTS - BLOG
   ============================================ */

.blog-posts {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 2rem;
}

.blog-post {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
}

.blog-post:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.blog-post h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
}

.blog-post h3 a {
    color: #1a1a1a;
    text-decoration: none;
}

.blog-post h3 a:hover {
    color: #666;
}

.blog-post-meta {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 1rem;
}

.blog-post-excerpt {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

.blog-coming-soon {
    text-align: center;
    padding: 4rem 2rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    color: #888;
    font-size: 1.1rem;
}


/* ============================================
   COMPONENTS - TIMELINE
   ============================================ */

.year-nav {
    position: fixed;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 10;
}

.year-link {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.75rem;
    color: #d0d0d0;
    cursor: pointer;
    padding: 0.25rem;
    text-align: center;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.year-link:hover {
    color: #888;
}

.year-link.active {
    color: #333;
    font-weight: 600;
}

.timeline {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 2rem 2rem 0 2rem;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 6rem);
    scroll-snap-type: y mandatory;
    background-image: linear-gradient(#e0e0e0, #e0e0e0);
    background-size: 2px 100%;
    background-position: center 0;
    background-repeat: no-repeat;
}

.timeline::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
}

/* Hide scrollbar */
.timeline {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.timeline-end {
    position: relative;
    height: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0;
    margin: 0;
}

.timeline-end .timeline-dot {
    position: static;
    left: auto;
    transform: none;
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    display: flex;
    justify-content: flex-start;
    scroll-snap-align: start;
}

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

.timeline-item.final-item {
    margin-bottom: 0 !important;
}

.timeline-item:nth-child(even) {
    justify-content: flex-end;
}

.timeline-dot {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    background: #666;
    border: 3px solid #f9f9f9;
    border-radius: 50%;
    z-index: 1;
    top: 0;
}

.timeline-content {
    width: 47%;
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
    text-align: left;
    position: relative;
}

.company-logo {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 60px;
    height: 60px;
    background: #2a2a2a;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 8px;
    letter-spacing: 0.5px;
}

.timeline-content:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.timeline-date {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.timeline-content h3 {
    font-size: 1.25rem;
    color: #1a1a1a;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.timeline-company {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 1rem;
    font-style: italic;
}

.timeline-details {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    list-style: none;
    padding: 0;
    margin: 0;
}

.timeline-details li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #333;
    text-align: left;
}

.timeline-details li:before {
    content: '•';
    position: absolute;
    left: 0;
    color: #666;
    font-weight: bold;
}

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


/* ============================================
   LAYOUT - MOBILE FOOTER
   ============================================ */

.mobile-footer {
    display: none;
}


/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */

@media (max-width: 768px) {
    /* Body Grid */
    body {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }
    
    /* Hamburger */
    .hamburger {
        display: flex;
    }
    
    /* Sidebar */
    .sidebar {
        padding: 1rem;
        grid-row: 1 / 2;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        flex-direction: column;
        align-items: flex-start;
        position: relative;
        width: 100%;
    }
    
    .sidebar nav {
        flex-direction: column;
        gap: 0;
        padding: 0;
        width: 100%;
        margin-top: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.3s ease, 
                    opacity 0.3s ease,
                    margin-top 0.3s ease;
    }
    
    .sidebar.expanded nav {
        margin-top: 1rem;
        max-height: 500px;
        opacity: 1;
    }
    
    .sidebar nav a {
        padding: 1.25rem 1.5rem;
        margin: 0;
        font-size: 0.95rem;
        width: 100%;
        text-align: left;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .sidebar nav a:last-child {
        border-bottom: none;
    }
    
    .sidebar-footer {
        display: none;
    }
    
    /* Main Container */
    .container {
        grid-column: 1 / 2;
        grid-row: 2 / 3;
        overflow-y: auto;
        padding: 0;
        align-items: flex-start;
    }
    
    #home.content-wrapper.active {
        min-height: 100%;
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    
    #home.content-wrapper.active h1 {
        margin-bottom: 1rem;
    }
    
    #home.content-wrapper.active .subtitle {
        margin-bottom: 2rem;
    }
    
    #home.content-wrapper.active .divider {
        margin: 2rem auto;
    }
    
    #home.content-wrapper.active .tagline {
        margin-top: 1.5rem;
    }
    
    .section {
        padding: 2rem 1rem;
    }
    
    #socials {
        padding-top: 0;
    }
    
    #projects {
        padding-top: 0;
    }
    
    /* Mobile Footer */
    .mobile-footer {
        display: block !important;
        padding: 1rem;
        background: #fff;
        border-top: 1px solid #e0e0e0;
        grid-column: 1 / 2;
        grid-row: 3 / 4;
        text-align: center;
    }
    
    .mobile-footer-content {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        align-items: center;
    }
    
    .mobile-footer p {
        margin: 0;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
        font-size: 0.75rem;
        color: #666;
    }
    
    .mobile-footer a {
        display: inline-block;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
        font-size: 0.75rem;
        color: #666;
        text-decoration: none;
    }
    
    .mobile-footer a:hover {
        color: #1a1a1a;
    }
    
    /* Social Cards */
    .socials-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Timeline - Mobile */
    .year-nav {
        display: none;
    }
    
    #experience {
        overflow-y: auto;
        height: 100%;
    }
    
    #projects {
        overflow-y: auto;
        height: 100%;
    }
    
    .timeline {
        padding: 0 1rem;
        scroll-snap-type: none;
        max-height: none;
        overflow: visible;
    }
    
    .timeline-item {
        justify-content: center !important;
        scroll-snap-align: none;
    }
    
    .timeline-dot {
        display: none;
    }
    
    .timeline-end {
        display: none;
    }
    
    .timeline-content {
        width: 100%;
        max-width: 100%;
        padding: 1.5rem;
        text-align: center;
    }
    
    .timeline-content h3,
    .timeline-date,
    .timeline-company {
        text-align: center;
    }
    
    .timeline-details {
        text-align: left;
    }
}

/* Easter egg */
.trigger-char {
    cursor: default;
    user-select: none;
}

/* Resume download button */
.resume-download {
    display: inline-block;
    padding: 1rem 2rem;
    background: #666;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 600;
    transition: background 0.3s ease;
    margin-top: 1rem;
}

.resume-download:hover {
    background: #444;
}

/* ============================================
   COMPONENTS - PROJECTS
   ============================================ */

#projects {
    max-width: 1200px;
    margin: 0 auto;
    text-align: left;
}

#projects > h1 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.projects-section {
    margin-bottom: 4rem;
}

.projects-section:last-child {
    margin-bottom: 0;
}

.projects-section h2 {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.3rem;
    color: #888;
    margin-bottom: 2rem;
    font-weight: 400;
    text-align: left;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background: #fff;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-left: 4px solid #666;
    position: relative;
    cursor: pointer;
}

.project-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

.project-card.expanded {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    max-width: 1000px;
    height: 90vh;
    max-height: 800px;
    z-index: 1000;
    overflow-y: auto;
    cursor: default;
}

.project-card.expanded:hover {
    transform: translate(-50%, -50%);
}

.project-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.project-overlay.active {
    display: block;
}

.project-card.inactive {
    background: #fafafa;
    border-left-color: #d0d0d0;
}

.project-card.inactive:hover {
    border-left-color: #999;
}

.project-card h3 {
    font-size: 1.6rem;
    color: #1a1a1a;
    margin-bottom: 1.25rem;
    font-weight: 600;
}

.project-description {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.7;
    color: #333;
    margin-bottom: 1.25rem;
    font-size: 1rem;
}

.project-status {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.85rem;
    color: #888;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1.5rem;
    padding: 0.5rem 1rem;
    background: #f4f4f4;
    border-radius: 4px;
    display: inline-block;
}

.project-card.inactive .project-status {
    background: #e8e8e8;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    color: #666;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    padding: 0.75rem 1.5rem;
    background: #f9f9f9;
    border-radius: 6px;
}

.project-link:hover {
    color: #1a1a1a;
    background: #efefef;
}

.project-link::after {
    content: '→';
    transition: transform 0.2s ease;
}

.project-link:hover::after {
    transform: translateX(4px);
}
