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

:root {
    --gold:      #C8A45D;
    --gold-lt:   #DFC08A;
    --cream:     #FAF7F2;
    --dark:      #0E0B08;
    --dark-mid:  #1A140E;
    --muted:     rgba(250,247,242,0.45);
    --border:    rgba(200,164,93,0.18);
    --overlay:   rgba(10, 8, 5, 0.88);
}

html, body {
    background: var(--dark);
    color: var(--cream);
    overflow-x: hidden;
}

/* ── NAV ── */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(10,8,5,0.90), transparent);
}

nav {
    display: flex;
    justify-content: flex-end;
    padding: 22px 60px;
}

nav ul {
    display: flex;
    align-items: center;
    list-style: none;
}

nav ul li {
    display: inline-flex;
    align-items: center;
    position: relative;
}

nav ul li:not(:last-child)::after {
    content: "";
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(200,164,93,0.4);
    margin: 0 24px;
    display: inline-block;
    flex-shrink: 0;
}

nav ul li a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    color: rgba(250,247,242,0.7);
    font-family: 'Raleway', sans-serif;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 3px;
    text-transform: uppercase;
    position: relative;
    transition: color 0.3s ease;
    white-space: nowrap;
}

nav ul li a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0;
    height: 1px;
    background: var(--gold);
    transition: width 0.35s ease;
}

nav ul li a:hover { color: var(--cream); }
nav ul li a:hover::after { width: 100%; }

nav ul li a svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    opacity: 0.7;
    flex-shrink: 0;
}

/* ════════════════════════════
   SLIDE 1 — HERO
   ════════════════════════════ */
.works-hero {
    height: 100svh; /* use svh to fix mobile browser chrome offset */
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    background: var(--dark);
}

/* subtle gold glow */
.works-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 60%, rgba(200,164,93,0.05) 0%, transparent 65%);
    pointer-events: none;
}

.title-eyebrow {
    font-family: 'Raleway', sans-serif;
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 6px;
    text-transform: uppercase;
    color: var(--gold);
    display: block;
    margin-bottom: 20px;
    opacity: 0;
    animation: fadeUp 0.9s ease forwards;
    animation-delay: 0.2s;
}

.works-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(52px, 9vw, 120px);
    font-weight: 300;
    letter-spacing: 8px;
    color: var(--cream);
    line-height: 1;
    opacity: 0;
    animation: fadeUp 1s ease forwards;
    animation-delay: 0.45s;
}

.title-rule {
    width: 1px;
    height: 50px;
    background: linear-gradient(to bottom, transparent, var(--gold), transparent);
    margin: 32px auto 0;
    opacity: 0;
    animation: fadeIn 1s ease forwards;
    animation-delay: 0.9s;
}

/* scroll hint at bottom of hero */
.scroll-hint {
    position: absolute;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-family: 'Raleway', sans-serif;
    font-size: 8px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(250,247,242,0.35);
    opacity: 0;
    animation: fadeIn 1s ease forwards;
    animation-delay: 1.3s;
}

.scroll-hint::after {
    content: "";
    display: block;
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--gold), transparent);
    animation: pulse 2s ease-in-out infinite;
}

/* ════════════════════════════
   SLIDE 2 — GALLERY
   ════════════════════════════ */
.works-section {
    /* Use auto height instead of min-height: 100vh to avoid excess blank space */
    padding: 80px 0 80px;
    background: var(--dark-mid);
    border-top: 1px solid var(--border);
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 60px;
}

/* ── GALLERY ── */
.gallery-wrapper {
    display: flex;
    align-items: center;
    gap: 24px;
}

.work-viewport {
    overflow: hidden;
    flex: 1;
    /* Ensure viewport doesn't clip overlay text */
    position: relative;
}

.work-list {
    display: flex;
    transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
    /* Prevent list from collapsing */
    align-items: stretch;
}

/* ── WORK CARDS ── */
.work {
    flex: 0 0 33.3333%;
    padding: 0 10px;
    position: relative;
    /* FIXED: don't clip overflow so overlay isn't cut off on smaller screens */
    overflow: visible;
    cursor: pointer;
}

/* Clip wrapper — this sits between .work and its contents, so overflow:hidden
   only clips within the card area, not the nav buttons */
.work-inner {
    position: relative;
    overflow: hidden;
    width: 100%;
}

.work img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: contain;
    object-position: center top;
    display: block;
    transition: transform 0.6s ease;
    filter: brightness(0.92);
}

.work:hover .work-inner img,
.work.layer-visible .work-inner img {
    transform: scale(1.04);
    filter: brightness(0.65);
}

/* Overlay — now positioned inside .work-inner */
.layer {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;  /* CHANGED: center vertically so text never clips at bottom */
    padding: 16px 14px;
    background: var(--overlay);
    opacity: 0;
    transition: opacity 0.45s ease;
    text-align: center;
    /* Allow internal scroll if content somehow overflows */
    overflow-y: auto;
}

.work:hover .layer { opacity: 1; }
.work.layer-visible .layer { opacity: 1; }

.layer h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(15px, 1.6vw, 22px);
    font-weight: 400;
    letter-spacing: 2px;
    color: var(--cream);
    margin-bottom: 8px;
    flex-shrink: 0;
}

.layer h3::before {
    content: "";
    display: block;
    width: 36px;
    height: 1px;
    background: var(--gold);
    margin: 0 auto 10px;
}

.layer p {
    font-family: 'Raleway', sans-serif;
    font-size: clamp(10px, 1vw, 12px);
    font-weight: 300;
    line-height: 1.65;
    letter-spacing: 0.5px;
    color: rgba(250,247,242,0.75);
    max-width: 220px;
    flex-shrink: 0;
}

/* ── NAV BUTTONS ── */
.nav-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid rgba(200,164,93,0.5);
    background: transparent;
    color: var(--gold);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.3s, border-color 0.3s, color 0.3s;
    /* Keep buttons above anything */
    position: relative;
    z-index: 2;
}

.nav-btn:hover:not(:disabled) {
    background: var(--gold);
    color: var(--dark);
    border-color: var(--gold);
}

.nav-btn:disabled { visibility: hidden; }

/* ── DOTS ── */
.dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 40px;
}

.dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    border: 1px solid rgba(200,164,93,0.5);
    background: transparent;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s, border-color 0.3s;
    /* Bigger tap target on touch */
    padding: 8px;
    background-clip: content-box;
    -webkit-background-clip: content-box;
}

.dot.active {
    background: var(--gold);
    background-clip: content-box;
    -webkit-background-clip: content-box;
    border-color: var(--gold);
    transform: scale(1.4);
}

/* ── FOOTER ── */
.site-footer {
    background: var(--dark-mid);
    border-top: 1px solid var(--border);
    width: 100%;
    padding: 20px 40px;
    text-align: center;
    font-family: 'Raleway', sans-serif;
    font-size: clamp(8px, 2.5vw, 10px);
    letter-spacing: clamp(1px, 0.5vw, 3px);
    font-weight: 300;
    text-transform: uppercase;
    color: rgba(250,247,242,0.28);
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse {
    0%, 100% { opacity: 0.3; }
    50%       { opacity: 1; }
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
    .container { padding: 0 36px; }
    nav { padding: 20px 36px; }

    .site-footer {
        padding: 16px 12px; /* reduce side gaps */
    }

    .layer h3 { font-size: clamp(14px, 2vw, 20px); }
    .layer p  { font-size: clamp(10px, 1.2vw, 13px); }
}

@media (max-width: 768px) {
    nav { padding: 16px 24px; justify-content: center; }
    nav ul li:not(:last-child)::after { margin: 0 14px; }

    .works-title { letter-spacing: 4px; }
    .works-section { padding: 60px 0 60px; }
    .container { padding: 0 16px; }

    .gallery-wrapper { gap: 12px; }

    .site-footer {
        padding: 16px 12px; /* reduce side gaps */
    }

    .work { flex: 0 0 50%; }
    .nav-btn { width: 38px; height: 38px; font-size: 15px; }

    /* On tablet, overlay always shows text legibly */
    .layer { padding: 12px 10px; }
    .layer h3 { font-size: 16px; }
    .layer p  { font-size: 11px; max-width: 180px; }
}

@media (max-width: 480px) {
    nav { padding: 14px 16px; }
    nav ul li:not(:last-child)::after { margin: 0 10px; }
    nav ul li a { font-size: 9px; letter-spacing: 2px; gap: 5px; }
    nav ul li a svg { width: 12px; height: 12px; }

    .works-title { letter-spacing: 2px; }
    .works-section { padding: 50px 0 50px; }
    .container { padding: 0 12px; }

    .site-footer {
        padding: 16px 12px; /* reduce side gaps */
    }

    .gallery-wrapper { gap: 8px; }
    .work { flex: 0 0 100%; }
    .nav-btn { width: 34px; height: 34px; font-size: 13px; }

    .layer { padding: 16px 12px; }
    .layer h3 { font-size: 18px; letter-spacing: 1.5px; }
    .layer p  { font-size: 12px; max-width: 260px; line-height: 1.6; }
}

/* ── TOUCH DEVICES: always show overlay on tap, style accordingly ── */
@media (hover: none) {
    /* On touch, show a subtle hint that cards are tappable */
    .work img {
        filter: brightness(0.85);
    }

    .site-footer {
        padding: 16px 12px; /* reduce side gaps */
    }
}