/* ===================================
   AGORA TECHNOS - MAIN STYLESHEET
   Clean & Sustainable (Light Mode)
   =================================== */

:root {
    /* Brand Colors — Light Green / Solar Amber */
    --sun:    #F0A500;   /* solar amber accent */
    --amber:  #E08A00;   /* darker amber hover */
    --deep:   #F9F7F2;   /* warm white – primary bg */
    --slate:  #F0EDE5;   /* warm cream – secondary bg */
    --sky:    #3D8A65;   /* green-light (repurposed) */
    --light:  #1C1C1C;   /* dark text */
    --muted:  #8A9E8F;   /* muted green-grey text */
    --white:  #FFFFFF;

    /* Green tokens */
    --green:    #2E6B4F;
    --green-lt: #3D8A65;
    --green-dk: #1C4A35;

    /* Compatibility aliases */
    --primary-orange: #F0A500;
    --accent-gold:    #E08A00;
    --dark-navy:      #F9F7F2;
    --primary-green:  #2E6B4F;
    --deep-green:     #1C4A35;
    --sky-blue:       #3D8A65;

    /* Functional variables */
    --bg-primary:   #F9F7F2;
    --bg-secondary: #F0EDE5;
    --text-primary: #1C1C1C;
    --text-secondary: #8A9E8F;
    --border-color: rgba(46, 107, 79, 0.15);

    /* Gradients */
    --gradient-text:       linear-gradient(135deg, var(--green), var(--amber));
    --gradient-hero-mesh:  linear-gradient(135deg, rgba(46,107,79,0.04) 0%, rgba(240,165,0,0.04) 100%);
    --gradient-glass:      linear-gradient(135deg, rgba(249,247,242,0.92), rgba(240,237,229,0.96));
    --gradient-card-border: linear-gradient(135deg, var(--green), var(--amber));

    /* Shadows — lighter for light theme */
    --shadow-glow-orange: 0 0 30px rgba(240, 165, 0, 0.2);
    --shadow-glow-green:  0 0 20px rgba(46, 107, 79, 0.15);
    --shadow-elevated:    0 20px 60px rgba(0, 0, 0, 0.10);
    --shadow-card-hover:  0 20px 50px rgba(0, 0, 0, 0.10);
    --shadow-sm:  0 2px 8px  rgba(0, 0, 0, 0.05);
    --shadow-md:  0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg:  0 8px 32px rgba(0, 0, 0, 0.10);

    /* Glass */
    --glass-bg:    rgba(249, 247, 242, 0.92);
    --glass-border: rgba(46, 107, 79, 0.15);
    --glass-blur:  14px;

    /* Typography */
    --font-heading: 'Cormorant Garamond', Georgia, serif;
    --font-body:    'Outfit', sans-serif;
    --font-serif:   'Cormorant Garamond', Georgia, serif;

    /* Letter Spacing */
    --tracking-tight:  -0.01em;
    --tracking-normal:  0.01em;
    --tracking-wide:    0.05em;
    --tracking-wider:   0.10em;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;

    /* Transitions */
    --transition-fast:   0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow:   0.5s ease;
    --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-back:  cubic-bezier(0.34, 1.56, 0.64, 1);
    --spring:         cubic-bezier(0.43, 0.195, 0.02, 1.0);

    /* Border Radius — organic / rounded */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

/* Light theme */
html[data-theme="light"] {
    color-scheme: light;
    --bg-primary:    #F9F7F2;
    --bg-secondary:  #F0EDE5;
    --text-primary:  #1C1C1C;
    --text-secondary: #8A9E8F;
    --border-color:  rgba(46, 107, 79, 0.15);
    --glass-bg:      rgba(249, 247, 242, 0.92);
    --glass-border:  rgba(46, 107, 79, 0.15);
}

/* Dark theme — html[...] has specificity (0,1,1) which beats :root (0,1,0) */
html[data-theme="dark"] {
    color-scheme: dark;
    /* Core palette */
    --deep:   #0D1F0A;
    --slate:  #152B10;
    --white:  #1E3D10;
    --light:  #EDE9E0;
    --muted:  #8FAF92;

    /* Green tokens — brightened for dark bg */
    --green:    #5DC88A;
    --green-lt: #70D49A;
    --green-dk: #C4DFC8;

    /* Compatibility aliases */
    --dark-navy:   #0D1F0A;
    --primary-green: #5DC88A;
    --deep-green:  #C4DFC8;
    --sky-blue:    #70D49A;

    /* Functional variables */
    --bg-primary:    #0D1F0A;
    --bg-secondary:  #152B10;
    --text-primary:  #EDE9E0;
    --text-secondary: #8FAF92;
    --border-color:  rgba(237, 233, 224, 0.12);

    /* Glass */
    --glass-bg:    rgba(13, 31, 10, 0.92);
    --glass-border: rgba(237, 233, 224, 0.12);

    /* Shadows — stronger for dark surfaces */
    --shadow-sm:  0 2px 8px  rgba(0, 0, 0, 0.4);
    --shadow-md:  0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg:  0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-elevated:   0 20px 60px rgba(0, 0, 0, 0.6);
    --shadow-card-hover: 0 20px 50px rgba(0, 0, 0, 0.5);

    /* Gradients */
    --gradient-glass: linear-gradient(135deg, rgba(13,31,10,0.92), rgba(21,43,16,0.96));
}

/* ===================================
   RESET & BASE
   =================================== */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

html.font-small  { font-size: 14px; }
html.font-medium { font-size: 16px; }
html.font-large  { font-size: 18px; }

body {
    font-family: var(--font-body);
    font-weight: 300;
    background-color: var(--deep);
    color: var(--light);
    line-height: 1.7;
    overflow-x: hidden;
}

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

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

ul { list-style: none; }

button { font-family: var(--font-body); cursor: pointer; border: none; background: none; }

/* ===================================
   TYPOGRAPHY
   =================================== */

h1, h2 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0;
    margin-bottom: var(--spacing-sm);
    color: var(--green-dk);
}

h3, h4, h5, h6 {
    font-family: var(--font-body);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    margin-bottom: var(--spacing-sm);
    color: var(--green-dk);
}

h1 { font-size: clamp(2.5rem, 5.5vw, 5rem); line-height: 1.15; }
h2 { font-size: clamp(2rem, 3.5vw, 3.2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }
h4 { font-size: clamp(0.95rem, 1.5vw, 1.1rem); }

p {
    margin-bottom: var(--spacing-sm);
    color: var(--muted);
}

/* ===================================
   UTILITY CLASSES
   =================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.container-fluid { width: 100%; padding: 0 var(--spacing-md); }

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

.section-title {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.section-title h2 {
    position: relative;
    display: inline-block;
    padding-bottom: var(--spacing-sm);
    color: var(--green-dk);
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, var(--amber), transparent);
    border-radius: 2px;
}

.section-title p {
    font-size: 1rem;
    max-width: 600px;
    margin: 0.75rem auto 0;
    color: var(--muted);
}

/* Section Label */
.section-label {
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--green);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.section-label::before {
    content: '';
    display: block;
    width: 24px;
    height: 2px;
    background: var(--amber);
    border-radius: 2px;
    flex-shrink: 0;
}

.section-title .section-label {
    justify-content: center;
    display: flex;
    margin-bottom: 0.75rem;
}

/* ===================================
   BUTTONS
   =================================== */

.btn {
    display: inline-block;
    padding: 0.9rem 2.2rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    border-radius: 100px;
    transition: all 0.3s;
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.4s;
}

.btn:hover::before { left: 100%; }

.btn-primary {
    background: var(--green);
    color: var(--white);
    border: none;
    box-shadow: 0 4px 15px rgba(46, 107, 79, 0.25);
}

.btn-primary:hover {
    background: var(--green-dk);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(46, 107, 79, 0.35);
}

.btn-primary:active { transform: translateY(-1px) scale(0.98); }

.btn-secondary {
    background: transparent;
    border: 1.5px solid var(--border-color);
    color: var(--light);
}

.btn-secondary:hover {
    border-color: var(--green);
    color: var(--green);
    transform: translateY(-2px);
}

.btn-secondary:active { transform: translateY(-1px) scale(0.98); }

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border-color);
    color: var(--light);
}

.btn-outline:hover {
    border-color: var(--green);
    color: var(--green);
    transform: translateY(-2px);
}

/* Grid System */
.grid { display: grid; gap: var(--spacing-md); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

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

.text-gradient {
    background: linear-gradient(135deg, var(--green), var(--amber));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===================================
   HEADER & NAVIGATION
   =================================== */

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: transparent;
    transition: all 0.4s var(--ease-out-expo);
}

.header.scrolled {
    background: var(--glass-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 1px 0 var(--border-color);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.4rem var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-img { height: 50px; width: auto; }

.logo-text h1 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin: 0;
    letter-spacing: -0.01em;
    color: var(--green-dk);
    text-transform: none;
    background: none;
    -webkit-text-fill-color: var(--green-dk);
    line-height: 1;
}

.logo-text p {
    font-size: 0.68rem;
    color: var(--muted);
    margin: 0;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-family: var(--font-body);
    font-weight: 300;
}

/* Navigation */
.nav-menu {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-menu a {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    position: relative;
    padding: 0.5rem 0;
    transition: color var(--transition-fast);
    color: var(--muted);
}

.nav-menu a:hover { color: var(--green); }
.nav-menu a::after { display: none; }
.nav-menu a.active { color: var(--green); font-weight: 500; }

/* Header Controls */
.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.control-btn {
    width: 36px;
    height: 36px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(46, 107, 79, 0.08);
    border: 1px solid rgba(46, 107, 79, 0.2);
    color: var(--muted);
    transition: all 0.3s;
}

.control-btn:hover {
    background: var(--green);
    color: var(--white);
    border-color: var(--green);
}

.control-btn svg { width: 18px; height: 18px; }

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--green);
    transition: all var(--transition-normal);
}

.menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(4px, 5px); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ===================================
   HERO SECTION
   =================================== */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: var(--deep);
    padding-top: 110px;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse 70% 60% at 70% 30%, rgba(240,165,0,0.07) 0%, transparent 60%),
        radial-gradient(ellipse 50% 50% at 20% 70%, rgba(46,107,79,0.06) 0%, transparent 50%);
    z-index: 0;
}

.hero::after { display: none; }

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-text .section-label {
    animation: heroEntrance 0.8s var(--ease-out-expo) both;
}

.hero-text h1 {
    margin-bottom: var(--spacing-md);
    animation: heroEntrance 0.8s var(--ease-out-expo) 0.15s both;
    color: var(--green-dk);
}

.hero-text .tagline {
    font-size: 0.88rem;
    color: var(--green);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: var(--spacing-md);
    animation: heroEntrance 0.8s var(--ease-out-expo) 0.3s both;
    font-family: var(--font-body);
}

.hero-text p {
    font-size: 1rem;
    margin-bottom: var(--spacing-md);
    animation: heroEntrance 0.8s var(--ease-out-expo) 0.3s both;
    color: var(--muted);
    line-height: 1.75;
    max-width: 460px;
}

.hero-buttons {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    animation: heroEntrance 0.8s var(--ease-out-expo) 0.45s both;
}

.hero-image {
    position: relative;
    animation: fadeInRight 1s var(--ease-out-expo) 0.3s both;
}

.hero-image img {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-elevated);
    position: relative;
    z-index: 1;
    border: 1px solid rgba(46, 107, 79, 0.12);
}

.hero-image::before {
    content: '';
    position: absolute;
    top: -12px;
    right: -12px;
    bottom: 12px;
    left: 12px;
    border: 1px solid rgba(46, 107, 79, 0.2);
    border-radius: var(--radius-md);
    z-index: 0;
}

.hero-image::after {
    content: '';
    position: absolute;
    top: -16px;
    right: -16px;
    width: 44px;
    height: 44px;
    background: var(--amber);
    border-radius: 0;
    z-index: 0;
    opacity: 0.8;
}

/* Hero Particles */
.hero-particles {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.hero-particles .particle { position: absolute; border-radius: 50%; }

.hero-particles .particle:nth-child(1) {
    width: 220px; height: 220px;
    top: 15%; left: 10%;
    background: radial-gradient(circle, rgba(240,165,0,0.08) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

.hero-particles .particle:nth-child(2) {
    width: 160px; height: 160px;
    top: 60%; right: 15%;
    background: radial-gradient(circle, rgba(46,107,79,0.08) 0%, transparent 70%);
    animation: float 8s ease-in-out infinite 2s;
}

.hero-particles .particle:nth-child(3) {
    width: 100px; height: 100px;
    bottom: 20%; left: 30%;
    background: radial-gradient(circle, rgba(240,165,0,0.05) 0%, transparent 70%);
    animation: float 10s ease-in-out infinite 4s;
}

/* Stats Cards */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
    position: relative;
    z-index: 1;
}

.stat-card {
    background: var(--white);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--green), var(--amber));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s var(--ease-out-expo);
}

.stat-card:hover::before { transform: scaleX(1); }

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border-color: rgba(46, 107, 79, 0.25);
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    color: var(--green);
    line-height: 1;
    letter-spacing: -0.02em;
}

.stat-label {
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 0.25rem;
    font-weight: 400;
}

/* ===================================
   ANIMATIONS
   =================================== */

@keyframes heroEntrance {
    from { opacity: 0; transform: translateY(30px); filter: blur(4px); }
    to   { opacity: 1; transform: translateY(0);    filter: blur(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(50px); filter: blur(4px); }
    to   { opacity: 1; transform: translateX(0);    filter: blur(0); }
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.05); }
}

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

@keyframes slideInFromBottom {
    from { opacity: 0; transform: translateY(60px); filter: blur(2px); }
    to   { opacity: 1; transform: translateY(0);    filter: blur(0); }
}

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

@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position:  200% center; }
}

@keyframes rotateGlow {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

/* Typed Text Cursor */
.typed-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--green);
    margin-left: 2px;
    vertical-align: middle;
    animation: cursorBlink 0.7s steps(1) infinite;
}

@keyframes cursorBlink {
    0%, 50%   { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Scroll Animation System */
.animate-hidden {
    opacity: 0;
    transform: translateY(40px);
    filter: blur(2px);
    transition: opacity 0.7s var(--ease-out-expo),
                transform 0.7s var(--ease-out-expo),
                filter 0.7s var(--ease-out-expo);
}

.animate-visible {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

/* Section Separators */
.services::before,
.contact::before {
    content: '';
    display: block;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(46,107,79,0.15), transparent);
    margin-bottom: var(--spacing-xl);
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

@media (max-width: 968px) {
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: var(--white);
        flex-direction: column;
        justify-content: start;
        padding: var(--spacing-lg) var(--spacing-md);
        transition: left var(--transition-normal);
        box-shadow: var(--shadow-lg);
        border-top: 1px solid var(--border-color);
    }

    .nav-menu.active { left: 0; }

    .menu-toggle { display: flex; }

    .hero-content { grid-template-columns: 1fr; }

    .hero-image { order: -1; }

    .hero-image::before,
    .hero-image::after { display: none; }
}

@media (max-width: 640px) {
    .hero-buttons { flex-direction: column; }
    .btn { width: 100%; }
    .stats-cards { grid-template-columns: repeat(2, 1fr); }
}

/* ===================================
   DARK MODE OVERRIDES
   Fixes hardcoded colors in inline styles
   =================================== */

/* Hero photo background — swap overlay to dark */
html[data-theme="dark"] #home.hero {
    background-image:
        linear-gradient(rgba(13,31,10,0.88), rgba(13,31,10,0.85)),
        url('row-panel.png');
}

/* Process section photo background */
html[data-theme="dark"] .process-section {
    background-image:
        linear-gradient(rgba(13,31,10,0.94), rgba(13,31,10,0.94)),
        url('rain-sun-panel.png');
}

/* About visual gradient card */
html[data-theme="dark"] .av-bg {
    background: linear-gradient(135deg, #0F2A18 0%, #162E1E 50%, #1A3828 100%);
}

/* Hero panel visualisation */
html[data-theme="dark"] .panel-vis {
    background: linear-gradient(160deg, #0E3A1A 0%, #152B0F 55%, #1A2B2A 100%);
}

/* Panel cells on dark */
html[data-theme="dark"] .p-cell {
    background: #203A6A;
}

/* Mobile nav background */
html[data-theme="dark"] .nav-menu {
    background: var(--bg-secondary);
}

/* Body transition for smooth theme switch */
body {
    transition: background-color 0.3s ease, color 0.2s ease;
}
