/* ============================================
   Work Section Styles
   Requires ../styles.css to be loaded first
   ============================================ */

/* ── Password Gate ───────────────────────── */

.gate-overlay {
    position: fixed;
    inset: 0;
    background: var(--color-bg);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.gate-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.gate-card {
    width: 100%;
    max-width: 420px;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    text-align: center;
}

.gate-icon {
    width: 56px;
    height: 56px;
    background: var(--color-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.75rem;
}

.gate-icon svg {
    width: 24px;
    height: 24px;
    color: var(--color-text);
}

.gate-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.gate-card p {
    font-size: 0.95rem;
    max-width: none;
    margin-bottom: 2rem;
}

.gate-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.gate-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.gate-input {
    width: 100%;
    padding: 0.875rem 3rem 0.875rem 1.25rem;
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s ease;
}

.gate-input:focus {
    border-color: var(--color-text);
}

.gate-reveal {
    position: absolute;
    right: 0.875rem;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    transition: color 0.2s ease;
}

.gate-reveal:hover {
    color: var(--color-text);
}

.gate-input.error {
    border-color: #e53e3e;
    animation: shake 0.35s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.gate-submit {
    width: 100%;
    padding: 0.875rem;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text);
    background: var(--color-accent);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gate-submit:hover {
    background: var(--color-accent-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(237, 255, 0, 0.4);
}

.gate-error {
    font-size: 0.85rem;
    color: #e53e3e;
    opacity: 0;
    transition: opacity 0.2s ease;
    height: 1em;
}

.gate-error.visible {
    opacity: 1;
}

.gate-home-link {
    display: block;
    margin-top: 20px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.gate-home-link:hover {
    color: var(--color-text);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* ── Work Listing Page ───────────────────── */

.work-hero {
    padding: 10rem 2rem 5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.work-hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 1rem;
}

.work-hero p {
    font-size: 1.1rem;
    max-width: 50ch;
}

.work-listing {
    padding: 0 2rem 8rem;
    max-width: 1400px;
    margin: 0 auto;
}

.work-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.work-card {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.work-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.08);
    border-color: var(--color-accent);
}

.work-card-cover {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    position: relative;
}

.work-card-cover-inner {
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.work-card:hover .work-card-cover-inner {
    transform: scale(1.04);
}

.work-card-body {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.work-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.work-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text);
    background: var(--color-accent);
    padding: 0.3rem 0.65rem;
    border-radius: 50px;
}

.work-card-body h2 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.work-card-body p {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex: 1;
}

.work-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
    transition: gap 0.3s ease;
}

.work-card:hover .work-card-cta {
    gap: 0.7rem;
}

.work-card-cta svg {
    transition: transform 0.3s ease;
}

.work-card:hover .work-card-cta svg {
    transform: translate(3px, -3px);
}

/* ── Case Study Page ─────────────────────── */

/* Hero */
.cs-hero {
    background: var(--color-text);
    color: var(--color-bg);
    padding: 8rem 2rem 5rem;
    position: relative;
    overflow: hidden;
}

.cs-hero::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 240px;
    height: 240px;
    background: var(--color-accent);
    opacity: 0.12;
    border-radius: 50%;
}

.cs-hero-inner {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.cs-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 252, 246, 0.6);
    text-decoration: none;
    margin-bottom: 2.5rem;
    transition: color 0.2s ease;
}

.cs-back:hover {
    color: var(--color-bg);
}

.cs-back svg {
    transition: transform 0.2s ease;
}

.cs-back:hover svg {
    transform: translateX(-3px);
}

.cs-hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--color-bg);
    margin-bottom: 1rem;
    max-width: 18ch;
}

.cs-hero-subtitle {
    font-size: 1.15rem;
    color: rgba(255, 252, 246, 0.7);
    max-width: 55ch;
    margin-bottom: 2.5rem;
}

.cs-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

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

.cs-meta-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 252, 246, 0.45);
}

.cs-meta-value {
    font-size: 0.95rem;
    font-weight: 500;
    color: rgba(255, 252, 246, 0.9);
}

/* Body layout */
.cs-body {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 8rem;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 5rem;
    align-items: start;
}

/* Sidebar */
.cs-sidebar {
    position: sticky;
    top: 90px;
    padding-top: 4rem;
}

.cs-sidebar-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-muted);
    text-decoration: none;
    margin-bottom: 1.5rem;
    transition: color 0.2s ease;
}

.cs-sidebar-back:hover {
    color: var(--color-text);
}

.cs-sidebar-back svg {
    transition: transform 0.2s ease;
}

.cs-sidebar-back:hover svg {
    transform: translateX(-3px);
}

.cs-sidebar-divider {
    height: 1px;
    background: var(--color-border);
    margin-bottom: 1.5rem;
}

.cs-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    list-style: none;
}

.cs-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    border-left: 2px solid transparent;
    transition: all 0.2s ease;
}

.cs-nav-link:hover {
    color: var(--color-text);
    background: rgba(0, 0, 0, 0.03);
}

.cs-nav-link.active {
    color: var(--color-text);
    border-left-color: var(--color-accent);
    background: rgba(237, 255, 0, 0.08);
}

.cs-nav-num {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--color-text-muted);
    min-width: 1.5em;
    transition: color 0.2s ease;
}

.cs-nav-link.active .cs-nav-num {
    color: var(--color-text);
}

/* Content area */
.cs-content {
    min-width: 0;
}

.cs-section {
    padding: 4rem 0;
    border-bottom: 1px solid var(--color-border);
}

.cs-section:first-child {
    padding-top: 4rem;
}

.cs-section:last-child {
    border-bottom: none;
}

.cs-section > .section-label {
    display: inline-block;
    margin-bottom: 0.75rem;
}

.cs-section h2 {
    margin-bottom: 1.5rem;
}

.cs-section p {
    max-width: 65ch;
    font-size: 1.05rem;
    margin-bottom: 1.25rem;
}

/* Section components */
.cs-callout {
    border-left: 3px solid var(--color-accent);
    background: rgba(237, 255, 0, 0.06);
    padding: 1.25rem 1.5rem;
    border-radius: 0 12px 12px 0;
    margin: 2rem 0;
}

.cs-callout p {
    margin: 0;
    font-size: 1rem;
    font-style: italic;
    font-family: var(--font-serif);
}

.cs-stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin: 2.5rem 0;
}

.cs-stat {
    padding: 1.5rem;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    text-align: center;
}

.cs-stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.cs-stat-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.cs-image-block {
    margin: 2.5rem 0;
}

.cs-image-block img,
.cs-image-placeholder {
    width: 100%;
    border-radius: 16px;
    display: block;
    border: 1px solid var(--color-border);
}

.cs-image-placeholder {
    aspect-ratio: 16 / 9;
}

.cs-image-caption {
    font-size: 0.825rem;
    color: var(--color-text-muted);
    margin-top: 0.75rem;
    text-align: center;
}

.cs-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

/* ── Responsive ──────────────────────────── */

@media (max-width: 1024px) {
    .work-grid {
        grid-template-columns: 1fr;
    }

    .cs-body {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .cs-sidebar {
        position: relative;
        top: 0;
        padding-top: 2rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid var(--color-border);
    }

    .cs-sidebar-back {
        display: none;
    }

    .cs-sidebar-divider {
        display: none;
    }

    .cs-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .cs-nav-link {
        border-left: none;
        border-bottom: 2px solid transparent;
        border-radius: 8px;
        padding: 0.5rem 0.75rem;
    }

    .cs-nav-link.active {
        border-left-color: transparent;
        border-bottom-color: var(--color-accent);
    }

    .cs-nav-num {
        display: none;
    }

    .cs-stat-row {
        grid-template-columns: 1fr 1fr;
    }

    .cs-two-col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .work-hero {
        padding: 8rem 1.5rem 3rem;
    }

    .work-listing {
        padding: 0 1.5rem 5rem;
    }

    .cs-hero {
        padding: 7rem 1.5rem 3.5rem;
    }

    .cs-body {
        padding: 0 1.5rem 5rem;
    }

    .cs-meta {
        gap: 1.25rem;
    }

    .cs-stat-row {
        grid-template-columns: 1fr;
    }
}
