/* ==========================================================================
   Grain SaaS - Premium Light/Grain Theme
   ========================================================================== */

:root {
    /* Grain-inspired Colors */
    --primary: #d4a373;      /* Golden Wheat */
    --primary-dark: #b88656;
    --primary-light: #e9c46a;
    --secondary: #2a9d8f;    /* Earthy Green */
    
    /* Backgrounds & Surfaces */
    --bg-light: #fdfaf6;     /* Very light cream background */
    --bg-card: #ffffff;      /* Pure white for cards */
    --bg-card-hover: #faf8f5;
    --bg-dark: #264653;      /* Deep forest/ocean contrast for footer */
    
    /* Text Colors */
    --text-main: #333333;
    --text-muted: #666666;
    --text-light: #999999;
    
    /* Accents */
    --accent-green: #2a9d8f;
    --accent-orange: #f4a261;
    --accent-red: #e76f51;
    
    /* Borders & Shadows */
    --border-light: rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.12);
    
    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Base Resets & Typography --- */
html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    font-family: var(--font-body);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    margin-top: 0;
    line-height: 1.2;
    color: var(--text-main);
}

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

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

p {
    color: var(--text-muted);
}

/* --- Layout Utilities --- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 100px 0;
    position: relative;
}

.section-sm {
    padding: 60px 0;
}

.bg-white { background-color: #ffffff; }
.bg-cream { background-color: var(--bg-light); }
.bg-dark { background-color: var(--bg-dark); color: #ffffff; }
.bg-dark h1, .bg-dark h2, .bg-dark h3, .bg-dark h4, .bg-dark p { color: #ffffff; }

.text-center { text-align: center; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mb-5 { margin-bottom: 48px; }
.mt-1 { margin-top: 8px; }
.mt-3 { margin-top: 24px; }
.mt-5 { margin-top: 48px; }

/* --- Gradients & Effects --- */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.glow-bg {
    position: absolute;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(212, 163, 115, 0.15) 0%, rgba(253, 250, 246, 0) 70%);
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
}

.grain-pattern {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all var(--transition-smooth);
    border: none;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(212, 163, 115, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 163, 115, 0.6);
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.btn-secondary {
    background: var(--secondary);
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(42, 157, 143, 0.4);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(42, 157, 143, 0.6);
}

.btn-outline {
    background: transparent;
    color: var(--text-main) !important;
    border: 2px solid var(--border-light);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary-dark) !important;
    background: rgba(212, 163, 115, 0.05);
    transform: translateY(-2px);
}

/* --- Navigation --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 0;
    z-index: 1000;
    transition: all var(--transition-fast);
    background: transparent;
    border-bottom: 1px solid transparent;
}

.navbar.scrolled {
    padding: 15px 0;
    background: rgba(253, 250, 246, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 800;
    color: var(--primary-dark) !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-links {
    display: flex;
    gap: 35px;
    align-items: center;
}

.nav-links a {
    color: var(--text-main);
    font-weight: 500;
    font-size: 16px;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--secondary);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 24px;
    cursor: pointer;
}

/* --- Hero Section --- */
.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    padding-top: 100px;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 72px;
    margin-bottom: 24px;
    letter-spacing: -1.5px;
    color: var(--text-main);
}

.hero p {
    font-size: 22px;
    margin-bottom: 40px;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    color: var(--text-muted);
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.hero-image-wrapper {
    margin-top: 60px;
    position: relative;
    z-index: 2;
    padding: 0 20px;
}

.hero-image-wrapper img {
    width: 100%;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 8px solid #ffffff;
}

/* --- Cards --- */
.light-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-smooth);
}

.light-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-5px);
}

/* --- Features Grid --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-icon {
    width: 70px;
    height: 70px;
    border-radius: 16px;
    background: rgba(212, 163, 115, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--primary-dark);
    margin-bottom: 24px;
}

/* --- Alternating Layout (Image/Text) --- */
.split-section {
    display: flex;
    align-items: center;
    gap: 60px;
}

.split-section.reverse {
    flex-direction: row-reverse;
}

.split-content {
    flex: 1;
}

.split-content h2 {
    font-size: 42px;
    margin-bottom: 24px;
}

.split-image {
    flex: 1;
    position: relative;
}

.split-image img {
    width: 100%;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
}

/* --- Pricing --- */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.pricing-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 50px 40px;
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.pricing-card.popular {
    border: 2px solid var(--primary);
    box-shadow: var(--shadow-lg);
    transform: scale(1.05);
    z-index: 10;
}

.pricing-badge {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 1px;
}

.pricing-price {
    font-size: 56px;
    font-weight: 800;
    color: var(--text-main);
    margin: 30px 0;
    font-family: var(--font-heading);
}

.pricing-price span {
    font-size: 18px;
    color: var(--text-muted);
    font-weight: 400;
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 40px 0;
    text-align: left;
}

.pricing-features li {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-main);
}

.pricing-features li i {
    color: var(--secondary);
}

/* --- Stats Row --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    text-align: center;
}
.stat-item h3 {
    font-size: 56px;
    color: var(--primary-dark);
    margin-bottom: 10px;
}
.stat-item p {
    font-size: 18px;
    font-weight: 500;
}

/* --- Testimonials --- */
.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.testimonial-text {
    font-size: 18px;
    font-style: italic;
    color: var(--text-main);
    margin-bottom: 24px;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 15px;
}

.testimonial-author img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

/* --- Contact Form --- */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 30px;
}

.contact-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(42, 157, 143, 0.1);
    color: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.form-control {
    width: 100%;
    padding: 16px 20px;
    background: #f9f9f9;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 16px;
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(212, 163, 115, 0.2);
}

/* --- Footer --- */
.footer {
    background: var(--bg-dark);
    color: #ffffff;
    padding: 80px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 60px;
}

.footer-brand {
    color: #fff !important;
}

.footer-links h4 {
    color: #fff;
    margin-bottom: 24px;
    font-size: 20px;
}

.footer-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
}

.footer-links a:hover {
    color: var(--primary-light);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
}

/* --- Responsive --- */
@media (max-width: 991px) {
    .pricing-grid { grid-template-columns: 1fr; }
    .split-section, .split-section.reverse, .contact-container {
        flex-direction: column;
    }
    .hero h1 { font-size: 50px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #ffffff;
        flex-direction: column;
        padding: 20px;
        box-shadow: var(--shadow-md);
        z-index: 9999;
    }
    .nav-links.active { display: flex; }
    .nav-links a {
        padding: 12px 0;
        border-bottom: 1px solid var(--border-light);
        width: 100%;
        text-align: left;
    }
    .nav-links a:last-child {
        border-bottom: none;
    }
    .nav-links a.btn {
        margin-top: 15px;
        text-align: center;
        padding: 14px;
        width: 100%;
        display: block;
        box-sizing: border-box;
    }
    .mobile-menu-btn { display: block; }
    .hero h1 { font-size: 40px; }
    .hero-buttons { flex-direction: column; }
    .hero-buttons .btn { width: 100%; margin-bottom: 10px; box-sizing: border-box; }
    .stats-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
}

/* --- Animations --- */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-up {
    animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.delay-1 { animation-delay: 0.1s; opacity: 0; }
.delay-2 { animation-delay: 0.2s; opacity: 0; }
.delay-3 { animation-delay: 0.3s; opacity: 0; }
