/* ==========================================================
   ARAWA STUDIOS — Main Stylesheet
   1. CSS Custom Properties
   2. CSS Reset / Base
   3. Typography
   4. Layout & Section Patterns
   5. Utilities
   6. Buttons
   7. Animations
   ========================================================== */

/* ----------------------------------------------------------
   1. Custom Properties
   ---------------------------------------------------------- */
:root {
    --clr-bg-primary: #08080c;
    --clr-bg-secondary: #0e0e14;
    --clr-bg-tertiary: #1a1a24;
    --clr-surface: #22223a;
    --clr-border: rgba(255, 255, 255, 0.06);

    --clr-accent-primary: #ae70f1;
    --clr-accent-secondary: #22d3ee;
    --clr-accent-tertiary: #ff4a9e;

    --clr-text-primary: #eef0f6;
    --clr-text-secondary: #9ba1b0;
    --clr-text-tertiary: #5c6070;

    --gradient-brand: linear-gradient(135deg, #ae70f1, #22d3ee);
    --gradient-brand-reverse: linear-gradient(135deg, #22d3ee, #ae70f1);

    --ff-primary: 'Inter', sans-serif;
    --ff-heading: 'Poppins', sans-serif;
    --ff-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 3rem;
    --space-2xl: 6rem;
    --space-3xl: 8rem;

    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;

    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(174, 112, 241, 0.3);
    --shadow-glow-teal: 0 0 30px rgba(34, 211, 238, 0.2);

    --glass-bg: rgba(14, 14, 20, 0.6);
    --glass-bg-light: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-blur: 20px;
}

/* ----------------------------------------------------------
   2. Reset / Base
   ---------------------------------------------------------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-padding-top: 80px;
}

/* Lenis smooth scroll */
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;
}

body {
    font-family: var(--ff-primary);
    background-color: var(--clr-bg-primary);
    color: var(--clr-text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
}

/* Noise grain overlay */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px;
}

::selection {
    background-color: var(--clr-accent-primary);
    color: var(--clr-text-primary);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ----------------------------------------------------------
   3. Typography
   ---------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--ff-heading);
    font-weight: 700;
    line-height: 1.12;
    color: var(--clr-text-primary);
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 800; }
h2 { font-size: clamp(1.85rem, 4vw, 3rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: clamp(1.1rem, 2vw, 1.35rem); }

p {
    color: var(--clr-text-secondary);
    margin-bottom: var(--space-md);
}

a {
    color: var(--clr-accent-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover { color: var(--clr-accent-secondary); }

ul, ol { color: var(--clr-text-secondary); }

/* ----------------------------------------------------------
   4. Layout & Section Patterns
   ---------------------------------------------------------- */
main { min-height: 60vh; }

.section-padding {
    padding: var(--space-3xl) 0;
}

/* Modern editorial section header */
.section-header {
    margin-bottom: var(--space-2xl);
}

.section-header.text-center { text-align: center; }

.section-tag {
    display: inline-block;
    font-family: var(--ff-mono);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--clr-accent-secondary);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: var(--space-md);
    background: rgba(34, 211, 238, 0.08);
    padding: 0.35rem 0.9rem;
    border-radius: 100px;
    border: 1px solid rgba(34, 211, 238, 0.15);
}

.section-header p {
    max-width: 550px;
    font-size: 1.05rem;
}

.section-header.text-center p {
    margin-inline: auto;
}

/* Legacy compat */
.section-title { text-align: center; margin-bottom: var(--space-2xl); }
.section-title h2 { margin-bottom: var(--space-sm); }
.section-title p { max-width: 600px; margin-inline: auto; }
.section-divider { display: none; }

/* ----------------------------------------------------------
   5. Utilities
   ---------------------------------------------------------- */
.gradient-text {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-dark-secondary { background-color: var(--clr-bg-secondary); }
.bg-dark-tertiary { background-color: var(--clr-bg-tertiary); }
.text-accent { color: var(--clr-accent-primary); }
.text-accent-secondary { color: var(--clr-accent-secondary); }

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
}

.glass-light {
    background: var(--glass-bg-light);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

/* ----------------------------------------------------------
   6. Buttons
   ---------------------------------------------------------- */
.btn-gradient {
    background: var(--gradient-brand);
    background-size: 200% 200%;
    border: none;
    color: #fff;
    padding: 0.8rem 2rem;
    border-radius: 100px;
    font-weight: 600;
    font-family: var(--ff-primary);
    font-size: 0.95rem;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.btn-gradient::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent 50%);
    opacity: 0;
    transition: opacity var(--transition-fast);
    border-radius: inherit;
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
    color: #fff;
    background-position: right center;
}

.btn-gradient:hover::before { opacity: 1; }

.btn-outline-custom {
    border: 1px solid rgba(174, 112, 241, 0.4);
    color: var(--clr-text-primary);
    padding: 0.78rem 2rem;
    border-radius: 100px;
    font-weight: 600;
    font-family: var(--ff-primary);
    font-size: 0.95rem;
    background: rgba(174, 112, 241, 0.06);
    transition: all var(--transition-base);
}

.btn-outline-custom:hover {
    background: rgba(174, 112, 241, 0.15);
    border-color: var(--clr-accent-primary);
    color: #fff;
    transform: translateY(-2px);
}

.btn-white {
    background-color: #fff;
    color: var(--clr-accent-primary);
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 100px;
    font-weight: 600;
    font-family: var(--ff-primary);
    transition: all var(--transition-base);
}

.btn-white:hover {
    background-color: var(--clr-text-primary);
    color: var(--clr-accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

/* ----------------------------------------------------------
   7. Animations
   ---------------------------------------------------------- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes blurIn {
    from { opacity: 0; filter: blur(10px); }
    to { opacity: 1; filter: blur(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* GSAP SplitText helpers */
.gsap-word, .gsap-line {
    display: inline-block;
    will-change: transform, opacity;
}

/* Reveal-text lines must be block with hidden overflow — GSAP handles the animation */
.reveal-text .reveal-line {
    display: block;
    overflow: hidden;
}

.reveal-text .reveal-line > span {
    display: inline-block;
}

/* ----------------------------------------------------------
   8. Page Loader
   ---------------------------------------------------------- */
.page-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--clr-bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: transform;
}

.loader-logo {
    font-family: var(--ff-heading);
    font-size: 2rem;
    font-weight: 800;
    color: var(--clr-text-primary);
}

.loader-logo span {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ----------------------------------------------------------
   9. Scroll Progress Bar
   ---------------------------------------------------------- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--gradient-brand);
    z-index: 100000;
    transition: width 0.05s linear;
    box-shadow: 0 0 10px rgba(174, 112, 241, 0.5);
}

/* ----------------------------------------------------------
   10. Custom Cursor
   ---------------------------------------------------------- */
.cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    background: var(--clr-accent-primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99998;
    transform: translate(-50%, -50%);
    transition: width 0.2s ease, height 0.2s ease, background 0.2s ease;
}

.cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    width: 36px;
    height: 36px;
    border: 1.5px solid rgba(174, 112, 241, 0.5);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99997;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease, border-color 0.3s ease, background 0.15s ease;
}

.cursor-dot.hover {
    width: 12px;
    height: 12px;
    background: var(--clr-accent-secondary);
}

.cursor-ring.hover {
    width: 50px;
    height: 50px;
    border-color: rgba(34, 211, 238, 0.4);
}

.cursor-dot.click {
    transform: translate(-50%, -50%) scale(0.6);
}

.cursor-ring.click {
    width: 28px;
    height: 28px;
}

/* Hide custom cursor on touch devices */
@media (hover: none) and (pointer: coarse) {
    .cursor-dot, .cursor-ring { display: none; }
}

/* ----------------------------------------------------------
   11. Animated Gradient Text
   ---------------------------------------------------------- */
.gradient-text-animated {
    background: linear-gradient(135deg, #ae70f1, #22d3ee, #ff4a9e, #ae70f1);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientTextShift 6s ease infinite;
}

@keyframes gradientTextShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ----------------------------------------------------------
   12. Reveal Text (GSAP handles animation; layout-only CSS)
   ---------------------------------------------------------- */

/* ----------------------------------------------------------
   13. Magnetic Button
   ---------------------------------------------------------- */
.btn-magnetic {
    position: relative;
    transition: transform 0.2s ease;
}

/* ----------------------------------------------------------
   14. Theme Toggle Button
   ---------------------------------------------------------- */
.btn-theme-toggle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    color: var(--clr-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 0;
}

.btn-theme-toggle:hover {
    background: rgba(174, 112, 241, 0.12);
    color: var(--clr-accent-primary);
    border-color: rgba(174, 112, 241, 0.25);
}

/* ----------------------------------------------------------
   15. Light Theme
   ---------------------------------------------------------- */

/* Theme transition */
html, body,
.navbar, .service-card, .feature-card, .team-card,
.contact-info-card, .contact-form-wrapper, .cta-inner,
.site-footer, .legal-toc, .stats-bar, #back-to-top,
.btn-theme-toggle, .offcanvas {
    transition: background-color 0.35s ease,
                color 0.35s ease,
                border-color 0.35s ease,
                box-shadow 0.35s ease;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0s !important;
    }
}

/* Light theme color tokens */
[data-theme="light"] {
    --clr-bg-primary: #f8f9fc;
    --clr-bg-secondary: #eef1f6;
    --clr-bg-tertiary: #e2e7ef;
    --clr-surface: #ffffff;
    --clr-border: rgba(15, 15, 26, 0.08);

    --clr-accent-primary: #9333ea;
    --clr-accent-secondary: #06b6d4;
    --clr-accent-tertiary: #e84393;

    --clr-text-primary: #0f0f1a;
    --clr-text-secondary: #4a4d5e;
    --clr-text-tertiary: #8b8fa0;

    --gradient-brand: linear-gradient(135deg, #9333ea, #06b6d4);
    --gradient-brand-reverse: linear-gradient(135deg, #06b6d4, #9333ea);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 30px rgba(147, 51, 234, 0.15);
    --shadow-glow-teal: 0 0 30px rgba(6, 182, 212, 0.12);

    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-bg-light: rgba(255, 255, 255, 0.5);
    --glass-border: rgba(15, 15, 26, 0.08);
    --glass-blur: 20px;
}

/* ---- Light theme component overrides ---- */

/* Noise grain — subtle on light */
[data-theme="light"] body::after {
    opacity: 0.012;
}

/* Navbar */
[data-theme="light"] .navbar-scrolled {
    background: rgba(248, 249, 252, 0.85) !important;
}

[data-theme="light"] .offcanvas {
    background: rgba(248, 249, 252, 0.95) !important;
}

[data-theme="light"] .navbar .nav-link:hover {
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .navbar-brand {
    color: var(--clr-text-primary) !important;
}

/* Cards — swap white-alpha to dark-alpha */
[data-theme="light"] .team-card .social-links a,
[data-theme="light"] .footer-social a {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}

/* CTA text */
[data-theme="light"] .cta-section h2 {
    color: var(--clr-text-primary);
}

/* Hero grid dots */
[data-theme="light"] .hero-grid {
    background-image: radial-gradient(rgba(0, 0, 0, 0.07) 1px, transparent 1px);
}

/* Hero glow — softer in light */
[data-theme="light"] .hero-glow {
    background: radial-gradient(circle, rgba(147, 51, 234, 0.08) 0%, transparent 70%);
}

/* Marquee bg */
[data-theme="light"] .marquee-section {
    background: rgba(238, 241, 246, 0.6);
}

/* Service card icon box */
[data-theme="light"] .service-card .icon-box {
    background: rgba(147, 51, 234, 0.08);
}

/* Feature card icon */
[data-theme="light"] .feature-icon {
    background: rgba(147, 51, 234, 0.08);
}

/* Section tag */
[data-theme="light"] .section-tag {
    background: rgba(6, 182, 212, 0.08);
    border-color: rgba(6, 182, 212, 0.15);
}

/* Form controls */
[data-theme="light"] .contact-form-wrapper .form-control,
[data-theme="light"] .contact-form-wrapper .form-select {
    background-color: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--clr-text-primary);
}

[data-theme="light"] .contact-form-wrapper .form-control:focus,
[data-theme="light"] .contact-form-wrapper .form-select:focus {
    background-color: #fff;
}

/* Cursor ring — lighter border in light mode */
[data-theme="light"] .cursor-ring {
    border-color: rgba(147, 51, 234, 0.3);
}

/* Card spotlight — slightly stronger on light */
[data-theme="light"] .card-spotlight {
    background: radial-gradient(circle at var(--spotlight-x, 50%) var(--spotlight-y, 50%), rgba(147, 51, 234, 0.08), transparent 60%);
}

/* Page hero gradient fade */
[data-theme="light"] .page-hero::after {
    background: linear-gradient(to top, var(--clr-bg-primary), transparent);
}

/* Scroll progress glow */
[data-theme="light"] .scroll-progress {
    box-shadow: 0 0 8px rgba(147, 51, 234, 0.3);
}

/* Back to top */
[data-theme="light"] #back-to-top {
    background: rgba(255, 255, 255, 0.8);
}

/* Theme toggle — swap subtle bg */
[data-theme="light"] .btn-theme-toggle {
    background: rgba(0, 0, 0, 0.04);
}

/* Mesh layers — reduced opacity on light */
[data-theme="light"] .mesh-layer {
    opacity: 0.18;
}

[data-theme="light"] .mesh-3 {
    opacity: 0.08;
}

[data-theme="light"] .mesh-4 {
    opacity: 0.06;
}

/* Hero pills */
[data-theme="light"] .hero-pill {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.06);
}

/* Hero particles — softer on light */
[data-theme="light"] .hero-particles .particle {
    background: rgba(147, 51, 234, 0.25);
}

/* Service card hover shadow */
[data-theme="light"] .service-card:hover {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
}

/* Feature number watermark */
[data-theme="light"] .feature-num {
    opacity: 0.06;
}

/* Footer */
[data-theme="light"] .site-footer::before {
    opacity: 0.25;
}

/* CTA particles */
[data-theme="light"] .cta-particles .cta-particle {
    background: rgba(147, 51, 234, 0.2);
}
