/* ========================================
   MAIN.CSS - Design System
   Web Personal José Arbelaez — Astro
   ======================================== */

/* ----------------------------------------
   CSS Custom Properties (Light Mode)
   ---------------------------------------- */
:root {
    /* Colores principales */
    --color-white: #ffffff;
    --color-black: #111111;
    --color-gray-50: #fafafa;
    --color-gray-100: #f4f4f5;
    --color-gray-200: #e4e4e7;
    --color-gray-300: #d4d4d8;
    --color-gray-400: #a1a1aa;
    --color-gray-500: #71717a;
    --color-gray-600: #52525b;
    --color-gray-700: #3f3f46;
    --color-gray-800: #27272a;
    --color-gray-900: #18181b;

    /* Colores de acento */
    --color-blue: #3b82f6;
    --color-blue-light: #60a5fa;
    --color-blue-dark: #2563eb;

    /* Colores semánticos */
    --color-primary: #1a1a1a;
    --color-primary-hover: #4a4a4a;
    --color-text: #1a1a1a;
    --color-text-secondary: #4a4a4a;
    --color-text-muted: #737373;
    --color-background: #f0ece4;
    --color-surface: #ffffff;
    --color-border: #d5d1c9;
    --color-bg-alt: #e4e0d7;

    /* Espaciado (escala 4px) */
    --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;

    /* Tipografía */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-serif: 'Merriweather', Georgia, serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    --font-body: var(--font-serif);
    --font-ui: var(--font-sans);

    /* Tamaños de fuente */
    --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;

    /* Line heights */
    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 1.8;

    /* Font weights */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;

    /* Border radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

    /* Sombras */
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07);

    /* Transiciones */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
}

/* ----------------------------------------
   Dark Mode Variables
   ---------------------------------------- */
[data-theme="dark"] {
    --color-text: #e8e6e1;
    --color-text-secondary: #b3b1ab;
    --color-text-muted: #888681;
    --color-background: #1a1a1a;
    --color-surface: #242424;
    --color-border: #3a3a3a;
    --color-bg-alt: #2d2d2d;
    --color-primary: #f0ece4;
    --color-primary-hover: #b3b1ab;
}

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

html {
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    background-color: var(--color-background);
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--color-text);
    background-color: var(--color-background);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color var(--transition-slow), color var(--transition-slow);
}

main {
    flex-grow: 1;
    /* Deja sitio al footer fijo para que no tape el final del contenido */
    padding-bottom: 10rem;
}

::selection {
    background-color: var(--color-text);
    color: var(--color-background);
}

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

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

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

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

ul,
ol {
    list-style: none;
}

/* ----------------------------------------
   Layout
   ---------------------------------------- */
.container {
    width: 100%;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-6);
    padding-right: var(--space-6);
}

.container--wide {
    max-width: 1024px;
}

.section {
    padding-top: var(--space-12);
    padding-bottom: var(--space-12);
}

.section-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--color-text);
    margin-bottom: var(--space-8);
}

/* ----------------------------------------
   Utilities
   ---------------------------------------- */
.text-center {
    text-align: center;
}

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

.mt-4 {
    margin-top: var(--space-4);
}

.mt-6 {
    margin-top: var(--space-6);
}

.mt-8 {
    margin-top: var(--space-8);
}

.mt-10 {
    margin-top: var(--space-10);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-8 {
    margin-bottom: var(--space-8);
}

.lead {
    font-size: var(--text-lg);
    line-height: var(--leading-relaxed);
    color: var(--color-text);
}

/* ----------------------------------------
   Intro section
   ---------------------------------------- */
.intro {
    max-width: 600px;
}

.intro p {
    margin-bottom: var(--space-4);
    line-height: var(--leading-relaxed);
    color: var(--color-text-secondary);
}

.intro .lead {
    color: var(--color-text);
}

/* ----------------------------------------
   Fade-in animations
   ---------------------------------------- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
}

.fade-in-1 {
    animation-delay: 0.05s;
}

.fade-in-2 {
    animation-delay: 0.15s;
}

.fade-in-3 {
    animation-delay: 0.25s;
}

@media (prefers-reduced-motion: reduce) {
    .fade-in {
        animation: none;
        opacity: 1;
    }
}

/* ----------------------------------------
   Buttons
   ---------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 10px 20px;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    line-height: 1.2;
    text-decoration: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    background: var(--color-background);
    color: var(--color-text-secondary);
    transition: all var(--transition-base);
}

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

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

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

/* ----------------------------------------
   Responsive
   ---------------------------------------- */
@media (max-width: 640px) {
    .container {
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }

    .section {
        padding-top: var(--space-8);
        padding-bottom: var(--space-8);
    }
}

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