:root {
    --primary-green: #9ac695;
    --primary-brown: #8d5a35;
    --accent-green: #b3d4af;
    --accent-brown: #a66d45;
    --dark-green: #7ba576;
    --dark-brown: #6e4629;
    --light-bg: #f9f7f5;
    --text-dark: #2c2420;
    --text-light: #5a524c;
    --white: #ffffff;
    --shadow: rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --point-size: clamp(14px, 2.8vw, 22px);
    --point-hover-scale: 1.25;
    --point-active-scale: 1.35;
    --point-border-width: clamp(2px, 0.35vw, 3px);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(135deg, var(--light-bg) 0%, #ffffff 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--accent-green) 100%);
    padding: 2rem 1rem;
    box-shadow: 0 4px 20px var(--shadow);
}

.header-banner {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.name-banner {
    max-width: 100%;
    height: auto;
    max-height: 120px;
}

main {
    flex: 1;
    padding: 3rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.profile-section {
    margin-bottom: 3rem;
    animation: fadeIn 0.8s ease-out;
}

.profile-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2.5rem;
    align-items: center;
    background: var(--white);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px var(--shadow);
}

.profile-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 8px 24px var(--shadow);
    transition: var(--transition);
}

.profile-image:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 32px var(--shadow);
}

.profile-text {
    padding: 0 1rem;
}

.profile-text h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    color: var(--primary-brown);
    margin-bottom: 1rem;
    font-weight: 700;
}

.profile-text p {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.8;
}

.timeline-section {
    margin-top: 2rem;
}

.timeline-container {
    background: var(--white);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px var(--shadow);
}

.timeline-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--primary-brown);
    text-align: center;
    margin-bottom: 2rem;
}

.timeline-viewport {
    width: 100%;
    height: 250px;
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 15px;
    background: linear-gradient(135deg, #fafafa 0%, #ffffff 100%);
    border: 2px solid var(--light-bg);
    margin: 2rem 0;
    position: relative;
}

.timeline-hint {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0.36;
    transition: opacity 0.4s ease;
    z-index: 5;
}

.timeline-hint.hidden {
    opacity: 0;
}

.hint-line {
    position: relative;
    width: 120px;
    height: 2px;
    background: var(--primary-green);
    border-radius: 2px;
}

.hint-line::before,
.hint-line::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 10px;
    height: 10px;
    border-top: 2px solid var(--primary-green);
    border-right: 2px solid var(--primary-green);
    transform: translateY(-50%) rotate(45deg);
}

.hint-line::before {
    left: -6px;
    transform: translateY(-50%) rotate(225deg);
}

.hint-line::after {
    right: -6px;
}

.timeline-viewport::-webkit-scrollbar {
    height: 10px;
}

.timeline-viewport::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 5px;
}

.timeline-viewport::-webkit-scrollbar-thumb {
    background: var(--accent-green);
    border-radius: 5px;
}

.timeline-viewport::-webkit-scrollbar-thumb:hover {
    background: var(--primary-green);
}

.timeline-canvas {
    position: relative;
    height: 100%;
    min-width: 100%;
    display: inline-block;
}

.timeline-line {
    position: absolute;
    top: 50%;
    left: 50px;
    right: 50px;
    height: 6px;
    background: linear-gradient(90deg, var(--accent-brown) 0%, var(--primary-brown) 50%, var(--accent-brown) 100%);
    transform: translateY(-50%);
    border-radius: 3px;
}

.timeline-points {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.timeline-point {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: var(--point-size);
    height: var(--point-size);
    background: var(--white);
    border: var(--point-border-width) solid var(--primary-green);
    border-radius: 50%;
    cursor: pointer;
    transition: width 0.3s ease, height 0.3s ease, border-width 0.3s ease, box-shadow 0.3s ease;
    z-index: 2;
}

.timeline-point::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    z-index: -1;
}

.timeline-point.has-images {
    background: linear-gradient(135deg, var(--white) 0%, var(--light-bg) 100%);
}

.timeline-point:hover {
    width: calc(var(--point-size) * var(--point-hover-scale));
    height: calc(var(--point-size) * var(--point-hover-scale));
    border-width: calc(var(--point-border-width) + 1px);
    z-index: 4;
}

.timeline-point.active {
    width: calc(var(--point-size) * var(--point-active-scale));
    height: calc(var(--point-size) * var(--point-active-scale));
    background: var(--primary-green) !important;
    border-color: var(--dark-green);
    border-width: calc(var(--point-border-width) + 1px);
    box-shadow: 0 0 25px rgba(154, 198, 149, 0.7);
    z-index: 3;
}

.timeline-point-label {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.85rem;
    color: var(--text-light);
    white-space: nowrap;
    padding: 3px 10px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow);
    font-weight: 500;
}

/* Show label only on hover or when active */
.timeline-point .timeline-point-label {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, background-color 0.2s ease;
    z-index: 1;
}

.timeline-point.active .timeline-point-label {
    opacity: 1;
    background: var(--white);
    z-index: 2;
}

/* Limit hover behaviors to devices that actually support hover (avoid sticky hover on touch) */
@media (hover: hover) and (pointer: fine) {
    .timeline-point:hover { z-index: 4; }
    .timeline-point:hover .timeline-point-label {
        opacity: 1;
        background: rgba(255, 255, 255, 0.85);
        z-index: 3;
    }
}

.timeline-display {
    min-height: 300px;
    padding: 2rem;
    background: linear-gradient(135deg, #fafafa 0%, #ffffff 100%);
    border-radius: 15px;
    animation: fadeIn 0.5s ease-out;
    position: relative;
}

.timeline-content-container {
    position: relative;
    z-index: 1;
}

.timeline-content {
    animation: slideIn 0.5s ease-out;
}

.timeline-content + .timeline-content {
    margin-top: 1.5rem;
}

.timeline-content h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--primary-brown);
    margin-bottom: 1rem;
}

.timeline-content p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

/* Ensure links in timeline entries match body text color in all states */
.timeline-content a,
.timeline-content a:visited,
.timeline-content a:hover,
.timeline-content a:active,
.timeline-content a:focus {
    color: var(--text-light);
}

.timeline-images {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
}

.timeline-images.images-1 {
    grid-template-columns: 1fr;
}

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

.timeline-images.images-3 {
    grid-template-columns: repeat(3, 1fr);
}

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

/* Image wrappers provide consistent tile height without cropping */
.timeline-image-wrapper {
    width: 100%;
    height: 360px; /* default for 1 image; overridden in count-specific rules */
    border-radius: 10px;
    box-shadow: 0 4px 16px var(--shadow);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* hides overflow of the image, but we use contain so no crop occurs */
}

.timeline-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Per-layout wrapper heights to align rows while preserving aspect ratios */
.timeline-images.images-1 .timeline-image-wrapper { height: 360px; }
.timeline-images.images-2 .timeline-image-wrapper { height: 260px; }
.timeline-images.images-3 .timeline-image-wrapper { height: 200px; }
.timeline-images.images-4 .timeline-image-wrapper { height: 200px; }

.timeline-image:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px var(--shadow);
}

footer {
    background: linear-gradient(135deg, var(--primary-brown) 0%, var(--dark-brown) 100%);
    color: var(--white);
    padding: 2rem 1rem;
    text-align: center;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-link {
    color: var(--white);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: var(--transition);
}

.footer-link:hover {
    text-decoration-thickness: 2px;
}

/* Social links */
.social-links {
    margin-top: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--white);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 12px var(--shadow);
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.social-link:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.16);
    box-shadow: 0 8px 20px var(--shadow);
}

.social-link:active {
    transform: translateY(0);
}

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

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

@media (max-width: 768px) {
    .timeline-viewport {
        height: 200px;
    }
    
    .timeline-line {
        height: 4px;
    }
    
    /* Use dynamic sizing variables rather than fixed pixel sizes */
    .timeline-point { width: var(--point-size); height: var(--point-size); }
    .timeline-point:hover { width: calc(var(--point-size) * var(--point-hover-scale)); height: calc(var(--point-size) * var(--point-hover-scale)); }
    .timeline-point.active { width: calc(var(--point-size) * var(--point-active-scale)); height: calc(var(--point-size) * var(--point-active-scale)); }
    
    .timeline-point-label {
        font-size: 0.75rem;
        bottom: -35px;
    }
    
    header {
        padding: 1.5rem 1rem;
    }

    .name-banner {
        max-height: 80px;
    }

    main {
        padding: 2rem 1rem;
    }

    .profile-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 1.5rem;
    }

    .profile-image {
        max-width: 200px;
        margin: 0 auto;
    }

    .profile-text h2 {
        font-size: 1.9rem;
        text-align: center;
    }

    .profile-text p {
        text-align: center;
    }


    .timeline-container {
        padding: 1.5rem;
    }

    .timeline-title {
        font-size: 1.75rem;
    }

    .timeline-navigation {
        padding: 0.75rem;
    }

    .timeline-item {
        padding: 0.6rem 1.2rem;
        font-size: 0.95rem;
    }

    .timeline-display {
        padding: 1.5rem;
    }

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

    .timeline-images.images-3 {
        grid-template-columns: 1fr;
    }

    .timeline-images.images-4 {
        grid-template-columns: 1fr;
    }

    /* Responsive wrapper heights on tablets */
    .timeline-images.images-1 .timeline-image-wrapper { height: 300px; }
    .timeline-images.images-2 .timeline-image-wrapper { height: 220px; }
    .timeline-images.images-3 .timeline-image-wrapper { height: 170px; }
    .timeline-images.images-4 .timeline-image-wrapper { height: 170px; }
    /* slightly smaller hint on tablets */
    .hint-line { width: 90px; }
}

@media (max-width: 480px) {
    .profile-text h2 {
        font-size: 1.6rem;
    }

    .profile-image {
        max-width: 150px;
    }

    .timeline-title {
        font-size: 1.5rem;
    }

    .timeline-nav-btn {
        width: 35px;
        height: 35px;
        font-size: 1.25rem;
    }

    .timeline-item {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

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

    .timeline-images.images-2 {
        grid-template-columns: 1fr;
    }

    /* Responsive wrapper heights on phones */
    .timeline-images.images-1 .timeline-image-wrapper { height: 220px; }
    .timeline-images.images-2 .timeline-image-wrapper { height: 180px; }
    .timeline-images.images-3 .timeline-image-wrapper { height: 150px; }
    .timeline-images.images-4 .timeline-image-wrapper { height: 150px; }

    .timeline-content + .timeline-content { margin-top: 1rem; }
    /* smaller hint on phones */
    .hint-line { width: 70px; }
}