/*
Theme Name: Merkri Media
Theme URI: 
Author: Merkri Media
Author URI: https://merkri.media
Description: A premium marketing agency theme for Merkri Media with elegant design (Dark/Light Mode)
Version: 3.1
*/

:root {
    /* Dark Mode Colors (Default) */
    --primary-violet: #7C3AED;
    --primary-violet-light: #9d6cff;
    --primary-violet-dark: #5b21b6;
    --accent-amber: #F59E0B;
    --accent-amber-light: #fbbf24;
    --accent-amber-dark: #d97706;
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --text-primary: #FFFFFF;
    --text-secondary: #FFFFFF;
    --border-color: rgba(255, 255, 255, 0.1);
    --dot-color: #FFFFFF;
    --shadow-color: rgba(124, 58, 237, 0.3);
    --gradient-start: rgba(124, 58, 237, 0.15);
    --gradient-end: rgba(245, 158, 11, 0.15);
    --bg-gradient: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 50%, var(--gradient-start) 100%);
    --nav-bg: rgba(10, 10, 10, 0.2);
    --footer-bg: #0a0a0a;
}

/* Light Mode Colors */
[data-theme="light"] {
    --primary-violet: #7C3AED;
    --primary-violet-light: #9d6cff;
    --primary-violet-dark: #5b21b6;
    --accent-amber: #7C3AED;
    --accent-amber-light: #9d6cff;
    --accent-amber-dark: #5b21b6;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F3F4F6;
    --text-primary: #111827;
    --text-secondary: #4B5563;
    --border-color: rgba(0, 0, 0, 0.1);
    --dot-color: #111827;
    --shadow-color: rgba(124, 58, 237, 0.2);
    --gradient-start: rgba(124, 58, 237, 0.1);
    --gradient-end: rgba(124, 58, 237, 0.1);
    --bg-gradient: linear-gradient(135deg, rgba(124, 58, 237, 0.08) 0%, rgba(124, 58, 237, 0.03) 50%, rgba(124, 58, 237, 0.08) 100%);
    --nav-bg: rgba(255, 255, 255, 0.2);
    --footer-bg: #f3f4f6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Hero-style Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        var(--bg-gradient),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1920 1080"><defs><linearGradient id="bg" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="0%" style="stop-color:%237C3AED;stop-opacity:0.15"/><stop offset="100%" style="stop-color:%23F59E0B;stop-opacity:0.15"/></linearGradient></defs><rect width="1920" height="1080" fill="url(%23bg)"/><circle cx="200" cy="200" r="150" fill="%237C3AED" opacity="0.1"/><circle cx="1720" cy="880" r="200" fill="%23F59E0B" opacity="0.1"/><circle cx="960" cy="540" r="300" fill="%237C3AED" opacity="0.08"/><path d="M0,540 Q480,400 960,540 T1920,540" stroke="%23F59E0B" stroke-width="2" fill="none" opacity="0.12"/><path d="M0,600 Q480,450 960,600 T1920,600" stroke="%237C3AED" stroke-width="1" fill="none" opacity="0.12"/></svg>') center/cover;
    pointer-events: none;
    animation: slowDrift 30s ease-in-out infinite;
    z-index: 0;
    transition: background 0.3s ease;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, var(--gradient-end) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, var(--gradient-start) 0%, transparent 50%);
    pointer-events: none;
    animation: floatingGradient 20s ease-in-out infinite;
    z-index: 0;
    transition: background 0.3s ease;
}

@keyframes slowDrift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(2%, 1%) scale(1.02); }
    50% { transform: translate(-1%, 2%) scale(0.98); }
    75% { transform: translate(-2%, -1%) scale(1.01); }
}

@keyframes floatingGradient {
    0%, 100% { transform: translate(0, 0) rotate(0deg); opacity: 0.8; }
    33% { transform: translate(-20px, -15px) rotate(120deg); opacity: 1; }
    66% { transform: translate(15px, -20px) rotate(240deg); opacity: 0.9; }
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 9999;
    background: var(--bg-secondary);
    border: 2px solid var(--accent-amber);
    color: var(--accent-amber);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.theme-toggle:hover {
    transform: scale(1.1);
    background: var(--accent-amber);
    color: var(--bg-primary);
}

.theme-toggle .light-icon,
.theme-toggle .dark-icon {
    position: absolute;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

[data-theme="dark"] .theme-toggle .light-icon {
    opacity: 0;
    transform: rotate(-90deg);
}

[data-theme="dark"] .theme-toggle .dark-icon {
    opacity: 1;
    transform: rotate(0);
}

[data-theme="light"] .theme-toggle .light-icon {
    opacity: 1;
    transform: rotate(0);
}

[data-theme="light"] .theme-toggle .dark-icon {
    opacity: 0;
    transform: rotate(90deg);
}

/* ========== MAIN CONTENT WRAPPER ========== */
.main-wrapper {
    flex: 1 0 auto;
    margin-top: 80px;
    position: relative;
    width: 100%;
    min-height: calc(100vh - 80px);
}

/* ========== PAGE SPECIFIC STYLES ========== */
.page-content {
    max-width: 1300px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 2;
}

/* Homepage Styles */
.homepage {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
}

.hero-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.hero-highlight {
    color: var(--accent-amber);
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
}

.btn-primary {
    background: var(--accent-amber);
    color: var(--bg-primary);
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px var(--shadow-color);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid var(--accent-amber);
}

.btn-secondary:hover {
    background: var(--accent-amber);
    color: var(--bg-primary);
    transform: translateY(-3px);
}

.hero-stats {
    display: flex;
    gap: 3rem;
    margin-top: 3rem;
}

.stat-item h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-amber);
}

.stat-item p {
    font-size: 0.9rem;
    margin-bottom: 0;
}

.hero-image img {
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 20px 40px var(--shadow-color);
}

/* Responsive for homepage */
@media (max-width: 968px) {
    .hero-section {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-stats {
        justify-content: center;
    }
}

/* =============================================
   GLOBAL RESPONSIVE ADDITIONS
   ============================================= */

/* Global overflow prevention */
*, *::before, *::after { box-sizing: border-box; }
/* NOTE: overflow-x: hidden on html/body breaks position:sticky.
   Instead we clip overflow on a wrapper element (see .main-wrapper). */
html { overflow-x: clip; }
body { overflow-x: clip; }
img { max-width: 100%; height: auto; }

/* Main wrapper fixes */
@media (max-width: 640px) {
    .main-wrapper {
        margin-top: 70px;
    }
}

/* 480px breakpoint - between 425px and 576px */
@media (max-width: 480px) {
    .hero-title { font-size: 1.9rem; }
    .title-line.highlight { font-size: 2.1rem; }
    .hero-card { padding: 1.5rem; }
    .hero-card { margin-left: 0 !important; }
    .mini-stat-value { font-size: 1.3rem; }
    .mini-stat-label { font-size: 0.75rem; }
    .stats-mini-grid { gap: 1rem; }
    .btn-xl { 
        padding: 0.8rem 1.2rem; 
        font-size: 0.85rem; 
        width: 100%;
        justify-content: center;
    }
    .cta-premium-card { padding: 1.2rem 1rem; border-radius: 30px; }
    .cta-title { font-size: 1.6rem; }
    .cta-description { font-size: 0.9rem; }
    .section-title { font-size: 1.7rem; }
    .problems-grid { gap: 1.2rem; }
    .problem-card { padding: 1.5rem 1.2rem; }
    .services-premium-grid { gap: 1.2rem; }
    .brand-showcase-item { padding: 1.2rem; border-radius: 24px; }
}

/* 320px breakpoint - very small phones */
@media (max-width: 320px) {
    .container { padding: 0 0.8rem; }
    .hero-title { font-size: 1.6rem; }
    .title-line.highlight { font-size: 1.8rem; }
    .section-title { font-size: 1.4rem; }
    .section-tag { font-size: 0.7rem; letter-spacing: 1.5px; }
    .hero-card { padding: 1.2rem; }
    .mini-stat-value { font-size: 1.2rem; }
    .cta-title { font-size: 1.4rem; }
    .btn-primary, .btn-outline { padding: 0.8rem 1.5rem; font-size: 0.9rem; }
    .btn-large { padding: 0.9rem 1.8rem; font-size: 0.95rem; }
    .problem-card h3 { font-size: 1.1rem; }
    .problem-card p { font-size: 0.85rem; }
    .brand-logo-large h3 { font-size: 1.4rem; }
    .result-number { font-size: 1.2rem; }
}

/* Landscape mobile specific */
@media (max-width: 896px) and (orientation: landscape) and (max-height: 450px) {
    .hero-section-full { min-height: auto; padding: 2rem 0; }
    .hero-grid { gap: 2rem; }
    .hero-title { font-size: 2rem; }
    .lead-text { font-size: 1rem; }
    .hero-cta-group { margin-bottom: 1.5rem; }
    .hero-card { margin-left: 0; padding: 1.5rem; }
}

/* Ensure process section doesn't overflow on mobile */
@media (max-width: 992px) {
    .process-section { overflow: hidden; }
    .process-zigzag-container { overflow: visible; }
}

/* Fix hero card margin on tablets */
@media (max-width: 1024px) {
    .hero-card { margin-left: 0; }
}

/* Portfolio page mobile fixes */
@media (max-width: 480px) {
    .portfolio-container { padding: 0.8rem; }
    .merkri-logo { padding: 1.5rem 1rem; }
    .merkri-logo h1.black-heading { font-size: 1.9rem; }
    .brands-grid { gap: 1.2rem; }
    .brand-image { height: 250px; }
    .brand-info h2 { font-size: 1.3rem; }
    .info-label { font-size: 0.7rem; }
    .brand-card.personal-branding .brand-image,
    .brand-card.web-design .brand-image { height: 300px; }
    .overlay-title { font-size: 1.3rem; }
    .overlay-desc { font-size: 0.85rem; }
    .view-more-btn { padding: 0.6rem 1.5rem; font-size: 0.85rem; }
}

@media (max-width: 320px) {
    .portfolio-container { padding: 0.6rem; }
    .merkri-logo h1.black-heading { font-size: 1.7rem; }
    .brand-image { height: 220px; }
    .brands-grid { gap: 1rem; }
}