/* ============================================
   BASE STYLES - Reset & Foundation
   ============================================ */

/* Modern CSS Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Remove default margin and set base */
html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Smooth scroll disabled when reduced motion preferred */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--weight-regular);
    line-height: var(--leading-normal);
    color: var(--color-text-primary);
    background-color: var(--color-primary);
    overflow-x: hidden;
    cursor: none;
    /* Custom cursor will be used */
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--color-surface-lighter);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-secondary);
}

/* Firefox Scrollbar */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--color-surface-lighter) var(--color-primary);
}

/* Selection */
::selection {
    background-color: var(--color-secondary);
    color: var(--color-text-primary);
}

::-moz-selection {
    background-color: var(--color-secondary);
    color: var(--color-text-primary);
}

/* Remove list styles */
ul,
ol {
    list-style: none;
}

/* Images */
img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
    html:focus-within {
        scroll-behavior: auto;
    }
}

/* Links */
a {
    color: inherit;
    text-decoration: none;
    cursor: none;
}

/* Buttons */
button {
    background: none;
    border: none;
    cursor: none;
}

/* Focus visible */
:focus-visible {
    outline: 2px solid var(--color-secondary);
    outline-offset: 2px;
}

/* Remove outlines for mouse users */
:focus:not(:focus-visible) {
    outline: none;
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
    text-wrap: balance;
}

h1 {
    font-size: var(--text-hero);
}

h2 {
    font-size: var(--text-5xl);
}

h3 {
    font-size: var(--text-4xl);
}

h4 {
    font-size: var(--text-3xl);
}

h5 {
    font-size: var(--text-2xl);
}

h6 {
    font-size: var(--text-xl);
}

/* Paragraphs */
p {
    text-wrap: pretty;
    max-width: 70ch;
}

/* Strong */
strong,
b {
    font-weight: var(--weight-semibold);
}

/* Emphasis */
em,
i {
    font-style: italic;
}

/* Small */
small {
    font-size: var(--text-sm);
}

/* Horizontal Rule */
hr {
    border: none;
    height: 1px;
    background: var(--glass-border);
    margin: var(--space-8) 0;
}

/* ========== UTILITY CLASSES ========== */

/* 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;
}

/* Container */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--section-padding-x);
}

.container--narrow {
    max-width: var(--container-narrow);
}

/* Section */
.section {
    padding-block: var(--section-padding-y);
    position: relative;
}

/* Flex Utilities */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.items-end {
    align-items: flex-end;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-end {
    justify-content: flex-end;
}

.gap-1 {
    gap: var(--space-1);
}

.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 Utilities */
.grid {
    display: grid;
}

/* Text Utilities */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

/* Font Family Utilities */
.font-display {
    font-family: var(--font-display);
}

.font-body {
    font-family: var(--font-body);
}

.font-accent {
    font-family: var(--font-accent);
}

.font-mono {
    font-family: var(--font-mono);
}

/* Color Utilities */
.text-primary {
    color: var(--color-text-primary);
}

.text-secondary {
    color: var(--color-text-secondary);
}

.text-muted {
    color: var(--color-text-muted);
}

.text-accent {
    color: var(--color-accent);
}

.text-indigo {
    color: var(--color-secondary);
}

/* Background Utilities */
.bg-primary {
    background-color: var(--color-primary);
}

.bg-surface {
    background-color: var(--color-surface);
}


/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, var(--color-secondary), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Text Outline */
.text-outline {
    -webkit-text-stroke: 1px var(--color-text-secondary);
    -webkit-text-fill-color: transparent;
}

/* Grain Texture Overlay */
.grain::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    z-index: 1;
}

/* Loading State */
.loading {
    pointer-events: none;
    opacity: 0.7;
}

/* Hidden */
.hidden {
    display: none !important;
}

/* Visibility */
.invisible {
    visibility: hidden;
}

.visible {
    visibility: visible;
}