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

html {
    scroll-behavior: smooth;
    margin: 0;
    padding: 0;
    height: 100%;
}

section {
    scroll-margin-top: 96px; /* match header height */
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.7;
    color: #333;
    background-color: #ffffff;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Dark mode styles */
body.dark-mode {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode p {
    color: #b0b0b0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    transition: color 0.4s ease;
}

body.dark-mode h1, 
body.dark-mode h2, 
body.dark-mode h3, 
body.dark-mode h4, 
body.dark-mode h5, 
body.dark-mode h6 {
    color: #ffffff;
}

p {
    margin-bottom: 1rem;
    color: #666;
    max-width: 65ch;
    transition: color 0.4s ease;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Static Header */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #f0f0f0;
    z-index: 1000;
    transition: all 0.3s ease, background-color 0.4s ease, border-color 0.4s ease;
}

body.dark-mode .header {
    background: rgba(26, 26, 26, 0.95);
    border-bottom: 1px solid #333;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.logo-link {
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease;
}

.logo-link:hover {
    transform: scale(1.05);
}

.back-link {
    margin-right: 10px;
    font-size: 22px;
    text-decoration: none;
    color: #2563eb; /* blue */
    line-height: 1;
}

.back-link:hover {
    filter: brightness(1.2);
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 600;
    color: #333;
    transition: color 0.4s ease;
}

body.dark-mode .logo-text {
    color: #ffffff;
}

.header-nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: #666;
    font-weight: 500;
    transition: all 0.3s ease, color 0.4s ease;
    position: relative;
    padding: 0.5rem 0;
}

.nav-link:hover {
    color: #333;
    transform: translateY(-1px);
}

body.dark-mode .nav-link {
    color: #b0b0b0;
}

body.dark-mode .nav-link:hover {
    color: #ffffff;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #007bff;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link.active {
    font-weight: 600;
    border-bottom: 2px solid currentColor;
}

.book-call-btn {
    background: #007bff;
    color: white !important;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.book-call-btn:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.book-call-btn::after {
    display: none;
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    outline: none;
}

.theme-toggle,
.theme-toggle:focus,
.theme-toggle:active,
.theme-toggle:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

.dark-mode-toggle:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

body.dark-mode .dark-mode-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dark-mode-icon {
    transition: transform 0.3s ease;
}

.dark-mode-toggle:hover .dark-mode-icon {
    transform: rotate(180deg);
}

/* Hero Section - Compact */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    position: relative;
    transition: background-color 0.4s ease;
}

body.dark-mode .hero {
    background: #1a1a1a;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
    margin-top: 20px;
}

.hero-title {
    font-size: 3.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #333;
    transition: color 0.4s ease;
}

body.dark-mode .hero-title {
    color: #ffffff;
}

.highlight {
    color: #007bff;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    transition: color 0.4s ease;
}

body.dark-mode .hero-subtitle {
    color: #b0b0b0;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary, .btn-secondary {
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-block;
    min-width: 140px;
}

.btn-primary {
    background: #007bff;
    color: white;
    border: 2px solid #007bff;
}

.btn-primary:hover {
    background: #0056b3;
    border-color: #0056b3;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.3);
}

.btn-secondary {
    background: transparent;
    color: #333;
    border: 2px solid #333;
    transition: all 0.3s ease, color 0.4s ease, border-color 0.4s ease;
}

.btn-secondary:hover {
    background: #333;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

body.dark-mode .btn-secondary {
    color: #e0e0e0;
    border-color: #e0e0e0;
}

body.dark-mode .btn-secondary:hover {
    background: #e0e0e0;
    color: #1a1a1a;
}

/* About Section - Compact */
.about {
    min-height: 80vh;
    background: #f8f9fa;
    padding: 3rem 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    transition: background-color 0.4s ease;
}

body.dark-mode .about {
    background: #2a2a2a;
}

.about-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

.about-header {
    padding: 1rem 0 1.5rem;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 2rem;
    transition: border-color 0.4s ease;
}

body.dark-mode .about-header {
    border-bottom: 1px solid #444;
}

.about-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    margin: 0;
    transition: color 0.4s ease;
}

body.dark-mode .about-title {
    color: #ffffff;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-text {
    margin-bottom: 2rem;
}

.about-text p {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 1rem;
    color: #666;
    transition: color 0.4s ease;
}

body.dark-mode .about-text p {
    color: #e0e0e0;
}

/* Experience Section */
.experience-header {
    margin-bottom: 1.5rem;
}

.experience-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #333;
    margin: 0;
    transition: color 0.4s ease;
}

body.dark-mode .experience-title {
    color: #ffffff;
}

.experience-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.experience-item {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease, background-color 0.4s ease, border-color 0.4s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.experience-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

body.dark-mode .experience-item {
    background: #3a3a3a;
    border: 1px solid #444;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

body.dark-mode .experience-item:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.company-name {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    transition: color 0.4s ease;
    color: #007bff;
}

body.dark-mode .company-name {
    color: #007bff;
}

.company-link {
    color: #007bff;
    text-decoration: none;
    transition: all 0.3s ease;
}

.company-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

.roles p {
    margin-bottom: 0.3rem;
    font-size: 1rem;
    line-height: 1.6;
    color: #666;
    transition: color 0.4s ease;
}

body.dark-mode .roles p {
    color: #b0b0b0;
}

/* Contact Section - Compact with Book a Call */
.contact {
    background: #ffffff;
    padding-block: 48px;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: background-color 0.4s ease;
}

body.dark-mode .contact {
    background: #1a1a1a;
}

.contact-content {
    text-align: center;
    margin-bottom: 2rem;
}

.contact-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
    transition: color 0.4s ease;
}

body.dark-mode .contact-title {
    color: #ffffff;
}

.contact-subtitle {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 24px;
    transition: color 0.4s ease;
}

body.dark-mode .contact-subtitle {
    color: #b0b0b0;
}

.contact-cta {
    margin-block: 24px;
}

.btn-call {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1.2rem 2.5rem;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    margin-bottom: 0.5rem;
}

.btn-call:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
    background: linear-gradient(135deg, #ee5a24, #d63031);
}

.btn-call i {
    font-size: 1.2rem;
}

.cta-subtitle {
    font-size: 0.9rem;
    color: #888;
    font-style: italic;
    margin: 0;
    margin-top: 24px;
    transition: color 0.4s ease;
}

body.dark-mode .cta-subtitle {
    color: #666;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: #f8f9fa;
    border-radius: 50%;
    text-decoration: none;
    color: #666;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.social-link:hover {
    background: #007bff;
    color: white;
    transform: translateY(-3px) scale(1.1);
    border-color: #007bff;
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.3);
}

body.dark-mode .social-link {
    background: #333;
    color: #b0b0b0;
}

body.dark-mode .social-link:hover {
    background: #007bff;
    color: white;
}

.social-link i {
    font-size: 1.2rem;
}

/* Email notification */
.email-notification {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.email-notification.show {
    opacity: 1;
}

body.dark-mode .email-notification {
    background: #000;
    color: #fff;
}

/* Footer */
.site-footer {
    text-align: center;
    padding-block: 16px;
}

.copyright {
    margin: 0;
    opacity: 0.9;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-container {
        padding: 0 1rem;
        height: 55px;
    }
    
    .header-nav {
        gap: 1rem;
    }
    
    .nav-link {
        font-size: 0.9rem;
    }
    
    .book-call-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-cta {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        max-width: 280px;
    }
    
    .about-title, .contact-title {
        font-size: 2rem;
    }
    
    .experience-item {
        padding: 1rem;
    }
    
    .social-links {
        gap: 1rem;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        gap: 1.5rem;
    }
    
    .container {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .header-nav {
        display: none;
    }
    
    .about, .contact {
        min-height: 70vh;
        padding: 2rem 0;
    }
    
    .contact {
        padding-block: 32px;
    }
    
    .contact-subtitle {
        margin-bottom: 16px;
    }
    
    .contact-cta {
        margin-block: 16px;
    }
    
    .cta-subtitle {
        margin-top: 16px;
    }
    
    .btn-call {
        padding: 1rem 2rem;
        font-size: 1rem;
    }
    
    .social-links {
        flex-direction: row;
        justify-content: center;
    }
}

/* Smooth animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.experience-item,
.social-link {
    animation: fadeInUp 0.6s ease-out;
}

/* Focus states for accessibility */
:focus-visible {
    outline: 3px solid #60a5fa;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .header,
    .hero-cta,
    .social-links,
    .footer,
    .dark-mode-toggle {
        display: none;
    }
    
    .hero {
        min-height: auto;
        padding: 2rem 0;
    }
    
    .about, .contact {
        min-height: auto;
        padding: 2rem 0;
    }
}

/* Books page */
.books-hero { 
    padding-top: 120px;  /* pushes content lower */
    padding-bottom: 24px; 
}

.books-section {
    padding: 40px 0;
}

.books-title { 
    font-size: 28px; 
    font-weight: 700; 
    margin: 0 0 8px; 
    color: #333;
    transition: color 0.4s ease;
}

body.dark-mode .books-title {
    color: #ffffff;
}

.books-subtitle { 
    color: #555; 
    margin: 0 0 24px; 
    transition: color 0.4s ease;
}

body.dark-mode .books-subtitle {
    color: #b0b0b0;
}

.section-heading { 
    font-size: 22px; 
    font-weight: 600; 
    margin: 60px 0 24px; 
    color: #333;
    transition: color 0.4s ease;
}

body.dark-mode .section-heading {
    color: #ffffff;
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0,1fr));
    gap: 16px;
}

@media (min-width: 720px) {
    .book-grid { 
        grid-template-columns: repeat(2, minmax(0,1fr)); 
    }
}

@media (min-width: 1024px) {
    .book-grid { 
        grid-template-columns: repeat(3, minmax(0,1fr)); 
    }
}

.book-card {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,.06);
    background: rgba(255,255,255,.7);
    backdrop-filter: blur(4px);
    transition: all 0.3s ease, background-color 0.4s ease, border-color 0.4s ease;
}

.book-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

body.dark-mode .book-card {
    background: rgba(16,16,18,.6);
    border-color: rgba(255,255,255,.08);
}

body.dark-mode .book-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.book-cover {
    border-radius: 6px;
    object-fit: cover;
    width: 72px;
    height: 108px;
    background: rgba(0,0,0,.05);
}

body.dark-mode .book-cover {
    background: rgba(255,255,255,.05);
}

.book-meta { 
    display: flex; 
    flex-direction: column; 
    gap: 4px; 
}

.book-title { 
    font-weight: 600; 
    text-decoration: none; 
    color: #007bff;
    transition: all 0.3s ease;
}

.book-title:hover { 
    text-decoration: underline; 
    color: #0056b3;
}

.book-author { 
    color: #666; 
    font-size: 14px; 
    margin: 0;
    transition: color 0.4s ease;
}

body.dark-mode .book-author { 
    color: #aaa; 
}

/* One-per-row layout */
.book-grid {
    display: grid;
    grid-template-columns: 1fr !important; /* force single column */
    gap: 18px;
}

/* Bigger card + image */
.book-card {
    display: grid;
    grid-template-columns: 96px 1fr;  /* cover | text */
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 14px;
}

.book-cover {
    width: 96px;
    height: 144px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    background: #1a1a1a; /* placeholder while loading */
    aspect-ratio: 2 / 3; /* modern browsers, keeps ratio if size ever changes */
}

/* Larger title */
.book-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.book-author {
    font-size: 15px;
    opacity: 0.9;
}

@media (max-width: 480px) {
    .book-card { grid-template-columns: 84px 1fr; }
    .book-cover { width: 84px; height: 126px; }
    .book-title { font-size: 18px; }
}

/* Books Layout - Sidebar */
.books-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 28px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Sticky sidebar */
.books-sidebar {
    position: sticky;
    top: 96px;              /* adjust if your header height differs */
    align-self: start;
}

.books-side-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.side-link {
    text-decoration: none;
    font-weight: 600;
    padding: 6px 8px;
    border-radius: 8px;
    opacity: .9;
    color: #333;
    transition: all 0.2s ease;
}

.side-link:hover { 
    background: rgba(0,0,0,.06); 
    opacity: 1;
}

body.dark-mode .side-link {
    color: #e0e0e0;
}

body.dark-mode .side-link:hover { 
    background: rgba(255,255,255,.08); 
}

.side-link.active {
    color: #2563eb;
    background: rgba(37,99,235,.12);
    opacity: 1;
}

body.dark-mode .side-link.active {
    color: #60a5fa;
    background: rgba(96,165,250,.15);
}

/* Content column */
.books-content { 
    min-width: 0; 
}

/* Make anchors land below sticky header */
html { 
    scroll-behavior: smooth; 
}
section { 
    scroll-margin-top: 96px; 
}

/* Responsive: hide sidebar on small screens */
@media (max-width: 960px) {
    .books-layout { 
        grid-template-columns: 1fr; 
    }
    .books-sidebar { 
        display: none; 
    }
}