/* ==========================================================================
   GLOBAL DESIGN SYSTEM (main.css)
   Exact replica of Itti's Framer Portfolio (https://itti.framer.website/)
   Structured cleanly as in yen-tweaking for easy understanding & tweaking
   ========================================================================== 
   
   TABLE OF CONTENTS:
   1. Google Fonts Import (Inter & Fraunces/Wombat style serif)
   2. CSS Variables & Theme Tokens
   3. Reset & Base Typography
   4. Floating Top Navigation Bar
   5. Global Footer (Contact, Main Links, Spotify Track)
   ========================================================================== */

/* 1. GOOGLE FONTS IMPORT */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600&family=Inter:wght@400;500;600;700&display=swap');

/* 2. CSS VARIABLES & THEME TOKENS */
:root {
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-serif: 'Fraunces', 'WOMBAT Regular', 'Playfair Display', Georgia, serif;
    
    /* Colors - Light Section (Work) */
    --bg-light: #FFFFFF;
    --text-dark: #001122;
    --text-muted-dark: #666666;
    --text-subtle: #888888;
    
    /* Play Section & Footer Colors (Light by default) */
    --play-bg: #FFFFFF;
    --play-title: var(--text-dark);
    --play-card-bg: #F5F5F7;
    --play-card-border: rgba(0, 0, 0, 0.08);
    --play-card-text: var(--text-dark);
    
    --footer-bg: #FFFFFF;
    --footer-text: var(--text-dark);
    --footer-text-muted: var(--text-muted-dark);
    --footer-border: rgba(0, 0, 0, 0.08);
    --footer-giant-text: #000000;
    --footer-asterisk: #000000;
    
    /* Accent Star Colors from Itti's Site */
    --star-green: #489E66;
    --star-blue: #2A5AC8;
    --star-orange: #E35935;
    --star-yellow: #EEC342;
    
    /* Work Card Background Colors */
    --card-bg-lists: #FCE5FF;
    --card-bg-enclave: radial-gradient(50% 50% at 50% 50%, rgb(21, 30, 115) 5%, rgb(0, 0, 0) 100%);
    --card-bg-ua: #E6F3FF;
    --card-bg-spcu: #D1EBE2;
    --card-bg-recipely: #FAEAFA;
    --card-bg-citizen: #EBF2FF;
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 3. RESET & BASE TYPOGRAPHY */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background-color: var(--bg-light);
}

html.dark-mode {
    background-color: #000000;
}

body {
    min-height: 100vh;
    font-family: var(--font-sans);
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

@media (max-width: 768px) {
    .container {
        padding: 0 24px;
    }
}

/* 4. FLOATING TOP NAVIGATION BAR (Exact replica of Itti's floating nav) */
.header-nav {
    position: fixed;
    top: 24px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 0 40px;
    pointer-events: none;
}

.header-logo {
    position: absolute;
    left: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    pointer-events: auto;
}

.logo-icon {
    width: 28px;
    height: 28px;
    animation: spin-slow 20s linear infinite;
}

.header-logo span {
    font-weight: 600;
    font-size: 18px;
    color: var(--text-dark);
    letter-spacing: -0.4px;
}

.navbar-pill {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 10px 24px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    gap: 28px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    pointer-events: auto;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted-dark);
    font-weight: 500;
    font-size: 15px;
    transition: var(--transition);
}

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

/* Right-aligned dark mode toggle button */
.header-right, .header-actions {
    position: absolute;
    right: 40px;
    pointer-events: auto;
}

.dark-mode-btn {
    background-color: #000000;
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 10px 24px;
    border-radius: 9999px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0px;
    overflow: hidden;
    position: relative;
    transition: background-color 0.3s ease, border-color 0.3s ease, padding 0.3s cubic-bezier(0.16, 1, 0.3, 1), gap 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dark-mode-text {
    white-space: nowrap;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.dark-mode-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 0px;
    height: 24px;
    opacity: 0;
    transform: scale(0.6) translateX(10px);
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
}

.dark-mode-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    padding: 2.5px;
    border: 1.5px solid currentColor;
    border-radius: 50%;
}

.dark-mode-btn:hover {
    padding-right: 18px;
    gap: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.dark-mode-btn:hover .dark-mode-icon {
    width: 24px;
    opacity: 1;
    transform: scale(1) translateX(0);
}

/* ==========================================================================
   DARK MODE THEME OVERRIDES (when body.dark-mode is active)
   ========================================================================== */
html.dark-mode,
body.dark-mode {
    --bg-light: #000000;
    --text-dark: #f5f5f7;
    --text-muted-dark: #a0a0a5;
    --text-subtle: #707075;
    --card-bg-lists: #2a1530;
    --card-bg-ua: #122233;
    --card-bg-spcu: #132822;
    --card-bg-recipely: #251624;
    --card-bg-citizen: #111C30;

    /* Colors - Play Section & Footer (Dark Mode overrides) */
    --play-bg: #000000;
    --play-title: #FFFFFF;
    --play-card-bg: #0C0C0E;
    --play-card-border: rgba(255, 255, 255, 0.08);
    --play-card-text: #FFFFFF;

    --footer-bg: #050507;
    --footer-text: #FFFFFF;
    --footer-text-muted: #AAAAAA;
    --footer-border: rgba(255, 255, 255, 0.08);
    --footer-giant-text: #FFFFFF;
    --footer-asterisk: #888888;
}

body.dark-mode .navbar-pill {
    background: rgba(25, 25, 28, 0.85);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

body.dark-mode .logo-icon,
body.dark-mode .footer-asterisk-icon {
    filter: invert(1);
}

body.dark-mode .dark-mode-btn {
    background-color: #FFFFFF;
    color: #000000;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.15);
}

@media (max-width: 900px) {
    .header-nav {
        flex-wrap: wrap;
        gap: 16px;
        justify-content: space-between;
        padding: 16px 24px;
    }
    .navbar-pill-wrap {
        position: static;
        transform: none;
        order: 3;
        width: 100%;
        display: flex;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .header-logo span {
        font-size: 16px;
    }
    .logo-icon {
        width: 24px;
        height: 24px;
    }
    .dark-mode-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .navbar-pill {
        gap: 16px;
        padding: 8px 16px;
    }
    .nav-link {
        font-size: 13px;
    }
}

/* 5. GLOBAL FOOTER (Photo 2 Transformation) */
.footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 100px 0 100px 0;
    border-top: 1px solid var(--footer-border);
    position: relative;
    overflow: hidden;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.footer-top-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 50px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 60px;
}

.footer-brand-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.footer-asterisk-icon {
    width: 26px;
    height: 26px;
    color: var(--footer-asterisk);
    flex-shrink: 0;
    animation: spin-slow 20s linear infinite;
    transition: color 0.3s ease;
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.footer-brand-name {
    font-size: 26px;
    font-weight: 500;
    color: var(--footer-text);
    letter-spacing: -0.5px;
    transition: color 0.3s ease;
}

.footer-columns-wrap {
    display: flex;
    gap: 80px;
    flex-wrap: wrap;
}

.footer-col {
    display: flex;
    flex-direction: column;
}

.footer-col-header {
    font-size: 14px;
    color: var(--footer-text-muted);
    margin-bottom: 12px;
    font-weight: 400;
    transition: color 0.3s ease;
}

.footer-nav-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-nav-link,
.footer-contact-link {
    font-size: 16px;
    color: var(--footer-text);
    text-decoration: none;
    transition: var(--transition);
    width: fit-content;
}

.footer-nav-link:hover,
.footer-contact-link:hover {
    color: var(--star-green);
    transform: translateX(3px);
}

.footer-phone-text {
    font-size: 16px;
    color: var(--footer-text);
    transition: color 0.3s ease;
}

.footer-giant-banner {
    display: none;
}

.footer-giant-banner span {
    font-size: clamp(60px, 15.5vw, 260px);
    font-weight: 700;
    letter-spacing: -0.05em;
    color: var(--footer-giant-text);
    display: inline-block;
    white-space: nowrap;
    transition: color 0.3s ease;
}

@media (max-width: 768px) {
    .header-nav {
        flex-direction: column;
        gap: 16px;
        position: absolute;
        padding: 16px;
    }
    .header-logo, .header-right, .header-actions {
        position: static;
    }
    .navbar-pill {
        padding: 8px 16px;
        gap: 16px;
    }
    .footer-top-container {
        flex-direction: column;
        gap: 40px;
        padding: 0 24px;
    }
    .footer-columns-wrap {
        gap: 40px;
        width: 100%;
        justify-content: space-between;
    }
    .footer-giant-banner span {
        font-size: 17vw;
    }
}

/* ==========================================================================
   6. CUSTOM BLACK DOT CURSOR
   Ultra-modern floating dot cursor for laptop/desktop screens
   ========================================================================== */
@media (pointer: fine) {
    * {
        cursor: none !important;
    }
}

.custom-cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 18px;
    height: 18px;
    background-color: #000000;
    border: 2px solid rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    pointer-events: none;
    z-index: 999999;
    transform: translate(-50%, -50%);
    transition: width 0.2s cubic-bezier(0.16, 1, 0.3, 1), 
                height 0.2s cubic-bezier(0.16, 1, 0.3, 1), 
                background-color 0.2s ease, 
                border-color 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    opacity: 0;
}

/* Hovering over clickable links & cards */
.custom-cursor-dot.hovering {
    width: 34px;
    height: 34px;
    background-color: #FFFFFF;
    border: 2.5px solid #000000;
    box-shadow: none;
}

/* On dark backgrounds (Play section, dark cards, Footer) */
.custom-cursor-dot.on-dark {
    background-color: #FFFFFF;
    border-color: rgba(0, 0, 0, 0.95);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.3);
}

.custom-cursor-dot.on-dark.hovering {
    background-color: #000000;
    border: 2.5px solid #FFFFFF;
}

/* Cursor style when entire body is in Dark Mode */
body.dark-mode .custom-cursor-dot {
    background-color: #FFFFFF;
    border-color: rgba(0, 0, 0, 0.95);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.3);
}

body.dark-mode .custom-cursor-dot.hovering {
    background-color: #000000;
    border: 2.5px solid #FFFFFF;
}

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

/* ==========================================================================
   7. VIEW TRANSITIONS (Circular wipe effect from 800k.dev)
   ========================================================================== */
::view-transition-old(root) {
    animation: 300ms cubic-bezier(0.4, 0, 0.2, 1) both fade-out;
}
::view-transition-new(root) {
    animation: 400ms cubic-bezier(0.16, 1, 0.3, 1) both slide-up-fade;
}

/* Disable crossfade for dark mode toggle (circular wipe takes over via JS) */
html.theme-transition::view-transition-old(root),
html.theme-transition::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
}
html.theme-transition::view-transition-old(root) {
    z-index: 1;
}
html.theme-transition::view-transition-new(root) {
    z-index: 2;
}

@keyframes fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slide-up-fade {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   8. LENIS SMOOTH SCROLL COMPATIBILITY
   ========================================================================== */
html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

/* ==========================================================================
   9. CROSS-DOCUMENT VIEW TRANSITIONS (Page transitions)
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
  
  ::view-transition {
    background-color: var(--bg-light);
  }
  
  html.dark-mode::view-transition {
    background-color: #000000;
  }
}
