/* ===== NAVBAR - TRANSPARENT ALWAYS ===== */
.navbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    padding: 1.2rem 2rem !important;
    z-index: 1000 !important;
    transition: transform 0.3s ease, background 0.3s ease, padding 0.3s ease !important;
    background: transparent !important;
    backdrop-filter: none !important;
}

/* Hide navbar when scrolling down */
.navbar.hide {
    transform: translateY(-100%) !important;
}

/* Scrolled state - STAYS TRANSPARENT */
.navbar.scrolled {
    background: transparent !important;
    backdrop-filter: none !important;
    padding: 0.8rem 2rem !important;
    border-bottom: none !important;
    box-shadow: none !important;
}

/* When navbar is hidden AND scrolled */
.navbar.hide.scrolled {
    background: transparent !important;
    backdrop-filter: none !important;
}

/* Nav links on transparent navbar - keep readable */
.navbar:not(.scrolled) .nav-link,
.navbar.scrolled .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
}

.navbar:not(.scrolled) .nav-link:hover,
.navbar.scrolled .nav-link:hover {
    color: white !important;
    background: rgba(204, 47, 1, 0.15) !important;
}

.navbar:not(.scrolled) .nav-link.active,
.navbar.scrolled .nav-link.active {
    color: var(--marubi-ember) !important;
    background: rgba(204, 47, 1, 0.15) !important;
    border: 1px solid rgba(204, 47, 1, 0.4) !important;
}

/* Logo text on transparent navbar */
.navbar:not(.scrolled) .logo-text,
.navbar.scrolled .logo-text {
    -webkit-text-fill-color: white !important;
    background: none !important;
    color: white !important;
}
.page-header {
    min-height: 55vh;
    display: flex;
    align-items: flex-end;
    position: relative;
    padding: 8rem 0 5rem;
    background: linear-gradient(0deg, var(--marubi-charcoal) 0%, rgba(36, 35, 35, 0.4) 100%), 
                url('/images/gallery/nairobi-skyline.JPG');
    background-size: cover;
    background-position: center 30%;
    background-repeat: no-repeat;
    background-attachment: fixed;
    overflow: hidden;
    border-bottom: 1px solid rgba(204, 47, 1, 0.2);
}

/* Lighter overlay for better image visibility */
.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(135deg, rgba(0, 0, 0, 0.3) 0%, rgba(36, 35, 35, 0.2) 100%),
        radial-gradient(circle at 20% 30%, rgba(204, 47, 1, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(204, 47, 1, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}
/* Content stays above overlay */
.page-header .container,
.page-header .header-content {
    position: relative;
    z-index: 2;
}

/* Add an ember glow edge at bottom */
.page-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--marubi-ember) 20%, 
        var(--marubi-ember-light) 50%, 
        var(--marubi-ember) 80%, 
        transparent 100%);
    z-index: 3;
}

.header-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.page-title {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 800;
    color: var(--marubi-cream);
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
    line-height: 1.1;
}

.page-title .ember {
    color: var(--marubi-ember);
    position: relative;
    display: inline-block;
    text-shadow: 0 0 20px rgba(204, 47, 1, 0.3);
}

.page-title .ember::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--marubi-ember);
    transform: scaleX(0);
    transform-origin: left;
    animation: slideIn 1s ease 1s forwards;
}

.page-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.7);
    max-width: 600px;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.header-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.stat-chip {
    background: rgba(36, 35, 35, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(204, 47, 1, 0.2);
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.stat-chip:hover {
    border-color: var(--marubi-ember);
    transform: translateY(-2px);
    box-shadow: var(--shadow-ember);
}

.stat-chip-label {
    color: rgba(255, 255, 255, 0.5);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-chip-value {
    color: var(--marubi-ember);
    font-weight: 600;
}

/* ===== TIMELINE SECTION ===== */
.timeline-section {
    padding: var(--space-2xl) 0;
    background: var(--marubi-charcoal);
    position: relative;
}

.timeline-container {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    padding: 2rem 0;
}

.timeline-container::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, 
        transparent 0%,
        var(--marubi-ember) 5%,
        var(--marubi-ember) 95%,
        transparent 100%);
    opacity: 0.3;
}

.timeline-item {
    position: relative;
    margin-bottom: 4rem;
    width: 100%;
    display: flex;
    justify-content: flex-start;
}

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

.timeline-marker {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    top: 0;
}

.timeline-year {
    background: var(--marubi-ember);
    color: white;
    padding: 0.5rem 1.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 30px;
    box-shadow: var(--shadow-ember);
    display: inline-block;
    white-space: nowrap;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition-fast);
}

.timeline-year:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-ember-strong);
}

.timeline-content {
    width: calc(50% - 3rem);
    background: rgba(36, 35, 35, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(204, 47, 1, 0.2);
    border-radius: 16px;
    padding: 2rem;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.timeline-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 0;
    background: var(--marubi-ember);
    transition: height 0.5s ease;
}

.timeline-content:hover {
    transform: translateY(-5px);
    border-color: var(--marubi-ember);
    box-shadow: var(--shadow-ember);
}

.timeline-content:hover::before {
    height: 100%;
}

.timeline-content.present {
    border: 2px solid var(--marubi-ember);
    box-shadow: var(--shadow-ember);
}

.timeline-icon {
    width: 50px;
    height: 50px;
    background: rgba(204, 47, 1, 0.1);
    border: 2px solid var(--marubi-ember);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    transition: var(--transition-smooth);
}

.timeline-content:hover .timeline-icon {
    background: var(--marubi-ember);
    transform: rotate(360deg);
}

.timeline-content:hover .timeline-icon i {
    color: white;
}

.timeline-icon i {
    font-size: 1.2rem;
    color: var(--marubi-ember);
    transition: var(--transition-smooth);
}

.timeline-content h3 {
    font-size: 1.8rem;
    color: var(--marubi-cream);
    margin-bottom: 0.5rem;
}

.timeline-location {
    color: var(--marubi-ember);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timeline-location i {
    font-size: 0.8rem;
}

.timeline-content p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.memory-quote {
    font-style: italic;
    padding: 1rem;
    background: rgba(204, 47, 1, 0.05);
    border-left: 3px solid var(--marubi-ember);
    margin: 1rem 0;
    font-size: 0.95rem;
}

.code-snippet {
    background: var(--marubi-onyx);
    padding: 1rem;
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: var(--marubi-ember);
    border: 1px solid rgba(204, 47, 1, 0.3);
    margin: 1rem 0;
}

.milestone-badge {
    display: inline-block;
    padding: 0.3rem 1rem;
    background: transparent;
    border: 1px solid var(--marubi-ember);
    color: var(--marubi-ember);
    font-size: 0.8rem;
    border-radius: 4px;
    margin-top: 0.5rem;
}

.course-highlight {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.course-highlight span {
    padding: 0.3rem 1rem;
    background: rgba(204, 47, 1, 0.1);
    border: 1px solid rgba(204, 47, 1, 0.2);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--marubi-cream);
}

.company-badge {
    margin-top: 1rem;
}

.company-badge span {
    background: var(--marubi-ember);
    color: white;
    padding: 0.3rem 1rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.project-metrics {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.project-metrics span {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-metrics i {
    color: var(--marubi-ember);
}

.present-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    color: var(--marubi-ember);
    font-weight: 600;
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background: var(--marubi-ember);
    border-radius: 50%;
    animation: pulse 1.5s ease infinite;
}

.timeline-gallery {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.gallery-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid rgba(204, 47, 1, 0.3);
    transition: var(--transition-fast);
    cursor: pointer;
}

.gallery-thumb:hover {
    transform: scale(1.1);
    border-color: var(--marubi-ember);
}

/* ===== VALUES SECTION ===== */
.values-section {
    padding: var(--space-2xl) 0;
    background: var(--marubi-onyx);
    position: relative;
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
    margin-top: var(--space-xl);
}

.value-card {
    background: rgba(36, 35, 35, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(204, 47, 1, 0.2);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    text-align: center;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.value-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--marubi-ember);
    transform: scaleX(0);
    transition: transform 0.5s ease;
}

.value-card:hover {
    transform: translateY(-10px);
    border-color: var(--marubi-ember);
    box-shadow: var(--shadow-ember);
}

.value-card:hover::before {
    transform: scaleX(1);
}

.value-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--marubi-ember);
    border-radius: 50%;
    transition: var(--transition-smooth);
}

.value-card:hover .value-icon {
    background: var(--marubi-ember);
    transform: rotate(360deg);
}

.value-card:hover .value-icon i {
    color: white;
}

.value-icon i {
    font-size: 2rem;
    color: var(--marubi-ember);
    transition: var(--transition-smooth);
}

.value-card h3 {
    font-size: 1.5rem;
    color: var(--marubi-cream);
    margin-bottom: 1rem;
}

.value-card p {
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.8;
    font-size: 0.95rem;
}

/* ===== ORIGIN GALLERY ===== */
.origin-gallery {
    padding: var(--space-2xl) 0;
    background: var(--marubi-charcoal);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin-top: var(--space-xl);
}

.gallery-item {
    position: relative;
    height: 300px;
    overflow: hidden;
    border: 1px solid rgba(204, 47, 1, 0.2);
    border-radius: 8px;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.gallery-item.large {
    grid-column: span 2;
    height: 400px;
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
}

.gallery-item:hover {
    border-color: var(--marubi-ember);
    box-shadow: var(--shadow-ember);
}

.gallery-item:hover .gallery-image {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(to top, rgba(36, 35, 35, 0.9), transparent);
    transform: translateY(100%);
    transition: transform 0.5s ease;
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-overlay h3 {
    font-size: 1.3rem;
    color: white;
    margin-bottom: 0.3rem;
}

.gallery-overlay p {
    color: var(--marubi-ember);
    font-size: 0.9rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .values-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .timeline-container::before {
        left: 30px;
    }
    
    .timeline-item,
    .timeline-item:nth-child(even) {
        justify-content: flex-start;
        padding-left: 60px;
    }
    
    .timeline-marker {
        left: 30px;
        transform: translateX(-50%);
    }
    
    .timeline-content {
        width: 100%;
    }
    
    .values-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-item.large {
        grid-column: auto;
        height: 300px;
    }
    
    .page-header {
        min-height: 40vh;
        padding: 6rem 0 3rem;
    }
}

@media (max-width: 480px) {
    .timeline-content {
        padding: 1.5rem;
    }
    
    .timeline-content h3 {
        font-size: 1.5rem;
    }
    
    .header-stats {
        flex-direction: column;
    }
    
    .stat-chip {
        width: 100%;
    }
    
    .gallery-item {
        height: 250px;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes emberPulse {
    0% { opacity: 0.3; }
    50% { opacity: 0.6; }
    100% { opacity: 0.3; }
}

@keyframes slideIn {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* ===== ANIMATION CLASSES ===== */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

[data-animate="slide-left"] {
    transform: translateX(-50px);
    opacity: 0;
}

[data-animate="slide-right"] {
    transform: translateX(50px);
    opacity: 0;
}

[data-animate="fade-in"] {
    transform: translateY(30px);
    opacity: 0;
}

[data-animate="zoom-in"] {
    transform: scale(0.9);
    opacity: 0;
}

[data-animate="slide-left"].animated,
[data-animate="slide-right"].animated,
[data-animate="fade-in"].animated,
[data-animate="zoom-in"].animated {
    transform: translateX(0) translateY(0) scale(1);
    opacity: 1;
}

[data-delay="100"] { transition-delay: 0.1s; }
[data-delay="200"] { transition-delay: 0.2s; }
[data-delay="300"] { transition-delay: 0.3s; }
[data-delay="400"] { transition-delay: 0.4s; }

/* ============================================
   ORIGIN PAGE - MOBILE STYLES ONLY (≤768px)
   ============================================ */

@media (max-width: 768px) {
    /* Page Header */
    .page-header {
        min-height: auto;
        padding: 100px 0 50px;
        text-align: center;
    }

    .header-content {
        width: 100%;
        padding: 0;
    }

    .page-title {
        font-size: clamp(2.2rem, 8vw, 3rem);
        margin-bottom: 1rem;
    }

    .page-title .ember::after {
        bottom: 2px;
        height: 3px;
        width: 100%;
    }

    .page-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
        padding: 0 0.5rem;
    }

    .header-stats {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .stat-chip {
        width: 100%;
        justify-content: center;
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }

    .stat-chip-label {
        font-size: 0.75rem;
    }

    /* Timeline Section */
    .timeline-section {
        padding: 3rem 0;
    }

    .timeline-container {
        padding: 1rem 0;
    }

    .timeline-container::before {
        left: 20px;
        transform: none;
        opacity: 0.2;
    }

    .timeline-item,
    .timeline-item:nth-child(even) {
        justify-content: flex-start;
        padding-left: 45px;
        margin-bottom: 2.5rem;
    }

    .timeline-marker {
        left: 20px;
        transform: translateX(-50%);
    }

    .timeline-year {
        padding: 0.4rem 1rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .timeline-content {
        width: 100%;
        padding: 1.5rem;
        border-radius: 12px;
        margin: 0;
    }

    .timeline-content::before {
        width: 2px;
    }

    .timeline-icon {
        width: 40px;
        height: 40px;
        margin-bottom: 1rem;
    }

    .timeline-icon i {
        font-size: 1rem;
    }

    .timeline-content h3 {
        font-size: 1.3rem;
        margin-bottom: 0.25rem;
    }

    .timeline-location {
        font-size: 0.8rem;
        gap: 0.25rem;
        flex-wrap: wrap;
        margin-bottom: 0.75rem;
    }

    .timeline-location i {
        font-size: 0.7rem;
    }

    .timeline-content p {
        font-size: 0.9rem;
        line-height: 1.6;
        margin-bottom: 1rem;
    }

    .memory-quote {
        padding: 0.75rem;
        font-size: 0.85rem;
        margin: 0.75rem 0;
    }

    .code-snippet {
        padding: 0.75rem;
        font-size: 0.8rem;
        margin: 0.75rem 0;
        overflow-x: auto;
        white-space: nowrap;
    }

    .course-highlight {
        gap: 0.4rem;
        margin: 0.75rem 0;
    }

    .course-highlight span {
        padding: 0.2rem 0.8rem;
        font-size: 0.75rem;
    }

    .milestone-badge {
        padding: 0.2rem 0.8rem;
        font-size: 0.7rem;
    }

    .project-metrics {
        gap: 0.5rem;
        margin-top: 0.75rem;
    }

    .project-metrics span {
        padding: 0.2rem 0.8rem;
        font-size: 0.7rem;
        gap: 0.3rem;
    }

    .project-metrics i {
        font-size: 0.7rem;
    }

    .company-badge span {
        padding: 0.2rem 0.8rem;
        font-size: 0.7rem;
    }

    .present-badge {
        font-size: 0.8rem;
        gap: 0.3rem;
    }

    .pulse-dot {
        width: 8px;
        height: 8px;
    }

    .timeline-gallery {
        gap: 0.4rem;
        margin-top: 0.75rem;
        flex-wrap: wrap;
    }

    .gallery-thumb {
        width: 60px;
        height: 60px;
        border-radius: 6px;
    }

    /* Values Section */
    .values-section {
        padding: 3rem 0;
    }

    .values-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 2rem;
    }

    .value-card {
        padding: 2rem 1.5rem;
        border-radius: 12px;
    }

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

    .value-icon i {
        font-size: 1.5rem;
    }

    .value-card h3 {
        font-size: 1.2rem;
        margin-bottom: 0.75rem;
    }

    .value-card p {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    /* Origin Gallery */
    .origin-gallery {
        padding: 3rem 0;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 2rem;
    }

    .gallery-item {
        height: 250px;
        border-radius: 8px;
        width: 100%;
    }

    .gallery-item.large {
        grid-column: auto;
        height: 250px;
    }

    .gallery-item.tall {
        height: 300px;
    }

    .gallery-overlay {
        padding: 1.5rem;
        transform: translateY(0);
        background: linear-gradient(to top, rgba(36, 35, 35, 0.95), transparent);
    }

    .gallery-overlay h3 {
        font-size: 1.1rem;
        margin-bottom: 0.2rem;
    }

    .gallery-overlay p {
        font-size: 0.8rem;
    }

    /* Section Headers */
    .section-header {
        margin-bottom: 2rem;
    }

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

    .section-title::after {
        width: 60px;
        height: 2px;
        bottom: -5px;
    }

    .section-subtitle {
        font-size: 0.95rem;
        padding: 0 1rem;
    }

    /* Animation adjustments for mobile */
    .timeline-content:hover {
        transform: none;
        box-shadow: var(--shadow-ember);
    }

    .value-card:hover {
        transform: none;
    }

    .gallery-item:hover .gallery-image {
        transform: none;
    }

    .timeline-year:hover {
        transform: none;
    }

    .stat-chip:hover {
        transform: none;
    }

    .gallery-thumb:hover {
        transform: none;
    }

    /* Touch-friendly tap states */
    .timeline-content:active,
    .value-card:active,
    .gallery-item:active,
    .stat-chip:active {
        opacity: 0.8;
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }

    /* Ensure content doesn't overflow */
    .timeline-content,
    .value-card,
    .gallery-item {
        max-width: 100%;
        overflow: hidden;
    }

    /* Code snippet scroll on mobile */
    .code-snippet::-webkit-scrollbar {
        height: 3px;
    }

    .code-snippet::-webkit-scrollbar-thumb {
        background: var(--marubi-ember);
        border-radius: 10px;
    }
}

/* Small mobile devices (480px and below) */
@media (max-width: 480px) {
    .page-title {
        font-size: clamp(1.8rem, 6vw, 2.2rem);
    }

    .page-subtitle {
        font-size: 0.9rem;
    }

    .timeline-item,
    .timeline-item:nth-child(even) {
        padding-left: 35px;
    }

    .timeline-container::before {
        left: 15px;
    }

    .timeline-marker {
        left: 15px;
    }

    .timeline-year {
        padding: 0.3rem 0.8rem;
        font-size: 0.75rem;
    }

    .timeline-content {
        padding: 1.25rem;
    }

    .timeline-content h3 {
        font-size: 1.1rem;
    }

    .timeline-location {
        font-size: 0.7rem;
    }

    .timeline-content p {
        font-size: 0.85rem;
    }

    .memory-quote {
        font-size: 0.8rem;
        padding: 0.5rem;
    }

    .code-snippet {
        font-size: 0.7rem;
        padding: 0.5rem;
    }

    .course-highlight span {
        padding: 0.15rem 0.6rem;
        font-size: 0.65rem;
    }

    .gallery-item {
        height: 200px;
    }

    .gallery-item.large,
    .gallery-item.tall {
        height: 200px;
    }

    .gallery-overlay {
        padding: 1rem;
    }

    .gallery-overlay h3 {
        font-size: 1rem;
    }

    .gallery-thumb {
        width: 50px;
        height: 50px;
    }

    .value-card {
        padding: 1.5rem 1rem;
    }

    .value-card h3 {
        font-size: 1.1rem;
    }

    .value-card p {
        font-size: 0.85rem;
    }
}

/* Landscape mode for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .page-header {
        padding: 80px 0 40px;
    }

    .timeline-item,
    .timeline-item:nth-child(even) {
        margin-bottom: 2rem;
    }

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

    .gallery-item,
    .gallery-item.large,
    .gallery-item.tall {
        height: 180px;
    }

    .gallery-overlay {
        padding: 0.75rem;
    }

    .gallery-overlay h3 {
        font-size: 0.9rem;
    }

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

/* Notched phones support */
@supports (padding: max(0px)) {
    .page-header {
        padding-top: max(100px, env(safe-area-inset-top));
        padding-bottom: max(50px, env(safe-area-inset-bottom));
    }

    .timeline-section,
    .values-section,
    .origin-gallery {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .timeline-content:hover,
    .value-card:hover,
    .gallery-item:hover .gallery-image,
    .timeline-year:hover,
    .stat-chip:hover,
    .gallery-thumb:hover {
        transform: none !important;
        transition: none !important;
    }

    .pulse-dot {
        animation: none;
    }
}