

/* Import Inter from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Swiss Typography Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base Typography - Swiss Principles */
:root {
    /* Typographic Scale - Modular Scale (1.25) */
    --font-size-xs: 0.75rem;      /* 12px */
    --font-size-sm: 0.875rem;     /* 14px */
    --font-size-base: 1rem;       /* 16px */
    --font-size-lg: 1.25rem;      /* 20px */
    --font-size-xl: 1.563rem;     /* 25px */
    --font-size-2xl: 1.953rem;    /* 31px */
    --font-size-3xl: 2.441rem;    /* 39px */
    --font-size-4xl: 3.052rem;    /* 49px */
    
    /* Line Heights - Swiss Precision */
    --line-height-tight: 1.2;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;
    
    /* Letter Spacing - Refined Tracking */
    --letter-spacing-tight: -0.02em;
    --letter-spacing-normal: 0;
    --letter-spacing-wide: 0.05em;
    
    /* Colors - Swiss Minimalism */
    --color-black: #000000;
    --color-gray-900: #1a1a1a;
    --color-gray-800: #2d2d2d;
    --color-gray-700: #4a4a4a;
    --color-gray-600: #6b6b6b;
    --color-gray-500: #8e8e8e;
    --color-gray-400: #b3b3b3;
    --color-gray-300: #d9d9d9;
    --color-gray-200: #e8e8e8;
    --color-gray-100: #f5f5f5;
    --color-white: #ffffff;
    
    /* Spacing - 8px Grid System */
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;    /* 8px */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.25rem;   /* 20px */
    --space-6: 1.5rem;    /* 24px */
    --space-8: 2rem;      /* 32px */
    --space-10: 2.5rem;   /* 40px */
    --space-12: 3rem;     /* 48px */
    --space-16: 4rem;     /* 64px */
    --space-20: 5rem;     /* 80px */
    --space-24: 6rem;     /* 96px */
    
    /* Max Width - Optimal Reading */
    --max-width-content: 65ch;
    --max-width-container: 1200px;
}

/* Body - Swiss Foundation */
html, body {
    height: 100%;
    min-height: 100vh;
}

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    letter-spacing: var(--letter-spacing-normal);
    color: var(--color-gray-200);
    background: var(--color-black);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    position: relative;
}

/* Loading Bar */
.loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--color-white);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s ease, width 0s 0.2s;
    pointer-events: none;
}

.loading-bar.active {
    opacity: 1;
    width: 0%;
    transition: opacity 0.2s ease, width 0s;
    animation: loadingProgress 0.6s ease-out forwards;
}

@keyframes loadingProgress {
    0% {
        width: 0%;
    }
    50% {
        width: 70%;
    }
    100% {
        width: 100%;
    }
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    line-height: var(--line-height-tight);
    letter-spacing: var(--letter-spacing-tight);
    color: var(--color-white);
    margin: 0;
}

h1 {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    letter-spacing: var(--letter-spacing-tight);
    margin-bottom: var(--space-6);
}

h2 {
    font-size: var(--font-size-3xl);
    margin-bottom: var(--space-5);
}

h3 {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--space-4);
}

h4 {
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-4);
}

h5 {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-3);
}

h6 {
    font-size: var(--font-size-base);
    margin-bottom: var(--space-3);
}

/* Paragraph Typography */
p {
    font-size: var(--font-size-base);
    line-height: var(--line-height-relaxed);
    color: var(--color-gray-300);
    margin-bottom: var(--space-5);
    max-width: var(--max-width-content);
}

/* Links */
a {
    color: var(--color-white);
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
    letter-spacing: var(--letter-spacing-normal);
}

a:hover {
    opacity: 0.7;
}

/* Page Content - Swiss Grid */
.page-content {
    max-width: var(--max-width-container);
    margin: var(--space-20) auto;
    padding: 0 var(--space-8);
    /* View transition name for smooth transitions */
    view-transition-name: page-content;
    /* Prevent flicker during SPA navigation */
    will-change: contents;
    /* Ensure instant updates without transitions */
    transition: none;
}

/* Page Content with Logo - Full Width */
.page-content:has(.logo-container) {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* Content Sections */
.content-section {
    max-width: var(--max-width-container);
    margin: 0 auto;
    padding: var(--space-16) var(--space-8);
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 12px;
    overflow: hidden;
}

.content-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 0;
}

.content-section > * {
    position: relative;
    z-index: 1;
}

.content-section h2 {
    margin-bottom: var(--space-6);
}

.content-section p {
    margin-bottom: var(--space-4);
}

/* Background images for each section */
.content-section-welcome {
    background-image: 
        linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(20, 20, 40, 0.8) 100%),
        url('https://picsum.photos/1920/1080?random=1');
}

.content-section-work {
    background-image: 
        linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(40, 20, 0, 0.8) 100%),
        url('https://picsum.photos/1920/1080?random=2');
}

.content-section-news {
    background-image: 
        linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 20, 40, 0.8) 100%),
        url('https://picsum.photos/1920/1080?random=3');
}

.content-section-about {
    background-image: 
        linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(40, 0, 40, 0.8) 100%),
        url('https://picsum.photos/1920/1080?random=4');
}

.content-section-contact {
    background-image: 
        linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(20, 40, 20, 0.8) 100%),
        url('https://picsum.photos/1920/1080?random=5');
}

/* Typography within Content */
.page-content h1 {
    margin-bottom: var(--space-8);
}

.page-content p {
    margin-bottom: var(--space-6);
}

.page-content p:last-child {
    margin-bottom: 0;
}

/* Logo Container - As Large As Possible */
.logo-container {
    width: 100%;
    height: calc(100vh - 120px);
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: var(--space-8);
}

.logo-svg {
    width: 100%;
    height: 100%;
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

#logo-container {
    cursor: pointer;
}

/* Hide audio element */
#sonic-audio {
    display: none;
}

/* Liquid Glass Effect */
.liquidGlass-wrapper {
    position: relative;
    display: flex;
    font-weight: 600;
    overflow: hidden;
    color: black;
    cursor: pointer;
    box-shadow: 0 6px 6px rgba(0, 0, 0, 0.2), 0 0 20px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 2.2);
}

.liquidGlass-effect {
    position: absolute;
    z-index: 0;
    inset: 0;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    filter: url(#glass-distortion);
    overflow: hidden;
    isolation: isolate;
    border-radius: 9999px;
}


.nav {
    position: fixed !important;
    bottom: var(--space-4);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: calc(100% - var(--space-8));
    max-width: 600px;
    height: 56px;
    min-height: 56px;
    padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom));
    border-radius: 9999px;
    contain: layout style paint;
    backface-visibility: hidden;
}

.nav-container {
    max-width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: var(--space-2);
    padding: 0 var(--space-2);
    position: relative;
    z-index: 3;
}

.nav-container .nav-item {
    flex: 0 1 auto;
    min-width: fit-content;
}

.nav-logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 40px;
    width: auto;
    min-width: 80px;
    margin-right: var(--space-3);
    flex-shrink: 0;
}

.nav-logo-svg {
    width: 100%;
    height: 100%;
    max-width: 120px;
    max-height: 40px;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2) var(--space-4);
    border-radius: 12px;
    text-decoration: none;
    color: var(--color-gray-400);
    transition: all 0.2s ease;
    flex: 1;
    min-width: 0;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.nav-item:active {
    transform: scale(0.95);
}

.nav-item.active {
    color: var(--color-white);
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.15);
}

.nav-label {
    font-size: var(--font-size-sm);
    font-weight: 500;
    letter-spacing: var(--letter-spacing-normal);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.2s ease;
}

.nav-item.active .nav-label {
    font-weight: 600;
}

/* Active indicator dot */
.nav-item.active::before {
    content: '';
    position: absolute;
    top: var(--space-1);
    width: 4px;
    height: 4px;
    border-radius: 9999px;
    background: var(--color-white);
    opacity: 0;
    animation: fadeInDot 0.2s ease forwards;
}

@keyframes fadeInDot {
    to {
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .nav {
        position: fixed !important;
        bottom: var(--space-2);
        left: var(--space-2);
        right: var(--space-2);
        transform: none !important;
        width: auto;
        max-width: none;
        height: 56px;
        min-height: 56px;
        border-radius: 9999px;
        padding: var(--space-2) var(--space-3) calc(var(--space-2) + env(safe-area-inset-bottom));
        backface-visibility: hidden;
    }
    
    .nav-container {
        gap: var(--space-1);
        padding: 0 var(--space-1);
    }
    
    .nav-logo {
        min-width: 60px;
        max-width: 80px;
        margin-right: var(--space-1);
    }
    
    .nav-logo-svg {
        max-width: 80px;
        max-height: 32px;
    }
    
    .nav-item {
        padding: var(--space-2) var(--space-3);
    }
    
    .nav-label {
        font-size: var(--font-size-xs);
    }
    
    /* Add padding to page content to prevent overlap */
    .page-content {
        padding-bottom: calc(70px + env(safe-area-inset-bottom));
    }
    
    /* Adjust logo container for bottom nav */
    .logo-container {
        height: calc(100vh - 70px - env(safe-area-inset-bottom));
        min-height: calc(100vh - 70px - env(safe-area-inset-bottom));
    }
    
}

/* Desktop floating nav adjustments */
@media (min-width: 769px) {
    .page-content {
        padding-bottom: calc(100px + env(safe-area-inset-bottom));
    }
    
    .logo-container {
        height: calc(100vh - 100px - env(safe-area-inset-bottom));
        min-height: calc(100vh - 100px - env(safe-area-inset-bottom));
    }
}

@supports (-webkit-touch-callout: none) {
    .nav-item {
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
    }
}

/* Lists - Swiss Style */
ul, ol {
    margin: 0 0 var(--space-5) 0;
    padding-left: var(--space-6);
    max-width: var(--max-width-content);
}

li {
    font-size: var(--font-size-base);
    line-height: var(--line-height-relaxed);
    color: var(--color-gray-300);
    margin-bottom: var(--space-2);
}

/* Blockquote */
blockquote {
    font-size: var(--font-size-lg);
    line-height: var(--line-height-relaxed);
    color: var(--color-gray-400);
    border-left: 2px solid var(--color-gray-600);
    padding-left: var(--space-6);
    margin: var(--space-6) 0;
    font-style: italic;
    max-width: var(--max-width-content);
}

/* Code */
code {
    font-family: 'Inter', monospace;
    font-size: 0.9em;
    background: var(--color-gray-900);
    padding: var(--space-1) var(--space-2);
    border-radius: 2px;
    color: var(--color-gray-200);
}

/* Horizontal Rule */
hr {
    border: none;
    border-top: 1px solid var(--color-gray-800);
    margin: var(--space-12) 0;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


::view-transition-old(page-content) {
    animation-name: fadeOut;
}

::view-transition-new(page-content) {
    animation-name: fadeIn;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}

/* Responsive Typography */
@media (max-width: 768px) {
    :root {
        --font-size-4xl: 2.441rem;  /* 39px */
        --font-size-3xl: 1.953rem;  /* 31px */
        --font-size-2xl: 1.563rem;  /* 25px */
    }
    
    .nav-container {
        padding: var(--space-4) var(--space-4);
        gap: var(--space-4);
    }
    
    .page-content {
        margin: var(--space-12) auto;
        padding: 0 var(--space-4);
    }
    
    .logo-container {
        height: calc(100vh - 100px);
        min-height: 400px;
        padding: var(--space-4);
    }
}

/* Search Overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-container {
    position: relative;
    width: 90%;
    max-width: 600px;
    padding: var(--space-8);
}

.search-close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50%;
    color: var(--color-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.search-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.search-close svg {
    width: 20px;
    height: 20px;
}

.search-input {
    width: 100%;
    padding: var(--space-6) var(--space-8);
    font-size: var(--font-size-xl);
    font-family: 'Inter', sans-serif;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 9999px;
    color: var(--color-white);
    outline: none;
    transition: all 0.2s ease;
}

.search-input::placeholder {
    color: var(--color-gray-400);
}

.search-input:focus {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

/* Print Styles - Swiss Precision */
@media print {
    body {
        color: var(--color-black);
        background: var(--color-white);
    }
    
    .page-content {
        max-width: 100%;
    }
}
