/* =============================================
   BASE STYLES
   Reset, CSS Variables, Typography, Buttons
   ============================================= */

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

::selection {
    background: var(--eg-green);
    color: white;
}

::-moz-selection {
    background: var(--eg-green);
    color: white;
}

/* ---- Theme Variables ---- */

/* Dark theme (V1, About) */
body.theme-dark {
    --green-primary: #00D26A;
    --green-dark: #00B35A;
    --green-glow: rgba(0, 210, 106, 0.3);
    --black: #0A0A0A;
    --dark-gray: #141414;
    --mid-gray: #1E1E1E;
    --light-gray: #2A2A2A;
    --accent-gray: #6B7280;
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);

    font-family: 'Poppins', sans-serif;
    background: var(--black);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Light theme (V4) */
body.theme-light {
    --stone-50: #FAFAF9;
    --stone-100: #F5F5F4;
    --stone-200: #E7E5E4;
    --stone-400: #A8A29E;
    --stone-600: #57534E;
    --stone-800: #292524;
    --stone-950: #0C0A09;
    --eg-green: #3D9B6B;
    --eg-green-light: #E8F5EE;

    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    color: var(--stone-800);
    font-size: 17px;
    line-height: 1.7;
    background: var(--stone-50);
}

/* Cinematic theme (V5) */
body.theme-cinematic {
    --void: #0A0A0A;
    --concrete: #1A1A1A;
    --graphite: #2C2C2C;
    --warm-stone: #F5F0EB;
    --cream: #FAF7F2;
    --signal: #00E676;
    --signal-dim: rgba(0, 230, 118, 0.15);
    --text-body: #3D3D3D;
    --white: #FFFFFF;

    font-family: 'Poppins', sans-serif;
    font-weight: 300;
    color: var(--text-body);
    font-size: 1.05rem;
    line-height: 1.7;
    background: var(--cream);
    overflow-x: hidden;
}

/* ---- Dark theme grid background ---- */
body.theme-dark.landing-original::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

/* ---- Cinematic film grain overlay ---- */
body.theme-cinematic::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    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 256px;
}

/* ---- Typography ---- */

/* Dark theme headings */
body.theme-dark h1,
body.theme-dark h2,
body.theme-dark h3 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

/* Light theme headings */
body.theme-light h1,
body.theme-light h2,
body.theme-light h3 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

/* Cinematic theme headings */
body.theme-cinematic h1,
body.theme-cinematic h2,
body.theme-cinematic h3 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.15;
    color: var(--void);
}

/* ---- Shared section base (dark) ---- */
.section {
    padding: 6rem 5%;
}

.section-dark {
    background: var(--dark-gray);
}

.section-white {
    background: #FFFFFF;
    color: var(--black);
}

.section-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 4rem;
}

.section-label {
    font-family: 'Space Mono', monospace;
    color: var(--green-primary);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1rem;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 300;
}

.section-white .section-label {
    color: var(--green-dark);
}

.section-white .section-title {
    color: var(--black);
}

.section-white .section-subtitle {
    color: rgba(0, 0, 0, 0.7);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ---- Shared Buttons (Dark theme) ---- */
.btn-primary {
    background: var(--green-primary);
    color: var(--black);
    padding: 1.1rem 2.5rem;
    border-radius: 0;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 0 30px var(--green-glow);
}

.btn-primary:hover {
    background: var(--text-primary);
    color: var(--black);
    transform: translateY(-2px);
    box-shadow: 0 0 40px var(--green-glow);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: transparent;
    color: var(--text-primary);
    padding: 1.1rem 2.5rem;
    border-radius: 0;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 2px solid var(--text-primary);
    transition: all 0.3s;
}

.btn-secondary:hover {
    border-color: var(--green-primary);
    color: var(--green-primary);
}

.cta-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ---- Light theme eyebrow ---- */
body.theme-light .eyebrow {
    font-family: 'Poppins', sans-serif;
    font-weight: 300;
    font-size: 1rem;
    color: var(--eg-green);
    margin-bottom: 0.75rem;
    letter-spacing: 0.02em;
}

/* ---- Cinematic theme label ---- */
body.theme-cinematic .label {
    font-family: 'Poppins', sans-serif;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

/* ---- Cinematic gradient bridges ---- */
.bridge-dark-to-light {
    height: 120px;
    background: linear-gradient(to bottom, var(--void), var(--cream));
}
.bridge-light-to-dark {
    height: 120px;
    background: linear-gradient(to bottom, var(--cream), var(--void));
}
.bridge-light-to-warm {
    height: 120px;
    background: linear-gradient(to bottom, var(--cream), var(--warm-stone));
}
.bridge-warm-to-dark {
    height: 120px;
    background: linear-gradient(to bottom, var(--warm-stone), var(--void));
}
.bridge-dark-to-warm {
    height: 120px;
    background: linear-gradient(to bottom, var(--void), var(--warm-stone));
}

/* ---- Wave divider (dark theme) ---- */
.wave-divider {
    margin-top: -2px;
    line-height: 0;
}

.wave-divider svg {
    width: 100%;
    height: 80px;
}

/* ---- Section flow dividers (dark theme) ---- */
.section-flow {
    position: relative;
}

.section-flow::before {
    content: '';
    position: absolute;
    top: -80px;
    left: 0;
    right: 0;
    height: 160px;
    background: inherit;
    clip-path: polygon(0 50%, 100% 0, 100% 100%, 0 100%);
    z-index: 1;
}

.section-flow-reverse::before {
    clip-path: polygon(0 0, 100% 50%, 100% 100%, 0 100%);
}

/* Section blend gradients */
.section-blend-top {
    position: relative;
}

.section-blend-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to bottom, var(--black) 0%, transparent 100%);
    pointer-events: none;
    z-index: 2;
}

.section-blend-bottom::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to top, var(--black) 0%, transparent 100%);
    pointer-events: none;
    z-index: 2;
}

/* Curved section divider */
.section-curve {
    position: relative;
}

.section-curve::before {
    content: '';
    position: absolute;
    top: -100px;
    left: 0;
    right: 0;
    height: 200px;
    background: inherit;
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
