/* ============================================
   Base Styles - Reset & Typography
   ============================================ */

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color var(--transition-slow), color var(--transition-slow);
}

/* Background gradient overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse 80% 80% at 50% -20%, rgba(99, 102, 241, 0.15), transparent),
        radial-gradient(ellipse 60% 60% at 100% 0%, rgba(139, 92, 246, 0.1), transparent),
        radial-gradient(ellipse 60% 60% at 0% 100%, rgba(6, 182, 212, 0.08), transparent);
    pointer-events: none;
    z-index: -1;
}

[data-theme="light"] body::before {
    background:
        radial-gradient(ellipse 80% 80% at 50% -20%, rgba(99, 102, 241, 0.08), transparent),
        radial-gradient(ellipse 60% 60% at 100% 0%, rgba(139, 92, 246, 0.05), transparent),
        radial-gradient(ellipse 60% 60% at 0% 100%, rgba(6, 182, 212, 0.04), transparent);
}

/* ===== Typography ===== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    color: var(--text-primary);
}

h1 {
    font-size: clamp(var(--text-4xl), 8vw, var(--text-7xl));
    font-weight: var(--font-extrabold);
}

h2 {
    font-size: clamp(var(--text-2xl), 5vw, var(--text-4xl));
}

h3 {
    font-size: clamp(var(--text-xl), 3vw, var(--text-2xl));
}

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

h5 {
    font-size: var(--text-lg);
}

h6 {
    font-size: var(--text-base);
}

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

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

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

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

/* ===== Lists ===== */
ul,
ol {
    list-style: none;
}

/* ===== Images ===== */
img,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* ===== Buttons ===== */
button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* ===== Inputs ===== */
input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
}

/* ===== Focus States ===== */
:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

/* ===== Selection ===== */
::selection {
    background: var(--primary-500);
    color: white;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

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

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

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

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

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

/* ===== Section ===== */
section {
    padding: var(--space-24) 0;
    position: relative;
}

/* ===== Section Header ===== */
.section-header {
    text-align: center;
    margin-bottom: var(--space-16);
}

.section-subtitle {
    display: inline-block;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary-400);
    margin-bottom: var(--space-4);
}

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

.section-description {
    max-width: 600px;
    margin: 0 auto;
    color: var(--text-tertiary);
}

/* ===== Gradient Text ===== */
.gradient-text {
    background: var(--gradient-glow);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

/* ===== Skip Link ===== */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    padding: var(--space-3) var(--space-6);
    background: var(--primary-500);
    color: white;
    border-radius: var(--radius-md);
    z-index: var(--z-tooltip);
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: var(--space-4);
}