﻿/* ============================================================
   STYLE.CSS — Design Tokens, Reset, Layout, Typography, Utilities
   Portfolio Website for Paul — Freelance Web Developer
   ============================================================ */

/* ————— Google Fonts Import ————— */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ============================================================
   1. CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================================ */
:root {
    /* — Colors (Dark Mode — Default) — */
    --color-bg:          #060606;
    --color-bg-alt:      #0a0a0a;
    --color-surface:     #111111;
    --color-surface-2:   #1a1a1a;
    --color-surface-3:   #242424;
    --color-border:      rgba(255, 255, 255, 0.08);
    --color-border-hover:rgba(255, 255, 255, 0.15);

    --color-text:        #f0ebe3;
    --color-text-secondary: #9a9a9a;
    --color-text-muted:  #666666;

    --color-accent-1:    #ff4d00;   /* vivid orange */
    --color-accent-2:    #ff7a2e;   /* warm orange */
    --color-accent-3:    #ffaa5c;   /* golden orange */
    --color-accent-4:    #22d3ee;   /* electric cyan */

    --gradient-accent: linear-gradient(135deg, var(--color-accent-1), var(--color-accent-2), var(--color-accent-3));
    --gradient-accent-h: linear-gradient(135deg, var(--color-accent-2), var(--color-accent-3), #ff8c42);
    --gradient-subtle: linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-alt) 100%);
    --gradient-surface: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
    --gradient-glow: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255,77,0,0.06), transparent 40%);

    /* — Typography — */
    --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Space Grotesk', 'Inter', sans-serif;
    --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

    /* Fluid type scale (min: 375px — max: 1440px) */
    --text-xs:   clamp(0.75rem, 0.7rem + 0.2vw, 0.875rem);
    --text-sm:   clamp(0.8125rem, 0.78rem + 0.15vw, 0.9375rem);
    --text-base: clamp(0.9375rem, 0.9rem + 0.18vw, 1.0625rem);
    --text-lg:   clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
    --text-xl:   clamp(1.25rem, 1.1rem + 0.7vw, 1.75rem);
    --text-2xl:  clamp(1.5rem, 1.2rem + 1.3vw, 2.5rem);
    --text-3xl:  clamp(1.875rem, 1.4rem + 2vw, 3.25rem);
    --text-4xl:  clamp(2.25rem, 1.6rem + 2.8vw, 4rem);
    --text-5xl:  clamp(2.75rem, 1.8rem + 4vw, 5.5rem);
    --text-hero: clamp(3rem, 2rem + 5vw, 7rem);

    /* Font weights */
    --fw-light:    300;
    --fw-regular:  400;
    --fw-medium:   500;
    --fw-semibold: 600;
    --fw-bold:     700;
    --fw-extrabold:800;

    /* Line heights */
    --lh-tight:    1.1;
    --lh-snug:     1.25;
    --lh-normal:   1.6;
    --lh-relaxed:  1.75;

    /* Letter spacing */
    --ls-tight:   -0.03em;
    --ls-normal:   0;
    --ls-wide:     0.05em;
    --ls-wider:    0.1em;

    /* — Spacing (8px grid) — */
    --space-2xs:   0.25rem;   /* 4px */
    --space-xs:    0.5rem;    /* 8px */
    --space-sm:    0.75rem;   /* 12px */
    --space-md:    1rem;      /* 16px */
    --space-lg:    1.5rem;    /* 24px */
    --space-xl:    2rem;      /* 32px */
    --space-2xl:   3rem;      /* 48px */
    --space-3xl:   4rem;      /* 64px */
    --space-4xl:   6rem;      /* 96px */
    --space-5xl:   8rem;      /* 128px */
    --space-section: clamp(4rem, 3rem + 5vw, 8rem);

    /* — Border Radius — */
    --radius-sm:   0.375rem;
    --radius-md:   0.75rem;
    --radius-lg:   1rem;
    --radius-xl:   1.5rem;
    --radius-2xl:  2rem;
    --radius-full: 9999px;

    /* — Shadows & Glows — */
    --shadow-sm:    0 1px 2px rgba(0,0,0,0.3);
    --shadow-md:    0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg:    0 8px 30px rgba(0,0,0,0.5);
    --shadow-xl:    0 16px 60px rgba(0,0,0,0.6);
    --shadow-glow:  0 0 30px rgba(255,77,0,0.3);
    --shadow-glow-lg: 0 0 60px rgba(255,77,0,0.2), 0 0 120px rgba(255,122,46,0.1);

    /* — Transitions — */
    --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --ease-in-out:    cubic-bezier(0.65, 0, 0.35, 1);
    --ease-spring:    cubic-bezier(0.34, 1.56, 0.64, 1);

    --transition-fast:   150ms var(--ease-out-expo);
    --transition-base:   300ms var(--ease-out-expo);
    --transition-slow:   500ms var(--ease-out-expo);
    --transition-slower: 800ms var(--ease-out-expo);

    /* — Z-index — */
    --z-behind:     -1;
    --z-base:       1;
    --z-dropdown:   100;
    --z-sticky:     200;
    --z-overlay:    300;
    --z-modal:      400;
    --z-toast:      500;

    /* — Container — */
    --container-max: 1280px;
    --container-pad: clamp(1.25rem, 1rem + 2vw, 3rem);
}

/* ============================================================
   1b. LIGHT MODE OVERRIDES
   ============================================================ */
[data-theme="light"] {
    --color-bg:          #faf9f6;
    --color-bg-alt:      #f0eee9;
    --color-surface:     #ffffff;
    --color-surface-2:   #f5f3f0;
    --color-surface-3:   #eae7e2;
    --color-border:      rgba(0, 0, 0, 0.08);
    --color-border-hover:rgba(0, 0, 0, 0.15);

    --color-text:        #1a1a1a;
    --color-text-secondary: #555555;
    --color-text-muted:  #888888;

    --color-accent-1:    #e64500;
    --color-accent-2:    #d63a00;
    --color-accent-3:    #ff7a2e;
    --color-accent-4:    #0ea5e9;

    --gradient-accent: linear-gradient(135deg, #e64500, #ff6b2c, #ff8c42);
    --gradient-accent-h: linear-gradient(135deg, #ff6b2c, #ff8c42, #ffaa5c);
    --gradient-subtle: linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-alt) 100%);
    --gradient-surface: linear-gradient(135deg, rgba(0,0,0,0.02) 0%, rgba(0,0,0,0.01) 100%);
    --gradient-glow: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255,77,0,0.04), transparent 40%);

    --shadow-sm:    0 1px 2px rgba(0,0,0,0.06);
    --shadow-md:    0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg:    0 8px 30px rgba(0,0,0,0.1);
    --shadow-xl:    0 16px 60px rgba(0,0,0,0.12);
    --shadow-glow:  0 0 30px rgba(255,77,0,0.15);
    --shadow-glow-lg: 0 0 60px rgba(255,77,0,0.1), 0 0 120px rgba(255,122,46,0.05);
}

[data-theme="light"] .bg-noise::after {
    opacity: 0.015;
}

[data-theme="light"] .bg-grid::after {
    background-image:
        linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
}

[data-theme="light"] ::selection {
    background: rgba(255,77,0,0.2);
    color: #1a1a1a;
}

[data-theme="light"] .glass-card {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .glass-card:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .header::before {
    background: rgba(250, 249, 246, 0.6);
}

[data-theme="light"] .header.is-scrolled::before {
    background: rgba(250, 249, 246, 0.9);
}

[data-theme="light"] .mobile-menu {
    background: rgba(250, 249, 246, 0.98);
}

[data-theme="light"] .page-loader {
    background: var(--color-bg);
}

[data-theme="light"] .hero-orb--1 { background: rgba(255,77,0,0.08); }
[data-theme="light"] .hero-orb--2 { background: rgba(255,122,46,0.06); }
[data-theme="light"] .hero-orb--3 { background: rgba(255,170,92,0.05); }
[data-theme="light"] .hero-orb--4 { background: rgba(34,211,238,0.05); }


/* ============================================================
   2. CSS RESET
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

@media (pointer: fine) {
    *, *::before, *::after {
        cursor: none !important;
    }
}

html {
    scroll-behavior: auto; /* Lenis handles smooth scroll */
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--fw-regular);
    line-height: var(--lh-normal);
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100vh;
    transition: background-color 0.4s ease, color 0.4s ease;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

input, button, textarea, select {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--fw-bold);
    line-height: var(--lh-tight);
    letter-spacing: var(--ls-tight);
    overflow-wrap: break-word;
}


/* ============================================================
   3. TYPOGRAPHY
   ============================================================ */
.text-hero {
    font-size: var(--text-hero);
    font-weight: var(--fw-extrabold);
    line-height: 1;
    letter-spacing: -0.04em;
}

h1, .text-5xl { font-size: var(--text-5xl); }
h2, .text-4xl { font-size: var(--text-4xl); }
h3, .text-3xl { font-size: var(--text-3xl); }
h4, .text-2xl { font-size: var(--text-2xl); }
h5, .text-xl  { font-size: var(--text-xl); }
h6, .text-lg  { font-size: var(--text-lg); }

.text-gradient {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-muted {
    color: var(--color-text-secondary);
}

.text-sm   { font-size: var(--text-sm); }
.text-xs   { font-size: var(--text-xs); }
.text-base { font-size: var(--text-base); }

.lead {
    font-size: var(--text-lg);
    color: var(--color-text-secondary);
    line-height: var(--lh-relaxed);
    max-width: 600px;
}

.label {
    font-size: var(--text-xs);
    font-weight: var(--fw-semibold);
    text-transform: uppercase;
    letter-spacing: var(--ls-wider);
    color: var(--color-accent-1);
}


/* ============================================================
   4. LAYOUT
   ============================================================ */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-pad);
}

.container--narrow {
    max-width: 900px;
}

.container--wide {
    max-width: 1440px;
}

section {
    padding-block: var(--space-section);
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.section-header .label {
    margin-bottom: var(--space-sm);
    display: block;
}

.section-header h2 {
    margin-bottom: var(--space-md);
}

.section-header .lead {
    margin-inline: auto;
}

/* Grid */
.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1023px) {
    .grid-3, .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* Flex */
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.flex-wrap   { flex-wrap: wrap; }
.items-center{ align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-xs  { gap: var(--space-xs); }
.gap-sm  { gap: var(--space-sm); }
.gap-md  { gap: var(--space-md); }
.gap-lg  { gap: var(--space-lg); }
.gap-xl  { gap: var(--space-xl); }
.gap-2xl { gap: var(--space-2xl); }

/* Centering */
.mx-auto { margin-inline: auto; }
.text-center { text-align: center; }


/* ============================================================
   5. BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: 0.875rem 2rem;
    font-family: var(--font-heading);
    font-size: var(--text-sm);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--ls-wide);
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn--primary {
    background: var(--gradient-accent);
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.btn--primary:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: var(--shadow-glow-lg);
}

.btn--primary:active {
    transform: translateY(0) scale(0.98);
}

.btn--outline {
    background: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-border-hover);
}

.btn--outline:hover {
    border-color: var(--color-accent-1);
    color: var(--color-accent-1);
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(255,77,0,0.15);
}

.btn--ghost {
    background: transparent;
    color: var(--color-text-secondary);
    padding: 0.5rem 1rem;
}

.btn--ghost:hover {
    color: var(--color-text);
}

.btn--lg {
    padding: 1.125rem 2.5rem;
    font-size: var(--text-base);
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
}

@media (max-width: 480px) {
    .btn-group {
        flex-direction: column;
    }
    .btn {
        width: 100%;
    }
}

/* Button arrow icon */
.btn .arrow {
    transition: transform var(--transition-fast);
}
.btn:hover .arrow {
    transform: translateX(4px);
}


/* ============================================================
   6. CARDS
   ============================================================ */
.card {
    background: var(--gradient-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--gradient-glow);
    opacity: 0;
    transition: opacity var(--transition-slow);
    pointer-events: none;
}

.card:hover {
    border-color: var(--color-border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card:hover::before {
    opacity: 1;
}

/* Glass Card */
.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    transition: all var(--transition-base);
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-4px);
}


/* ============================================================
   7. FORM ELEMENTS
   ============================================================ */
.form-group {
    position: relative;
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--fw-medium);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xs);
    transition: color var(--transition-fast);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: var(--text-base);
    transition: all var(--transition-base);
    outline: none;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--color-accent-1);
    box-shadow: 0 0 0 3px rgba(255,77,0,0.15);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--color-text-muted);
}

.form-textarea {
    resize: vertical;
    min-height: 140px;
}

.form-error {
    color: #ef4444;
    font-size: var(--text-xs);
    margin-top: var(--space-2xs);
}


/* ============================================================
   8. BACKGROUND EFFECTS
   ============================================================ */
.bg-noise {
    position: relative;
}

.bg-noise::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    background-repeat: repeat;
    pointer-events: none;
    z-index: 0;
}

.bg-grid {
    position: relative;
}

.bg-grid::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

/* Gradient orbs for backgrounds */
.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}

.gradient-orb--1 {
    width: 600px;
    height: 600px;
    background: rgba(255,77,0,0.15);
    top: -200px;
    right: -200px;
}

.gradient-orb--2 {
    width: 500px;
    height: 500px;
    background: rgba(255,122,46,0.1);
    bottom: -100px;
    left: -200px;
}

.gradient-orb--3 {
    width: 400px;
    height: 400px;
    background: rgba(255,170,92,0.08);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}


/* ============================================================
   9. UTILITY CLASSES
   ============================================================ */
.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;
}

.relative { position: relative; }
.overflow-hidden { overflow: hidden; }

.z-1 { z-index: var(--z-base); }
.z-10 { z-index: 10; }

.w-full { width: 100%; }
.h-screen { min-height: 100vh; }

.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

.mt-xs  { margin-top: var(--space-xs); }
.mt-sm  { margin-top: var(--space-sm); }
.mt-md  { margin-top: var(--space-md); }
.mt-lg  { margin-top: var(--space-lg); }
.mt-xl  { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }
.mt-3xl { margin-top: var(--space-3xl); }

.mb-xs  { margin-bottom: var(--space-xs); }
.mb-sm  { margin-bottom: var(--space-sm); }
.mb-md  { margin-bottom: var(--space-md); }
.mb-lg  { margin-bottom: var(--space-lg); }
.mb-xl  { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }

.py-sm  { padding-block: var(--space-sm); }
.py-md  { padding-block: var(--space-md); }
.py-lg  { padding-block: var(--space-lg); }
.py-xl  { padding-block: var(--space-xl); }

.opacity-0 { opacity: 0; }

/* Divider */
.divider {
    height: 1px;
    background: var(--gradient-accent);
    opacity: 0.3;
    border: none;
}

/* Tag / Badge */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    font-size: var(--text-xs);
    font-weight: var(--fw-medium);
    border-radius: var(--radius-full);
    background: rgba(255,77,0,0.1);
    color: var(--color-accent-1);
    border: 1px solid rgba(255,77,0,0.2);
}


/* ============================================================
   10. PAGE TRANSITIONS
   ============================================================ */
.page-transition-overlay {
    position: fixed;
    inset: 0;
    background: var(--color-bg);
    z-index: 9999;
    pointer-events: none;
}

main {
    position: relative;
    z-index: var(--z-base);
}


/* ============================================================
   11. SELECTION & SCROLLBAR
   ============================================================ */
::selection {
    background: rgba(255,77,0,0.3);
    color: #fff;
}

/* Custom scrollbar (Webkit) */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--color-surface-3);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent-1);
}


/* ============================================================
   12. REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto !important;
    }
}
