/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #050505;
    --bg-card: #0c0c0c;
    --bg-lighter: #151515;
    --border: #222222;
    --text-primary: #F4F4F4;
    --text-secondary: #8A8A8A;
    --accent-orange: #FF4500; /* Vivid DesignByBrandin Orange */
    --accent-blue: #3333FF;
    --accent-neon: #CCFF00; /* Acid Green */
    
    /* V3 Override names for onboarding continuity if needed */
    --gradient: var(--accent-orange);
    --gradient-text: var(--text-primary);
}

/* LENIS SMOOTH SCROLL REQUIRED CSS */
html.lenis, html.lenis body {
    height: auto;
}
.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}
.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}
.lenis.lenis-stopped {
    overflow: hidden;
}

html {
    background-color: var(--bg-primary);
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.4;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    touch-action: pan-y;
    -webkit-text-size-adjust: 100%;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 4vw;
}

/* ===== TYPOGRAPHY & REVEALS ===== */
h1, h2, h3, h4, .massive-text {
    text-transform: uppercase;
    line-height: 0.95;
    font-weight: 900;
    letter-spacing: -0.04em;
    margin: 0;
}

.pattern-azulejo {
    background-image: url('azulejo.png');
    background-size: cover;
    background-position: center;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    display: inline-block;
}

.pattern-amazigh {
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 20 L20 0 L40 20 L20 40 Z M20 10 L30 20 L20 30 L10 20 Z' fill='none' stroke='%23d35400' stroke-width='2'/%3E%3Cpath d='M0 5 L10 15 M30 15 L40 5' stroke='%232c3e50' stroke-width='2'/%3E%3C/svg%3E");
    background-color: #f5f5dc; /* earthen tone base */
    background-size: 60px 60px;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    display: inline-block;
}

/* For GSAP text reveal (text slides up from a hidden overflow box) */
.reveal-box {
    overflow: hidden;
    position: relative;
    display: inline-block;
    vertical-align: top;
}

.reveal-text {
    display: inline-block;
    transform: translateY(110%);
    opacity: 0;
}

p.reveal-text {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
    line-height: 1.3;
    max-width: 70vw;
    text-transform: none;
}

/* ===== FOREIGN ACCENTS ===== */
.bg-accent-kanji, .bg-accent-arabic, .bg-accent-amazigh {
    position: absolute;
    font-size: clamp(20rem, 50vw, 40rem);
    color: #ffffff;
    opacity: 0.02;
    z-index: 0;
    pointer-events: none;
    line-height: 1;
    font-weight: 900;
    user-select: none;
}
.bg-accent-amazigh {
    opacity: 0.04; /* Tifinagh paths are thinner, need slight bump */
}
.tag-accent {
    font-size: 0.8rem;
    color: var(--accent-orange);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 12px;
}
.tag-accent::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    background: var(--accent-orange);
    border-radius: 50%;
}

/* ===== NAV ===== */
#navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 2vw 4vw;
    display: flex;
    justify-content: space-between;
    align-items: center;
    mix-blend-mode: difference;
}

.logo {
    font-size: 2rem;
    font-weight: 900;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.05em;
}

.nav-cta {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    text-decoration: none;
    overflow: hidden;
    position: relative;
    padding-bottom: 4px;
}
.nav-cta::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 100%; height: 2px;
    background: #fff;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}
.nav-cta:hover::after {
    transform: translateX(0);
}

/* ===== HERO ===== */
#hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-bottom: 10vh;
    position: relative;
}

.hero-headline {
    font-size: clamp(4rem, 11vw, 15rem);
    color: transparent;
    -webkit-text-stroke: 1px var(--text-primary);
    position: relative;
    z-index: 2;
}

.hero-headline.filled {
    color: var(--text-primary);
    -webkit-text-stroke: 0;
}

.hero-headline span {
    color: var(--accent-orange);
    -webkit-text-stroke: 0;
}

.sub-hero {
    margin-top: 4vh;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    position: relative;
    z-index: 2;
}

/* ===== 3D FLAG BANNER ===== */
.flag-section {
    width: 100vw;
    height: 350px;
    margin: 8vh 0;
    position: relative;
    z-index: 10;
    overflow: hidden;
    margin-left: calc(-50vw + 50%);
}

#flag-canvas {
    width: 100vw;
    height: 100%;
    display: block;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ===== SERVICES GRID ===== */
#architecture {
    padding: 15vh 0;
    position: relative;
}

.services-list {
    margin-top: 5vh;
}

.service-row {
    border-top: 1px solid var(--border);
    padding: 2vw 0; /* Thinner */
    display: grid;
    grid-template-columns: 100px 1fr 1fr;
    align-items: start;
    gap: 4vw;
    position: relative;
    overflow: hidden;
    transition: background 0.4s;
}

.service-row:hover {
    background: var(--bg-lighter);
}

.service-row:hover .srv-title {
    color: var(--accent-orange);
    transform: translateX(20px);
}

.srv-num {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.srv-title {
    font-size: clamp(2rem, 4vw, 5rem);
    font-weight: 900;
    text-transform: uppercase;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.srv-desc {
    font-size: 1.2rem;
    color: var(--text-secondary);
    padding-top: 1vw;
}

/* ===== DIGITAL TRADES GRID ===== */
.trades-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border);
    margin-top: 2vh;
}

.trade-card {
    background: var(--bg-primary);
    padding: 3vw 2.5vw;
    position: relative;
    transition: background 0.4s, transform 0.3s;
    overflow: hidden;
}

.trade-card:hover {
    background: var(--bg-lighter);
}

.trade-card:hover .trade-title {
    color: var(--accent-orange);
    transform: translateX(10px);
}

.trade-num {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.trade-title {
    font-size: clamp(1.3rem, 2.5vw, 2.2rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.03em;
    margin-bottom: 0.8rem;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.trade-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

@media (max-width: 900px) {
    .trades-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 550px) {
    .trades-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== HOW IT WORKS STEPS ===== */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
}

.step-card {
    background: var(--bg-primary);
    padding: 3vw 2.5vw;
    transition: background 0.4s;
}

.step-card:hover {
    background: var(--bg-lighter);
}

.step-card:hover .step-title {
    color: var(--accent-orange);
}

.step-num {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.step-title {
    font-size: clamp(1.1rem, 2vw, 1.6rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.03em;
    margin-bottom: 0.8rem;
    transition: color 0.4s;
}

.step-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

@media (max-width: 900px) {
    .steps-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 550px) {
    .steps-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== WHO THIS IS FOR ===== */
.niche-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: var(--border);
}

.niche-card {
    background: var(--bg-primary);
    padding: 3vw 2.5vw;
    transition: background 0.4s;
}

.niche-card:hover {
    background: var(--bg-lighter);
}

.niche-card:hover .niche-title {
    color: var(--accent-orange);
}

.niche-title {
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.03em;
    margin-bottom: 0.8rem;
    transition: color 0.4s;
}

.niche-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

@media (max-width: 550px) {
    .niche-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 24px 48px;
    background: var(--text-primary);
    color: var(--bg-primary);
    font-size: 1.2rem;
    font-weight: 800;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 100px;
    transition: transform 0.3s cubic-bezier(0.19, 1, 0.22, 1), background 0.3s;
}

.btn:hover {
    transform: scale(1.05);
    background: var(--accent-orange);
    color: #fff;
}

/* ===== CONTACT SECTION / GATE ===== */
.contact-form {
    max-width: 600px;
    margin: 5vh auto 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: left;
}

.form-input {
    width: 100%;
    padding: 20px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 1.1rem;
    font-family: inherit;
    border-radius: 0;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-orange);
    box-shadow: 4px 4px 0px 0px var(--accent-orange);
    transform: translate(-2px, -2px);
}

.form-input::placeholder {
    color: var(--text-secondary);
}

textarea.form-input {
    min-height: 150px;
    resize: vertical;
}

/* ===== RESULT STATS ===== */
.result-stat {
    transition: border-color 0.3s ease;
}
.result-stat:hover {
    border-color: var(--accent-orange) !important;
}

/* ===== MEDIA QUERIES ===== */
@media (max-width: 900px) {
    .service-row {
        grid-template-columns: 1fr;
        gap: 2vw;
    }
    .srv-num { margin-bottom: 10px; }
    .sub-hero { flex-direction: column; align-items: flex-start; gap: 40px; }
    p.reveal-text { max-width: 100%; }
    .grid-2 { grid-template-columns: 1fr !important; gap: 4vh !important; }
    .results-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (max-width: 550px) {
    .hero-headline {
        font-size: clamp(2.6rem, 13vw, 4rem) !important;
    }
    .results-grid { grid-template-columns: 1fr !important; }
    .cta-cards { grid-template-columns: 1fr !important; }
}
