/* ===== CSS RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color System */
    --primary-color: #8B4513;
    --secondary-color: #D2B48C;
    --accent-color: #A0522D;
    --light-color: #F5F5DC;
    --dark-color: #3E2723;
    --text-color: #5D4037;
    --background-color: #FFF8E1;
    --surface-color: #FFFFFF;
    
    /* Typography */
    --font-primary: 'Poppins', sans-serif;
    --font-secondary: 'Roboto Slab', serif;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-xxl: 4rem;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Z-index */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal: 1040;
    --z-popover: 1050;
    --z-tooltip: 1060;
    --z-preloader: 9999;
}

/* Dark Theme */
[data-theme="dark"] {
    --primary-color: #D2B48C;
    --secondary-color: #8B4513;
    --accent-color: #CD853F;
    --light-color: #3E2723;
    --dark-color: #F5F5DC;
    --text-color: #EFEBE9;
    --background-color: #5D4037;
    --surface-color: #4E342E;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.3);
}

/* ===== BASE STYLES ===== */
html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    transition: background-color var(--transition-normal), color var(--transition-normal);
    overflow-x: hidden;
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px 12px;
    text-decoration: none;
    border-radius: var(--radius-sm);
    z-index: var(--z-popover);
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 6px;
}

/* ===== LAYOUT & CONTAINERS ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.section {
    padding: var(--space-xxl) 0;
}

.section-title {
    font-family: var(--font-secondary);
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: var(--space-xl);
    color: var(--primary-color);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

/* ===== COMPONENTS ===== */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 12px 30px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
}

.btn:hover {
    background-color: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.btn.secondary-btn {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn.secondary-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn.instagram-btn {
    background: linear-gradient(45deg, #405DE6, #5851DB, #833AB4, #C13584, #E1306C, #FD1D1D);
    color: white;
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: var(--z-preloader);
    transition: opacity var(--transition-slow);
}

.coffee-cup {
    width: 80px;
    height: 80px;
    border: 6px solid var(--primary-color);
    border-radius: 0 0 40px 40px;
    position: relative;
    margin-bottom: var(--space-md);
    background: var(--surface-color);
}

.coffee-cup::before {
    content: '';
    position: absolute;
    width: 30px;
    height: 20px;
    border: 6px solid var(--primary-color);
    border-left: none;
    border-radius: 0 20px 20px 0;
    right: -30px;
    top: 10px;
}

.coffee {
    position: absolute;
    width: 100%;
    height: 0;
    background: linear-gradient(to bottom, var(--accent-color), var(--primary-color));
    border-radius: 0 0 34px 34px;
    bottom: 0;
    animation: fill 2s infinite ease-in-out;
}

@keyframes fill {
    0%, 100% { height: 0; }
    50% { height: 70%; }
}

#preloader p {
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: 500;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Header / Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: var(--z-fixed);
    background-color: rgba(255, 248, 225, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] header {
    background-color: rgba(62, 39, 35, 0.95);
}

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

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-family: var(--font-secondary);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.nav-link:hover {
    color: var(--primary-color);
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 1rem;
}

.theme-text {
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    background: none;
    border: none;
    padding: var(--space-xs);
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 3px 0;
    transition: all var(--transition-normal);
}

/* Home Section */
#home {
    padding-top: 120px;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.home-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    align-items: center;
}

.home-text h1 {
    font-family: var(--font-secondary);
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: var(--space-md);
    line-height: 1.2;
}

.intro-text {
    font-size: 1.2rem;
    margin-bottom: var(--space-lg);
    color: var(--text-color);
    line-height: 1.7;
}

.home-buttons {
    display: flex;
    gap: var(--space-md);
}

.home-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.portrait-container {
    position: relative;
    width: 420px;
    height: 520px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

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

.coffee-steam {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 100px;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
    animation: steam 3s infinite ease-in-out;
}

@keyframes steam {
    0% { opacity: 0; transform: translateX(-50%) translateY(0) scale(0.5); }
    50% { opacity: 1; }
    100% { opacity: 0; transform: translateX(-50%) translateY(-100px) scale(1); }
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-xl);
}

.about-text p {
    margin-bottom: var(--space-md);
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-color);
}

.about-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

.stat {
    text-align: center;
    padding: var(--space-lg);
    background-color: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.stat h3 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: var(--space-xs);
}

.stat p {
    color: var(--text-color);
    font-weight: 500;
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-md);
}

.skill-item {
    background-color: var(--surface-color);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
}

.skill-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: var(--space-md);
}

.skill-item h3 {
    margin-bottom: var(--space-md);
    color: var(--primary-color);
    font-size: 1.2rem;
}

.skill-bar {
    width: 100%;
    height: 10px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    margin-bottom: var(--space-xs);
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 5px;
}

.skill-percent {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
}

/* Experience Section */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary-color), var(--accent-color));
}

.timeline-item {
    position: relative;
    margin-bottom: var(--space-xl);
    width: 50%;
}

.timeline-item:nth-child(odd) {
    left: 0;
    padding-right: 60px;
}

.timeline-item:nth-child(even) {
    left: 50%;
    padding-left: 60px;
}

.timeline-content {
    background-color: var(--surface-color);
    padding: 35px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    position: relative;
}

.timeline-content::before {
    content: '';
    position: absolute;
    top: 25px;
    width: 24px;
    height: 24px;
    background-color: var(--primary-color);
    border-radius: 50%;
    border: 4px solid var(--background-color);
    box-shadow: 0 0 0 2px var(--primary-color);
}

.timeline-item:nth-child(odd) .timeline-content::before {
    right: -72px;
}

.timeline-item:nth-child(even) .timeline-content::before {
    left: -72px;
}

.timeline-content h3 {
    color: var(--primary-color);
    margin-bottom: 8px;
    font-size: 1.4rem;
}

.timeline-content h4 {
    color: var(--accent-color);
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.timeline-content p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-color);
}

.date {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 8px 18px;
    border-radius: 25px;
    font-size: 0.95rem;
    margin-bottom: 18px;
    font-weight: 500;
}

/* Gallery Section */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    height: 300px;
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.gallery-item:hover .gallery-img {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.9) 0%, rgba(160, 82, 45, 0.7) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay h3 {
    color: white;
    font-size: 1.8rem;
    font-weight: 600;
}

/* Videos Section */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.video-item {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-md);
}

.video-wrapper {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 177.78%; /* 16:9 Aspect Ratio */
    margin-bottom: 15px;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-item h3 {
    text-align: center;
    margin-top: 15px;
    font-size: 1.1rem;
    color: var(--text-color);
}

.instagram-cta {
    text-align: center;
    margin-top: 40px;
    padding: 30px;
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.instagram-cta p {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-color);
}

/* Coffee Quiz Section */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.quiz-header {
    text-align: center;
    margin-bottom: 30px;
}

.quiz-header h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.quiz-header p {
    color: var(--text-color);
    opacity: 0.8;
}

/* Quiz questions will be generated by JavaScript */
#quiz-content {
    /* Dynamic content from JS */
}

.quiz-actions {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.submit-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* Contact Section */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px;
    background-color: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.contact-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    color: white;
}

.contact-details h3 {
    color: var(--primary-color);
    margin-bottom: 5px;
    font-size: 1.2rem;
}

.contact-details a {
    color: var(--text-color);
    text-decoration: none;
    transition: color var(--transition-fast);
    font-weight: 500;
    font-size: 1.1rem;
}

.contact-details a:hover {
    color: var(--primary-color);
}

.contact-description {
    font-size: 0.85rem;
    color: var(--text-color);
    opacity: 0.7;
    margin-top: 5px;
}

/* Footer */
.footer {
    background-color: var(--dark-color);
    color: var(--light-color);
    padding: 40px 0;
    margin-top: var(--space-xl);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-text p {
    margin-bottom: 10px;
    color: var(--light-color);
}

.footer-tagline {
    font-style: italic;
    opacity: 0.8;
}

/* Coffee Animation */
.coffee-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: var(--z-modal);
}

.animation-container {
    background-color: var(--surface-color);
    padding: 40px;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-xl);
    max-width: 400px;
    width: 90%;
}

.coffee-cup-anim {
    position: relative;
    width: 150px;
    height: 120px;
    margin: 0 auto 30px;
}

.cup {
    width: 150px;
    height: 80px;
    border: 10px solid var(--primary-color);
    border-radius: 0 0 70px 70px;
    position: relative;
    background: var(--surface-color);
}

.cup::before {
    content: '';
    position: absolute;
    width: 50px;
    height: 20px;
    border: 10px solid var(--primary-color);
    border-left: none;
    border-radius: 0 20px 20px 0;
    right: -50px;
    top: 20px;
}

.coffee-fill {
    position: absolute;
    bottom: 10px;
    left: 10px;
    width: 130px;
    height: 0;
    background: linear-gradient(to bottom, var(--accent-color), var(--primary-color));
    border-radius: 0 0 60px 60px;
    transition: height 3s ease;
}

.handle {
    position: absolute;
    width: 50px;
    height: 50px;
    border: 10px solid var(--primary-color);
    border-left: none;
    border-radius: 0 50px 50px 0;
    right: -50px;
    top: 10px;
}

.close-animation {
    margin-top: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-weight: 500;
}

.close-animation:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet */
@media screen and (max-width: 992px) {
    .home-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .about-content {
        grid-template-columns: 1fr;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
    }
    
    .timeline::before {
        left: 30px;
    }
    
    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 0;
    }
    
    .timeline-item:nth-child(even) {
        left: 0;
    }
    
    .timeline-content::before {
        left: -40px !important;
    }
}

/* Mobile */
@media screen and (max-width: 768px) {
    .section {
        padding: var(--space-xl) 0;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    /* Mobile Navigation */
    .nav-menu {
        position: fixed;
        top: 70px;
        right: -100%;
        flex-direction: column;
        background-color: var(--surface-color);
        width: 100%;
        height: calc(100vh - 70px);
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding-top: 50px;
        gap: 30px;
        z-index: var(--z-dropdown);
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-toggle.active .bar:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }
    
    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active .bar:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }
    
    .home-text h1 {
        font-size: 2.5rem;
    }
    
    .home-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .portrait-container {
        width: 350px;
        height: 450px;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-item {
        height: 250px;
    }
    
    .videos-grid {
        grid-template-columns: 1fr;
    }
    
    .quiz-container {
        padding: 30px 20px;
    }
}

/* Small Mobile */
@media screen and (max-width: 576px) {
    .section-title {
        font-size: 1.8rem;
    }
    
    .home-text h1 {
        font-size: 2rem;
    }
    
    .portrait-container {
        width: 280px;
        height: 350px;
    }
    
    .gallery-item {
        height: 200px;
    }
    
    .gallery-overlay h3 {
        font-size: 1.5rem;
    }
    
    .timeline-content {
        padding: 20px;
    }
    
    .timeline-content::before {
        left: -45px !important;
        width: 18px;
        height: 18px;
    }
    
    .date {
        padding: 6px 15px;
        font-size: 0.9rem;
    }
    
    .quiz-container {
        padding: 20px 15px;
    }
    
    .contact-item {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
}

/* Very Small Mobile */
@media screen and (max-width: 480px) {
    .home-buttons .btn {
        width: 100%;
        justify-content: center;
    }
    
    .about-stats {
        grid-template-columns: 1fr;
    }
    
    .stat {
        padding: var(--space-md);
    }
    
    .stat h3 {
        font-size: 2rem;
    }
    
    .contact-item {
        padding: 20px;
    }
}

/* Print Styles */
@media print {
    .nav-toggle,
    .theme-toggle,
    .coffee-animation,
    #preloader,
    .home-buttons,
    .quiz-actions,
    .instagram-cta {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .section {
        padding: 20pt 0;
    }
}