/* ==========================================================================
   Template: Mailcraft - Email API for Developers
   Version: 1.0.0
   Author: Premium Templates
   ========================================================================== */

/* ==========================================================================
   DESIGN TOKENS
   ========================================================================== */

:root {
    /* Brand Colors - Clean, Developer-focused */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #06b6d4;
    --accent: #f43f5e;
    --success: #10b981;
    --warning: #f59e0b;

    /* Dark Theme (Default) */
    --bg-primary: #09090b;
    --bg-secondary: #18181b;
    --bg-tertiary: #27272a;
    --bg-elevated: #09090b;

    /* Text Colors */
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;
    --text-muted: #52525b;

    /* Border Colors */
    --border-primary: #27272a;
    --border-secondary: #3f3f46;
    --border-focus: #6366f1;

    /* Code Colors */
    --code-bg: #18181b;
    --code-border: #27272a;
    --code-text: #e4e4e7;
    --code-keyword: #c084fc;
    --code-string: #4ade80;
    --code-function: #60a5fa;
    --code-comment: #71717a;

    /* Typography Scale */
    --text-hero: clamp(3rem, 8vw, 5rem);
    --text-display: clamp(2.5rem, 5vw, 3.5rem);
    --text-h1: clamp(2rem, 4vw, 2.75rem);
    --text-h2: clamp(1.5rem, 3vw, 2rem);
    --text-h3: clamp(1.25rem, 2vw, 1.5rem);
    --text-body: 1rem;
    --text-small: 0.875rem;
    --text-xs: 0.75rem;

    /* Spacing Scale (8px base) */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    --space-32: 8rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 60px rgba(99, 102, 241, 0.3);
    --shadow-glow-sm: 0 0 30px rgba(99, 102, 241, 0.2);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Mode */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f4f4f5;
    --bg-tertiary: #e4e4e7;
    --bg-elevated: #ffffff;

    --text-primary: #18181b;
    --text-secondary: #52525b;
    --text-tertiary: #71717a;
    --text-muted: #a1a1aa;

    --border-primary: #e4e4e7;
    --border-secondary: #d4d4d8;

    --code-bg: #f4f4f5;
    --code-border: #e4e4e7;
    --code-text: #18181b;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   BASE STYLES
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

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

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.font-mono {
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-accent {
    background: linear-gradient(135deg, var(--accent) 0%, var(--warning) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================================================
   LAYOUT UTILITIES
   ========================================================================== */

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.section {
    padding: var(--space-24) 0;
}

.section-sm {
    padding: var(--space-16) 0;
}

.section-lg {
    padding: var(--space-32) 0;
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(9, 9, 11, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-primary);
    transition: var(--transition-base);
}

[data-theme="light"] .nav {
    background: rgba(255, 255, 255, 0.8);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    padding: 0 var(--space-6);
    max-width: 1280px;
    margin: 0 auto;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

.nav-logo svg {
    width: 32px;
    height: 32px;
}

.nav-links {
    display: none;
    align-items: center;
    gap: var(--space-8);
}

@media (min-width: 768px) {
    .nav-links {
        display: flex;
    }
}

.nav-link {
    font-size: var(--text-small);
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    font-size: var(--text-small);
    font-weight: 500;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow-sm);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-secondary);
}

.btn-secondary:hover {
    background: var(--border-secondary);
    border-color: var(--border-focus);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-body);
}

.btn-icon {
    padding: var(--space-2);
}

/* ==========================================================================
   CARDS
   ========================================================================== */

.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    transition: var(--transition-base);
}

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

.card-glass {
    background: rgba(24, 24, 27, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .card-glass {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card-feature {
    position: relative;
    overflow: hidden;
}

.card-feature::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0;
    transition: var(--transition-base);
}

.card-feature:hover::before {
    opacity: 1;
}

/* ==========================================================================
   CODE BLOCKS
   ========================================================================== */

.code-block {
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--code-border);
}

.code-dots {
    display: flex;
    gap: var(--space-2);
}

.code-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.code-dot-red { background: #ff5f56; }
.code-dot-yellow { background: #ffbd2e; }
.code-dot-green { background: #27ca40; }

.code-lang {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    font-family: 'JetBrains Mono', monospace;
}

.code-content {
    padding: var(--space-6);
    overflow-x: auto;
}

.code-content pre {
    margin: 0;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 14px;
    line-height: 1.7;
    color: var(--code-text);
}

.code-keyword { color: var(--code-keyword); }
.code-string { color: var(--code-string); }
.code-function { color: var(--code-function); }
.code-comment { color: var(--code-comment); font-style: italic; }

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

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-gradient {
    position: absolute;
    width: 800px;
    height: 800px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.3;
}

.hero-gradient-1 {
    top: -200px;
    right: -200px;
    background: var(--primary);
}

.hero-gradient-2 {
    bottom: -200px;
    left: -200px;
    background: var(--secondary);
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-full);
    font-size: var(--text-small);
    color: var(--text-secondary);
    margin-bottom: var(--space-8);
}

.hero-badge-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.hero-title {
    font-size: var(--text-hero);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: var(--space-6);
    letter-spacing: -0.03em;
}

.hero-description {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: var(--space-10);
    line-height: 1.7;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    margin-bottom: var(--space-16);
}

.hero-stats {
    display: flex;
    gap: var(--space-12);
}

.hero-stat {
    text-align: left;
}

.hero-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.hero-stat-label {
    font-size: var(--text-small);
    color: var(--text-tertiary);
}

/* ==========================================================================
   FEATURES SECTION
   ========================================================================== */

.features-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: var(--space-6);
}

@media (min-width: 768px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.feature-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
}

.feature-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.feature-title {
    font-size: var(--text-h3);
    font-weight: 600;
    margin-bottom: var(--space-3);
}

.feature-description {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ==========================================================================
   PRICING SECTION
   ========================================================================== */

.pricing-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    margin-bottom: var(--space-12);
}

.pricing-toggle-label {
    font-size: var(--text-small);
    color: var(--text-secondary);
}

.pricing-toggle-label.active {
    color: var(--text-primary);
}

.pricing-switch {
    position: relative;
    width: 48px;
    height: 24px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition-base);
}

.pricing-switch.active {
    background: var(--primary);
}

.pricing-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: var(--transition-base);
}

.pricing-switch.active::after {
    transform: translateX(24px);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: var(--space-6);
    max-width: 1000px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .pricing-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.pricing-card {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
}

.pricing-card.featured {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.pricing-card.featured::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    padding: var(--space-1) var(--space-4);
    background: var(--primary);
    color: white;
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
}

.pricing-name {
    font-size: var(--text-h3);
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.pricing-description {
    font-size: var(--text-small);
    color: var(--text-secondary);
    margin-bottom: var(--space-6);
}

.pricing-price {
    display: flex;
    align-items: baseline;
    gap: var(--space-1);
    margin-bottom: var(--space-6);
}

.pricing-amount {
    font-size: 3rem;
    font-weight: 700;
}

.pricing-period {
    color: var(--text-tertiary);
}

.pricing-features {
    list-style: none;
    margin-bottom: var(--space-8);
}

.pricing-feature {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    font-size: var(--text-small);
    color: var(--text-secondary);
}

.pricing-feature svg {
    width: 16px;
    height: 16px;
    color: var(--success);
    flex-shrink: 0;
}

/* ==========================================================================
   TESTIMONIALS
   ========================================================================== */

.testimonial-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
}

.testimonial-content {
    font-size: 1.125rem;
    line-height: 1.7;
    margin-bottom: var(--space-6);
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.testimonial-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.testimonial-name {
    font-weight: 600;
}

.testimonial-role {
    font-size: var(--text-small);
    color: var(--text-tertiary);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.footer {
    border-top: 1px solid var(--border-primary);
    padding: var(--space-16) 0 var(--space-8);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-8);
    margin-bottom: var(--space-12);
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 2fr repeat(3, 1fr);
    }
}

.footer-brand {
    grid-column: span 2;
}

@media (min-width: 768px) {
    .footer-brand {
        grid-column: span 1;
    }
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    margin-bottom: var(--space-4);
}

.footer-description {
    color: var(--text-secondary);
    font-size: var(--text-small);
    max-width: 280px;
    line-height: 1.6;
}

.footer-title {
    font-size: var(--text-small);
    font-weight: 600;
    margin-bottom: var(--space-4);
    color: var(--text-primary);
}

.footer-links {
    list-style: none;
}

.footer-link {
    display: block;
    padding: var(--space-2) 0;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--text-small);
    transition: var(--transition-fast);
}

.footer-link:hover {
    color: var(--text-primary);
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    padding-top: var(--space-8);
    border-top: 1px solid var(--border-primary);
}

@media (min-width: 768px) {
    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.footer-copyright {
    font-size: var(--text-small);
    color: var(--text-tertiary);
}

.footer-social {
    display: flex;
    gap: var(--space-4);
}

.footer-social a {
    color: var(--text-tertiary);
    transition: var(--transition-fast);
}

.footer-social a:hover {
    color: var(--text-primary);
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

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

/* Scroll Reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* Stagger delays */
.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; }

/* Hover effects */
.hover-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.hover-glow:hover {
    box-shadow: var(--shadow-glow);
}

/* ==========================================================================
   UTILITIES
   ========================================================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

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

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* ==========================================================================
   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;
    }

    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-scale {
        opacity: 1;
        transform: none;
    }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .nav,
    .hero-gradient,
    .hero-grid {
        display: none;
    }

    body {
        background: white;
        color: black;
    }
}
