/* ========================================
   CUSTOM PROPERTIES
   ======================================== */
:root {
    --burgundy: #461220;
    --pink: #FFD6E0;
    --sage: #B5C6B4;
    --forest: #285943;

    --cream: #FFF6F3;
    --cream-warm: #FFEFEB;
    --text-primary: #461220;
    --text-secondary: #7a5560;
    --text-light: #FFF9F5;

    --font-serif: 'Cormorant Garamond', 'Georgia', serif;
    --font-sans: 'Outfit', 'Helvetica Neue', sans-serif;

    --nav-height: 80px;
    --container: 1200px;
    --section-pad: clamp(80px, 12vh, 140px);

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ========================================
   RESET & BASE
   ======================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
}

body {
    font-family: var(--font-sans);
    font-weight: 400;
    color: var(--text-primary);
    background-color: var(--cream);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--forest);
    outline-offset: 4px;
    border-radius: 2px;
}

::selection {
    background-color: var(--pink);
    color: var(--burgundy);
}

/* ========================================
   PAGE LOADER — Sparkle Dissolve
   ======================================== */
.page-loader {
    position: fixed;
    inset: 0;
    background-color: var(--cream);
    z-index: 10000;
    pointer-events: all;
}

.page-loader.dissolving {
    pointer-events: none;
}

.page-loader .sparkle {
    position: absolute;
    pointer-events: none;
    line-height: 1;
    text-align: center;
}

@keyframes sparkleUp {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.3);
    }
    20% {
        opacity: 1;
        transform: translateY(-14px) scale(1.2);
    }
    50% {
        opacity: 0.7;
        transform: translateY(-50px) scale(0.9);
    }
    100% {
        opacity: 0;
        transform: translateY(-120px) scale(0);
    }
}

/* ========================================
   LAYOUT
   ======================================== */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 clamp(24px, 5vw, 60px);
}

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

/* ========================================
   SCROLL REVEAL
   ======================================== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

.reveal[data-delay="1"] { transition-delay: 0.12s; }
.reveal[data-delay="2"] { transition-delay: 0.24s; }
.reveal[data-delay="3"] { transition-delay: 0.36s; }

/* ========================================
   NAVIGATION
   ======================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(24px, 5vw, 60px);
    z-index: 1000;
    transition: background-color 0.4s ease, backdrop-filter 0.4s ease;
}

.navbar.scrolled {
    background-color: rgba(255, 240, 237, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 20px rgba(70, 18, 32, 0.06);
}

.nav-logo {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--burgundy);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-link {
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1.5px;
    background-color: var(--forest);
    transition: width 0.3s var(--ease-out);
}

.nav-link:hover,
.nav-link.active {
    color: var(--burgundy);
}

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

/* Nav Toggle (Mobile) */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 1001;
}

.nav-toggle span {
    display: block;
    width: 28px;
    height: 2px;
    background-color: var(--burgundy);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle.active span:first-child {
    transform: rotate(45deg) translate(3px, 3px);
}

.nav-toggle.active span:last-child {
    transform: rotate(-45deg) translate(3px, -3px);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    inset: 0;
    background-color: var(--cream);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.mobile-menu.active {
    opacity: 1;
    pointer-events: all;
}

.mobile-link {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 500;
    color: var(--burgundy);
    transition: color 0.3s ease;
}

.mobile-link:hover {
    color: var(--forest);
}

/* ========================================
   HERO
   ======================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, var(--cream) 0%, #ffe8ef 40%, #fff0f2 70%, var(--cream) 100%);
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 2;
    padding: 0 clamp(24px, 5vw, 60px);
}

.hero-label {
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--forest);
    margin-bottom: 1.5rem;
}

.hero-name {
    font-family: var(--font-serif);
    font-size: clamp(2.8rem, 10vw, 12rem);
    font-weight: 300;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--burgundy);
    margin-bottom: 1.5rem;
    overflow-wrap: normal;
    word-break: keep-all;
}

.hero-name .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(60px) rotate(4deg);
    animation: charReveal 0.8s var(--ease-out) forwards;
}

@keyframes charReveal {
    to {
        opacity: 1;
        transform: translateY(0) rotate(0);
    }
}

.hero-tagline {
    font-size: clamp(1rem, 1.6vw, 1.15rem);
    color: var(--text-secondary);
    line-height: 1.8;
    max-width: 480px;
    margin: 0 auto 2.5rem;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-light);
    background-color: var(--forest);
    padding: 1rem 2rem;
    border-radius: 100px;
    transition: background-color 0.3s ease, transform 0.3s ease, gap 0.3s ease;
}

.hero-cta:hover {
    background-color: var(--burgundy);
    transform: translateY(-2px);
    gap: 0.8rem;
}

/* Decorative Orbs */
.hero-decorative {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.orb {
    position: absolute;
    border-radius: 50%;
}

.orb-1 {
    width: clamp(300px, 40vw, 580px);
    height: clamp(300px, 40vw, 580px);
    background: radial-gradient(circle, rgba(255, 200, 215, 0.5), rgba(255, 200, 215, 0) 70%);
    top: 5%;
    right: -8%;
    animation: float1 14s ease-in-out infinite;
}

.orb-2 {
    width: clamp(220px, 30vw, 450px);
    height: clamp(220px, 30vw, 450px);
    background: radial-gradient(circle, rgba(255, 214, 224, 0.35), rgba(255, 214, 224, 0) 70%);
    bottom: 12%;
    left: -8%;
    animation: float2 18s ease-in-out infinite;
}

.orb-3 {
    width: clamp(120px, 16vw, 240px);
    height: clamp(120px, 16vw, 240px);
    background: radial-gradient(circle, rgba(255, 180, 200, 0.25), rgba(255, 180, 200, 0) 70%);
    top: 22%;
    left: 12%;
    animation: float3 11s ease-in-out infinite;
}

@keyframes float1 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-20px, 30px); }
}

@keyframes float2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, -20px); }
}

@keyframes float3 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-15px, -25px); }
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    animation: fadeInUp 1s ease 1.5s both;
}

.scroll-indicator span {
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--burgundy), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 1; transform: scaleY(1); }
    50% { opacity: 0.3; transform: scaleY(0.6); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ========================================
   SECTION HEADER
   ======================================== */
.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: clamp(3rem, 6vw, 5rem);
}

.section-number {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 400;
    color: var(--forest);
}

.section-line {
    flex: 0 0 40px;
    height: 1px;
    background-color: var(--sage);
}

.section-label {
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

/* ========================================
   ABOUT
   ======================================== */
.about {
    background-color: var(--cream);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: clamp(2rem, 4vw, 3.5rem);
    align-items: start;
    margin-bottom: clamp(4rem, 8vw, 6rem);
}

.about-heading {
    font-family: var(--font-serif);
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
}

.about-bio {
    font-size: clamp(0.95rem, 1.1vw, 1.05rem);
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.about-image {
    position: relative;
    align-self: stretch;
    display: flex;
    align-items: stretch;
}

/* D+S Emblem */
.emblem-container {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    outline: none;
    perspective: 800px;
    width: 100%;
}

.emblem-container *,
.emblem-container *:focus,
.emblem-container *:active {
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.emblem-svg {
    width: 100%;
    height: auto;
    will-change: transform;
    filter: drop-shadow(0 4px 20px rgba(70, 18, 32, 0.06));
    transition: filter 0.4s ease;
}

.emblem-container:hover .emblem-svg {
    filter: drop-shadow(0 8px 30px rgba(160, 160, 160, 0.3));
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    padding-top: clamp(2rem, 4vw, 3rem);
    border-top: 1px solid rgba(255, 214, 224, 0.5);
}

.stat-number {
    display: block;
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    font-weight: 300;
    color: var(--burgundy);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

/* ========================================
   WORK / PROJECTS
   ======================================== */
.work {
    background-color: var(--cream-warm);
}

/* Project thumbnail layout */
.project-thumbnail--balsamiq,
.project-thumbnail--matcha,
.project-thumbnail--axure {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: var(--cream);
}

.project-logo {
    width: auto;
    height: 80%;
    max-width: 80%;
    object-fit: contain;
    filter: drop-shadow(0 4px 16px rgba(70, 18, 32, 0.08));
    position: relative;
    z-index: 1;
    transition: transform 0.5s var(--ease-out), filter 0.5s ease;
}

.project-thumbnail--balsamiq .project-logo {
    transform: scale(1.4) translateX(1.5%);
}

.project-thumbnail:hover .project-logo {
    transform: scale(1.05);
    filter: drop-shadow(0 6px 20px rgba(70, 18, 32, 0.12));
}

.project-thumbnail--balsamiq:hover .project-logo {
    transform: scale(1.5) translateX(1.5%);
}

/* Stacked Image Gallery */
.project-thumbnail--stack {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    aspect-ratio: auto;
    padding: 2rem 0;
    background: linear-gradient(145deg, var(--sage), var(--cream-warm));
}

.image-stack {
    position: relative;
    width: 55%;
    aspect-ratio: 1272 / 2668;
    z-index: 1;
}

.stack-card {
    position: absolute;
    inset: 0;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    background: var(--cream-warm);
    transition: transform 0.5s var(--ease-out), opacity 0.5s var(--ease-out), z-index 0s;
    will-change: transform, opacity;
}

.stack-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Scattered pile — each card has a unique offset & rotation */
.stack-card:nth-child(1)  { --sx: 0;    --sy: 0;    --sr: 0;    z-index: 9; }
.stack-card:nth-child(2)  { --sx: 12px; --sy: 6px;  --sr: 3.5deg;  z-index: 8; }
.stack-card:nth-child(3)  { --sx:-8px;  --sy: 10px; --sr:-2.5deg;  z-index: 7; }
.stack-card:nth-child(4)  { --sx: 18px; --sy: 14px; --sr: 5deg;    z-index: 6; }
.stack-card:nth-child(5)  { --sx:-14px; --sy: 8px;  --sr:-4deg;    z-index: 5; }
.stack-card:nth-child(6)  { --sx: 6px;  --sy: 18px; --sr: 2deg;    z-index: 4; }
.stack-card:nth-child(7)  { --sx:-10px; --sy: 16px; --sr:-5.5deg;  z-index: 3; }
.stack-card:nth-child(8)  { --sx: 20px; --sy: 12px; --sr: 4.5deg;  z-index: 2; }
.stack-card:nth-child(9)  { --sx:-16px; --sy: 20px; --sr:-3deg;    z-index: 1; }

.stack-card {
    transform: translate(var(--sx, 0), var(--sy, 0)) rotate(var(--sr, 0)) scale(0.97);
}

/* Active card snaps to front, straight */
.stack-card.active {
    z-index: 10 !important;
    transform: translate(0, 0) rotate(0deg) scale(1) !important;
    opacity: 1;
}

.stack-card.exiting {
    z-index: 11 !important;
    animation: cardExit 0.45s var(--ease-out) forwards;
}

@keyframes cardExit {
    0%   { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 1; }
    100% { transform: translate(-40px, -24px) rotate(-6deg) scale(0.9); opacity: 0; }
}

/* Counter badge */
.stack-counter {
    position: absolute;
    bottom: 10px;
    right: 12px;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: rgba(70, 18, 32, 0.55);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(6px);
    padding: 3px 10px;
    border-radius: 100px;
    z-index: 10;
    pointer-events: none;
}

.projects-grid {
    display: grid;
    grid-template-columns: 1fr 1.25fr 1fr;
    gap: clamp(2rem, 3vw, 3rem);
    align-items: start;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 1.5rem 0 0.5rem;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1.5px solid var(--burgundy);
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: background 0.3s ease, transform 0.3s ease;
}

.carousel-dot:hover {
    background: rgba(70, 18, 32, 0.3);
    transform: scale(1.2);
}

.carousel-dot.active {
    background: var(--burgundy);
}

.project-card {
    cursor: pointer;
    transition: opacity 0.7s cubic-bezier(0.25, 0.1, 0.25, 1);
    opacity: 0.7;
}

.project-card.card-center {
    opacity: 1;
}

.project-card:hover .project-thumbnail {
    transform: scale(0.94) translateY(-4px);
    box-shadow: 0 12px 40px rgba(70, 18, 32, 0.12);
}

.project-card.card-center:hover .project-thumbnail {
    transform: scale(1) translateY(-4px);
}

.project-thumbnail {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1.2rem;
    box-shadow: 0 4px 20px rgba(70, 18, 32, 0.08);
    transform: scale(0.94);
    transition: transform 0.7s cubic-bezier(0.25, 0.1, 0.25, 1), box-shadow 0.7s ease;
}

.card-center .project-thumbnail {
    transform: scale(1);
    box-shadow: 0 8px 32px rgba(70, 18, 32, 0.12);
}

.project-number {
    position: absolute;
    bottom: 0.8rem;
    right: 1.2rem;
    font-family: var(--font-serif);
    font-size: clamp(3rem, 5vw, 5rem);
    font-weight: 300;
    color: rgba(255, 255, 255, 0.1);
    line-height: 1;
    pointer-events: none;
}

.project-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background-color: rgba(43, 26, 31, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.project-card.card-center:hover .project-overlay {
    opacity: 1;
}

.project-view {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transform: translateY(10px);
    transition: transform 0.4s var(--ease-out);
    background: rgba(70, 18, 32, 0.6);
    padding: 0.6rem 1.4rem;
    border-radius: 100px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.project-card.card-center:hover .project-view {
    transform: translateY(0);
}

.project-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.project-category {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--burgundy);
    background-color: rgba(255, 214, 224, 0.4);
    padding: 0.2rem 0.7rem;
    border-radius: 100px;
}

.project-year {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.project-title {
    font-family: var(--font-serif);
    font-size: clamp(1.3rem, 2vw, 1.6rem);
    font-weight: 500;
}

.project-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-top: 0.5rem;
}

/* Icon-style thumbnails */
/* (flex centering now in main thumbnail rules above) */

.project-thumb-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    gap: 0.75rem;
    z-index: 1;
}

.project-icon {
    opacity: 0.9;
}

.project-thumb-label {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
}

/* ========================================
   SKILLS
   ======================================== */
.skills {
    background-color: var(--cream);
}

/* Marquee */
.marquee {
    overflow: hidden;
    padding: clamp(1.5rem, 3vw, 2.5rem) 0;
    margin-bottom: clamp(3rem, 6vw, 4rem);
    border-top: 1px solid var(--sage);
    border-bottom: 1px solid var(--sage);
}

.marquee:hover .marquee-track {
    animation-play-state: paused;
}

.marquee-track {
    display: flex;
    align-items: center;
    width: max-content;
    animation: marquee 35s linear infinite;
}

.marquee-item {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 300;
    color: var(--burgundy);
    white-space: nowrap;
    padding: 0 1rem;
}

.marquee-sep {
    color: var(--sage);
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    padding: 0 0.5rem;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Skills Grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(1.5rem, 3vw, 2.5rem);
}

.skill-category {
    padding: clamp(1.5rem, 3vw, 2.5rem);
    background-color: white;
    border-radius: 10px;
    border: 1px solid rgba(181, 198, 180, 0.3);
    box-shadow: 0 2px 12px rgba(70, 18, 32, 0.04);
    transition: transform 0.4s var(--ease-out), box-shadow 0.4s ease;
}

.skill-category:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(70, 18, 32, 0.06);
}

.skill-category-title {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--sage);
    color: var(--burgundy);
}

.skill-list li {
    font-size: 0.95rem;
    color: var(--text-secondary);
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(181, 198, 180, 0.15);
    transition: color 0.3s ease, padding-left 0.3s ease;
}

.skill-list li:last-child {
    border-bottom: none;
}

.skill-list li:hover {
    color: var(--burgundy);
    padding-left: 0.5rem;
}

/* ========================================
   CONTACT
   ======================================== */
.contact {
    background-color: var(--burgundy);
    color: var(--text-light);
    text-align: center;
}

.contact .section-number {
    color: var(--sage);
}

.contact .section-line {
    background-color: rgba(181, 198, 180, 0.35);
}

.contact .section-label {
    color: rgba(255, 249, 245, 0.5);
}

.contact .section-header {
    justify-content: center;
}

.contact-heading {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 5.5vw, 4.5rem);
    font-weight: 300;
    line-height: 1.15;
    margin-bottom: 3rem;
    letter-spacing: -0.02em;
}

.contact-heading em {
    font-style: italic;
    color: var(--pink);
}

.contact-email {
    display: inline-block;
    font-family: var(--font-serif);
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    font-weight: 400;
    color: var(--pink);
    border-bottom: 1px solid rgba(255, 214, 224, 0.3);
    padding-bottom: 0.25rem;
    transition: border-color 0.3s ease;
    margin-bottom: 3rem;
}

.contact-email:hover {
    border-color: var(--pink);
}

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

.social-link {
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 249, 245, 0.5);
    transition: color 0.3s ease;
}

.social-link:hover {
    color: var(--pink);
}

/* ========================================
   PROJECT DETAIL PAGES
   ======================================== */
.project-detail-hero {
    padding: calc(var(--nav-height) + 3rem) 0 3rem;
    background-color: var(--cream);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--forest);
    margin-bottom: 2.5rem;
    transition: gap 0.3s ease, color 0.3s ease;
}

.back-link:hover {
    gap: 0.7rem;
    color: var(--burgundy);
}

.project-detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.project-detail-year {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.project-detail-title {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 5.5vw, 4.5rem);
    font-weight: 300;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--burgundy);
    margin-bottom: 1.5rem;
}

.project-detail-desc {
    font-size: clamp(1rem, 1.2vw, 1.1rem);
    color: var(--text-secondary);
    line-height: 1.8;
    max-width: 640px;
    margin-bottom: 2.5rem;
}

.project-detail-meta {
    display: flex;
    gap: clamp(2rem, 4vw, 4rem);
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 214, 224, 0.5);
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.meta-label {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.meta-value {
    font-size: 0.95rem;
    color: var(--burgundy);
}

/* Gallery */
.project-gallery {
    background-color: var(--cream-warm);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(1.2rem, 2vw, 1.8rem);
    max-width: 900px;
    margin: 0 auto;
}

.gallery-grid img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(70, 18, 32, 0.06);
    transition: transform 0.5s var(--ease-out), box-shadow 0.5s ease, opacity 0.6s ease;
    cursor: pointer;
}

.gallery-grid img:nth-child(3n+2) {
    transform: translateY(20px);
}

.gallery-grid img:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(70, 18, 32, 0.12);
}

.gallery-grid img:nth-child(3n+2):hover {
    transform: translateY(14px);
}

.gallery-empty {
    text-align: center;
    font-size: 1rem;
    color: var(--text-secondary);
    font-style: italic;
    padding: 4rem 0;
}

/* ========================================
   LIGHTBOX
   ======================================== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s var(--ease-out), visibility 0.4s;
}

.lightbox.is-active {
    opacity: 1;
    visibility: visible;
}

.lightbox-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(43, 26, 31, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.lightbox-close {
    position: absolute;
    top: clamp(16px, 3vw, 32px);
    right: clamp(16px, 3vw, 32px);
    z-index: 3;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 246, 243, 0.1);
    border: 1px solid rgba(255, 246, 243, 0.15);
    border-radius: 50%;
    color: var(--cream);
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(255, 246, 243, 0.2);
    transform: scale(1.08);
}

.lightbox-close:focus-visible {
    outline: 2px solid var(--sage);
    outline-offset: 4px;
}

.lightbox-counter {
    position: absolute;
    top: clamp(16px, 3vw, 32px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    color: rgba(255, 246, 243, 0.6);
    user-select: none;
}

.lightbox-separator {
    margin: 0 0.35em;
    color: rgba(255, 246, 243, 0.3);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 246, 243, 0.08);
    border: 1px solid rgba(255, 246, 243, 0.12);
    border-radius: 50%;
    color: var(--cream);
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s var(--ease-out);
}

.lightbox-prev { left: clamp(12px, 3vw, 32px); }
.lightbox-next { right: clamp(12px, 3vw, 32px); }

.lightbox-nav:hover {
    background: rgba(255, 246, 243, 0.18);
    transform: translateY(-50%) scale(1.08);
}

.lightbox-nav:focus-visible {
    outline: 2px solid var(--sage);
    outline-offset: 4px;
}

.lightbox-stage {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: clamp(60px, 8vh, 100px) clamp(80px, 10vw, 140px);
    pointer-events: none;
}

.lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 60px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    transition: opacity 0.3s ease, transform 0.3s var(--ease-out);
    will-change: opacity, transform;
}

.lightbox-img.is-entering {
    opacity: 0;
    transform: scale(0.96);
}

.lightbox-img.is-visible {
    opacity: 1;
    transform: scale(1);
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
    background-color: var(--burgundy);
    padding: 1.5rem 0;
    border-top: 1px solid rgba(181, 198, 180, 0.12);
}

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

.footer-copy {
    font-size: 0.78rem;
    color: rgba(255, 249, 245, 0.35);
}

.back-to-top {
    font-size: 0.78rem;
    color: rgba(255, 249, 245, 0.35);
    transition: color 0.3s ease;
}

.back-to-top:hover {
    color: var(--pink);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 968px) {
    .nav-links {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .about-image {
        max-width: 300px;
        margin: 0 auto;
    }

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

    .project-detail-meta {
        flex-wrap: wrap;
        gap: 1.5rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .image-stack {
        width: 40%;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .lightbox-stage {
        padding: clamp(60px, 8vh, 80px) 16px;
    }

    .lightbox-nav {
        width: 44px;
        height: 44px;
    }

    .lightbox-prev { left: 8px; }
    .lightbox-next { right: 8px; }
}

@media (max-width: 600px) {
    :root {
        --nav-height: 64px;
    }

    .about-stats {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-inner {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .social-links {
        gap: 1.5rem;
    }

    .lightbox-stage {
        padding: 56px 8px 40px;
    }

    .lightbox-nav {
        top: auto;
        bottom: clamp(12px, 3vw, 24px);
        transform: none;
        width: 48px;
        height: 48px;
    }

    .lightbox-prev { left: calc(50% - 60px); }
    .lightbox-next { right: calc(50% - 60px); }

    .lightbox-nav:hover {
        transform: scale(1.08);
    }

    .lightbox-counter {
        bottom: clamp(20px, 4vw, 32px);
        top: auto;
    }
}

/* ========================================
   REDUCED MOTION
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }

    .hero-name .char {
        opacity: 1;
        transform: none;
    }

    .page-loader {
        display: none;
    }
}