﻿/* 
   Portfolio  Numbered Case Study Style
   ThisUncle Technologies Limited    www.thisuncle.co.tz
    */

:root {
    --cs-black:    #0a0a0a;
    --cs-white:    #ffffff;
    --cs-offwhite: #f7f7f5;
    --cs-border:   #e8e8e8;
    --cs-muted:    #888888;
    --cs-desc:     #555555;
    --cs-num-col:  #e0e0e0;
    --cs-nav-h:    70px;
    --cs-hpad:     clamp(2rem, 8vw, 10rem);
}

/* 
   SECTION 1  HERO
    */

.cs-hero {
    height: 100vh !important;
    min-height: 100vh !important;
    box-sizing: border-box !important;
    background: #ffffff;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    padding: calc(var(--cs-nav-h) + clamp(2rem, 5vw, 4rem)) clamp(2rem, 8vw, 10rem) 3rem;
    padding-top: 80px !important;
    overflow: hidden;
}

/* Heading */
.cs-heading {
    margin: 0;
    font-family: 'Playfair Display', serif;
    font-size: clamp(5rem, 14vw, 14rem);
    font-weight: 700;
    line-height: 0.9;
    color: var(--cs-black);
    letter-spacing: -0.02em;
    perspective: 800px;
}

/* Word reveal — rotateX page-turn on load */
.reveal-word {
    display: block;
    opacity: 0;
    transform: rotateX(90deg) translateY(30px);
    transform-origin: bottom center;
    animation: cs-word-reveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards;
}

.reveal-word:nth-child(2) {
    animation-delay: 0.35s;
}

@keyframes cs-word-reveal {
    to {
        opacity: 1;
        transform: rotateX(0deg) translateY(0);
    }
}

/* Divider line */
.cs-hero-divider {
    width: 120px;
    height: 1px;
    background: var(--cs-black);
    margin: 2.8rem 0 1.6rem;
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left center;
    animation: cs-divider-in 0.6s ease 0.7s forwards;
}

@keyframes cs-divider-in {
    to {
        opacity: 1;
        transform: scaleX(1);
    }
}

/* Meta labels — bottom flex item of hero */
.cs-hero-meta {
    display: flex;
    gap: 3rem;
    opacity: 0;
    animation: cs-fade-up 0.4s ease 0.9s forwards;
}

.cs-meta-item {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--cs-muted);
}

@keyframes cs-fade-up {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0);    }
}

@keyframes cs-filter-in {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 
   SECTION 2  FILTER BAR
    */

.cs-filter {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #ffffff;
    box-shadow: 0 1px 0 #ebebeb;
    opacity: 0;
    transform: translateY(20px);
    animation: cs-filter-in 0.4s ease 0.4s forwards;
}

.cs-filter-inner {
    display: flex;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 0 clamp(2rem, 6vw, 6rem);
}

.cs-filter-inner::-webkit-scrollbar {
    display: none;
}

.cs-fb {
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #888888;
    background: transparent;
    border: none;
    padding: 1.1rem 1.4rem;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    transition: color 0.2s ease;
}

.cs-fb:hover { color: #0a0a0a; }

.cs-fb.active {
    color: #0a0a0a;
    font-weight: 700;
}

.cs-fb.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #0a0a0a;
    border-radius: 2px 2px 0 0;
}

/* 
   SECTION 3  PROJECTS GRID
    */

.cs-projects {
    background: #ffffff;
    padding: clamp(3rem, 6vw, 6rem) clamp(2rem, 6vw, 6rem);
}

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

/* Card */
.cs-card {
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #eeeeee;
    cursor: none;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.3s ease;
}

.cs-card.in-view {
    opacity: 1;
    transform: translateY(0);
}

.cs-card.in-view:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.10);
}

.cs-card.is-hidden {
    display: none !important;
}

/* Card image */
.card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    position: relative;
    background: #f5f5f5;
    flex-shrink: 0;
}

/* Image stacking: img above fallback, preview above img */
.card-image .cs-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    position: relative;
    z-index: 1;
    transition: opacity 0.35s ease, transform 0.5s ease;
}

/* Fallback text shown when image fails to load (FIX 6) */
.cs-img-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.2rem, 3vw, 2rem);
    font-weight: 700;
    color: #cccccc;
    pointer-events: none;
    z-index: 0;
    user-select: none;
}

.card-image:hover .cs-img {
    transform: scale(1.05);
}

/* Card topbar: categories left, badge right */
.cs-card-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
}

/* Date badge */
.cs-date-badge {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
    user-select: none;
}

.cs-date-badge--done { background: #e8f4e8; color: #2d7a2d; }
.cs-date-badge--wip  { background: #fff3e0; color: #e65c00; }

/* Card details */
.card-details {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.cs-cats {
    margin: 0;
    font-family: 'Inter', sans-serif;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #999999;
}

.cs-name {
    margin: 0 0 0.6rem;
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    font-weight: 700;
    color: #0a0a0a;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.cs-desc {
    margin: 0 0 1.2rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #666666;
    font-weight: 400;
}

/* Visit link */
.cs-visit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: #0a0a0a;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    position: relative;
    align-self: flex-start;
    padding-bottom: 2px;
    margin-top: auto;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.cs-visit::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 1px;
    width: 100%;
    background: #0a0a0a;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.3s ease;
}

.cs-visit:hover::after {
    transform: scaleX(1);
}

.cs-visit:hover {
    transform: translateX(4px);
}

/* Jolymo — gradient overlay to soften baked-in text */
#jolymo-thumb::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.18) 0%, rgba(0,0,0,0) 40%);
    z-index: 1;
    pointer-events: none;
}

/* 
   RESPONSIVE  TABLET  768–1024px
    */

@media (min-width: 768px) and (max-width: 1024px) {
    .cs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 
   RESPONSIVE  MOBILE  < 768px
    */

@media (max-width: 767px) {
    .cs-hero {
        height: auto !important;
        min-height: auto !important;
        padding: calc(var(--cs-nav-h) + 2rem) 1.5rem 2.5rem !important;
    }

    .cs-heading {
        font-size: clamp(3.5rem, 16vw, 14rem);
    }

    .cs-hero-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .cs-meta-item {
        font-size: 0.65rem;
    }

    .cs-filter-inner {
        padding: 0 1rem;
    }

    .cs-fb {
        padding: 1rem 1rem;
        font-size: 0.68rem;
    }

    .cs-projects {
        padding: 2rem 1.25rem;
    }

    .cs-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .cs-name {
        font-size: clamp(1.2rem, 5vw, 1.5rem);
    }
}

/* 
   CUSTOM CURSOR  (desktop / hover-capable devices only)
    */

body.portfolio-body,
body.portfolio-body * { cursor: none !important; }

#cursor-dot {
    position: fixed;
    top: 0; left: 0;
    width: 10px; height: 10px;
    background: var(--cs-black);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    will-change: left, top;
    transition: width 0.22s ease, height 0.22s ease, background 0.22s ease;
}

#cursor-ring {
    position: fixed;
    top: 0; left: 0;
    width: 36px; height: 36px;
    border: 1.5px solid var(--cs-black);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    will-change: left, top;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width  0.36s cubic-bezier(0.16, 1, 0.3, 1),
                height 0.36s cubic-bezier(0.16, 1, 0.3, 1),
                background     0.36s ease,
                border-color   0.36s ease,
                border-width   0.36s ease;
}

#cursor-ring span {
    font-family: 'Inter', sans-serif;
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--cs-white);
    opacity: 0;
    transition: opacity 0.22s ease;
    white-space: nowrap;
}

/* ── Hover: over .cs-card ── */
body.cursor-hover #cursor-dot {
    width: 6px; height: 6px;
    background: var(--cs-white);
}

body.cursor-hover #cursor-ring {
    width: 72px; height: 72px;
    background: var(--cs-black);
    border-color: var(--cs-black);
}

body.cursor-hover #cursor-ring span { opacity: 1; }

/* ── Hover: over .cs-visit link ── */
body.cursor-open #cursor-dot {
    width: 6px; height: 6px;
    background: var(--cs-black);
}

body.cursor-open #cursor-ring {
    width: 58px; height: 58px;
    background: transparent;
    border-color: var(--cs-black);
    border-width: 2px;
}

body.cursor-open #cursor-ring span {
    opacity: 1;
    color: var(--cs-black);
}

/* Touch/no-hover devices: hide DOM cursor, restore pointer */
@media (hover: none) {
    body.portfolio-body,
    body.portfolio-body * { cursor: auto !important; }
    #cursor-dot, #cursor-ring { display: none !important; }
}

/* Footer separator */
.footer {
    border-top: 1px solid var(--cs-border);
}

/*
   FIX 5 — NAVBAR: seamless hero connection on portfolio page
    */

body.portfolio-body #header.header {
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: none;
}

body.portfolio-body #header.header.scrolled {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid #e0e0e0;
}

/*
   FIX 2 — BACK TO TOP: portfolio-page style overrides
    */

body.portfolio-body .back-to-top {
    width: 44px;
    height: 44px;
    background: #0a0a0a;
    color: #ffffff;
    font-size: 1.1rem;
    z-index: 9999;
    box-shadow: none;
}

body.portfolio-body .back-to-top:hover {
    background: #333333;
    transform: none;
    box-shadow: none;
}

/* 
   CTA SECTION — removed
    */
