/**
 * Critical CSS for "Sab Kuch Theek Hai" website
 * Above-the-fold styles loaded synchronously
 */

/* CSS Reset and Base Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* CSS Custom Properties (Light Theme) */
:root {
    /* Colors */
    --primary: #2c1810;
    --primary-light: #4a2d1a;
    --primary-dark: #1a0e08;
    --secondary: #8b4513;
    --accent: #d2691e;
    --accent-light: #daa520;
    
    /* Text Colors */
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --text-inverse: #ffffff;
    
    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f1f3f4;
    --bg-overlay: rgba(0, 0, 0, 0.5);
    
    /* Border Colors */
    --border-light: #e0e0e0;
    --border-medium: #cccccc;
    --border-dark: #999999;
    
    /* Shadow */
    --shadow-small: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 8px rgba(0, 0, 0, 0.12);
    --shadow-large: 0 8px 16px rgba(0, 0, 0, 0.15);
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Typography */
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    --font-size-4xl: 2.5rem;
    
    /* Line Heights */
    --line-height-tight: 1.25;
    --line-height-normal: 1.6;
    --line-height-loose: 1.8;
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.15s ease-out;
    --transition-medium: 0.3s ease-out;
    --transition-slow: 0.5s ease-out;
    
    /* Layout */
    --max-width: 1200px;
    --max-width-narrow: 800px;
    --max-width-wide: 1400px;
    --header-height: 80px;
    --footer-height: auto;
}

/* Dark Theme */
[data-theme="dark"] {
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #999999;
    --text-inverse: #000000;
    
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #404040;
    --bg-overlay: rgba(255, 255, 255, 0.1);
    
    --border-light: #404040;
    --border-medium: #666666;
    --border-dark: #999999;
    
    --shadow-small: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-medium: 0 4px 8px rgba(0, 0, 0, 0.4);
    --shadow-large: 0 8px 16px rgba(0, 0, 0, 0.5);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin: 0 0 var(--space-md) 0;
    font-weight: 600;
    line-height: var(--line-height-tight);
    color: var(--text-primary);
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

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

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

a:hover {
    color: var(--accent-light);
    text-decoration: underline;
}

a:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Skip Links */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary);
    color: var(--text-inverse);
    padding: var(--space-sm) var(--space-md);
    text-decoration: none;
    border-radius: var(--radius-sm);
    z-index: 1000;
    transition: top var(--transition-medium);
}

.skip-link:focus {
    top: 6px;
    outline: 2px solid var(--accent);
}

/* Visually Hidden */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-small);
    z-index: 100;
    height: var(--header-height);
}

.main-nav {
    height: 100%;
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-md);
}

.logo a {
    color: var(--primary);
    font-weight: 700;
    font-size: var(--font-size-xl);
    text-decoration: none;
}

.logo h1 {
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: var(--space-lg);
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    color: var(--text-primary);
    font-weight: 500;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    display: block;
    position: relative;
}

.nav-menu a:hover,
.nav-menu a[aria-current="page"] {
    background: var(--bg-secondary);
    color: var(--accent);
    text-decoration: none;
}

.nav-menu a[aria-current="page"]::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 20px;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
    transform: translateX(-50%);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    transition: background-color var(--transition-fast);
}

.menu-toggle:hover {
    background: var(--bg-secondary);
}

.hamburger-line {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    margin: 2px 0;
    transition: all var(--transition-medium);
    border-radius: 1px;
}

.menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
    border-radius: var(--radius-full);
    font-size: var(--font-size-lg);
    transition: all var(--transition-fast);
    margin-left: var(--space-md);
}

.theme-toggle:hover {
    background: var(--bg-secondary);
    transform: scale(1.1);
}

.theme-toggle:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - var(--header-height));
    padding-top: var(--space-lg);
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--text-inverse);
    padding: var(--space-3xl) var(--space-md);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="20" cy="20" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="80" cy="40" r="0.5" fill="%23ffffff" opacity="0.05"/><circle cx="40" cy="80" r="1.5" fill="%23ffffff" opacity="0.08"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    max-width: var(--max-width-narrow);
    text-align: center;
    z-index: 2;
    position: relative;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    margin-bottom: var(--space-md);
    font-weight: 800;
    letter-spacing: -0.02em;
    text-shadow: 2px 4px 8px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-2xl);
    opacity: 0.9;
    font-weight: 300;
}

.hero-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-lg);
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-medium);
    border: 2px solid transparent;
    font-size: var(--font-size-lg);
    min-width: 160px;
    justify-content: center;
}

.cta-button.primary {
    background: var(--accent);
    color: var(--text-inverse);
    box-shadow: var(--shadow-medium);
}

.cta-button.primary:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-large);
    text-decoration: none;
}

.cta-button.secondary {
    background: transparent;
    color: var(--text-inverse);
    border-color: rgba(255, 255, 255, 0.3);
}

.cta-button.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
}

/* Hero Visual Effects */
.hero-visual {
    position: absolute;
    right: -100px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.1;
    z-index: 1;
    pointer-events: none;
}

.floating-text {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.floating-text span {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--text-inverse);
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

/* Page Header */
.page-header {
    background: var(--bg-secondary);
    padding: var(--space-3xl) var(--space-md) var(--space-2xl);
    text-align: center;
    border-bottom: 1px solid var(--border-light);
}

.page-header-content {
    max-width: var(--max-width-narrow);
    margin: 0 auto;
}

.page-title {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: var(--space-md);
    color: var(--primary);
}

.page-subtitle {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--bg-primary);
        flex-direction: column;
        padding: var(--space-md);
        box-shadow: var(--shadow-large);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-medium);
        gap: 0;
        border-top: 1px solid var(--border-light);
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-menu a {
        padding: var(--space-md);
        border-bottom: 1px solid var(--border-light);
        margin: 0;
    }
    
    .nav-menu a:last-child {
        border-bottom: none;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .hero {
        min-height: 500px;
        padding: var(--space-2xl) var(--space-md);
        text-align: center;
    }
    
    .hero-visual {
        display: none;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-button {
        width: 100%;
        max-width: 280px;
    }
    
    .page-header {
        padding: var(--space-2xl) var(--space-md) var(--space-xl);
    }
}

@media (max-width: 480px) {
    :root {
        --font-size-4xl: 2rem;
        --font-size-3xl: 1.75rem;
        --font-size-2xl: 1.5rem;
    }
    
    .nav-container {
        padding: 0 var(--space-sm);
    }
    
    .hero {
        min-height: 400px;
        padding: var(--space-xl) var(--space-md);
    }
    
    .hero-actions {
        gap: var(--space-sm);
    }
    
    .page-header {
        padding: var(--space-xl) var(--space-md) var(--space-lg);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .hero::before {
        display: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --border-light: #000000;
        --border-medium: #000000;
        --shadow-small: none;
        --shadow-medium: none;
        --shadow-large: none;
    }
    
    .hero {
        background: #000000;
    }
    
    .cta-button.primary {
        border: 2px solid #ffffff;
    }
}

/* Print Styles */
@media print {
    .site-header,
    .hero-visual,
    .theme-toggle,
    .menu-toggle {
        display: none;
    }
    
    .hero {
        background: none;
        color: #000000;
        min-height: auto;
        padding: var(--space-md) 0;
    }
    
    .cta-button {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
}