/* Note: Fonts are loaded efficiently in the HTML <head> */

:root {
    --studio-navy: #0F172A;
    --frictionless-white: #F8FAFC;
    --commuter-yellow: #FFD166;
    --color-games: #FF6B6B;
    --color-travel: #45AAF2;
    --color-health: #06D6A0;
    --color-finance: #9F7AEA;
    --color-food: #FFA94D;
    --font-headline: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition-wipe: 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-body);
    background-color: var(--studio-navy);
    color: var(--frictionless-white);
    transition: background-color var(--transition-wipe);
    overflow: hidden; 
    height: 100vh;
    display: flex; 
}

/* Dynamic Background Colors based on Mode */
body[data-mode="default"] { background-color: var(--studio-navy); }
body[data-mode="travel"] { background-color: var(--color-travel); }
body[data-mode="health"] { background-color: var(--color-health); }
body[data-mode="finance"] { background-color: var(--color-finance); }
body[data-mode="food"] { background-color: var(--color-food); }
body[data-mode="games"] { background-color: var(--color-games); }

/* ============================================
   LAYOUT: SIDEBAR & MAIN STAGE
   ============================================ */
.sidebar {
    width: 320px;
    height: 100vh;
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-shrink: 0;
    z-index: 100;
    position: sticky;
    top: 0;
    align-self: flex-start; 
}

#spa-stage {
    flex-grow: 1;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-right: 5vw;
}

.content-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1100px;
    gap: 40px;
}

.text-area {
    flex: 1;
    max-width: 450px;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.6s ease-out;
}

/* ============================================
   VISUAL STAGE (The Square App Icon)
   ============================================ */
.visual-area {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.tilt-app-icon {
    width: 100%;
    max-width: 320px;
    aspect-ratio: 1 / 1;
    border-radius: 22.5%; 
    transform: rotate(-10deg) translateX(50px);
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 30px 60px rgba(0,0,0,0.25));
    object-fit: cover;
}

/* Active State Animations */
.active .text-area { transform: translateY(0); opacity: 1; }
.active .tilt-app-icon { transform: rotate(-8deg) translateX(0); opacity: 1; }

/* ============================================
   TYPOGRAPHY & BRANDING
   ============================================ */
.brand-name {
    font-family: var(--font-headline);
    font-size: 1.5rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.3em; 
    color: var(--frictionless-white);
    text-decoration: none;
    display: block;
    transition: all 0.3s ease;
}

.brand-name:hover {
    letter-spacing: 0.4em;
    opacity: 0.8;
}

.brand-sub {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.6;
    margin-top: 4px;
    display: block;
    font-weight: 600;
    color: var(--frictionless-white);
}

h1 { font-family: var(--font-headline); font-size: 4.5rem; line-height: 0.9; margin-bottom: 20px; }
p { font-size: 1.25rem; margin-bottom: 30px; }

/* ============================================
   NAVIGATION MENUS
   ============================================ */
.situation-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nav-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.6;
    margin-bottom: 8px;
    display: block;
}

.nav-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 12px 24px;
    border-radius: 100px;
    font-family: var(--font-headline);
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    backdrop-filter: blur(10px);
}

.nav-btn:hover, .nav-btn.active {
    background: white;
    color: var(--studio-navy);
    transform: translateX(10px);
}

.secondary-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.secondary-nav a {
    color: var(--frictionless-white);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.secondary-nav a:hover {
    opacity: 1;
}

/* Social Links Layout */
.social-nav {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    align-items: center;
}

.social-nav a {
    display: block;
    width: 22px;
    height: 22px;
    opacity: 0.5;
    transition: opacity 0.3s, transform 0.3s;
    color: var(--frictionless-white);
    padding: 0;
}

.social-nav a:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.social-nav svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

/* ============================================
   CALL TO ACTION BUTTONS
   ============================================ */
#cta-area {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-main {
    display: inline-block;
    padding: 18px 36px;
    background: white;
    color: var(--studio-navy);
    text-decoration: none;
    border-radius: 100px;
    font-weight: 700;
    transition: transform 0.3s;
}
.btn-main:hover { transform: scale(1.05); }

.btn-secondary {
    display: inline-block;
    padding: 16px 32px;
    background: transparent;
    color: var(--frictionless-white);
    border: 2px solid var(--frictionless-white);
    text-decoration: none;
    border-radius: 100px;
    font-weight: 700;
    transition: all 0.3s;
}
.btn-secondary:hover {
    background: var(--frictionless-white);
    color: var(--studio-navy);
    transform: scale(1.05);
}

/* ============================================
   MOBILE RESPONSIVENESS
   ============================================ */
@media (max-width: 900px) {
    body { 
        display: flex; 
        flex-direction: column; 
        height: auto; 
        min-height: 100vh; 
        overflow-y: auto; 
        overflow-x: hidden;
    }
    
    .sidebar { display: contents; position: static; } 
    
    .brand-anchor {
        order: 1;
        padding: 40px 20px 20px;
        text-align: center;
    }
    
    .situation-nav {
        order: 3; /* Nav drops below the stage */
        padding: 0 20px 20px;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .nav-label { width: 100%; text-align: center; }
    
    #spa-stage {
        order: 2; /* Stage shifts above nav */
        height: auto;
        padding: 20px;
    }
    
    .content-wrapper {
        flex-direction: column;
        text-align: center;
        gap: 15px; /* Tightened from 20px */
    }

    .text-area { order: 2; margin-top: 10px; max-width: 100%; }
    .visual-area { justify-content: center; order: 1; width: 100%; }
    h1 { font-size: 2.5rem; margin-bottom: 15px; } /* Slightly scaled down */
    #cta-area { justify-content: center; }
    
    .tilt-app-icon {
        transform: rotate(0) !important; 
        max-width: 140px; /* Reduced from 220px */
        margin: 0 auto;
    }
    .active .tilt-app-icon { transform: rotate(0) translateX(0) !important; }
    
    .secondary-nav {
        order: 4;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
        padding: 40px 20px;
    }
}

/* ============================================
   EXPERIMENTAL POLISH: GRAIN & CURSOR
   ============================================ */
body::after {
    content: ""; position: fixed; top: -100%; left: -100%; width: 300%; height: 300%;
    background-image: url("https://grainy-gradients.vercel.app/noise.svg");
    opacity: 0.04; pointer-events: none; z-index: 9999; animation: noise 8s steps(10) infinite;
}

@keyframes noise {
    0%, 100% { transform: translate(0,0); }
    10% { transform: translate(-5%,-10%); }
    30% { transform: translate(-10%,5%); }
    50% { transform: translate(5%,10%); }
    70% { transform: translate(10%,-5%); }
    90% { transform: translate(-5%,5%); }
}

.custom-cursor {
    width: 20px; height: 20px; background: var(--studio-navy); border: 2px solid white;
    border-radius: 50%; position: fixed; pointer-events: none; z-index: 10000;
    mix-blend-mode: difference; transition: transform 0.15s ease-out; transform: translate(-50%, -50%);
}

.cursor-hover { transform: translate(-50%, -50%) scale(3); background: transparent; border: 1px solid white; }
body, button, a { cursor: none; }

@media (hover: none) and (pointer: coarse) {
    .custom-cursor { display: none !important; }
    body, button, a { cursor: auto !important; }
}

/* ============================================
   DYNAMIC CONTRAST FIX (For Bright Modes)
   ============================================ */
body[data-mode="health"] .text-area h1, body[data-mode="health"] .text-area p,
body[data-mode="finance"] .text-area h1, body[data-mode="finance"] .text-area p,
body[data-mode="health"] .secondary-nav a, body[data-mode="finance"] .secondary-nav a,
body[data-mode="health"] .brand-name, body[data-mode="finance"] .brand-name,
body[data-mode="health"] .brand-sub, body[data-mode="finance"] .brand-sub,
body[data-mode="health"] .social-nav a, body[data-mode="finance"] .social-nav a {
    color: var(--studio-navy);
}

body[data-mode="health"] .btn-main, body[data-mode="finance"] .btn-main {
    background: var(--studio-navy); color: var(--frictionless-white);
}

body[data-mode="health"] .nav-btn, body[data-mode="finance"] .nav-btn {
    border-color: rgba(15, 23, 42, 0.2); color: var(--studio-navy); background: rgba(15, 23, 42, 0.05);
}

body[data-mode="health"] .nav-btn.active, body[data-mode="finance"] .nav-btn.active,
body[data-mode="health"] .nav-btn:hover, body[data-mode="finance"] .nav-btn:hover {
    background: var(--studio-navy); color: var(--frictionless-white);
}

body[data-mode="health"] .btn-secondary, body[data-mode="finance"] .btn-secondary {
    color: var(--studio-navy); border-color: var(--studio-navy);
}

body[data-mode="health"] .btn-secondary:hover, body[data-mode="finance"] .btn-secondary:hover {
    background: var(--studio-navy); color: var(--frictionless-white);
}

body[data-mode="health"] .nav-label, body[data-mode="finance"] .nav-label {
    color: var(--studio-navy); font-weight: 700;
}

button:focus-visible, a:focus-visible {
    outline: 2px solid var(--frictionless-white);
    outline-offset: 4px;
}

body[data-mode="health"] button:focus-visible, 
body[data-mode="health"] a:focus-visible,
body[data-mode="finance"] button:focus-visible, 
body[data-mode="finance"] a:focus-visible {
    outline-color: var(--studio-navy);
}

/* ============================================
   OUR STORY PAGE (ABOUT MODE)
   ============================================ */
body[data-mode="about"] {
    background-color: var(--frictionless-white);
    color: var(--studio-navy);
    height: auto;           
    min-height: 100vh;      
    overflow-y: visible;    
}

body[data-mode="about"] #spa-stage {
    height: auto;
    min-height: 100vh;
    align-items: flex-start;
    padding-top: 100px;
    padding-bottom: 100px;
}

.story-wrapper {
    max-width: 680px;
    width: 100%;          
    min-width: 0;         
    margin-left: 5vw;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.8s ease-out forwards;
}

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

.story-wrapper h1 { font-size: clamp(3rem, 5vw, 4.5rem); margin-bottom: 30px; color: var(--studio-navy); letter-spacing: -0.02em; }
.story-wrapper h2 { font-family: var(--font-headline); font-size: 2rem; margin-top: 60px; margin-bottom: 20px; color: var(--studio-navy); letter-spacing: -0.01em; }
.story-wrapper p { font-size: 1.25rem; line-height: 1.8; margin-bottom: 24px; color: rgba(15, 23, 42, 0.8); }
.story-wrapper .lead { font-size: 1.5rem; font-weight: 500; color: var(--studio-navy); line-height: 1.6; }

.story-wrapper ul { margin-bottom: 24px; padding-left: 20px; font-size: 1.25rem; color: rgba(15, 23, 42, 0.8); line-height: 1.8; }
.story-wrapper li { margin-bottom: 12px; }
.story-wrapper li strong { color: var(--studio-navy); }

.founder-signoff {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 2px solid rgba(15, 23, 42, 0.1);
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: 1.25rem;
}

body[data-mode="about"] .brand-name,
body[data-mode="about"] .brand-sub,
body[data-mode="about"] .secondary-nav a,
body[data-mode="about"] .social-nav a {
    color: var(--studio-navy);
}
body[data-mode="about"] .nav-label {
    color: var(--studio-navy); font-weight: 700;
}
body[data-mode="about"] .nav-btn {
    border-color: rgba(15, 23, 42, 0.2); color: var(--studio-navy); background: rgba(15, 23, 42, 0.05);
}
body[data-mode="about"] .nav-btn:hover {
    background: var(--studio-navy); color: var(--frictionless-white);
}
body[data-mode="about"] .cursor-hover {
    border-color: var(--studio-navy);
}

@media (max-width: 900px) {
    body[data-mode="about"] #spa-stage { order: 2; padding-bottom: 0; }
    body[data-mode="about"] .story-wrapper { margin-left: 0; padding: 0 20px; }
    body[data-mode="about"] .situation-nav {
        order: 3;
        margin-top: 40px;
        padding-top: 40px;
        border-top: 2px solid rgba(15, 23, 42, 0.05);
    }
}

body[data-mode="about"] .nav-btn.active {
    background: var(--studio-navy); color: var(--frictionless-white); transform: translateX(10px); border-color: var(--studio-navy);
}

/* ============================================
   APP SCREENSHOT CAROUSEL (Scroll-Snap)
   ============================================ */
.app-gallery {
    display: flex; gap: 20px; overflow-x: auto; padding-bottom: 20px; margin: 40px 0; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
}
.app-gallery::-webkit-scrollbar { height: 8px; }
.app-gallery::-webkit-scrollbar-track { background: rgba(15, 23, 42, 0.05); border-radius: 10px; }
.app-gallery::-webkit-scrollbar-thumb { background: rgba(15, 23, 42, 0.2); border-radius: 10px; }
.app-gallery::-webkit-scrollbar-thumb:hover { background: var(--studio-navy); }

.gallery-img {
    flex-shrink: 0; height: 500px; border-radius: 24px; object-fit: cover; scroll-snap-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.1); border: 1px solid rgba(15,23,42,0.1);
}

@media (max-width: 900px) {
    .gallery-img { height: 400px; scroll-snap-align: start; }
    .app-gallery { margin-left: -20px; margin-right: -20px; padding-left: 20px; padding-right: 20px; }
}

/* ============================================
   OUR APPS DIRECTORY GRID
   ============================================ */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 40px;
    margin-bottom: 60px;
}

.app-card {
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid rgba(15, 23, 42, 0.05);
    border-radius: 24px;
    padding: 30px;
    text-decoration: none;
    color: var(--studio-navy);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.app-card:hover {
    transform: translateY(-8px);
    background: white;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
    border-color: rgba(15, 23, 42, 0.1);
}

.app-card img {
    width: 72px;
    height: 72px;
    border-radius: 22.5%; 
    margin-bottom: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.app-card:hover img {
    transform: scale(1.05) rotate(-5deg);
}

.app-card h3 {
    font-family: var(--font-headline);
    font-size: 1.5rem;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.app-card p {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 0;
    opacity: 0.7;
}

.app-badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 100px;
    margin-bottom: 15px;
}
.badge-travel { background: rgba(69, 170, 242, 0.15); color: var(--color-travel); }
.badge-health { background: rgba(6, 214, 160, 0.2); color: #049c74; }
.badge-finance { background: rgba(159, 122, 234, 0.15); color: var(--color-finance); }
.badge-food { background: rgba(255, 169, 77, 0.15); color: #d67e2c; }
.badge-games { background: rgba(255, 107, 107, 0.15); color: var(--color-games); }