/* ==========================================================================
   ALFATH MEDIA - PORTFOLIO PAGE STYLES
   Color Palette: Black (#000000), Charcoal (#111111), Cream (#F9EFE8), 
                  Blue (#1A5DAC), Grey (#A09FA3), Magenta (#9F1850), Purple (#8D1EA4)
   Typography System: Harmonized with Home Page (Oswald & Inter)
   ========================================================================== */

:root {
    --color-black: #000000;
    --color-charcoal: #111111;
    --color-cream: #F9EFE8;
    --color-blue: #1A5DAC;
    --color-white: #FFFFFF;
    --color-grey: #A09FA3;
    --color-dark-grey: #2C2C2C;
    
    --accent-magenta: #9F1850;
    --accent-purple: #8D1EA4;

    /* Home Page Font System */
    --font-heading: 'Oswald', sans-serif;
    --font-body: 'Inter', sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 18px;
    background-color: var(--color-black);
    color: var(--color-white);
}

body {
    font-family: var(--font-body);
    line-height: 1.8;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Eyebrow / Label Utility */
.section-label-blue {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--color-blue);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

/* ==========================================================================
   SECTION 1: HERO
   ========================================================================== */
.portfolio-hero {
    position: relative;
    width: 100%;
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 190px 6vw 130px 6vw;
    background-color: var(--color-black);
    overflow: hidden;
}

.hero-bg-wrapper {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.08); /* Initial zoom state for animation */
    will-change: transform;
}

.hero-dark-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 40%, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.92) 100%),
                linear-gradient(180deg, rgba(26, 93, 172, 0.2) 0%, rgba(0, 0, 0, 0.8) 100%);
}

.ambient-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    pointer-events: none;
    z-index: 2;
    opacity: 0.22;
}

.blob-purple {
    top: 15%;
    right: 12%;
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, var(--accent-purple) 0%, transparent 70%);
}

.blob-blue {
    bottom: 10%;
    left: 10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--color-blue) 0%, transparent 70%);
}

.hero-container {
    position: relative;
    z-index: 3;
    max-width: 960px;
    width: 100%;
    /* .portfolio-hero is display:flex, making this its flex item. Flex
       items default to min-width:auto, so without this the browser won't
       shrink it below its own heading text's natural width — on very
       small phones that overflows the screen instead of just wrapping. */
    min-width: 0;
    margin: 0 auto;
    text-align: center;
    color: var(--color-white);
}

.hero-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--color-blue);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    margin-bottom: 24px;
}

.hero-heading {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 4.5vw, 4.75rem);
    line-height: 1.05;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--color-white);
    margin-bottom: 28px;
}

.hero-subtitle {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.15vw, 1.25rem);
    font-weight: 300;
    color: var(--color-grey);
    max-width: 780px;
    margin: 0 auto 40px auto;
    line-height: 1.6;
}

.hero-cta-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.btn-primary {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-white);
    text-decoration: none;
    padding: 16px 36px;
    background-color: var(--color-blue);
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 4px 20px rgba(26, 93, 172, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    background-color: #144988;
    box-shadow: 0 8px 30px rgba(26, 93, 172, 0.5);
}

.btn-secondary {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-white);
    text-decoration: none;
    padding: 16px 36px;
    background-color: transparent;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.btn-secondary:hover {
    background-color: var(--color-blue);
    border-color: var(--color-blue);
    transform: translateY(-2px);
}

/* ==========================================================================
   SECTION 2: PORTFOLIO SHOWCASE (CHARCOAL #111111)
   ========================================================================== */
.showcase-section {
    background-color: var(--color-charcoal);
    padding: 160px 6vw;
    color: var(--color-white);
}

.showcase-container {
    max-width: 1360px;
    margin: 0 auto;
}

.showcase-header {
    text-align: center;
    margin-bottom: 90px;
}

.showcase-heading {
    font-family: var(--font-heading);
    font-size: clamp(2.75rem, 4vw, 4.25rem);
    text-transform: uppercase;
    line-height: 1.05;
    letter-spacing: 0.01em;
    margin-bottom: 20px;
}

.showcase-description {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.1vw, 1.2rem);
    font-weight: 300;
    line-height: 1.6;
    color: var(--color-grey);
    max-width: 800px;
    margin: 0 auto;
}

/* Modern Asymmetrical Editorial Grid */
.editorial-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 40px;
    align-items: center;
}

.grid-item {
    position: relative;
    background-color: rgba(255, 255, 255, 0.02);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.item-large {
    grid-column: span 7;
}

.item-small {
    grid-column: span 5;
}

.grid-image-wrap {
    position: relative;
    width: 100%;
    height: 380px;
    overflow: hidden;
}

.item-large .grid-image-wrap {
    height: 460px;
}

.grid-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(17, 17, 17, 0.8) 100%);
}

.grid-caption {
    padding: 32px;
}

.card-title {
    font-family: var(--font-heading);
    font-size: clamp(1.35rem, 1.8vw, 1.75rem);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    line-height: 1.1;
    margin-bottom: 12px;
    color: var(--color-white);
    transition: color 0.3s ease;
}

.card-desc {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 300;
    color: var(--color-grey);
    line-height: 1.8;
}

/* Case Study Strip (Client / Objective / Result) */
.case-study-strip {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.case-study-row {
    display: flex;
    gap: 10px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    line-height: 1.5;
}

.cs-label {
    flex: 0 0 auto;
    min-width: 76px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.72rem;
    color: var(--color-blue);
    padding-top: 2px;
}

.cs-value {
    color: rgba(249, 239, 232, 0.55);
    font-style: italic;
}

.cs-value.cs-placeholder::before {
    content: "＋ ";
    font-style: normal;
}

/* Hover States */
.grid-item:hover {
    transform: translateY(-8px);
    border-color: rgba(26, 93, 172, 0.4);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.grid-item:hover .grid-img {
    transform: scale(1.05);
}

.grid-item:hover .card-title {
    color: var(--color-blue);
}

/* ==========================================================================
   SECTION 3: TRUSTED BRANDS (CLEARBIT API & OFFICIAL COLOR PALETTE)
   ========================================================================== */

.clients-section {
    position: relative;
    width: 100%;
    background-color: var(--color-cream, #F9EFE8) !important;
    padding: 170px 6vw;
    color: var(--color-black, #000000);
    overflow: hidden;
}

.clients-bg-glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

.clients-bg-glow.glow-blue {
    top: -5%;
    left: -5%;
    width: 650px;
    height: 650px;
    background: radial-gradient(circle, rgba(26, 93, 172, 0.08) 0%, transparent 70%);
    filter: blur(140px);
}

.clients-bg-glow.glow-magenta {
    bottom: -5%;
    right: -5%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(159, 24, 80, 0.07) 0%, transparent 70%);
    filter: blur(140px);
}

.clients-container {
    position: relative;
    z-index: 2;
    max-width: 1380px;
    margin: 0 auto;
}

.clients-header {
    text-align: center;
    margin-bottom: 50px;
}

.clients-heading {
    font-family: var(--font-heading, 'Oswald', sans-serif);
    font-size: clamp(2.75rem, 4.2vw, 4.5rem);
    text-transform: uppercase;
    line-height: 1.05;
    letter-spacing: 0.01em;
    margin-bottom: 18px;
    color: var(--color-black, #000000);
}

.clients-description {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: clamp(1.05rem, 1.15vw, 1.25rem);
    font-weight: 400;
    line-height: 1.6;
    color: var(--color-dark-grey, #2C2C2C);
    max-width: 820px;
    margin: 0 auto 36px auto;
}

.clients-divider {
    width: 140px;
    height: 3px;
    background: linear-gradient(90deg, #1A5DAC 0%, #9F1850 100%);
    margin: 0 auto;
    border-radius: 3px;
}

/* Floating White Panel */
.client-carousel-panel {
    position: relative;
    background: #FFFFFF;
    border: 1px solid rgba(160, 159, 163, 0.25);
    border-radius: 32px;
    padding: 56px 48px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.05),
                0 4px 16px rgba(26, 93, 172, 0.03);
    overflow: hidden;
}

.panel-border-glow {
    position: absolute;
    inset: -1px;
    border-radius: 32px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(26, 93, 172, 0.3), rgba(159, 24, 80, 0.2), transparent 70%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.carousel-top-bar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(160, 159, 163, 0.2);
}

.category-badge {
    display: inline-block;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.75rem;
    font-weight: 700;
    color: #1A5DAC;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.category-title {
    font-family: var(--font-heading, 'Oswald', sans-serif);
    font-size: clamp(1.6rem, 2.2vw, 2.4rem);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--color-black, #000000);
    margin-bottom: 4px;
}

.category-desc {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.95rem;
    font-weight: 400;
    color: #555555;
}

.carousel-controls {
    display: flex;
    gap: 12px;
}

.carousel-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid rgba(160, 159, 163, 0.3);
    background: #FFFFFF;
    color: #1A5DAC;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.carousel-btn svg {
    width: 22px;
    height: 22px;
}

.carousel-btn:hover {
    background: #1A5DAC;
    color: #FFFFFF;
    border-color: #1A5DAC;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(26, 93, 172, 0.25);
}

.carousel-viewport {
    position: relative;
    overflow: hidden;
    width: 100%;
}

.carousel-track {
    display: flex;
    transition: transform 0.65s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform;
}

.carousel-slide {
    min-width: 100%;
    box-sizing: border-box;
    opacity: 0.2;
    transition: opacity 0.65s ease;
}

.carousel-slide.active {
    opacity: 1;
}

/* Logo Grid & Image Handling */
.logo-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 36px 28px;
    align-items: center;
    padding: 24px 0 12px 0;
}

.logo-item {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 105px;
    padding: 16px 20px;
    border-radius: 16px;
    background: rgba(249, 239, 232, 0.25);
    border: 1px solid rgba(160, 159, 163, 0.12);
    transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

.client-logo {
    height: 64px;
    width: auto;
    max-width: 175px;
    object-fit: contain;
    filter: none !important;
    opacity: 1 !important;
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1), filter 0.35s ease;
    will-change: transform, filter;
}

.logo-item:hover {
    transform: translateY(-4px);
    border-color: rgba(159, 24, 80, 0.3);
    background: #FFFFFF;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.05), 
                0 0 24px rgba(159, 24, 80, 0.18);
}

.logo-item:hover .client-logo {
    transform: scale(1.04);
}

.carousel-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 40px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(160, 159, 163, 0.35);
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

.dot.active {
    width: 32px;
    border-radius: 20px;
    background: #1A5DAC;
}

@media screen and (max-width: 1280px) {
    .logo-grid { grid-template-columns: repeat(4, 1fr); gap: 28px 24px; }
    .client-logo { height: 56px; max-width: 150px; }
}

@media screen and (max-width: 1024px) {
    .client-carousel-panel { padding: 40px 32px; border-radius: 24px; }
    .logo-grid { grid-template-columns: repeat(3, 1fr); gap: 24px; }
    .logo-item { height: 95px; }
    .client-logo { height: 50px; max-width: 135px; }
}

@media screen and (max-width: 680px) {
    .clients-section { padding: 100px 5vw; }
    .client-carousel-panel { padding: 28px 20px; border-radius: 20px; }
    .carousel-top-bar { flex-direction: column; align-items: flex-start; gap: 20px; }
    .carousel-controls { align-self: flex-end; }
    .logo-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .logo-item { height: 85px; padding: 12px; }
    .client-logo { height: 44px; max-width: 115px; }
}

/* ==========================================================================
   SECTION 5: CALL TO ACTION
   ========================================================================== */
.portfolio-cta {
    position: relative;
    background: linear-gradient(135deg, #07131F 0%, #1A5DAC 100%);
    color: var(--color-white);
    padding: 170px 6vw;
    text-align: center;
    overflow: hidden;
}

.cta-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-heading);
    font-size: clamp(6rem, 18vw, 18rem);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.035);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    pointer-events: none;
    user-select: none;
    z-index: 1;
}

.cta-mesh-bg {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 32px 32px;
    opacity: 0.4;
}

.cta-purple-ambient {
    position: absolute;
    top: 50%;
    left: 20%;
    transform: translateY(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(141, 30, 164, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.cta-container {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
}

.cta-heading {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5vw, 5.0rem);
    line-height: 1.02;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    margin-bottom: 28px;
}

.cta-description {
    font-family: var(--font-body);
    font-size: clamp(1.05rem, 1.25vw, 1.35rem);
    color: rgba(255, 255, 255, 0.88);
    font-weight: 300;
    margin-bottom: 56px;
    line-height: 1.55;
}

.cta-btn-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.btn-primary-cta {
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-black);
    background-color: var(--color-white);
    padding: 18px 44px;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.35s ease;
}

.btn-primary-cta:hover {
    background-color: var(--color-black);
    color: var(--color-white);
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.btn-secondary-cta {
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--color-white);
    background-color: transparent;
    padding: 18px 44px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: all 0.35s ease;
}

.btn-secondary-cta:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--color-white);
    transform: translateY(-3px);
}


/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* Laptops (1025px - 1280px) */
@media screen and (max-width: 1280px) {
    .editorial-grid { gap: 28px; }
    .logo-wall-grid { grid-template-columns: repeat(4, 1fr); gap: 24px; }
}

/* Tablets (769px - 1024px) */
@media screen and (max-width: 1024px) {
    .editorial-grid { display: flex; flex-direction: column; gap: 36px; }
    .grid-item { width: 100%; }
    .grid-image-wrap { height: 340px !important; }
    
    .logo-wall-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
}

/* Small Tablets & Mobile (Up to 768px) */
@media screen and (max-width: 768px) {
    .portfolio-hero, .showcase-section, .clients-section, .portfolio-cta {
        padding: 100px 6vw;
    }

    .hero-cta-group, .cta-btn-group {
        flex-direction: column;
        width: 100%;
        gap: 14px;
    }

    .btn-primary, .btn-secondary, .btn-primary-cta, .btn-secondary-cta {
        width: 100%;
        text-align: center;
    }

    .logo-wall-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}

/* Micro Phones (Up to 380px) */
@media screen and (max-width: 380px) {
    .logo-wall-grid { grid-template-columns: 1fr; }
    .grid-caption { padding: 24px 18px; }
}

/* ========================================== */
/* ULTRA-WIDE / LARGE MONITORS (1600px+)      */
/* Matches the live production site's widths through normal laptop/desktop
   sizes; on wide/ultra-wide monitors (1920px+) these sections stretch
   further so they don't leave large empty margins either side. */
@media screen and (min-width: 1600px) {
    .showcase-container { max-width: 1560px; }
    .clients-container { max-width: 1580px; }
}
