/* ==========================================================================
   TPF Case Study Stylesheet — Bespoke Modular Extensions
   Aesthetic aligned with Zatnum Design System & Clay.global benchmark
   ========================================================================== */

/* --- Case Study Header & Hero Meta --- */
.cs-hero-section {
    padding-top: 120px;
    padding-bottom: 60px;
    position: relative;
}

.cs-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    color: #ffffff;
    letter-spacing: 0.02em;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
}

.cs-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00e599;
    box-shadow: 0 0 10px #00e599;
    display: inline-block;
}

.cs-hero-title {
    font-size: clamp(2.6rem, 5.5vw, 4.8rem);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
    color: #ffffff;
}

.cs-hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.78);
    max-width: 840px;
    margin-bottom: 48px;
    font-weight: 400;
}

/* --- Project Metadata Matrix --- */
.cs-meta-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 24px 32px;
    background: rgba(18, 18, 22, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    margin-bottom: 60px;
}

.cs-meta-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.cs-meta-value {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.4;
}

.cs-meta-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.cs-tag {
    font-size: 11px;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.85);
}

/* --- Clay-Style Visual Mockup Frames --- */
.cs-browser-frame {
    background: #141419;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.05);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
    margin-bottom: 40px;
}

.cs-browser-frame:hover {
    transform: translateY(-4px);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.85), 0 0 40px rgba(255, 255, 255, 0.06);
}

.cs-browser-header {
    background: rgba(255, 255, 255, 0.04);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cs-browser-dots {
    display: flex;
    gap: 7px;
    align-items: center;
}

.cs-browser-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.cs-dot-red { background: #ff5f56; }
.cs-dot-yellow { background: #ffbd2e; }
.cs-dot-green { background: #27c93f; }

.cs-browser-bar {
    flex: 1;
    max-width: 480px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: monospace;
}

.cs-browser-content {
    position: relative;
    overflow: hidden;
    background: #0d0d11;
}

.cs-browser-content img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Sticky Sub-Navigation Bar --- */
.cs-sticky-toc {
    position: sticky;
    top: 90px;
    z-index: 90;
    margin: 30px auto 60px;
    display: flex;
    justify-content: center;
}

.cs-toc-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(18, 18, 22, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    padding: 6px 10px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    max-width: 100%;
    overflow-x: auto;
}

.cs-toc-link {
    padding: 7px 15px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.cs-toc-link:hover,
.cs-toc-link.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

/* --- Key Impact Metrics Section --- */
.cs-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 40px 0 70px;
}

.cs-metric-card {
    background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 32px 24px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.cs-metric-card:hover {
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.cs-metric-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.cs-metric-number {
    font-size: clamp(2.4rem, 4vw, 3.4rem);
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
    margin-bottom: 8px;
    letter-spacing: -0.03em;
}

.cs-metric-number span {
    color: #00e599;
}

.cs-metric-label {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 6px;
}

.cs-metric-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
}

/* --- Section Headings & Pacing --- */
.cs-section {
    padding: 80px 0;
    position: relative;
}

.cs-section-header {
    margin-bottom: 50px;
}

.cs-section-tag {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #00e599;
    font-weight: 700;
    margin-bottom: 12px;
    display: inline-block;
}

.cs-section-title {
    font-size: clamp(2rem, 3.8vw, 3.2rem);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #ffffff;
    margin-bottom: 16px;
}

.cs-section-lead {
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.75);
    max-width: 780px;
}

/* --- Dual-Stakeholder Comparison Cards --- */
.cs-dual-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin: 40px 0;
}

.cs-stakeholder-card {
    background: rgba(18, 18, 22, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 36px 32px;
    backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.cs-stakeholder-card:hover {
    border-color: rgba(255, 255, 255, 0.22);
    transform: translateY(-4px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.cs-stakeholder-badge {
    align-self: flex-start;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 20px;
}

.cs-badge-public {
    background: rgba(0, 229, 153, 0.12);
    color: #00e599;
    border: 1px solid rgba(0, 229, 153, 0.3);
}

.cs-badge-admin {
    background: rgba(94, 162, 255, 0.12);
    color: #5ea2ff;
    border: 1px solid rgba(94, 162, 255, 0.3);
}

.cs-feature-list {
    list-style: none;
    padding: 0;
    margin: 24px 0 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cs-feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14.5px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
}

.cs-feature-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #ffffff;
    flex-shrink: 0;
    margin-top: 2px;
}

/* --- Architecture & Code Diagrams --- */
.cs-arch-diagram-wrapper {
    background: #111116;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 32px;
    margin: 40px 0;
    position: relative;
    overflow: hidden;
}

.cs-arch-diagram-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cs-arch-boxes-flow {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    position: relative;
}

.cs-arch-node {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 24px 20px;
    transition: all 0.3s ease;
}

.cs-arch-node:hover {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.05);
}

.cs-arch-node-title {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cs-arch-node-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.5;
    margin: 0;
}

/* --- Step Timeline Pipeline --- */
.cs-timeline-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 40px 0;
}

.cs-timeline-step {
    background: rgba(18, 18, 22, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px 20px;
    position: relative;
}

.cs-step-num {
    font-size: 12px;
    font-weight: 700;
    color: #00e599;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.cs-step-title {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
}

.cs-step-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.5;
}

/* --- UI/UX Gallery Showcase Grid --- */
.cs-gallery-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 40px;
}

.cs-gallery-grid-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.cs-gallery-card {
    background: #141419;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.cs-gallery-card:hover {
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-6px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
}

.cs-gallery-media {
    position: relative;
    overflow: hidden;
    background: #0d0d11;
    aspect-ratio: 16 / 10;
}

.cs-gallery-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.cs-gallery-card:hover .cs-gallery-media img {
    transform: scale(1.03);
}

.cs-gallery-caption {
    padding: 24px;
    background: rgba(20, 20, 26, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cs-gallery-tag {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    color: #00e599;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
    display: block;
}

.cs-gallery-title {
    font-size: 17px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 6px;
}

.cs-gallery-text {
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.5;
    margin: 0;
}

/* --- Roadmap / Modernization List --- */
.cs-roadmap-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 40px 0;
}

.cs-roadmap-item {
    background: rgba(18, 18, 22, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px 28px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 24px;
    align-items: center;
    transition: all 0.3s ease;
}

.cs-roadmap-item:hover {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.03);
}

.cs-roadmap-phase {
    font-size: 12px;
    font-weight: 700;
    color: #00e599;
    background: rgba(0, 229, 153, 0.1);
    border: 1px solid rgba(0, 229, 153, 0.25);
    border-radius: 8px;
    padding: 6px 12px;
    text-transform: uppercase;
    white-space: nowrap;
}

.cs-roadmap-info h5 {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
}

.cs-roadmap-info p {
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.5;
    margin: 0;
}

.cs-roadmap-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #00e599;
    background: rgba(0, 229, 153, 0.08);
    padding: 4px 10px;
    border-radius: 50px;
    white-space: nowrap;
}

/* --- Tech Specs Table Matrix --- */
.cs-specs-table-wrapper {
    background: #121217;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    overflow: hidden;
    margin: 40px 0;
}

.cs-specs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.cs-specs-table th {
    background: rgba(255, 255, 255, 0.04);
    padding: 18px 24px;
    text-align: left;
    font-weight: 600;
    color: #ffffff;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cs-specs-table td {
    padding: 18px 24px;
    color: rgba(255, 255, 255, 0.75);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    line-height: 1.5;
}

.cs-specs-table tr:last-child td {
    border-bottom: none;
}

.cs-specs-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
    color: #ffffff;
}

.cs-layer-tag {
    font-weight: 600;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* --- Responsive Media Queries --- */
@media screen and (max-width: 1024px) {
    .cs-meta-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        padding: 24px;
    }
    .cs-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .cs-dual-grid {
        grid-template-columns: 1fr;
    }
    .cs-arch-boxes-flow {
        grid-template-columns: 1fr;
    }
    .cs-timeline-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .cs-gallery-grid-2col,
    .cs-gallery-grid-3col {
        grid-template-columns: 1fr;
    }
    .cs-roadmap-item {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media screen and (max-width: 640px) {
    .cs-meta-grid {
        grid-template-columns: 1fr;
    }
    .cs-metrics-grid {
        grid-template-columns: 1fr;
    }
    .cs-timeline-grid {
        grid-template-columns: 1fr;
    }
    .cs-hero-section {
        padding-top: 100px;
    }
    .cs-meta-grid,
    .cs-arch-diagram-wrapper {
        padding: 20px 16px;
    }
}
