/* ============================================
   CASE STUDY — Dune Dark Theme
   ============================================ */

/* ── BODY PADDING FOR CASE STUDIES ── */
body {
    padding: var(--s-md);
}

/* ── SIDE NAVIGATION ── */
.cheeky-menu {
    position: fixed;
    top: 50vh;
    right: 0;
    transform: translateY(-50%);
    z-index: 9999;
    display: flex;
    align-items: center;
}

.bookmark-ribbon {
    width: 40px;
    height: 160px;
    background: rgba(15, 11, 7, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border-dim);
    border-right: none;
    border-radius: 10px 0 0 10px;
    color: var(--text-muted);
    transition: width 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), height 0.4s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
    position: relative;
}

.cheeky-menu.expanded .bookmark-ribbon {
    width: 260px;
    height: 340px;
    background: rgba(15, 11, 7, 0.95);
    border-color: var(--glass-border);
    align-items: flex-start;
    padding: 24px 28px;
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.7);
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    cursor: pointer;
    width: 120px;
    height: 36px;
    transform: rotate(-90deg);
    white-space: nowrap;
    outline: none;
    transition: color 0.25s ease;
    position: absolute;
    z-index: 10000;
}

.cheeky-menu.expanded .menu-toggle {
    transform: rotate(0deg);
    position: relative;
    width: 100%;
    height: auto;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--glass-border-dim);
    display: block;
    text-align: left;
    color: var(--text-primary);
    font-size: 0.68rem;
}

.cheeky-menu.expanded .menu-toggle::before { content: ''; }

.menu-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    visibility: hidden;
}

.cheeky-menu.expanded .menu-items {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transition-delay: 0.15s;
}

.menu-items a {
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    transition: all 0.2s ease;
    padding: 8px 0;
    width: 100%;
    display: block;
    border-bottom: 1px solid transparent;
}

.menu-items a:hover {
    color: var(--text-primary);
    border-bottom-color: var(--spice);
    transform: translateX(4px);
}

/* ── LAYOUT ── */
.book-layout {
    max-width: 900px;
    margin: 0 auto;
    padding-top: var(--s-md);
    padding-bottom: var(--s-lg);
}

/* ── CASE STUDY HEADER ── */
.cs-header {
    margin-bottom: var(--s-lg);
    max-width: 800px;
    padding-top: var(--s-md);
}

.cs-category {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--spice);
    margin-bottom: var(--s-sm);
    font-weight: 400;
    opacity: 0.85;
}

.cs-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 600;
    line-height: 1.05;
    color: var(--text-primary);
    letter-spacing: 0.02em;
    margin-bottom: var(--s-sm);
    text-transform: uppercase;
}

.cs-subtitle {
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: var(--s-md);
    line-height: 1.75;
    max-width: 680px;
    font-weight: 300;
}

.cs-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    border-top: 1px solid var(--glass-border-dim);
    padding-top: var(--s-sm);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-primary);
    opacity: 0.9;
    letter-spacing: 0.08em;
}

.meta-item strong {
    color: var(--spice);
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.62rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

/* ── CTA BUTTON ── */
.cta-button {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--spice);
    padding: 12px 24px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    margin-top: var(--s-sm);
    transition: all 0.3s ease;
    cursor: pointer;
}

.cta-button:hover {
    background: var(--glass-bg-high);
    border-color: var(--spice);
    color: var(--spice-bright);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(196, 148, 26, 0.12);
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-top: var(--s-sm);
}
.header-actions .cta-button { margin-top: 0; }

.cta-button--secondary {
    color: var(--text-muted);
    border-color: var(--glass-border-dim);
    background: transparent;
}

.cta-button--secondary:hover {
    color: var(--text-primary);
    border-color: var(--glass-border);
    background: var(--glass-bg);
}

/* ── CONTENT ── */
.cs-content { max-width: 800px; margin: 0 auto; }

.cs-section {
    margin-bottom: var(--s-lg);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.cs-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-header { margin-bottom: var(--s-sm); }

.section-header h2 {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 2.2vw, 1.85rem);
    font-weight: 500;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--glass-border-dim);
    padding-bottom: 0.75rem;
    display: inline-block;
}

.section-body p {
    font-size: 1.05rem;
    line-height: 1.85;
    margin-bottom: var(--s-sm);
    color: var(--text-muted);
    font-weight: 300;
}

/* ── DISCLAIMER BOX ── */
.disclaimer-box {
    border-left: 2px solid var(--spice);
    background: var(--glass-bg);
    padding: 1.5rem;
    margin: 2rem 0;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ── INSIGHT CARDS ── */
.insight-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s-sm);
    margin-top: var(--s-sm);
}

.insight-card {
    padding: var(--s-sm);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border-dim);
    border-radius: 2px;
    transition: border-color 0.25s ease, background 0.25s ease;
}

.insight-card:hover {
    border-color: var(--glass-border);
    background: var(--glass-bg-high);
}

.insight-card h3 {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--spice);
    margin-bottom: 0.6rem;
    font-weight: 400;
}

.insight-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 0;
    font-weight: 300;
}

/* ── VISUAL COMPARISON ── */
.visual-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s-md);
    margin: var(--s-md) 0;
}

.visual-block { text-align: center; }

.comparison-label {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    padding: 5px 14px;
    margin-bottom: var(--s-xs);
    display: inline-block;
    border-radius: 2px;
}

.before-label {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-dim);
    border: 1px solid var(--glass-border-dim);
}

.after-label {
    background: var(--glass-bg);
    color: var(--spice);
    border: 1px solid var(--glass-border);
}

.comparison-img {
    width: 100%;
    height: auto;
    min-height: 300px;
    max-height: 600px;
    object-fit: contain;
    border: 1px solid var(--glass-border-dim);
    background: var(--surface);
    display: block;
    transition: all 0.4s ease;
    cursor: zoom-in;
}

.comparison-img:hover {
    border-color: var(--glass-border);
    transform: scale(1.02);
}

/* ── FULL WIDTH ── */
.full-width-image { margin: var(--s-md) 0; }

/* ── CAPTIONS ── */
.caption {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-dim);
    text-align: center;
    display: block;
    margin-top: 0.6rem;
    letter-spacing: 0.06em;
}

/* ── TECH LIST ── */
.tech-list { list-style: none; margin-bottom: var(--s-sm); }

.tech-list li {
    padding: 0.4rem 0 0.4rem 1.5rem;
    position: relative;
    color: var(--text-muted);
    font-weight: 300;
    font-size: 0.95rem;
}

.tech-list li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: var(--spice);
    font-family: var(--font-mono);
}

/* ── COMPONENT LIST ── */
.component-list { list-style: none; margin: var(--s-sm) 0; }

.component-list li {
    padding: 0.75rem var(--s-sm);
    border-left: 2px solid var(--glass-border-dim);
    margin-bottom: 0.5rem;
    background: var(--glass-bg);
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 300;
}

.component-list li strong {
    color: var(--spice);
    display: block;
    margin-bottom: 0.2rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

/* ── PLACEHOLDER ── */
.placeholder-img {
    width: 100%;
    height: 300px;
    background: var(--glass-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    margin-bottom: var(--s-xs);
    border: 1px solid var(--glass-border-dim);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
}

/* ── SCREENSHOT GRID ── */
.screenshot-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s-sm);
    margin: var(--s-md) 0;
}

.screenshot-placeholder {
    height: 280px;
    border: 1px solid var(--glass-border-dim);
    background: var(--glass-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-dim);
    letter-spacing: 0.08em;
}

/* ── HERO IMAGE DISPLAY ── */
.hero-image-display { margin: var(--s-md) 0; }

.hero-image-display img {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    border: 1px solid var(--glass-border-dim);
    background: var(--surface);
    transition: border-color 0.3s ease;
}

.hero-image-display img:hover { border-color: var(--glass-border); }

/* ── USER DEFINITION ── */
.user-definition {
    background: var(--glass-bg);
    border-left: 2px solid var(--spice);
    padding: var(--s-sm);
    margin-bottom: var(--s-sm);
    border: 1px solid var(--glass-border-dim);
    border-left: 2px solid var(--spice);
    border-radius: 2px;
}

.user-definition h4 {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--spice);
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.user-definition p { margin-bottom: 0; font-size: 0.95rem; }

/* ── EXTENDED RESEARCH DIVIDER ── */
.research-divider {
    display: flex;
    align-items: center;
    gap: var(--s-sm);
    max-width: 800px;
    margin: var(--s-xl) auto var(--s-md);
}

.research-divider::before,
.research-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--glass-border-dim);
}

.research-divider__label {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--text-dim);
    white-space: nowrap;
    padding: 4px 12px;
    border: 1px solid var(--glass-border-dim);
}

/* ── FINDING LIST ── */
.finding-list {
    display: flex;
    flex-direction: column;
    gap: var(--s-sm);
    margin-top: var(--s-sm);
}

.finding-item {
    display: grid;
    grid-template-columns: 3rem 1fr;
    gap: var(--s-sm);
    padding: var(--s-sm);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border-dim);
    transition: border-color 0.25s ease, background 0.25s ease;
}

.finding-item:hover {
    border-color: var(--glass-border);
    background: var(--glass-bg-high);
}

.finding-number {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--spice-dim);
    padding-top: 0.15rem;
    letter-spacing: 0.06em;
}

.finding-content h3 {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.finding-content p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.75;
    margin-bottom: 0;
    font-weight: 300;
}

/* ── TECH STACK BLOCK ── */
.tech-stack-block {
    margin-top: var(--s-sm);
    border: 1px solid var(--glass-border-dim);
}

.tech-stack-heading {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-dim);
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--glass-border-dim);
    background: var(--glass-bg);
    font-weight: 400;
}

.tech-stack-grid { display: flex; flex-direction: column; }

.tech-stack-item {
    display: grid;
    grid-template-columns: 8rem 1fr;
    gap: var(--s-sm);
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--glass-border-dim);
    font-size: 0.88rem;
}

.tech-stack-item:last-child { border-bottom: none; }

.tech-stack-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--spice-dim);
    padding-top: 0.1rem;
    font-weight: 400;
}

.tech-stack-value {
    color: var(--text-muted);
    font-weight: 300;
    line-height: 1.55;
}

/* ── FOOTER ── */
.cs-footer {
    text-align: center;
    padding: var(--s-md) 0;
    border-top: 1px solid var(--glass-border-dim);
    margin-top: var(--s-xl);
}

.back-link-clean {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-dim);
    transition: color 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.back-link-clean::before {
    content: '←';
    color: var(--spice);
}

.back-link-clean:hover { color: var(--text-primary); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .cs-title { font-size: 2.2rem; }

    .cs-meta {
        flex-direction: column;
        gap: var(--s-xs);
    }

    .visual-comparison {
        grid-template-columns: 1fr;
    }

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

    .finding-item { grid-template-columns: 2.5rem 1fr; }

    .tech-stack-item { grid-template-columns: 1fr; gap: 0.2rem; }

    .header-actions { flex-direction: column; align-items: flex-start; }

    .cheeky-menu {
        top: 20px;
        right: 20px;
        transform: none;
    }

    .bookmark-ribbon {
        width: 42px;
        height: 42px;
        border-radius: 50%;
    }

    .menu-toggle {
        width: 100%;
        height: 100%;
        transform: rotate(0);
        font-size: 0.9rem;
    }

    .cheeky-menu.expanded .bookmark-ribbon {
        width: 240px;
        height: auto;
        min-height: 240px;
        border-radius: 10px 0 0 10px;
    }
}
