/* ═════════════════════════════════════════════════════════
   MisterDev — Main Stylesheet
   Design System & Base Styles
   ═════════════════════════════════════════════════════════ */

/* ─── Custom Properties ─────────────────────────────── */
:root {
    /* Colors */
    --color-black: #08111F;
    --color-black-soft: #0E172A;
    --color-surface: #111827;
    --color-surface-light: #1a2235;
    --color-surface-hover: #1f2a42;
    --color-border: #1e2d45;
    --color-border-light: #2a3d5a;

    --color-white: #ffffff;
    --color-text: #f4f4f5;
    --color-text-secondary: #a1a1aa;
    --color-text-tertiary: #71717a;

    --color-accent: #2ED76A;
    --color-accent-hover: #22c55e;
    --color-accent-soft: rgba(46, 215, 106, 0.08);
    --color-accent-glow: rgba(46, 215, 106, 0.25);
    --color-accent-gradient: linear-gradient(135deg, #2ED76A, #22c55e);

    --color-green-dark: #1a8a44;
    --color-green-soft: rgba(46, 215, 106, 0.08);

    --color-success: #2ED76A;
    --color-warning: #f59e0b;
    --color-error: #ef4444;

    /* Glassmorphism */
    --glass-bg: rgba(18, 18, 21, 0.6);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    --text-6xl: 3.75rem;
    --text-7xl: 4.5rem;

    --leading-tight: 1.1;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;

    --tracking-tight: -0.025em;
    --tracking-normal: 0;
    --tracking-wide: 0.025em;

    /* Spacing */
    --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;

    /* Layout */
    --max-width: 1200px;
    --max-width-wide: 1400px;
    --max-width-narrow: 800px;
    --nav-height: 72px;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
    --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 24px var(--color-accent-glow);
    --shadow-accent: 0 4px 20px rgba(46, 215, 106, 0.3);

    /* Z-index */
    --z-dropdown: 50;
    --z-nav: 100;
    --z-overlay: 200;
    --z-modal: 300;
}

/* ─── Reset ─────────────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: var(--nav-height);
}

body {
    font-family: var(--font-primary);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--color-text);
    background-color: var(--color-black);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100vh;
}

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

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

button {
    font: inherit;
    color: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input,
textarea,
select {
    font: inherit;
    color: inherit;
}

ul,
ol {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
}

/* ─── Focus Styles ──────────────────────────────────── */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* ─── Selection ─────────────────────────────────────── */
::selection {
    background: var(--color-accent);
    color: var(--color-white);
}

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

::-webkit-scrollbar-track {
    background: var(--color-black);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-border-light);
}

/* ─── Container ─────────────────────────────────────── */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.container--wide {
    max-width: var(--max-width-wide);
}

.container--narrow {
    max-width: var(--max-width-narrow);
}

/* ─── Section ───────────────────────────────────────── */
.section {
    padding: var(--space-24) 0;
}

.section--dark {
    background: var(--color-black-soft);
    position: relative;
}

.section--dark-alt {
    background: var(--color-surface);
    position: relative;
}

.section__label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-4);
}

.section__label::before {
    content: '';
    width: 20px;
    height: 2px;
    background: var(--color-accent);
    border-radius: var(--radius-full);
}

.section__title {
    font-size: var(--text-4xl);
    font-weight: 700;
    color: var(--color-white);
    margin-bottom: var(--space-4);
    max-width: 640px;
}

.section__subtitle {
    font-size: var(--text-lg);
    color: var(--color-text-secondary);
    max-width: 560px;
    line-height: var(--leading-relaxed);
}

.section__header {
    margin-bottom: var(--space-16);
}

.section__header--center {
    text-align: center;
}

.section__header--center .section__title,
.section__header--center .section__subtitle {
    margin-left: auto;
    margin-right: auto;
}

/* ─── Buttons ───────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    white-space: nowrap;
}

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

.btn--primary:hover {
    background: var(--color-accent-hover);
    box-shadow: 0 6px 28px rgba(46, 215, 106, 0.4);
    transform: translateY(-1px);
}

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

.btn--secondary:hover {
    border-color: var(--color-text-secondary);
    background: rgba(255, 255, 255, 0.03);
}

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

.btn--ghost:hover {
    color: var(--color-white);
}

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

.btn--xl {
    padding: var(--space-5) var(--space-10);
    font-size: var(--text-lg);
    border-radius: var(--radius-lg);
}

.btn--block {
    width: 100%;
}

.btn--whatsapp {
    background: #25d366;
    color: var(--color-white);
}

.btn--whatsapp:hover {
    background: #1ebe5d;
    transform: translateY(-1px);
}

.btn .icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn--xl .icon {
    width: 22px;
    height: 22px;
}

/* ─── Glass Card ────────────────────────────────────── */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--glass-shadow);
    transition: all var(--transition-base);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* ─── Grid Helpers ──────────────────────────────────── */
.grid {
    display: grid;
    gap: var(--space-6);
}

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

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

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

/* ─── Tag ──────────────────────────────────────────── */
.tag {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--color-accent);
    background: var(--color-accent-soft);
    border-radius: var(--radius-full);
    border: 1px solid rgba(46, 215, 106, 0.15);
}

/* ─── Text utilities ────────────────────────────────── */
.text-gradient {
    background: var(--color-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient--green {
    background: var(--color-accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-secondary {
    color: var(--color-text-secondary);
}

.text-center {
    text-align: center;
}

/* ─── Divider ──────────────────────────────────────── */
.divider {
    width: 100%;
    height: 1px;
    background: var(--color-border);
    border: none;
}

/* ─── Skeleton loading ──────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, var(--color-surface) 25%, var(--color-surface-light) 50%, var(--color-surface) 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ─── Responsive ────────────────────────────────────── */
@media (max-width: 1024px) {
    .grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .grid--3 {
        grid-template-columns: repeat(2, 1fr);
    }
    .section {
        padding: var(--space-16) 0;
    }
    .section__title {
        font-size: var(--text-3xl);
    }
}

@media (max-width: 768px) {
    :root {
        --nav-height: 64px;
    }
    .container {
        padding: 0 var(--space-4);
    }
    .section {
        padding: var(--space-12) 0;
    }
    .section__title {
        font-size: var(--text-2xl);
    }
    .section__subtitle {
        font-size: var(--text-base);
    }
    .grid--2,
    .grid--3,
    .grid--4 {
        grid-template-columns: 1fr;
    }
    .btn--xl {
        padding: var(--space-4) var(--space-8);
        font-size: var(--text-base);
    }
}

@media (max-width: 480px) {
    .section__title {
        font-size: var(--text-xl);
    }
}
