/* ===== ULTRA-MODERN TYPOGRAPHY SYSTEM ===== */
/* Modern fonts with gradient effects and tight letter-spacing */

/* === FONT IMPORTS === */
/* Using Google Fonts alternatives for Clash Display, Cabinet Grotesk, Satoshi */
/* Primary: Inter (geometric sans) - body text */
/* Display: Playfair Display (elegant serif) - headlines */
/* Alternative Display: Space Grotesk (modern geometric) */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Inter:wght@100;200;300;400;500;600;700;800;900&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,500;1,600&display=swap');

/* === FONT FAMILY TOKENS === */
:root {
    /* Modern Sans-Serif (Primary) */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;

    /* Display Font (Headlines) */
    --font-display: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Serif Font (Accent) */
    --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;

    /* Monospace (Code) */
    --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;
}

/* === BASE TYPOGRAPHY === */
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-sans);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    letter-spacing: var(--letter-spacing-normal);
    color: var(--text-on-light);
}

body.dark-mode {
    color: var(--text-on-dark);
}

/* === HEADING STYLES === */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-display);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    letter-spacing: var(--letter-spacing-tight);
    margin: 0;
}

h1, .h1 {
    font-size: var(--font-size-h1);
    font-weight: var(--font-weight-extrabold);
    letter-spacing: var(--letter-spacing-tighter);
}

h2, .h2 {
    font-size: var(--font-size-h2);
    font-weight: var(--font-weight-bold);
}

h3, .h3 {
    font-size: var(--font-size-h3);
    font-weight: var(--font-weight-semibold);
}

h4, .h4 {
    font-size: var(--font-size-h4);
    font-weight: var(--font-weight-semibold);
}

h5, .h5 {
    font-size: var(--font-size-h5);
    font-weight: var(--font-weight-medium);
}

h6, .h6 {
    font-size: var(--font-size-h6);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
}

/* === DISPLAY TEXT (Hero, Section Headers) === */
.text-hero {
    font-family: var(--font-display);
    font-size: var(--font-size-hero);
    font-weight: var(--font-weight-black);
    line-height: var(--line-height-none);
    letter-spacing: var(--letter-spacing-tighter);
}

.text-hero-sub {
    font-family: var(--font-display);
    font-size: var(--font-size-hero-sub);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    letter-spacing: var(--letter-spacing-tight);
}

.text-display {
    font-family: var(--font-display);
    font-size: var(--font-size-display);
    font-weight: var(--font-weight-extrabold);
    line-height: var(--line-height-tight);
    letter-spacing: var(--letter-spacing-tighter);
}

.text-display-sm {
    font-family: var(--font-display);
    font-size: var(--font-size-display-sm);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-snug);
    letter-spacing: var(--letter-spacing-tight);
}

/* === GRADIENT TEXT EFFECTS === */
.text-gradient {
    background: var(--gradient-text-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-primary {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-secondary {
    background: var(--gradient-secondary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-accent {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-fire {
    background: var(--gradient-text-fire);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-cosmic {
    background: var(--gradient-cosmic);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Animated gradient text */
.text-gradient-animated {
    background: linear-gradient(
        90deg,
        var(--token-primary) 0%,
        var(--token-accent) 25%,
        var(--token-secondary) 50%,
        var(--token-accent) 75%,
        var(--token-primary) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 4s ease infinite;
}

@keyframes gradient-shift {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* === BODY TEXT VARIANTS === */
.text-body-lg {
    font-size: var(--font-size-body-lg);
    line-height: var(--line-height-relaxed);
}

.text-body {
    font-size: var(--font-size-body);
    line-height: var(--line-height-normal);
}

.text-body-sm {
    font-size: var(--font-size-body-sm);
    line-height: var(--line-height-normal);
}

/* === CAPTION & SMALL TEXT === */
.text-caption {
    font-size: var(--font-size-caption);
    line-height: var(--line-height-normal);
    letter-spacing: var(--letter-spacing-wide);
}

.text-micro {
    font-size: var(--font-size-micro);
    line-height: var(--line-height-normal);
    letter-spacing: var(--letter-spacing-wider);
    text-transform: uppercase;
}

/* === SPECIAL TEXT STYLES === */
.text-serif {
    font-family: var(--font-serif);
}

.text-mono {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

/* Label text (forms, buttons) */
.text-label {
    font-family: var(--font-sans);
    font-size: var(--font-size-caption);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-wide);
    text-transform: uppercase;
}

/* Quote text */
.text-quote {
    font-family: var(--font-serif);
    font-size: var(--font-size-h3);
    font-style: italic;
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-relaxed);
}

/* === TEXT WEIGHT UTILITIES === */
.font-thin { font-weight: var(--font-weight-thin); }
.font-light { font-weight: var(--font-weight-light); }
.font-normal { font-weight: var(--font-weight-normal); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }
.font-extrabold { font-weight: var(--font-weight-extrabold); }
.font-black { font-weight: var(--font-weight-black); }

/* === TEXT TRANSFORM UTILITIES === */
.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }
.normal-case { text-transform: none; }

/* === LETTER SPACING UTILITIES === */
.tracking-tighter { letter-spacing: var(--letter-spacing-tighter); }
.tracking-tight { letter-spacing: var(--letter-spacing-tight); }
.tracking-normal { letter-spacing: var(--letter-spacing-normal); }
.tracking-wide { letter-spacing: var(--letter-spacing-wide); }
.tracking-wider { letter-spacing: var(--letter-spacing-wider); }
.tracking-widest { letter-spacing: var(--letter-spacing-widest); }

/* === LINE HEIGHT UTILITIES === */
.leading-none { line-height: var(--line-height-none); }
.leading-tight { line-height: var(--line-height-tight); }
.leading-snug { line-height: var(--line-height-snug); }
.leading-normal { line-height: var(--line-height-normal); }
.leading-relaxed { line-height: var(--line-height-relaxed); }
.leading-loose { line-height: var(--line-height-loose); }

/* === TEXT ALIGNMENT === */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }

/* === TEXT COLOR UTILITIES === */
.text-primary { color: var(--token-primary); }
.text-secondary { color: var(--token-secondary); }
.text-accent { color: var(--token-accent); }
.text-gold { color: var(--token-gold); }
.text-muted { color: var(--text-on-light-muted); }
.text-subtle { color: var(--text-on-light-subtle); }

body.dark-mode .text-muted { color: var(--text-on-dark-muted); }
body.dark-mode .text-subtle { color: var(--text-on-dark-subtle); }

/* === TEXT DECORATION === */
.underline { text-decoration: underline; }
.line-through { text-decoration: line-through; }
.no-underline { text-decoration: none; }

/* Fancy underline effect */
.underline-gradient {
    position: relative;
    text-decoration: none;
}

.underline-gradient::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--duration-normal) var(--ease-smooth);
}

.underline-gradient:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* === TEXT SHADOW EFFECTS === */
.text-shadow-sm {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.text-shadow-md {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.text-shadow-lg {
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.text-shadow-glow-primary {
    text-shadow: 0 0 20px var(--token-primary-glow), 0 0 40px var(--token-primary-glow);
}

.text-shadow-glow-secondary {
    text-shadow: 0 0 20px var(--token-secondary-glow), 0 0 40px var(--token-secondary-glow);
}

/* === SELECTION STYLES === */
::selection {
    background: var(--token-primary);
    color: var(--text-on-primary);
}

::-moz-selection {
    background: var(--token-primary);
    color: var(--text-on-primary);
}

/* === LINK STYLES === */
a {
    color: var(--token-primary);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-smooth);
}

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

a:focus-visible {
    outline: 2px solid var(--token-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* === PARAGRAPH STYLES === */
p {
    margin: 0 0 var(--space-4);
}

p:last-child {
    margin-bottom: 0;
}

/* Lead paragraph */
.lead {
    font-size: var(--font-size-body-lg);
    font-weight: var(--font-weight-light);
    line-height: var(--line-height-relaxed);
    color: var(--text-on-light-muted);
}

body.dark-mode .lead {
    color: var(--text-on-dark-muted);
}

/* === LIST STYLES === */
ul, ol {
    margin: 0 0 var(--space-4);
    padding-left: var(--space-6);
}

li {
    margin-bottom: var(--space-2);
}

/* === BLOCKQUOTE STYLES === */
blockquote {
    font-family: var(--font-serif);
    font-size: var(--font-size-h4);
    font-style: italic;
    margin: var(--space-8) 0;
    padding-left: var(--space-6);
    border-left: 4px solid var(--token-primary);
    color: var(--text-on-light-muted);
}

body.dark-mode blockquote {
    color: var(--text-on-dark-muted);
}

/* === CODE STYLES === */
code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    padding: var(--space-1) var(--space-2);
    background: var(--token-surface-muted);
    border-radius: var(--radius-sm);
}

body.dark-mode code {
    background: var(--token-surface-dark);
}

pre {
    font-family: var(--font-mono);
    font-size: var(--font-size-body-sm);
    padding: var(--space-4);
    background: var(--token-surface-darkest);
    color: var(--text-on-dark);
    border-radius: var(--radius-lg);
    overflow-x: auto;
}

pre code {
    padding: 0;
    background: transparent;
}

/* === RESPONSIVE TYPOGRAPHY === */
@media (max-width: 768px) {
    .text-hero {
        font-size: clamp(2rem, 10vw, 4rem);
    }

    .text-display {
        font-size: clamp(1.5rem, 7vw, 2.5rem);
    }

    h1, .h1 {
        font-size: clamp(1.5rem, 5vw, 2.25rem);
    }

    h2, .h2 {
        font-size: clamp(1.25rem, 4vw, 1.75rem);
    }
}

/* === END OF TYPOGRAPHY === */
