/* ==========================================================================
   Goodsides — Design System & Custom CSS
   Theme: Ethereal Dark Glass / Editorial Technology
   ========================================================================== */

/* 1. LOCAL FONT DECLARATIONS (DSGVO Compliant) */
@font-face {
    font-family: 'Outfit';
    src: url('fonts/outfit-300.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Outfit';
    src: url('fonts/outfit-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Outfit';
    src: url('fonts/outfit-500.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Outfit';
    src: url('fonts/outfit-600.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Outfit';
    src: url('fonts/outfit-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('fonts/inter-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('fonts/inter-500.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('fonts/inter-600.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('fonts/inter-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* 2. ROOT VARIABLES */
:root {
    --bg-base: #060606;           /* Deepest Space Charcoal */
    --bg-surface: #0f0f0e;        /* Vantablack Card Face */
    --text-primary: #f6f6f6;      /* Off-White */
    --text-secondary: #8e8e8f;    /* Muted Gray */
    --accent: #2563eb;            /* Electric Blue (Desaturated to 75% for luxury vibe) */
    --accent-glow: rgba(37, 99, 235, 0.15);
    --bezel-outer: rgba(255, 255, 255, 0.02);
    --bezel-border: rgba(255, 255, 255, 0.05);
    --bezel-inner: #0f0f0f;
    --inner-highlight: rgba(255, 255, 255, 0.06);
    --fluid-bezier: cubic-bezier(0.16, 1, 0.3, 1); /* Apple / Linear tier easing */
    --radius-outer: 2.2rem;
    --radius-inner: calc(2.2rem - 8px);
}

/* 3. BASE STYLING & CORE UTILITIES */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg-base);
    color: var(--text-primary);
}

body {
    background-color: var(--bg-base);
    overflow-x: hidden;
    position: relative;
    min-height: 100dvh; /* Viewport stability override */
}

/* Subtle Film Grain Noise Overlay (GPU Safe) */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.015;
    pointer-events: none;
    z-index: 9999;
}

/* Custom Interactive Cursor Follower */
.custom-cursor {
    width: 32px;
    height: 32px;
    border: 1px solid var(--text-primary);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    opacity: 0.25;
    transform: translate(-50%, -50%);
    transition: width 0.3s var(--fluid-bezier), height 0.3s var(--fluid-bezier), background-color 0.3s var(--fluid-bezier), opacity 0.3s ease;
}

.custom-cursor.hovering {
    width: 64px;
    height: 64px;
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(4px);
    opacity: 0.8;
}

@media (pointer: coarse) {
    .custom-cursor { display: none; }
}

/* 4. TYPOGRAPHY SYSTEM */
h1, h2, h3, h4, .logo {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.03em;
}

h1 {
    font-size: clamp(2.8rem, 7vw, 4.8rem);
    font-weight: 700;
    line-height: 1.05;
}

h2 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 700;
    line-height: 1.1;
}

h3 {
    font-size: clamp(1.3rem, 2.5vw, 1.8rem);
    font-weight: 600;
    line-height: 1.2;
}

p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

.eyebrow {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 99px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
}

/* 5. NAVIGATION (Floating dynamic glass island) */
nav {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 99px;
    padding: 8px 12px 8px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    max-width: 1000px;
    z-index: 1000;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    transition: padding 0.3s var(--fluid-bezier), top 0.3s var(--fluid-bezier);
}

nav.scrolled {
    top: 16px;
    padding: 6px 8px 6px 20px;
    background: rgba(8, 8, 8, 0.8);
}

nav .logo {
    font-size: 1.4rem;
    font-weight: 800;
    text-decoration: none;
    color: var(--text-primary);
    letter-spacing: -0.04em;
    display: flex;
    align-items: center;
}

nav .logo span {
    display: inline-block;
    transition: transform 0.3s var(--fluid-bezier);
}

nav ul {
    display: flex;
    list-style: none;
    gap: clamp(1rem, 2vw, 2rem);
    margin: 0 auto 0 40px;
}

nav ul li a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.3s ease;
    position: relative;
    padding: 6px 0;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--text-primary);
    transition: width 0.3s var(--fluid-bezier);
}

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

nav ul li a.active::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 6. DOUBLE-BEZEL COMPONENT WRAPPER (Nested Architecture) */
.double-bezel {
    background: var(--bezel-outer);
    border: 1px solid var(--bezel-border);
    padding: 8px;
    border-radius: var(--radius-outer);
    height: 100%;
    position: relative;
    overflow: hidden;
    transition: transform 0.6s var(--fluid-bezier), border-color 0.6s var(--fluid-bezier);
}

.double-bezel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(800px circle at var(--mouse-x, 0) var(--mouse-y, 0), rgba(255,255,255,0.06), transparent 40%);
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.double-bezel:hover::before {
    opacity: 1;
}

.double-bezel:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.12);
}

.double-bezel-inner {
    background: var(--bg-surface);
    border-radius: var(--radius-inner);
    padding: 40px;
    height: 100%;
    position: relative;
    z-index: 2;
    box-shadow: inset 0 1px 1px var(--inner-highlight);
    display: flex;
    flex-direction: column;
}

/* 7. DYNAMIC BUTTONS (Island Architecture) */
.btn-premium {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    background: var(--text-primary);
    color: var(--bg-base);
    padding: 6px 6px 6px 20px;
    border-radius: 99px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.3s var(--fluid-bezier), background-color 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-premium .icon-circle {
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-base);
    transition: transform 0.3s var(--fluid-bezier), background-color 0.3s ease;
}

.btn-premium:hover {
    background-color: #ffffff;
    transform: scale(1.02);
}

.btn-premium:hover .icon-circle {
    transform: rotate(45deg);
    background: rgba(0, 0, 0, 0.1);
}

.btn-premium:active {
    transform: scale(0.98);
}

.btn-secondary-glow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 24px;
    border-radius: 99px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s var(--fluid-bezier);
}

.btn-secondary-glow:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.btn-secondary-glow:active {
    transform: translateY(0);
}

/* 8. SECTIONS & LAYOUT ARCHEPLAY */
section {
    padding: 120px 8%;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

/* Grid & Bento Archetypes */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
}

.bento-col-8 { grid-column: span 8; }
.bento-col-6 { grid-column: span 6; }
.bento-col-4 { grid-column: span 4; }
.bento-row-2 { grid-row: span 2; }

/* Editorial Split Archetype */
.editorial-split {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 90dvh;
    gap: 64px;
    padding-top: 160px;
    padding-bottom: 80px;
}

.editorial-split .left {
    flex: 1;
    max-width: 550px;
}

.editorial-split .right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    position: relative;
}

/* Hero abstract background mesh glow */
.editorial-split::after {
    content: '';
    position: absolute;
    top: 10%;
    right: 5%;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, var(--accent-glow) 0%, rgba(37, 99, 235, 0) 70%);
    z-index: -1;
    filter: blur(40px);
    pointer-events: none;
}

/* 9. REVEAL SYSTEM (Scroll Triggered) */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    filter: blur(8px);
    transition: opacity 1.2s var(--fluid-bezier), transform 1.2s var(--fluid-bezier), filter 1.2s var(--fluid-bezier);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

/* Sequential delay utility */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* 10. INTERACTIVE HERO GRAPHIC (Browser Mockup Stream) */
.browser-mockup {
    width: 100%;
    max-width: 500px;
    aspect-ratio: 4/3;
}

.browser-header {
    height: 32px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 6px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
}

.dot.red { background: rgba(239, 68, 68, 0.5); }
.dot.yellow { background: rgba(245, 158, 11, 0.5); }
.dot.green { background: rgba(16, 185, 129, 0.5); }

.browser-body {
    padding: 24px;
    font-family: monospace;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
    line-height: 1.5;
    flex-grow: 1;
    overflow: hidden;
}

.code-keyword { color: #f43f5e; }
.code-entity { color: #3b82f6; }
.code-string { color: #10b981; }

/* 11. BENTO LIVE WIDGETS */
/* Waterfall list widget */
.live-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    margin-bottom: 12px;
    transition: transform 0.4s var(--fluid-bezier), background 0.4s ease;
}

.live-list-item:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateX(4px);
}

/* Monospace Numbers styling */
.font-mono {
    font-family: monospace;
}

/* 12. DYNAMIC TIMELINE (Ingenieur-Spirit) */
.timeline-container {
    position: relative;
    margin: 60px 0;
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.timeline-line {
    position: absolute;
    left: 20px;
    top: 0;
    width: 2px;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    z-index: 1;
}

.timeline-progress {
    position: absolute;
    left: 20px;
    top: 0;
    width: 2px;
    height: 0;
    background: var(--accent);
    z-index: 2;
    transition: height 0.5s ease;
}

.timeline-step {
    display: flex;
    align-items: flex-start;
    gap: 32px;
    position: relative;
    z-index: 3;
}

.timeline-badge {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    color: var(--text-secondary);
    transition: border-color 0.4s ease, color 0.4s ease, background-color 0.4s ease;
}

.timeline-step.active .timeline-badge {
    border-color: var(--accent);
    color: var(--text-primary);
    background: var(--bg-base);
    box-shadow: 0 0 15px var(--accent-glow);
}

.timeline-content {
    flex: 1;
    padding-top: 6px;
}

.timeline-content h3 {
    margin-bottom: 8px;
}

/* 13. REFERENCES PREVIEW HOVER SYSTEM */
.project-card {
    cursor: pointer;
}

.project-card-image {
    aspect-ratio: 16/10;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.project-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s var(--fluid-bezier);
}

.project-card:hover .project-card-image img {
    transform: scale(1.05);
}

/* Floating mouse-tracker overlay */
.hover-preview-tracker {
    position: fixed;
    width: 280px;
    height: 180px;
    border-radius: 16px;
    overflow: hidden;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transform: scale(0.8) translate(-50%, -50%);
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.1);
    transition: opacity 0.3s ease, transform 0.3s var(--fluid-bezier);
}

.hover-preview-tracker.active {
    opacity: 1;
    transform: scale(1) translate(-50%, -50%);
}

.hover-preview-tracker img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 14. LIQUID FORM DESIGN */
.form-group {
    position: relative;
    margin-bottom: 24px;
    width: 100%;
}

.form-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px 20px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.3s ease, background 0.3s ease;
    outline: none;
}

.form-input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.04);
}

.form-label {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    transition: top 0.3s var(--fluid-bezier), transform 0.3s var(--fluid-bezier), font-size 0.3s var(--fluid-bezier), color 0.3s ease;
}

.form-group.textarea .form-label {
    top: 24px;
    transform: none;
}

.form-input:focus ~ .form-label,
.form-input:not(:placeholder-shown) ~ .form-label {
    top: 0;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: var(--accent);
    background: var(--bg-surface);
    padding: 0 8px;
    left: 12px;
}

/* Real-time Project Calculator Widget */
.calc-widget {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
}

.calc-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.calc-option {
    padding: 8px 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 99px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.calc-option.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* 15. FOOTER STYLING */
footer {
    padding: 100px 8% 40px;
    border-top: 1px solid var(--bezel-border);
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

footer .logo {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 12px;
}

footer p {
    font-size: 0.95rem;
}

.footer-links {
    margin-top: 40px;
    display: flex;
    gap: 40px;
    justify-content: center;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--text-primary);
}

/* 16. MOBILE STYLES & INTERACTIVITY */
.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    cursor: pointer;
    padding: 0 10px;
    transition: all 0.3s var(--fluid-bezier);
}

.mobile-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    margin: 2px 0;
    transition: all 0.3s var(--fluid-bezier);
}

.mobile-toggle span:last-child {
    width: 14px;
}

.mobile-toggle.active span:first-child {
    transform: translateY(3px) rotate(45deg);
    width: 20px;
}

.mobile-toggle.active span:last-child {
    transform: translateY(-3px) rotate(-45deg);
    width: 20px;
}

@media (max-width: 992px) {
    section {
        padding: 80px 6%;
    }
    
    nav {
        width: 92%;
        top: 16px;
        padding: 6px 8px 6px 16px;
    }
    
    .mobile-toggle {
        display: flex;
    }
    
    nav ul {
        position: fixed;
        top: 80px;
        left: 50%;
        transform: translateX(-50%) translateY(-20px);
        width: calc(100% - 32px);
        background: rgba(8, 8, 8, 0.95);
        backdrop-filter: blur(30px);
        -webkit-backdrop-filter: blur(30px);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 2rem;
        flex-direction: column;
        align-items: center;
        padding: 40px 20px;
        gap: 24px;
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s var(--fluid-bezier);
        box-shadow: 0 20px 40px rgba(0,0,0,0.8);
        margin: 0;
    }
    
    nav ul.active {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }
    
    nav ul li a {
        font-size: 1.2rem;
        font-weight: 600;
        color: var(--text-secondary);
    }
    
    .nav-actions {
        gap: 8px;
    }
    
    .btn-premium span {
        display: none;
    }
    
    .btn-premium {
        padding: 6px;
    }
    
    /* Layout collapses */
    .editorial-split {
        flex-direction: column;
        padding-top: 120px;
        gap: 48px;
        text-align: center;
    }
    
    .editorial-split .left {
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .editorial-split .right {
        justify-content: center;
        width: 100%;
    }
    
    .bento-grid {
        grid-template-columns: 1fr;
    }
    
    .bento-grid > div {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
    }
    
    .timeline-step {
        gap: 20px;
    }
}
