/* ============================================
   DEEP CASE STUDY — premium subpage
   ============================================ */

/* Reveal primitive (shared with work.css) */
.reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}
.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal[data-delay='100'] { transition-delay: 0.1s; }
.reveal[data-delay='200'] { transition-delay: 0.2s; }
.reveal[data-delay='300'] { transition-delay: 0.3s; }

/* Hero */
.cs-hero {
    position: relative;
    padding: 9rem 0 6rem;
    color: var(--white);
    overflow: hidden;
    isolation: isolate;
}

.cs-hero.theme-hidaya {
    background:
        linear-gradient(135deg, #2a1608 0%, #4f2500 50%, #2a1608 100%);
}
.cs-hero.theme-hidaya::before {
    content: '';
    position: absolute;
    inset: -10%;
    background:
        radial-gradient(ellipse 60% 45% at 25% 30%, rgba(199, 143, 93, 0.4) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 80% 70%, rgba(255, 200, 87, 0.15) 0%, transparent 55%);
    animation: meshDrift 22s ease-in-out infinite alternate;
    z-index: -1;
}

.cs-hero.theme-alazhar {
    background:
        linear-gradient(135deg, #0f1736 0%, #2f3d86 50%, #151f4a 100%);
}
.cs-hero.theme-alazhar::before {
    content: '';
    position: absolute;
    inset: -10%;
    background:
        radial-gradient(ellipse 60% 45% at 20% 25%, rgba(249, 146, 42, 0.3) 0%, transparent 55%),
        radial-gradient(ellipse 55% 45% at 85% 80%, rgba(151, 179, 255, 0.25) 0%, transparent 55%);
    animation: meshDrift 22s ease-in-out infinite alternate;
    z-index: -1;
}

@keyframes meshDrift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-40px, 30px) scale(1.12); }
}

.cs-hero-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 4rem;
    align-items: center;
}

.cs-crumb {
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 1.5rem;
}
.cs-crumb a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: color 0.3s ease;
}
.cs-crumb a:hover { color: var(--gold); }

.cs-hero h1 {
    font-size: clamp(2.4rem, 5.5vw, 4.25rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.05;
    margin-bottom: 1.25rem;
}

.cs-hero .sub {
    font-size: clamp(1.05rem, 1.6vw, 1.3rem);
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.65;
    margin-bottom: 2rem;
    max-width: 560px;
}

.cs-hero-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

.cs-hero-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.cs-hero-meta svg { color: var(--gold); }

.cs-hero-ctas {
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.cs-hero-ctas .btn {
    padding: 0.95rem 1.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.cs-hero-ctas .btn-primary {
    background: var(--gold);
    color: var(--accent-color);
    box-shadow: 0 14px 34px -12px rgba(255, 200, 87, 0.55);
}
.cs-hero-ctas .btn-primary:hover {
    background: var(--gold-light);
    transform: translateY(-3px);
    box-shadow: 0 20px 44px -12px rgba(255, 200, 87, 0.75);
}

.cs-hero-ctas .btn-ghost {
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}
.cs-hero-ctas .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-3px);
}

.cs-hero-visual {
    position: relative;
    perspective: 1500px;
}

.cs-hero-visual .browser-frame {
    position: relative;
    background: linear-gradient(180deg, #1a1a1f 0%, #0f0f14 100%);
    border-radius: 14px 14px 12px 12px;
    padding: 12px 12px 0;
    box-shadow:
        0 50px 100px -20px rgba(0, 0, 0, 0.55),
        0 30px 60px -30px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    transform: rotateY(-6deg) rotateX(3deg);
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.cs-hero-visual .browser-frame:hover {
    transform: rotateY(0) rotateX(0) translateY(-6px);
}

.browser-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0 10px;
}
.browser-bar span {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #424249;
}
.browser-bar span:nth-child(1) { background: #ff5f57; }
.browser-bar span:nth-child(2) { background: #febc2e; }
.browser-bar span:nth-child(3) { background: #28c840; }
.browser-url {
    flex: 1;
    margin-left: 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    padding: 5px 12px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.76rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.browser-frame img {
    display: block;
    width: 100%;
    border-radius: 0 0 10px 10px;
    background: #fff;
}

.cs-hero-visual .mobile-shot {
    position: absolute;
    bottom: -50px;
    right: -30px;
    width: 130px;
    border-radius: 22px;
    border: 8px solid #111;
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.6);
    background: #fff;
    overflow: hidden;
    animation: floatIn 8s ease-in-out infinite;
}
.cs-hero-visual .mobile-shot img {
    display: block;
    width: 100%;
}

@keyframes floatIn {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* ------- Panels ------- */
.cs-panel {
    padding: 5rem 0;
    background: var(--white);
}
.cs-panel.alt { background: var(--bg-light); }

.cs-panel .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.cs-panel-head {
    max-width: 720px;
    margin: 0 auto 3.5rem;
    text-align: center;
}

.cs-panel-head .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    background: linear-gradient(135deg, rgba(113, 23, 242, 0.08), rgba(30, 31, 99, 0.08));
    color: var(--primary-color);
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 1.25rem;
}

.cs-panel-head h2 {
    font-size: clamp(1.9rem, 3.6vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-dark);
    margin-bottom: 0.85rem;
}

.cs-panel-head p {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

/* Problem / Solution split */
.cs-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

.cs-split-card {
    padding: 2.5rem;
    border-radius: var(--radius-2xl);
    position: relative;
    overflow: hidden;
}

.cs-split-card.problem {
    background: var(--white);
    border: 1px solid rgba(239, 68, 68, 0.15);
}
.cs-split-card.solution {
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 100%);
    color: var(--white);
    border: 1px solid rgba(113, 23, 242, 0.2);
}

.cs-split-card h3 {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.cs-split-card.problem h3 { color: var(--error); }
.cs-split-card.problem h3 svg {
    width: 36px;
    height: 36px;
    padding: 8px;
    box-sizing: border-box;
    border-radius: var(--radius-md);
    background: rgba(239, 68, 68, 0.12);
}

.cs-split-card.solution h3 svg {
    width: 36px;
    height: 36px;
    padding: 8px;
    box-sizing: border-box;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--gold), #ff9f43);
    color: var(--accent-color);
}

.cs-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.cs-list li {
    padding: 0.6rem 0 0.6rem 1.9rem;
    position: relative;
    line-height: 1.6;
    font-size: 0.98rem;
    color: var(--text-dark);
}
.cs-split-card.solution .cs-list li { color: rgba(255, 255, 255, 0.85); }

.cs-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.9rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    background-image: linear-gradient(135deg, var(--primary-color), var(--primary-light));
}

.cs-split-card.problem .cs-list li::before {
    background: var(--error);
    background-image: none;
}

.cs-list li::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1.2rem;
    width: 6px;
    height: 3px;
    border-bottom: 2px solid white;
    border-left: 2px solid white;
    transform: rotate(-45deg);
}

.cs-split-card.problem .cs-list li::after {
    content: '×';
    position: absolute;
    left: 4px;
    top: 0.72rem;
    width: 10px;
    height: 10px;
    color: white;
    font-size: 0.9rem;
    font-weight: 700;
    border: none;
    transform: none;
}

/* Feature grid */
.cs-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.cs-feature {
    padding: 2rem 1.75rem;
    background: var(--white);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-xl);
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overflow: hidden;
}

.cs-panel.alt .cs-feature { background: var(--white); }

.cs-feature::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease;
}

.cs-feature:hover {
    transform: translateY(-6px);
    box-shadow: 0 25px 50px -18px rgba(113, 23, 242, 0.25);
    border-color: transparent;
}

.cs-feature:hover::before { transform: scaleX(1); }

.cs-feature-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(113, 23, 242, 0.1), rgba(30, 31, 99, 0.1));
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    font-size: 1.15rem;
    transition: all 0.4s ease;
}

.cs-feature:hover .cs-feature-icon {
    background: var(--gradient);
    color: var(--white);
    transform: scale(1.08);
}

.cs-feature h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.cs-feature p {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.65;
}

/* Gallery */
.cs-gallery {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: auto auto;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.cs-gallery-item {
    border-radius: var(--radius-xl);
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.18);
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    background: linear-gradient(135deg, #0f0c29, #302b63);
}

.cs-gallery-item:hover { transform: translateY(-6px); }

.cs-gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cs-gallery-item.wide { grid-column: 1 / -1; aspect-ratio: 21 / 9; }
.cs-gallery-item.tall { grid-row: span 2; aspect-ratio: 2 / 3; max-height: 520px; }
.cs-gallery-item.half { aspect-ratio: 16 / 10; }

.cs-gallery-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem 1.25rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.82));
    color: var(--white);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* Outcomes banner */
.cs-outcomes {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    max-width: 1100px;
    margin: 0 auto;
}

.cs-outcome {
    padding: 2rem 1.5rem;
    background: var(--white);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-xl);
    text-align: center;
    transition: all 0.4s ease;
}

.cs-panel.alt .cs-outcome { background: var(--white); }

.cs-outcome:hover {
    transform: translateY(-6px);
    box-shadow: 0 25px 50px -20px rgba(113, 23, 242, 0.2);
}

.cs-outcome-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--gold), #ff9f43);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    font-size: 1.2rem;
    color: var(--accent-color);
    box-shadow: 0 14px 30px -12px rgba(255, 200, 87, 0.45);
}

.cs-outcome strong {
    display: block;
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 0.4rem;
    font-weight: 800;
}

.cs-outcome span {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.55;
}

/* Tech stack */
.cs-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    justify-content: center;
    max-width: 820px;
    margin: 0 auto;
}

.cs-stack-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.25rem;
    background: var(--white);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.cs-panel.alt .cs-stack-pill { background: var(--white); }

.cs-stack-pill:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -12px rgba(113, 23, 242, 0.3);
}

.cs-stack-pill svg { color: var(--primary-color); }

/* Quote */
.cs-quote {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2.5rem;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #1e1f63 100%);
    color: var(--white);
    border-radius: var(--radius-2xl);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cs-quote::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at top, rgba(255, 200, 87, 0.15), transparent 55%);
}

.cs-quote > * { position: relative; z-index: 1; }

.cs-quote-mark {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--gold), #ff9f43);
    color: var(--accent-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.cs-quote p {
    font-size: clamp(1.15rem, 2vw, 1.4rem);
    line-height: 1.65;
    font-style: italic;
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.92);
}

.cs-quote cite {
    display: block;
    font-style: normal;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Next / related */
.cs-next {
    padding: 5rem 0;
    background: var(--bg-light);
}

.cs-next h3 {
    text-align: center;
    font-size: clamp(1.7rem, 3vw, 2.1rem);
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 2.5rem;
    letter-spacing: -0.01em;
}

.cs-next-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.cs-next-card {
    position: relative;
    display: block;
    padding: 2rem;
    background: var(--white);
    border-radius: var(--radius-xl);
    text-decoration: none;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.4s ease;
    overflow: hidden;
}

.cs-next-card::after {
    content: '→';
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.15rem;
    transition: all 0.4s ease;
}

.cs-next-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary-color);
    box-shadow: 0 25px 50px -20px rgba(113, 23, 242, 0.25);
}

.cs-next-card:hover::after {
    background: var(--gradient);
    color: var(--white);
    transform: translateX(4px);
}

.cs-next-card .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.cs-next-card h4 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.cs-next-card p {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.55;
    max-width: 80%;
}

/* CTA */
.cs-cta {
    padding: 5rem 0;
    background: var(--white);
}

.cs-cta-inner {
    max-width: 900px;
    margin: 0 auto 0;
    padding: 4rem 2.5rem;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #1e1f63 100%);
    color: var(--white);
    border-radius: var(--radius-2xl);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cs-cta-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 55% 45% at 20% 25%, rgba(151, 71, 255, 0.35) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 80% 75%, rgba(255, 200, 87, 0.2) 0%, transparent 55%);
    animation: meshDrift 18s ease-in-out infinite alternate;
}

.cs-cta-inner > * { position: relative; z-index: 1; }

.cs-cta-inner h2 {
    font-size: clamp(1.8rem, 3.6vw, 2.4rem);
    font-weight: 800;
    margin-bottom: 0.85rem;
}

.cs-cta-inner p {
    color: rgba(255, 255, 255, 0.78);
    max-width: 520px;
    margin: 0 auto 2rem;
    line-height: 1.65;
}

.cs-cta-inner .btn-primary {
    background: var(--gold);
    color: var(--accent-color);
    padding: 0.95rem 2rem;
    font-weight: 700;
    box-shadow: 0 18px 40px -15px rgba(255, 200, 87, 0.6);
}

.cs-cta-inner .btn-primary:hover {
    background: var(--gold-light);
    transform: translateY(-3px);
    box-shadow: 0 24px 50px -15px rgba(255, 200, 87, 0.8);
}

/* ------- Responsive ------- */
@media (max-width: 1024px) {
    .cs-hero-inner { grid-template-columns: 1fr; gap: 3rem; }
    .cs-hero-visual .mobile-shot { right: 20px; width: 110px; }
    .cs-split { grid-template-columns: 1fr; }
    .cs-features { grid-template-columns: repeat(2, 1fr); }
    .cs-outcomes { grid-template-columns: repeat(2, 1fr); }
    .cs-gallery { grid-template-columns: 1fr 1fr; }
    .cs-gallery-item.wide { grid-column: 1 / -1; }
    .cs-gallery-item.tall { grid-row: auto; aspect-ratio: 16 / 10; max-height: none; }
    .cs-next-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .cs-hero { padding: 6rem 0 4rem; }
    .cs-hero-visual .browser-frame { transform: none; }
    .cs-hero-visual .mobile-shot { display: none; }
    .cs-panel { padding: 4rem 0; }
    .cs-features { grid-template-columns: 1fr; }
    .cs-outcomes { grid-template-columns: 1fr 1fr; }
    .cs-gallery { grid-template-columns: 1fr; }
    .cs-split-card { padding: 1.75rem; }
    .cs-cta-inner { padding: 3rem 1.5rem; }
}

@media (max-width: 480px) {
    .cs-hero-ctas { flex-direction: column; }
    .cs-hero-ctas .btn { width: 100%; justify-content: center; }
    .cs-outcomes { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .cs-hero::before, .cs-cta-inner::before { animation: none !important; }
    .cs-hero-visual .mobile-shot, .cs-hero-visual .browser-frame { animation: none !important; transform: none !important; }
    .reveal { opacity: 1; transform: none; transition: none; }
}

/* Inline SVG icons (replaced the legacy icon font). Size and color inherit
   from each icon's context; these are the shared defaults. */
.svg-icon {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
    vertical-align: -0.125em;
}
