/* ── Noise Overlay ─────────────────────────────────────────── */
.noise-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ── Glass Nav ─────────────────────────────────────────────── */
.glass-card {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.04);
}

/* ── Transitions ───────────────────────────────────────────── */
.transition-fast   { transition: all 0.2s ease; }
.transition-smooth { transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); }

/* ── Underline Hover ───────────────────────────────────────── */
.underline-hover { position: relative; }
.underline-hover::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: currentColor;
    transition: width 0.3s ease;
}
.underline-hover:hover::after { width: 100%; }

/* ── Section Label ─────────────────────────────────────────── */
.section-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(34, 34, 34, 0.04);
    border: 1px solid rgba(34, 34, 34, 0.08);
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(34, 34, 34, 0.55);
}
.section-label::before {
    content: '';
    width: 5px;
    height: 5px;
    background: #222222;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Reveal Animation ──────────────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.active { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
}

/* ── Mobile Menu ───────────────────────────────────────────── */
.mobile-menu {
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.mobile-menu.open { transform: translateX(0); }

/* ── Gradient Mesh Background ──────────────────────────────── */
.gradient-mesh {
    background: linear-gradient(135deg, #fafafa 0%, #f5f3f1 50%, #fafafa 100%);
}

/* ── Case Study Hero ───────────────────────────────────────── */
.case-study-hero {
    padding-top: 9rem;
    padding-bottom: 4rem;
}

/* ── Back Link ─────────────────────────────────────────────── */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    transition: color 0.2s ease, gap 0.2s ease;
    text-decoration: none;
}
.back-link:hover { color: #111827; gap: 8px; }
.back-link svg { transition: transform 0.2s ease; flex-shrink: 0; }
.back-link:hover svg { transform: translateX(-2px); }

/* ── Hero Stat Bar ─────────────────────────────────────────── */
.stat-card {
    padding: 1.25rem 1.5rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    text-align: center;
}
.stat-card-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    line-height: 1;
    margin-bottom: 0.25rem;
}
.stat-card-label {
    font-size: 0.75rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
}

/* ── Image Placeholder ─────────────────────────────────────── */
.img-placeholder {
    position: relative;
    background: #f3f4f6;
    border: 2px dashed #d1d5db;
    border-radius: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: #9ca3af;
    overflow: hidden;
    user-select: none;
}
.img-placeholder-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 1;
}
.img-placeholder-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}
.img-placeholder-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #9ca3af;
}
.img-placeholder-hint {
    font-size: 0.6875rem;
    color: #c4c9d4;
}

/* dark grid bg for screen mockups */
.img-placeholder-dark {
    background: #1a1f2e;
    border-color: #2d3748;
}
.img-placeholder-dark .img-placeholder-icon {
    background: #2d3748;
    color: #64748b;
}
.img-placeholder-dark .img-placeholder-label,
.img-placeholder-dark .img-placeholder-hint {
    color: #4b5563;
}

/* ── Project Meta Sidebar ──────────────────────────────────── */
.meta-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 1.25rem;
    padding: 1.75rem;
}
.meta-row {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f3f4f6;
}
.meta-row:last-child { border-bottom: none; }
.meta-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #9ca3af;
    margin-bottom: 0.25rem;
}
.meta-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

/* ── Feature Cards ─────────────────────────────────────────── */
.feature-card {
    padding: 1.75rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 1.25rem;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.feature-card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.07);
    transform: translateY(-4px);
}
.feature-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.875rem;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: #374151;
}

/* ── Tech Pills ────────────────────────────────────────────── */
.tech-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 100px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
}
.tech-pill-dark {
    background: #1f2937;
    border-color: #374151;
    color: #d1d5db;
}

/* ── Challenge / Solution Columns ──────────────────────────── */
.challenge-block {
    padding: 2rem;
    background: #fff8f0;
    border: 1px solid #fed7aa;
    border-radius: 1.25rem;
}
.solution-block {
    padding: 2rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 1.25rem;
}

/* ── Hero Stats Row ────────────────────────────────────────── */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-top: 2.5rem;
}
@media (max-width: 640px) {
    .hero-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ── Features Grid ─────────────────────────────────────────── */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}
@media (max-width: 1024px) {
    .features-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .features-grid { grid-template-columns: 1fr; }
}

/* ── Results Banner ────────────────────────────────────────── */
.results-banner {
    background: #111827;
    color: #f9fafb;
    border-radius: 1.5rem;
    padding: 3rem;
}

/* inline security stats row */
.security-stats-row {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.875rem;
    overflow: hidden;
}
.security-stat-item {
    flex: 1;
    padding: 1.25rem 1.5rem;
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}
.security-stat-item:last-child { border-right: none; }
.security-stat-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.375rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    margin-bottom: 0.25rem;
}
.security-stat-label {
    font-size: 0.6875rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ── Gallery Grid ──────────────────────────────────────────── */
.gallery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 1.25rem;
}
.gallery-grid .gallery-hero {
    grid-column: 1 / -1;
}

@media (max-width: 640px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    .gallery-grid .gallery-hero {
        grid-column: 1;
    }
    .results-banner { padding: 2rem 1.5rem; }
    .security-stats-row { flex-direction: column; border-radius: 0.875rem; }
    .security-stat-item { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.1); }
    .security-stat-item:last-child { border-bottom: none; }
}

/* ── Prose ─────────────────────────────────────────────────── */
.prose-body {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: #374151;
}
.prose-body + .prose-body { margin-top: 1.25rem; }

/* ── Dark mode ─────────────────────────────────────────────── */
body.dark-theme .glass-card {
    background: rgba(17, 24, 39, 0.72);
    border-color: rgba(255, 255, 255, 0.08);
}
body.dark-theme .meta-card {
    background: #111827;
    border-color: #1f2937;
}
body.dark-theme .meta-row { border-bottom-color: #1f2937; }
body.dark-theme .meta-label { color: #6b7280; }
body.dark-theme .meta-value { color: #d1d5db; }
body.dark-theme .feature-card {
    background: #111827;
    border-color: #1f2937;
}
body.dark-theme .feature-icon { background: #1f2937; color: #9ca3af; }
body.dark-theme .img-placeholder { background: #0d1117; border-color: #1f2937; }
body.dark-theme .stat-card { background: #111827; border-color: #1f2937; }
body.dark-theme .stat-card-value { color: #f9fafb; }
body.dark-theme .tech-pill { background: #1f2937; border-color: #374151; color: #d1d5db; }
body.dark-theme .prose-body { color: #9ca3af; }
body.dark-theme .challenge-block { background: #1c1108; border-color: #78350f; }
body.dark-theme .solution-block { background: #052e16; border-color: #14532d; }
body.dark-theme .section-label {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.4);
}
body.dark-theme .section-label::before { background: #f9fafb; }
body.dark-theme .back-link { color: #6b7280; }
body.dark-theme .back-link:hover { color: #f9fafb; }

/* Tailwind utility overrides */
body.dark-theme .text-gray-900 { color: #f1f5f9 !important; }
body.dark-theme .text-gray-700 { color: #94a3b8 !important; }
body.dark-theme .text-gray-600 { color: #94a3b8 !important; }
body.dark-theme .text-gray-500 { color: #64748b !important; }
body.dark-theme .text-gray-400 { color: #475569 !important; }
body.dark-theme .bg-gray-50 { background-color: var(--surface-alt) !important; }
body.dark-theme .bg-white { background-color: var(--surface-solid) !important; }
body.dark-theme .border-gray-100 { border-color: var(--border-soft) !important; }
body.dark-theme .border-gray-300 { border-color: var(--border-color) !important; }
body.dark-theme .gradient-mesh { background: linear-gradient(135deg, #0c1420 0%, #091018 50%, #0c1420 100%); }

@media (prefers-color-scheme: dark) {
    body:not(.light-theme) .glass-card { background: rgba(17, 24, 39, 0.72); border-color: rgba(255, 255, 255, 0.08); }
    body:not(.light-theme) .meta-card { background: #111827; border-color: #1f2937; }
    body:not(.light-theme) .meta-row { border-bottom-color: #1f2937; }
    body:not(.light-theme) .meta-label { color: #6b7280; }
    body:not(.light-theme) .meta-value { color: #d1d5db; }
    body:not(.light-theme) .feature-card { background: #111827; border-color: #1f2937; }
    body:not(.light-theme) .feature-icon { background: #1f2937; color: #9ca3af; }
    body:not(.light-theme) .img-placeholder { background: #0d1117; border-color: #1f2937; }
    body:not(.light-theme) .stat-card { background: #111827; border-color: #1f2937; }
    body:not(.light-theme) .stat-card-value { color: #f9fafb; }
    body:not(.light-theme) .tech-pill { background: #1f2937; border-color: #374151; color: #d1d5db; }
    body:not(.light-theme) .prose-body { color: #9ca3af; }
    body:not(.light-theme) .challenge-block { background: #1c1108; border-color: #78350f; }
    body:not(.light-theme) .solution-block { background: #052e16; border-color: #14532d; }
    body:not(.light-theme) .section-label { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08); color: rgba(255,255,255,0.4); }
    body:not(.light-theme) .section-label::before { background: #f9fafb; }
    body:not(.light-theme) .back-link { color: #6b7280; }
    body:not(.light-theme) .back-link:hover { color: #f9fafb; }
    body:not(.light-theme) .text-gray-900 { color: #f1f5f9 !important; }
    body:not(.light-theme) .text-gray-700 { color: #94a3b8 !important; }
    body:not(.light-theme) .text-gray-600 { color: #94a3b8 !important; }
    body:not(.light-theme) .text-gray-500 { color: #64748b !important; }
    body:not(.light-theme) .text-gray-400 { color: #475569 !important; }
    body:not(.light-theme) .bg-gray-50 { background-color: var(--surface-alt) !important; }
    body:not(.light-theme) .bg-white { background-color: var(--surface-solid) !important; }
    body:not(.light-theme) .border-gray-100 { border-color: var(--border-soft) !important; }
    body:not(.light-theme) .border-gray-300 { border-color: var(--border-color) !important; }
    body:not(.light-theme) .gradient-mesh { background: linear-gradient(135deg, #0c1420 0%, #091018 50%, #0c1420 100%); }
}
