/**
 * Base styles - Reset and foundational rules
 */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

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

/* Remove default list styles */
ul,
ol {
    list-style: none;
}

/* Remove default link styles */
a {
    color: inherit;
    text-decoration: none;
}

/* Make images easier to work with */
img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Remove built-in form typography styles */
input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

/* Avoid text overflows */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
    overflow-wrap: break-word;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: var(--font-semibold);
    line-height: var(--line-height-tight);
    color: var(--text-primary);
}

h1 {
    font-size: var(--text-4xl);
}

h2 {
    font-size: var(--text-3xl);
}

h3 {
    font-size: var(--text-2xl);
}

h4 {
    font-size: var(--text-xl);
}

p {
    color: var(--text-secondary);
    line-height: var(--line-height-relaxed);
}

strong {
    font-weight: var(--font-semibold);
}

/* ============================================
   LAYOUT UTILITIES
   ============================================ */
.container {
    width: 100%;
    max-width: var(--container-lg);
    margin-inline: auto;
    padding-inline: var(--space-4);
}

@media (min-width: 768px) {
    .container {
        padding-inline: var(--space-6);
    }
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

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

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: var(--space-2);
}

.gap-4 {
    gap: var(--space-4);
}

.gap-6 {
    gap: var(--space-6);
}

.gap-8 {
    gap: var(--space-8);
}

.grid {
    display: grid;
}

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

/* ============================================
   SPACING UTILITIES
   ============================================ */
.mt-4 {
    margin-top: var(--space-4);
}

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

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

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

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

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

.pt-4 {
    padding-top: var(--space-4);
}

.pb-4 {
    padding-bottom: var(--space-4);
}

.py-4 {
    padding-block: var(--space-4);
}

.py-8 {
    padding-block: var(--space-8);
}

.px-4 {
    padding-inline: var(--space-4);
}

.px-6 {
    padding-inline: var(--space-6);
}

.p-4 {
    padding: var(--space-4);
}

.p-6 {
    padding: var(--space-6);
}

/* ============================================
   BACKGROUND EFFECTS
   ============================================ */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(212, 175, 55, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(34, 211, 238, 0.03) 0%, transparent 60%);
    pointer-events: none;
    z-index: -1;
}

/* Stars effect */
.stars {
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255, 255, 255, 0.2), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255, 255, 255, 0.4), transparent),
        radial-gradient(2px 2px at 160px 120px, rgba(255, 255, 255, 0.2), transparent),
        radial-gradient(1px 1px at 230px 80px, rgba(255, 255, 255, 0.3), transparent);
    background-size: 250px 200px;
    animation: twinkle 4s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

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

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

/* ============================================
   SELECTION
   ============================================ */
::selection {
    background: var(--accent-purple);
    color: var(--text-primary);
}

/* ============================================
   FOCUS STYLES
   ============================================ */
:focus-visible {
    outline: 2px solid var(--accent-gold);
    outline-offset: 2px;
}

/* ============================================
   SCREEN READER ONLY
   ============================================ */
.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;
}