/* ============================================================
   SEBASTIAN JOHN — 3D PORTFOLIO
   Design System & Styles
   ============================================================ */

/* ---------- CSS CUSTOM PROPERTIES ---------- */
:root {
    /* Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #0e0e16;
    --bg-surface: #12121a;
    --bg-surface-hover: #1a1a28;
    --accent-primary: #6c63ff;
    --accent-primary-rgb: 108, 99, 255;
    --accent-secondary: #00d4aa;
    --accent-secondary-rgb: 0, 212, 170;
    --text-primary: #f0f0f5;
    --text-secondary: #8888a0;
    --text-muted: #55556a;
    --border-subtle: #1e1e2e;
    --border-active: #2a2a40;

    /* Typography */
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 40px;
    --space-2xl: 64px;
    --space-3xl: 96px;
    --space-4xl: 128px;

    /* Sizes */
    --container-max: 1200px;
    --nav-height: 72px;

    /* Transitions */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --transition-fast: 0.2s var(--ease-out);
    --transition-normal: 0.4s var(--ease-out);
    --transition-slow: 0.8s var(--ease-out);

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

::selection {
    background: rgba(var(--accent-primary-rgb), 0.3);
    color: var(--text-primary);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

/* ---------- UTILITY ---------- */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.section {
    padding: var(--space-4xl) 0;
    position: relative;
}

.section-label {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--accent-primary);
    margin-bottom: var(--space-lg);
}

.section-heading {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 700;
    line-height: 1.15;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.section-subheading {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 560px;
    margin-bottom: var(--space-2xl);
}

.hide-mobile {
    display: inline;
}

/* ---------- BUTTONS ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    border-radius: var(--radius-xl);
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--accent-primary);
    color: #fff;
    box-shadow: 0 0 30px rgba(var(--accent-primary-rgb), 0.2);
}

.btn-primary:hover {
    background: #7d75ff;
    box-shadow: 0 0 50px rgba(var(--accent-primary-rgb), 0.35);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.btn-ghost:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(var(--accent-primary-rgb), 0.05);
    transform: translateY(-2px);
}

.btn-large {
    padding: 18px 40px;
    font-size: 1.05rem;
}

/* ---------- NAVIGATION ---------- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    z-index: 1000;
    transition: all var(--transition-normal);
    backdrop-filter: blur(0px);
    border-bottom: 1px solid transparent;
}

.navbar.scrolled {
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom-color: var(--border-subtle);
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-lg);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.logo-dot {
    color: var(--accent-primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    list-style: none;
}

.nav-link {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-primary);
    transition: width var(--transition-fast);
    border-radius: 1px;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-cta-link {
    color: var(--accent-primary) !important;
    font-weight: 600;
}

.nav-cta-link::after {
    display: none;
}

.nav-cta-link:hover {
    color: #7d75ff !important;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
}

.hamburger-line {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition-fast);
}

/* ---------- HERO SECTION ---------- */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background: radial-gradient(ellipse at center, transparent 0%, var(--bg-primary) 75%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 0 var(--space-lg);
    max-width: 900px;
}

.hero-badge {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-secondary);
    padding: 8px 20px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-xl);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.8s var(--ease-out) 0.3s forwards;
}

.hero-headline {
    font-family: var(--font-heading);
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -2px;
    margin-bottom: var(--space-lg);
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 1s var(--ease-out) 0.5s forwards;
}

.hero-headline-accent {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-xl);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.8s var(--ease-out) 0.7s forwards;
}

.hero-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.8s var(--ease-out) 0.9s forwards;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    opacity: 0;
    animation: fadeUp 0.8s var(--ease-out) 1.2s forwards;
}

.scroll-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, var(--accent-primary), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
    50% { opacity: 1; transform: scaleY(1); }
}

/* ---------- ABOUT SECTION ---------- */
.about-section {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
}

.about-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: var(--space-3xl);
    align-items: start;
    margin-bottom: var(--space-3xl);
}

.about-bio {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: var(--space-lg);
}

.about-principles {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.principle-card {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-lg) var(--space-xl);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.principle-card:hover {
    border-color: var(--accent-primary);
    transform: translateX(4px);
    box-shadow: 0 0 30px rgba(var(--accent-primary-rgb), 0.08);
}

.principle-arrow {
    font-size: 1.5rem;
    color: var(--accent-primary);
    font-weight: 300;
    flex-shrink: 0;
}

.principle-content {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.principle-from {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: line-through;
    text-decoration-color: var(--text-muted);
}

.principle-to {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-secondary);
}

/* Stats */
.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.stat-item {
    text-align: center;
    padding: var(--space-xl) var(--space-lg);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.stat-number {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    color: var(--text-primary);
    display: inline;
}

.stat-suffix {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--accent-primary);
    display: inline;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ---------- SERVICES SECTION ---------- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

.service-card {
    padding: var(--space-xl) var(--space-xl);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.service-card:hover {
    border-color: var(--border-active);
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.service-card:hover::before {
    opacity: 1;
}

.service-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: rgba(var(--accent-primary-rgb), 0.1);
    color: var(--accent-primary);
    margin-bottom: var(--space-lg);
}

.service-icon svg {
    width: 24px;
    height: 24px;
}

.service-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.service-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ---------- PROJECTS SECTION ---------- */
.projects-section {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
}

.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}

.project-card {
    position: relative;
    padding: var(--space-2xl);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    overflow: hidden;
}

.project-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(var(--accent-primary-rgb), 0.04) 0%, transparent 70%);
    pointer-events: none;
}

.project-card:hover {
    border-color: var(--border-active);
    transform: translateY(-2px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.project-card-featured {
    border-color: rgba(var(--accent-primary-rgb), 0.2);
    background: linear-gradient(135deg, var(--bg-surface) 0%, rgba(var(--accent-primary-rgb), 0.03) 100%);
}

.project-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-primary);
    padding: 4px 12px;
    border: 1px solid rgba(var(--accent-primary-rgb), 0.3);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-lg);
}

.project-number {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.project-title {
    font-family: var(--font-heading);
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    font-weight: 700;
    margin-bottom: var(--space-md);
}

.project-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: var(--space-xl);
    max-width: 700px;
}

.project-outcomes {
    display: flex;
    gap: var(--space-xl);
    flex-wrap: wrap;
}

.project-outcomes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg) var(--space-xl);
}

.outcome {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.outcome-metric {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.outcome-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ---------- CONTACT SECTION ---------- */
.contact-section {
    text-align: center;
    padding: var(--space-4xl) 0;
    position: relative;
    overflow: hidden;
}

.contact-section::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(var(--accent-primary-rgb), 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.contact-content {
    position: relative;
    z-index: 1;
}

.contact-heading {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: var(--space-lg);
    letter-spacing: -1px;
}

.contact-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: var(--space-xl);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.contact-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
}

/* ---------- FOOTER ---------- */
.footer {
    padding: var(--space-xl) 0;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-primary);
}

.footer-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.footer-logo {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
}

.footer-copy {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-right {
    display: flex;
    gap: var(--space-md);
}

.footer-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--text-muted);
    transition: all var(--transition-fast);
    border: 1px solid var(--border-subtle);
}

.footer-link:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.footer-link svg {
    width: 18px;
    height: 18px;
}

/* ---------- SCROLL ANIMATIONS ---------- */
[data-animate] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

[data-animate].animated {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }
}

@media (max-width: 768px) {
    .section {
        padding: var(--space-3xl) 0;
    }

    .hide-mobile {
        display: none;
    }

    /* Mobile Nav */
    .nav-toggle {
        display: flex;
        z-index: 1001;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--bg-surface);
        flex-direction: column;
        align-items: flex-start;
        padding: calc(var(--nav-height) + var(--space-xl)) var(--space-xl) var(--space-xl);
        gap: var(--space-lg);
        transition: right var(--transition-normal);
        border-left: 1px solid var(--border-subtle);
        box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);
    }

    .nav-links.open {
        right: 0;
    }

    .nav-toggle.open .hamburger-line:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav-toggle.open .hamburger-line:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.open .hamburger-line:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    /* Hero */
    .hero-headline {
        letter-spacing: -1px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 300px;
    }

    /* Services */
    .services-grid {
        grid-template-columns: 1fr;
    }

    /* Projects */
    .project-card {
        padding: var(--space-xl);
    }

    .project-outcomes {
        flex-direction: column;
        gap: var(--space-md);
    }

    /* Stats */
    .about-stats {
        grid-template-columns: 1fr;
    }

    /* Footer */
    .footer-container {
        flex-direction: column;
        gap: var(--space-lg);
        text-align: center;
    }

    .footer-left {
        flex-direction: column;
        gap: var(--space-sm);
    }
}

@media (max-width: 480px) {
    .hero-headline {
        font-size: 2.5rem;
    }

    .section-heading {
        font-size: 1.8rem;
    }

    .contact-heading {
        font-size: 2rem;
    }

    .container {
        padding: 0 var(--space-md);
    }

    .principle-card {
        padding: var(--space-md);
    }
}
