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

:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --text-primary: #eaeaea;
    --text-secondary: #a0a0a0;
    --border-color: #2a2a4a;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --transition-speed: 0.3s;
}

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 1rem 0;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Links Grid */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    align-content: start;
}

/* Link Card */
.link-card {
    --accent-color: #667eea;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-speed) ease;
    position: relative;
    overflow: hidden;
}

.link-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-color);
    transform: scaleX(0);
    transition: transform var(--transition-speed) ease;
}

.link-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow-color);
    border-color: var(--accent-color);
}

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

.link-card:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Icon */
.icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-color), color-mix(in srgb, var(--accent-color) 70%, white));
    border-radius: 16px;
    transition: transform var(--transition-speed) ease;
}

.link-card:hover .icon {
    transform: scale(1.1);
}

/* Title */
.link-card .title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    text-align: center;
}

/* Description */
.link-card .description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: auto;
}

/* Responsive Design */

/* Tablet */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem 1rem;
    }

    header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .links-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    .link-card {
        padding: 1.5rem 1rem;
    }

    .icon {
        font-size: 2rem;
        width: 60px;
        height: 60px;
    }

    .link-card .title {
        font-size: 1rem;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .container {
        padding: 1rem 0.75rem;
    }

    header {
        margin-bottom: 2rem;
    }

    header h1 {
        font-size: 1.75rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

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

    .link-card {
        padding: 1.25rem 0.75rem;
        border-radius: 12px;
    }

    .icon {
        font-size: 1.75rem;
        width: 50px;
        height: 50px;
        border-radius: 12px;
        margin-bottom: 0.75rem;
    }

    .link-card .title {
        font-size: 0.9rem;
    }

    .link-card .description {
        font-size: 0.75rem;
    }
}

/* Very small screens */
@media (max-width: 320px) {
    .links-grid {
        grid-template-columns: 1fr;
    }

    .link-card {
        flex-direction: row;
        justify-content: flex-start;
        gap: 1rem;
        padding: 1rem;
    }

    .icon {
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .link-card .title,
    .link-card .description {
        text-align: left;
    }
}

/* Dark mode preference (already dark by default, but this ensures consistency) */
@media (prefers-color-scheme: light) {
    :root {
        --bg-primary: #f5f5f7;
        --bg-secondary: #e8e8ed;
        --bg-card: #ffffff;
        --text-primary: #1d1d1f;
        --text-secondary: #6e6e73;
        --border-color: #d2d2d7;
        --shadow-color: rgba(0, 0, 0, 0.1);
    }
}

/* Smooth scrolling */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
