/* Base CSS - Design Tokens, Reset, Typography, Global Styles for SK Chit Funds */

/* ==========================================
   CSS VARIABLES — SK CHIT FUNDS BRAND
   
   Variable names are inherited from the component system.
   Values have been updated to the SK Chit Funds palette.
   --primary-blue → Muted Gold (accent/CTAs)
   --bg-dark → Forest Green (dark sections)
   --bg-darker → Deepest Forest (footer/nav)
   ========================================== */
:root {
    /* Monochromatic Green Palette */
    --green-950: #072F2D; /* Deepest Forest */
    --green-900: #1A3B36;
    --green-800: #2C4A42;
    --green-700: #3D6B58;
    --green-500: #8BB59F; /* Sage Accent */
    --green-300: #D4E3D3; /* Pale Mint */
    --green-100: #EAF1E8; /* Lightest Mint */

    /* Neutral / Legacy variables (used across components) */
    --charcoal: #2D2D2D;
    --primary-blue: #0b6b3a;
    --text-white: #ffffff;
    --bg-darker: #072F2D;
    --text-muted: #6B7280;
    --border-color: rgba(212, 227, 211, 0.2);
    
    /* Semantic Variables */
    --bg-dark: var(--green-950);
    --bg-dark-surface: var(--green-900);
    --bg-light: var(--green-100);
    
    --text-on-dark: var(--green-100);
    --text-on-light: var(--green-950);
    --text-muted-dark: var(--green-500); 
    
    --accent: var(--green-300); /* Replaces Gold! */
    --border-dark: rgba(212, 227, 211, 0.15); /* Green-300 with opacity */
    --border-light: rgba(7, 47, 45, 0.1);

    /* Typography — Classic Finance */
    --font-heading: 'Instrument Serif', 'Playfair Display', Georgia, serif;
    --font-body: 'Manrope', 'Inter', sans-serif;
    --font-weight-heading: 400;
    --font-weight-body: 400;

    /* Spacing — Generous for premium feel */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2.5rem;
    --spacing-xl: 3.5rem;
    --spacing-3xl: 6rem;

    /* Transitions */
    --transition-fast: 0.2s;
    --transition-normal: 0.35s;
    --transition-slow: 0.6s;

    /* Shadows — Warm tint */
    --shadow-sm: 0 2px 5px rgba(42, 42, 40, 0.05);
    --shadow-md: 0 12px 28px rgba(42, 42, 40, 0.08);
    --shadow-lg: 0 24px 48px rgba(42, 42, 40, 0.12);

    /* Border Radius — Sharp, engineered (max 4px) */
    --radius-sm: 2px;
    --radius-md: 4px;
    --radius-lg: 4px;

    /* Z-indices */
    --z-dropdown: 1000;
    --z-sticky: 100;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;

    /* Container */
    --container-max: 1200px;

    /* Header height */
    --header-height: 80px;

    /* Angled Hero Geometry */
    --hero-angle-depth-desktop: 80px;
    --hero-angle-depth-tablet: 50px;
    --hero-angle-depth-mobile: 30px;
}

@media (max-width: 1023px) {
    :root {
        --header-height: 70px;
    }
}

/* ==========================================
   ANGLED HERO BOTTOM - UNIFIED DESIGN SYSTEM
   ========================================== */
.hero-angled-bottom {
    position: relative;
    z-index: 1;
}

.hero-angled-bottom::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--hero-angle-depth-desktop);
    background: inherit;
    clip-path: polygon(
        0 0,
        100% 0,
        100% 100%,
        0 100%,
        0 calc(100% - var(--hero-angle-depth-desktop)),
        100% calc(100% - var(--hero-angle-depth-desktop) * 0.4)
    );
    pointer-events: none;
}

/* Page-specific angle variations */
.hero-angled-bottom.variant-home::after {
    clip-path: polygon(
        0 0,
        100% 0,
        100% 100%,
        0 100%,
        0 calc(100% - var(--hero-angle-depth-desktop)),
        100% calc(100% - var(--hero-angle-depth-desktop) * 0.3)
    );
}

.hero-angled-bottom.variant-about::after {
    clip-path: polygon(
        0 0,
        100% 0,
        100% 100%,
        0 100%,
        0 calc(100% - var(--hero-angle-depth-desktop)),
        100% calc(100% - var(--hero-angle-depth-desktop) * 0.5)
    );
}

.hero-angled-bottom.variant-schemes::after {
    clip-path: polygon(
        0 0,
        100% 0,
        100% 100%,
        0 100%,
        0 calc(100% - var(--hero-angle-depth-desktop)),
        100% calc(100% - var(--hero-angle-depth-desktop) * 0.35)
    );
}

.hero-angled-bottom.variant-faq::after {
    clip-path: polygon(
        0 0,
        100% 0,
        100% 100%,
        0 100%,
        0 calc(100% - var(--hero-angle-depth-desktop)),
        100% calc(100% - var(--hero-angle-depth-desktop) * 0.45)
    );
}

.hero-angled-bottom.variant-contact::after {
    clip-path: polygon(
        0 0,
        100% 0,
        100% 100%,
        0 100%,
        0 calc(100% - var(--hero-angle-depth-desktop)),
        100% calc(100% - var(--hero-angle-depth-desktop) * 0.4)
    );
}

/* Tablet responsive */
@media (max-width: 1023px) {
    .hero-angled-bottom::after {
        height: var(--hero-angle-depth-tablet);
        clip-path: polygon(
            0 0,
            100% 0,
            100% 100%,
            0 100%,
            0 calc(100% - var(--hero-angle-depth-tablet)),
            100% calc(100% - var(--hero-angle-depth-tablet) * 0.4)
        );
    }

    .hero-angled-bottom.variant-home::after {
        clip-path: polygon(
            0 0,
            100% 0,
            100% 100%,
            0 100%,
            0 calc(100% - var(--hero-angle-depth-tablet)),
            100% calc(100% - var(--hero-angle-depth-tablet) * 0.3)
        );
    }

    .hero-angled-bottom.variant-about::after {
        clip-path: polygon(
            0 0,
            100% 0,
            100% 100%,
            0 100%,
            0 calc(100% - var(--hero-angle-depth-tablet)),
            100% calc(100% - var(--hero-angle-depth-tablet) * 0.5)
        );
    }

    .hero-angled-bottom.variant-schemes::after {
        clip-path: polygon(
            0 0,
            100% 0,
            100% 100%,
            0 100%,
            0 calc(100% - var(--hero-angle-depth-tablet)),
            100% calc(100% - var(--hero-angle-depth-tablet) * 0.35)
        );
    }

    .hero-angled-bottom.variant-faq::after {
        clip-path: polygon(
            0 0,
            100% 0,
            100% 100%,
            0 100%,
            0 calc(100% - var(--hero-angle-depth-tablet)),
            100% calc(100% - var(--hero-angle-depth-tablet) * 0.45)
        );
    }

    .hero-angled-bottom.variant-contact::after {
        clip-path: polygon(
            0 0,
            100% 0,
            100% 100%,
            0 100%,
            0 calc(100% - var(--hero-angle-depth-tablet)),
            100% calc(100% - var(--hero-angle-depth-tablet) * 0.4)
        );
    }
}

/* Mobile responsive */
@media (max-width: 767px) {
    .hero-angled-bottom::after {
        height: var(--hero-angle-depth-mobile);
        clip-path: polygon(
            0 0,
            100% 0,
            100% 100%,
            0 100%,
            0 calc(100% - var(--hero-angle-depth-mobile)),
            100% calc(100% - var(--hero-angle-depth-mobile) * 0.3)
        );
    }

    .hero-angled-bottom.variant-home::after {
        clip-path: polygon(
            0 0,
            100% 0,
            100% 100%,
            0 100%,
            0 calc(100% - var(--hero-angle-depth-mobile)),
            100% calc(100% - var(--hero-angle-depth-mobile) * 0.25)
        );
    }

    .hero-angled-bottom.variant-about::after {
        clip-path: polygon(
            0 0,
            100% 0,
            100% 100%,
            0 100%,
            0 calc(100% - var(--hero-angle-depth-mobile)),
            100% calc(100% - var(--hero-angle-depth-mobile) * 0.35)
        );
    }

    .hero-angled-bottom.variant-schemes::after {
        clip-path: polygon(
            0 0,
            100% 0,
            100% 100%,
            0 100%,
            0 calc(100% - var(--hero-angle-depth-mobile)),
            100% calc(100% - var(--hero-angle-depth-mobile) * 0.3)
        );
    }

    .hero-angled-bottom.variant-faq::after {
        clip-path: polygon(
            0 0,
            100% 0,
            100% 100%,
            0 100%,
            0 calc(100% - var(--hero-angle-depth-mobile)),
            100% calc(100% - var(--hero-angle-depth-mobile) * 0.32)
        );
    }

    .hero-angled-bottom.variant-contact::after {
        clip-path: polygon(
            0 0,
            100% 0,
            100% 100%,
            0 100%,
            0 calc(100% - var(--hero-angle-depth-mobile)),
            100% calc(100% - var(--hero-angle-depth-mobile) * 0.3)
        );
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .hero-angled-bottom::after {
        transition: none;
    }
}

/* ==========================================
   CSS RESET
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: auto; /* Handled by Lenis */
    box-sizing: border-box;
    overflow-x: hidden;
}

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;
}

.lenis.lenis-scrolling iframe {
    pointer-events: none;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--charcoal);
    background-color: var(--text-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ==========================================
   TYPOGRAPHY — Serif Headings, Sans-Serif Body
   ========================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-heading);
    line-height: 1.15;
    color: var(--bg-darker);
    letter-spacing: -0.01em;
    /* NO text-transform: uppercase — serif fonts use sentence case */
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
}

h2 {
    font-size: clamp(2rem, 4vw, 3.25rem);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
}

h4 {
    font-size: 1.5rem;
}

h5 {
    font-size: 1.25rem;
}

h6 {
    font-size: 1rem;
}

p {
    font-family: var(--font-body);
    color: #4A4A45;
    margin-bottom: 1.25rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.7;
}

a {
    color: inherit; /* Don't force a colour on every <a> — let components control their own links */
    text-decoration: none;
    transition: color var(--transition-fast) ease-in-out;
}

a:hover {
    color: var(--primary-blue);
}

/* ==========================================
   LAYOUT
   ========================================== */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

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

/* Section Label — Eyebrow text with decorative bar */
.section-label {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--charcoal);
    letter-spacing: 0.2em;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    position: relative;
    padding-left: 20px;
}

.section-label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 2px;
    background-color: var(--primary-blue);
}

/* Section Title — Serif, elegant */
.section-title {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 3.5vw, 2.75rem);
    font-weight: 400;
    color: var(--bg-darker);
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.section-subtitle {
    font-family: var(--font-body);
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 600px;
    margin-bottom: var(--spacing-lg);
    font-weight: 400;
    line-height: 1.7;
}

/* ==========================================
   GRID & LAYOUT UTILITIES
   ========================================== */
.grid {
    display: grid;
    gap: var(--spacing-sm);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Text Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Spacing Utilities */
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }

.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

.pt-xl { padding-top: var(--spacing-xl); }
.pb-xl { padding-bottom: var(--spacing-xl); }

/* Flexbox Utilities */
.flex { display: flex; }
.flex-column { flex-direction: column; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

.gap-sm { gap: var(--spacing-xs); }
.gap-md { gap: var(--spacing-sm); }
.gap-lg { gap: var(--spacing-md); }

/* ==========================================
   IMAGES & ICONS
   ========================================== */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

.icon {
    width: 24px;
    height: 24px;
    display: inline-block;
    vertical-align: middle;
    stroke: currentColor;
    fill: none;
}

/* Reset Lists */
ul {
    list-style: none;
}

.hidden {
    display: none !important;
}
