/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(var(--accent-color-rgb), 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--accent-color-rgb), 0.5);
}

:root {
    --primary-color: #1a1a1a;
    --secondary-color: #fafafa;
    --accent-color: #444444;
    --accent-color-rgb: 68, 68, 68; /* RGB value for the accent color */
    --text-color: #333;
    --light-text: #fff;
    --border-color: #e0e0e0;
    --subtle-color: #e5e5e5;
    --subtle-color-rgb: 229, 229, 229; /* RGB value for subtle effects */
    --site-padding: 1.5rem; /* Consistent padding for alignment */
    --section-padding: 2.1rem var(--site-padding); /* further tightened */
    --section-vertical: clamp(1.4rem, 4vw, 2.4rem); /* more compact vertical rhythm */
    --transition-speed: 0.3s;
    --transition-fast: 0.2s;
    --transition-slow: 0.5s;
    --font-family: 'Helvetica Neue', Arial, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    --font-size-base: 16px;
    --font-size-sm: 0.875rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.5rem;
    --font-size-xxl: 2.25rem;
    --line-height-tight: 1.25;
    --line-height-base: 1.6;
    --line-height-relaxed: 1.8;
    --max-measure: 68ch; /* Optimal reading width */
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    --radius-sm: 2px;
    --radius-md: 4px;
    --shadow-soft: 0 2px 6px rgba(0, 0, 0, 0.06), 0 4px 14px rgba(0, 0, 0, 0.04);
    --font-heading: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    --ls-tight:-0.015em;
    --ls-tighter:-0.02em;
    --ls-normal:0;
    --ls-wide:0.03em;
}

/* Letter-spacing system: 
   --ls-tighter (-0.02em) for large headings to reduce airy serif spacing
   --ls-tight (-0.015em) for secondary headings/subheads
   Neutral (0) for body for readability
   Slightly wide (0.04em) retained for navigation/footer for subtle separation
*/

/* Typography: unified sans-serif (Inter) for headings and body for consistency & reduced font payload */

/* Typography & spacing system additions */
/* Variables added: font scale, line-heights, max measure, radii, soft shadow */
/* These support a minimal, consistent layout and readable line length. */

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    line-height: var(--line-height-base);
    color: var(--text-color);
    background-color: var(--secondary-color);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: var(--font-size-md);
    letter-spacing: var(--ls-normal);
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 500;
    line-height: 1.2;
    margin-top: 0;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

h1 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    letter-spacing: var(--ls-tighter);
}

h2 {
    font-size: 1.4rem;
    letter-spacing: var(--ls-tight);
    font-weight: 500;
    margin-bottom: 1.05rem; /* tightened */
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 4rem;
    height: 1px;
    background-color: var(--accent-color);
    opacity: 0.5;
}

h3 {
    font-size: 1rem;
    margin-bottom: 0.4rem;
    font-weight: 500;
    letter-spacing: var(--ls-tight);
}

p {
    margin-bottom: 1.5rem;
    font-weight: 400;
    line-height: 1.7;
    max-width: var(--max-measure);
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: all var(--transition-speed) cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
}

a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    height: 1px;
    width: 0;
    background: currentColor;
    transition: width 0.3s ease;
    opacity: 0.6;
}

a:hover::after,
a:focus::after {
    width: 100%;
}

/* Main content */
main {
    flex: 1;
    margin-top: 4.5rem;
    padding-bottom: 3rem;
}

.section {
    padding: var(--section-vertical) 1.75rem;
    min-height: unset;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    max-width: 1300px;
    margin: 0 auto;
    position: relative;
}

/* Header styles */
header {
    background-color: rgba(255, 255, 255, 0.98);
    color: var(--primary-color);
    padding: 1.2rem var(--site-padding);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: all 0.4s ease;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    max-width: 1300px;
    margin: 0 auto;
    gap: 1rem;
}

.header-left { display: flex; flex-direction: column; align-items: flex-start; }
.header-right { display: flex; align-items: center; gap: 1rem; }

#site-title {
    font-size: 1.5rem;
    margin-bottom: 1.2rem; /* reasonable gap above nav */
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Nav layout */
nav { display: flex; }

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--primary-color);
    margin: 4px 0;
    transition: all 0.3s ease;
}

nav {
    display: flex; /* inline/horizontal */
}

nav ul {
    list-style: none;
    display: flex; /* keep items horizontal */
    gap: 2.5rem;
    padding: 0; /* remove default ul padding */
    margin: 0;  /* ensure left edge aligns with title */
}

nav a {
    color: var(--primary-color);
    text-decoration: none;
    padding: 0.3rem 0;
    position: relative;
    font-weight: 400;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    text-decoration: none;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--primary-color);
    transition: width var(--transition-speed) cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Main content */
main {
    flex: 1;
    margin-top: 4rem;
    padding-bottom: 2rem;
}

.section {
    padding: var(--section-padding);
    min-height: 50vh; /* slightly less vertical stretch */
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 1300px;
    margin: 0 auto;
    position: relative;
}

/* About Section */
/* Hero Section */
/* Intro split layout: mobile stacked; desktop side-by-side with hero full image on right */
.intro-split {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 1300px;
    margin: 0 auto 2rem;
    padding: 0 var(--site-padding); /* align with header left padding */
}

.hero-section {
    padding: 0;
    margin: 0;
    width: 100%;
    background: transparent; /* remove black bars */
    display: flex;
    align-items: center;
    justify-content: flex-start; /* align image to left padding */
}

.hero-container { width: 100%; }

.hero-image { width: 100%; height: auto; display: block; }

@media (min-width: 980px) {
    .intro-split { flex-direction: row; align-items: stretch; }
    .about-section { flex: 0 0 48%; display: flex; flex-direction: column; justify-content: center; }
    .hero-section { flex: 0 0 52%; min-height: auto; }
    .hero-container { width: 100%; display: flex; align-items: center; justify-content: center; }
    .hero-image picture, .hero-image img { width: 100%; height: auto; max-height: none; }
    .hero-section img { width: 100%; height: auto; object-fit: contain; }
}

/* About section - bio only, no portrait */
/* About content simplified */
.about-content { max-width: 800px; margin: 0 auto; }

.bio-container {
    width: 100%;
    font-family: var(--font-body) !important; /* ensure Inter inheritance */
}

/* Removed all profile image styling as it's no longer used */

/* Simple styling for bio paragraph */
.bio-container .bio {
    font-family: var(--font-body);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    font-weight: 350;
    line-height: 1.65;
    max-width: var(--max-measure);
    color: var(--text-color);
    opacity: 0.95;
}

/* Removed duplicate .bio style as it's now defined above */

/* Remove extra bottom margin on final bio paragraph for tighter rhythm */
.bio-container .bio:last-child { margin-bottom: 0; }

/* Prevent About text from overflowing on narrow widths or long words/links */
.bio-container .bio,
.bio-container .bio a {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Add subtle right padding on the About column at desktop sizes to avoid edge collisions */
@media (min-width: 980px) {
    .intro-split .about-section { padding-right: clamp(12px, 2.2vw, 28px); }
}


/* Carousel Sections */
.carousel-section {
    position: relative;
    padding-top: calc(var(--section-vertical) + 0.5rem);
    padding-bottom: calc(var(--section-vertical) + 0.5rem);
}

.carousel-container {
    position: relative;
    margin-top: 2.5rem;
    overflow: hidden;
    border-radius: 1px;
}

/* Carousel navigation buttons */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.15);
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    color: #222;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
    z-index: 5;
}
.carousel-nav.prev { left: 4px; }
.carousel-nav.next { right: 4px; }
.carousel-nav:hover:not(:disabled) { background: #fff; transform: translateY(-50%) scale(1.05); box-shadow: 0 4px 14px rgba(0,0,0,0.12);} 
.carousel-nav:active:not(:disabled) { transform: translateY(-50%) scale(0.94); }
.carousel-nav:disabled { opacity: 0.35; cursor: default; }
.carousel-nav:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 2px; }

@media (max-width: 680px) {
    .carousel-nav { display: none; }
}

/* Subtle single-character hint */
.subtle-hint {
    position: absolute;
    bottom: -22px;
    right: 8px;
    font-size: 0.85rem;
    opacity: 0.5;
    transition: opacity 0.4s ease;
    user-select: none;
    pointer-events: none;
    font-weight: 400;
    letter-spacing: 0.05em;
}
.subtle-hint:hover { opacity: 0.75; }

 .carousel-wrapper { position: relative; padding: 0 1.5rem; border-radius: 1px; }
 .carousel-items.dragging { cursor: grabbing !important; }

.carousel-items {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 2rem;
    padding: 0.5rem 0;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
    position: relative;
    z-index: 1;
    -webkit-overflow-scrolling: touch; /* momentum on iOS */
}

.carousel-items::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.carousel-item {
    flex: 0 0 300px;
    scroll-snap-align: start;
    cursor: pointer;
    transition: all var(--transition-speed) cubic-bezier(0.165, 0.84, 0.44, 1);
    opacity: 0.95;
    margin-bottom: 1rem;
}

/* Add space between thumbnail and title */
.carousel-item h3 { margin-top: 0.75rem; }

.carousel-item:hover {
    transform: translateY(-5px);
    opacity: 1;
}

.thumbnail-container {
    position: relative;
    overflow: hidden;
    border-radius: 2px;
    aspect-ratio: 16/9;
    box-shadow: var(--shadow);
    background-color: var(--subtle-color);
}

.thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1), filter 0.4s ease;
}

.carousel-item:hover .thumbnail {
    transform: scale(1.03);
    filter: brightness(1.03) contrast(1.02);
}

.video-indicator {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.4);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: all var(--transition-speed) cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
}

.video-indicator span {
    color: white;
    font-size: 0.9rem;
    transform: translateX(1px);
}

.carousel-item:hover .video-indicator {
    opacity: 0.9;
    transform: scale(1.1);
    background-color: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

/* Glow indicators instead of buttons */
.carousel-edge {
    position: absolute;
    top: 0;
    height: 100%;
    width: 70px;
    z-index: 2;
    pointer-events: none;
    opacity: 0.35; /* subtle always-on */
    transition: opacity 0.35s ease;
}

.carousel-container:hover .carousel-edge.active { opacity: 0.6; }

.carousel-edge.left {
    left: 0;
    background: linear-gradient(to right, 
        rgba(var(--subtle-color-rgb), 0.7), 
        rgba(var(--subtle-color-rgb), 0)
    );
}

.carousel-edge.right {
    right: 0;
    background: linear-gradient(to left, 
        rgba(var(--subtle-color-rgb), 0.7), 
        rgba(var(--subtle-color-rgb), 0)
    );
}

.scroll-hint {
    position: absolute;
    right: 0;
    bottom: -25px;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    opacity: 0.5;
    font-weight: 300;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(250, 250, 250, 0.97);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
    padding: 1rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-content {
    background-color: white;
    border-radius: 1px;
    max-width: 950px;
    width: 100%;
    max-height: 95vh;
    overflow-y: auto;
    position: relative;
    padding: 2rem;
    box-shadow: var(--shadow-soft);
}

.close-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--accent-color);
    border: none;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    cursor: pointer;
    color: #fff;
    z-index: 10001;
    opacity: 1;
    transition: box-shadow 0.2s ease, background 0.2s ease;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    outline: none;
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.close-button:hover {
    background: #222;
    color: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.full-image {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

/* Modal large image perceived performance enhancements */
 .modal-image-skeleton {
    width: 100%;
    max-height: 70vh;
    aspect-ratio: 16/10;
    background: linear-gradient(110deg, #efefef 8%, #f7f7f7 22%, #efefef 38%);
    background-size: 180% 100%;
    border-radius: 2px;
    animation: skeletonShimmer 1.6s linear infinite;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

@keyframes skeletonShimmer {
    to { background-position: -200% 0; }
}

.progressive-image { 
    filter: blur(5px) saturate(1.05);
    opacity: 0.55;
    transition: filter 0.65s ease, opacity 0.5s ease;
    will-change: filter, opacity;
}
.progressive-image.loaded { 
    filter: blur(0) saturate(1);
    opacity: 1;
}

/* Prevent layout shift when image loads */
.modal-content picture { display: block; }

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    margin-bottom: 2rem;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    box-shadow: var(--shadow);
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* Video loading placeholder */
 .video-placeholder {
     position: absolute;
     inset: 0;
     display: flex;
     align-items: center;
     justify-content: center;
     background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
     background-size: 200% 100%;
     animation: skeletonShimmer 1.35s linear infinite;
     overflow: hidden;
     transition: opacity 0.35s ease;
 }

 .video-placeholder::after {
     content: 'Loading video…';
     font-size: 0.75rem;
     letter-spacing: 0.06em;
     color: #666;
     position: absolute;
     bottom: 8px;
     left: 12px;
     background: rgba(255,255,255,0.6);
     padding: 2px 6px;
     border-radius: 2px;
     font-weight: 400;
 }


.video-container.ready iframe { opacity: 1; }
.video-container.ready .video-placeholder { opacity: 0; transition: opacity 0.35s ease; }
.video-container.ready .video-placeholder { pointer-events: none; }

.item-description {
    margin-top: 1rem;
    line-height: 1.8;
    font-weight: 300;
    max-width: 90%;
}

/* Contact Section */
.contact-container {
    display: flex;
    gap: 4rem;
    margin-top: 2rem;
}

.contact-info {
    flex: 1;
}

.contact-form-container {
    flex: 1;
}

.social-media {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.85rem; /* tighter spacing below email */
}

/* Tighter spacing for contact info paragraphs to bring icons closer */
.contact-info p { margin-bottom: 0.6rem; }

.social-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: transparent;
    border: none;
    color: var(--primary-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.social-icon:hover {
    transform: translateY(-3px);
}

/* Visually hidden utility */
.social-icon span.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Inline icon image (new reliable approach) */
.social-icon.has-inline-icon { background: transparent; }
.social-icon .icon-img {
    width: 22px;
    height: 22px;
    display: block;
    pointer-events: none;
    /* Invert white-stroke SVG to dark so outline shows on light background */
    filter: invert(1) brightness(0.25) contrast(1.3);
    transition: transform 0.3s ease, filter 0.3s ease;
}
.social-icon:hover .icon-img { transform: scale(1.08); filter: invert(1) brightness(0.15) contrast(1.4); }
.social-icon.icon-fallback-text { font-size: 0.9rem; font-weight: 500; letter-spacing: 0.04em; }
.social-icon .icon-fallback-initial { color: var(--light-text); }

/* Legacy pseudo-element fallback kept for any icon links without inline <img> */
.social-icon:not(.has-inline-icon)::after {
    content: '';
    display: block;
    width: 24px;
    height: 24px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.25s ease;
}
.social-icon:not(.has-inline-icon):hover::after { transform: scale(1.08); }

/* Provide fallback layering (used only if JS inline load skipped) */
.instagram:not(.has-inline-icon)::after { background-image: url(assets/icons/instagram-outline.svg), url(assets/icons/instagram.svg); }
.facebook:not(.has-inline-icon)::after { background-image: url(assets/icons/facebook-outline.svg), url(assets/icons/facebook.svg); }
.youtube:not(.has-inline-icon)::after { background-image: url(assets/icons/youtube.svg); }
.vimeo:not(.has-inline-icon)::after { background-image: url(assets/icons/vimeo.svg); }

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-weight: 400;
    font-size: 0.9rem;
    letter-spacing: 0.2px;
    color: var(--accent-color);
}

.form-group input,
.form-group textarea {
    padding: 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 2px;
    font-family: inherit;
    resize: vertical;
    transition: all var(--transition-speed) ease;
    background-color: rgba(255, 255, 255, 0.7);
    font-weight: 300;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(var(--accent-color-rgb), 0.1);
    background-color: white;
}

.submit-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 2px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all var(--transition-speed) cubic-bezier(0.19, 1, 0.22, 1);
    font-weight: 400;
    margin-top: 1rem;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.submit-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background-color: rgba(255,255,255,0.1);
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.submit-button:hover {
    background-color: var(--accent-color);
    transform: translateY(-1px);
}

.submit-button:hover::after {
    width: 100%;
}

.submit-button:active {
    transform: translateY(1px);
}

.submit-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.form-success {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #e3f8e2;
    color: #388e3c;
    border-radius: 4px;
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem 2rem;
    background-color: var(--primary-color);
    color: var(--light-text);
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    font-weight: 300;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.1), transparent);
}

/* Animations */
.fade-in {
    animation: fadeIn 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Apply subtle animations and styling to sections */
section {
    animation: slideIn 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    animation-fill-mode: both;
    position: relative;
    margin-bottom: 0;
}

section:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 8%;
    right: 8%;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(0,0,0,0.05), transparent);
}

section:nth-child(1) { animation-delay: 0.1s; }
section:nth-child(2) { animation-delay: 0.2s; }
section:nth-child(3) { animation-delay: 0.3s; }
section:nth-child(4) { animation-delay: 0.4s; }
section:nth-child(5) { animation-delay: 0.5s; }
section:nth-child(6) { animation-delay: 0.6s; }

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

/* Reduced vertical spacing strategy */
/* Override after reduction not needed; ensure consistency */
:root { --section-vertical: clamp(1.4rem, 4vw, 2.4rem); }

/* Slightly tighter separation line */
section:not(:last-child)::after {
    left: 8%;
    right: 8%;
    opacity: 0.6;
}

/* Dense layout modifier (future toggle) */
body.layout-dense .section { --section-vertical: clamp(1.4rem, 3.5vw, 2.3rem); }

/* Adjust carousel section internal padding */
.carousel-section {
    padding-top: calc(var(--section-vertical) + 0.35rem);
    padding-bottom: calc(var(--section-vertical) + 0.35rem);
}

/* About spacing tweak */
.about-content {
    gap: 3.5rem;
}

@media (max-width: 992px) {
    .about-content {
        gap: 2.5rem;
    }
}

@media (max-width: 600px) {
    .about-content {
        gap: 1.75rem;
    }
}

/* Reduce extra bottom margin on section wrapper */
section {
    margin-bottom: 0;
}

/* Responsive design */
@media (max-width: 992px) {
    :root {
        --section-padding: 3rem 2rem;
    }
    
    .about-content {
        flex-direction: column;
        gap: 2rem;
    }
    
    .profile-image-container {
        flex: 0 0 auto;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .contact-container {
        flex-direction: column;
        gap: 3rem;
    }
}

@media (max-width: 768px) {
    :root {
        --section-padding: 2.5rem 1.5rem;
    }
    
    .hamburger {
        display: flex;
    }
    
    header.menu-open .hamburger span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    header.menu-open .hamburger span:nth-child(2) {
        opacity: 0;
    }
    
    header.menu-open .hamburger span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }
    
    nav {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: rgba(255, 255, 255, 0.85);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        height: 0;
        overflow: hidden;
        transition: all 0.3s ease;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
        z-index: 100;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    nav.open {
        height: auto;
        padding: 0.5rem 0;
    }
    
    nav ul {
        flex-direction: column;
        width: 100%;
        gap: 0;
        padding: 0.5rem 0;
    }
    
    nav ul li {
        width: 100%;
        text-align: center;
        margin: 0.25rem 0;
    }
    
    nav a {
        display: block;
        padding: 1rem 1.5rem;
        color: var(--primary-color);
        font-size: 1.2rem;
        font-weight: 500;
        letter-spacing: 0.5px;
        position: relative;
        transition: all 0.2s ease;
    }
    
    nav a:hover, nav a:focus {
        background-color: rgba(0, 0, 0, 0.05);
        transform: translateY(-1px);
    }
    
    .carousel-control {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }
    
    .carousel-item {
        flex: 0 0 250px;
    }
    
    .modal-content {
        padding: 1.5rem;
        }
}

/* CV link styling (desktop/top-right) */
.cv-link { font-size: 0.85rem; letter-spacing: 0.05em; text-transform: uppercase; opacity: 0.65; transition: opacity 0.25s ease, color 0.25s ease; }
.cv-link:hover, .cv-link:focus { opacity: 1; color: var(--primary-color); }

@media (max-width: 768px){
    #site-title { margin-bottom: 0.75rem; }
    .header-right { gap: 0.5rem; }
    .cv-link { font-size: 0.75rem; }
}

@media (max-width: 480px) {
    :root {
        --section-padding: 2rem 1rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.4rem;
    }
    
    .carousel-item {
        flex: 0 0 220px;
    }
    
    .section {
        min-height: auto;
    }

    .close-button {
        top: 0.5rem;
        right: 0.5rem;
        width: 56px;
        height: 56px;
        font-size: 2.2rem;
        background: var(--accent-color);
        color: #fff;
        box-shadow: 0 4px 16px rgba(0,0,0,0.18);
        border-radius: 50%;
        border: 2px solid rgba(255,255,255,0.18);
        z-index: 10001;
    }
    .close-button:active {
        background: #444;
        color: #fff;
    }
}

@media (min-width: 1100px){
  .modal-content { padding: 2.25rem 2.75rem; }
  .carousel-item { flex: 0 0 280px; }
}
