/* ==========================================================================
   JOUR.DAY LANDING PAGE DESIGN SYSTEM (STRICT NO-PX POLICY)
   ========================================================================== */

/* Font Definitions */
@font-face {
    font-family: 'PicNic';
    src: url('assets/fonts/PicNic.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'BDOGrotesk';
    src: url('assets/fonts/BDOGrotesk-VF.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* Custom Properties (Variables) */
:root {
    /* Brand Colors */
    --color-green-flash: #9FFFC4;
    --color-nutrition: #FFFF00;
    --color-activity: #CCEBFF;
    --color-sleep: #070B34;
    --color-base: #FFFFFF;
    --color-base-soft: #F7F1EA;
    --color-base-dark: #5C5B4B;

    /* Theme-specific custom variables */
    --font-family-display: 'PicNic', system-ui, sans-serif;
    --font-family-body: 'BDOGrotesk', system-ui, sans-serif;

    /* Transitions */
    --transition-speed-smooth: 0.8s;
}

/* Base resets & structural styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden; /* Prevent page scrolling entirely */
}

body {
    background-color: var(--color-base);
    /* Custom ambient gradient centered below the viewport */
    background-image: radial-gradient(circle at 50% 200%, var(--color-nutrition) 45%, var(--color-base) 80%, var(--color-base-soft) 90%);
    background-attachment: fixed;
    font-family: var(--font-family-body);
    font-size: 0.75rem; /* Standard text size */
    color: var(--color-base-dark);
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Contain all elements */
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header styling */
#site-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* Align contents to top */
    padding: 1rem; /* Uniform vertical and horizontal padding */
    gap: 2rem; /* Column gap space between header elements */
    z-index: 10;
}

.header-text {
    font-size: 0.75rem; /* Matches footer */
    font-weight: 350; /* Light styling, no bold */
    letter-spacing: -0.01em;
    color: var(--color-base-dark);
    opacity: 0.7;
    text-transform: lowercase;
}

#brand-title {
    text-align: left;
    max-width: 50%;
}

/* Vision paragraph area inside header */
#vision-section {
    width: 20rem; /* Fixed width */
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
}

#vision-card {
    background: none;
    border: none;
    padding: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0;
    width: 100%;
}

#vision-paragraph {
    font-family: var(--font-family-body);
    font-size: inherit; /* Inherits body size */
    font-weight: 350;
    line-height: 1.6;
    letter-spacing: -0.005em;
    color: var(--color-base-dark);
    text-align: left; /* Left-aligned text */
}

#vision-paragraph .highlight {
    font-weight: 600;
    color: var(--color-sleep);
}

/* Main Content styling */
#main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem 5vw;
    z-index: 5;
}

/* Animated Words & Logo Hero Area */
#hero-words-section {
    height: 50vh; /* Taller hero section to accommodate larger logo */
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

#animation-viewport {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: visible;
    height: 100%;
    width: 100%;
    position: relative;
}

/* Hero Logo (inline SVG styled dynamically) */
#brand-logo {
    width: 80vw; /* Responsive large width */
    height: auto;
    max-width: 90%; /* Max container constraint */
    color: var(--color-green-flash);
    opacity: 1;
    visibility: visible;
    transition: opacity var(--transition-speed-smooth) ease, visibility var(--transition-speed-smooth) ease;
    position: absolute;
    display: block;
}

/* Animated word display styling */
#animated-word {
    font-family: var(--font-family-display);
    font-size: 20vw; /* Massive display typography */
    max-width: 90vw; /* Ensures text wraps rather than extending past screen */
    color: var(--color-base-soft);
    text-align: center;
    user-select: none;
    letter-spacing: -0.01em;
    display: inline-block;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-speed-smooth) ease, visibility var(--transition-speed-smooth) ease;
    position: absolute;
}

/* State classes toggled by JS */
#hero-words-section.state-logo #brand-logo {
    opacity: 1;
    visibility: visible;
}

#hero-words-section.state-logo #animated-word {
    opacity: 0;
    visibility: hidden;
}

#hero-words-section.state-words #brand-logo {
    opacity: 0;
    visibility: hidden;
}

#hero-words-section.state-words #animated-word {
    opacity: 1;
    visibility: visible;
}

/* Hover behaviors: Logo replaces animated word on hover */
#hero-words-section.state-words:hover #brand-logo {
    opacity: 1;
    visibility: visible;
}

#hero-words-section.state-words:hover #animated-word {
    opacity: 0;
    visibility: hidden;
}

/* Animation classes triggered during word change transitions */
#animated-word.word-exit {
    animation: slideOutUp var(--transition-speed-smooth) cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

#animated-word.word-enter {
    animation: slideInUp var(--transition-speed-smooth) cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

/* Keyframe Animations */
@keyframes slideInUp {
    0% {
        opacity: 0;
        transform: translateY(2rem) scale(0.95);
        filter: blur(0.5rem);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes slideOutUp {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-2rem) scale(1.05);
        filter: blur(0.5rem);
    }
}

/* Footer Section styling */
#site-footer {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem; /* Uniform vertical and horizontal padding */
    margin-top: auto;
    z-index: 10;
}

.footer-text {
    font-size: 0.75rem; /* Matches header */
    font-weight: 350;
    letter-spacing: -0.01em;
    color: var(--color-base-dark);
    opacity: 0.7;
}

#footer-launch {
    text-align: left;
    text-transform: lowercase;
}

#footer-copyright {
    text-align: right;
}

/* Responsive adjustments */
@media (max-width: 48rem) {
    #site-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    #brand-title {
        max-width: 100%;
    }
    
    #vision-section {
        width: 100%;
        max-width: 100%;
    }
    
    #hero-words-section {
        height: 40vh;
    }
    
    #site-footer {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    #footer-launch, #footer-copyright {
        text-align: center;
    }
}
