/* -------------------- GLOBAL DESIGN TOKENS -------------------- */
/* Main reusable brand colors for the whole page. */
:root {
    --primary: #ff751f;
    --navy: #001560;
}

/* -------------------- GLOBAL PAGE BEHAVIOR -------------------- */
/* 1. Hide Scrollbar while keeping functionality */
html, body {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}
html::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Webkit */
}

/* -------------------- PRELOADER RECTANGLE ANIMATION -------------------- */
/* Orange rectangle that expands from the preloader logo area. */
#preloader-rect {
    z-index: -1;
    position: absolute;
    top: 50%; /* Center vertically relative to the logo-center-target */
    left: 50%; /* Start at the center of the logo */
    height: 100%; /* Match the logo target height */
    transform: translateY(-50%) scaleX(0); /* Hide initially */
    transform-origin: left center;
    background-color: #ff751f;
    border-radius: 0 24px 24px 0;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

#logo-center-target {
    width: var(--preloader-logo-size, 160px) !important;
    height: var(--preloader-logo-size, 160px) !important;
}

#rect-text {
    margin-left: var(--preloader-text-offset, 100px) !important;
    font-size: var(--preloader-text-size, 4.5rem) !important;
    line-height: 1;
}

@media (max-width: 640px) {
    :root {
        --preloader-logo-size: min(30vw, 128px);
        --preloader-text-offset: clamp(52px, 16vw, 72px);
        --preloader-text-size: clamp(1.85rem, 9vw, 2.75rem);
    }

    #preloader {
        overflow: hidden;
    }

    #preloader-rect {
        border-radius: 0 18px 18px 0;
        max-width: calc(50vw - 8px);
        overflow: hidden;
    }
}

/* -------------------- HERO / INTRO TEXT SIZE ADJUSTMENTS -------------------- */
/* These rules resize the main animated intro title, description, image, and blue box. */
/* 2. Increase "Yummizi is" block size (3x) and reduce padding */
.title-block {
    transform: scale(2);
    padding: 0.2rem 1.2rem !important; /* Reduced padding */
    margin-bottom: 5rem; /* Added margin to compensate for scale */
}

/* 3. Descriptive words: Center align and responsive sizing */
.desc-text {
    /* Change this to adjust base desktop size */
    font-size: 2.5rem !important; 
    font-weight: 700;
    font-family: 'Glacial Indifference', sans-serif !important;
    text-align: center;
    width: 100%;
    margin: 0 auto;
    display: block;
    line-height: 1.2;
}

/* Mobile font size reduction */
@media (max-width: 768px) {
    .desc-text {
        /* Change this number to make mobile text smaller/larger */
        font-size: 1.5rem !important; 
        padding: 0 10%; /* Prevents text from hitting screen edges */
    }
    
    .title-block {
        transform: scale(1.4); /* Smaller scale for "Yummizi is" on phones */
        margin-bottom: 1rem !important; /* Pulls the hero content closer to "Yummizi is" on mobile */
    }

    .scene {
        justify-content: flex-start !important; /* Stops mobile hero content from sitting too low */
        padding-top: 1rem;
    }
}

/* 4. Decrease image size (Half) */
.scene-img {
    max-height: 20vh !important; /* Reduced from 30-35vh */
    margin: 20px 0;
}

/* 5. Control Blue Rectangle Transparency (More transparent) */
.blue-box {
    /* Changed from 0.7 to 0.4 opacity */
    background-color: rgba(0, 21, 96, 0.4) !important; 
    padding: 1.5rem 2.5rem !important; /* Reduced padding */
}

/* -------------------- GLOBAL TYPOGRAPHY -------------------- */
/* Headings */
h1, h2, h3 {
    font-family: 'League Spartan', sans-serif;
}

/* -------------------- TEXT REVEAL HELPERS -------------------- */
/* Smooth hidden mask for the text reveal */
.overflow-hidden span {
    display: inline-block;
}

/* -------------------- NAVIGATION HOVER UNDERLINE -------------------- */
/* Navigation Link Hover Effect */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #ff751f;
    transition: width 0.3s ease-in-out;
}

.nav-link:hover::after {
    width: 100%;
}

/* -------------------- PRELOADER LOGO POSITIONING -------------------- */
/* Ensure the logo container in the preloader is absolute for the transition */
#logo-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#y-logo {
    width: var(--preloader-logo-size, 160px) !important;
    height: var(--preloader-logo-size, 160px) !important;
    border-radius: 40px !important; /* Adjust this value to match your actual image rounding */
    overflow: hidden;
    object-fit: contain;
}

/* -------------------- HERO SECTION CONTAINER -------------------- */
/* Main hero container animation hints and spacing. */
#hero-section {
    transform-origin: center bottom;
    will-change: transform, width, height, border-radius;

    /* Optional: If you want the Hero to sit slightly UNDER the transparent header 
   so the blurred background is visible through the navbar glass: */
    margin-top: 0;
}

/* -------------------- HERO CORNER IMAGE -------------------- */
.hero-corner-image {
    /* Anchored to bottom left */
    bottom: 2rem; 
    left: 2rem;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .hero-corner-image {
        top: 39rem !important; /* Mobile: place the icon closer to the current scene instead of anchoring it near the hero bottom */
        bottom: auto !important;
        left: 1.5rem !important;
        width: 50px; /* Slightly larger for visibility on mobile */
        height: 50px;
    }
}

/* -------------------- NAVBAR LAYOUT AND CENTERING -------------------- */
/* Centered Navbar Adjustment */
#navbar {
    display: flex;
    justify-content: space-between; /* Keeps logo left and button right */
}

/* Ensure the nav links are truly centered regardless of other elements */
#navbar .absolute.left-1\/2 {
    /* This ensures that even if the Logo is wider than the Button, 
       the links stay at exactly 50% of the screen width */
    transform: translateX(-50%);
    pointer-events: auto;
}

/* This container will stay perfectly in the middle of the screen */
.nav-links-container {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}

/* -------------------- BACKGROUND REEL / HERO SLIDES -------------------- */
/* Full-cover background slides used behind the main hero experience. */
.reel-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transform: scale(1.1); /* Slightly larger so blur doesn't show white edges */
    will-change: filter, opacity;
}

/* -------------------- MAIN SCROLL NARRATIVE AREA -------------------- */
/* Ensure the main content has enough height for the 4000px scroll narrative */
#main-content {
    width: 100%;
    min-height: 500vh; /* Critical: Gives room for the "Pinned" animation */
    display: block;
    position: relative;
}

/* -------------------- SCENE VISIBILITY AND TEXT CURTAIN HELPERS -------------------- */
/* Fix for scene visibility */
.scene {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
}

/* Ensure the curtain doesn't cut off letters like 'g' or 'y' */
.curtain {
    overflow: hidden;
    padding: 0.5em 0; 
    display: block;
}

#rect-text {
    font-family: 'Glacial Indifference', sans-serif;
    font-weight: 700; /* Bold as requested */
    letter-spacing: -2px;
}

/* -------------------- COMPARISON / FEATURE CARDS -------------------- */
/* Card sizing, focus shadow, centered copy, and hover image zoom. */
.comp-card {
    transition: box-shadow 0.5s ease;
    will-change: transform, box-shadow;
    /* Remove or decrease min-height for mobile to avoid empty space */
    min-height: 520px; 
    display: flex;
    flex-direction: column;
}

/* Mobile specific fixes */
@media (max-width: 768px) {
    #comparison-section {
        padding-top: 2rem !important;
    }

    #comparison-section > .max-w-7xl {
        padding-top: 2rem !important;
    }

    #comparison-section h2 {
        margin-bottom: 3rem !important;
    }

    .comparison-row {
        margin-top: -1.5rem;
    }

    .comp-card {
        min-height: auto; /* Allows card to shrink to fit content on phone */
        padding: 1.5rem !important; /* Slightly smaller padding for small screens */
    }

    .img-placeholder {
        /* This ensures the horizontal image is fully visible without cropping */
        height: auto !important; 
        aspect-ratio: 16 / 9; 
    }

    .img-placeholder img {
        /* 'contain' ensures the whole image fits, 'cover' ensures no white space.
           Since your images are horizontal, 'cover' with aspect-video is usually best. */
        object-fit: cover; 
    }
}

/* Centers the description text specifically */
.comp-card p {
    text-align: center;
    width: 100%;
    margin-top: auto; /* Pushes text to bottom if card height varies */
}

.after-card p {
    font-weight: 500;
}

/* Custom shadow for focused cards */
.card-focus {
    box-shadow: 0 25px 50px -12px rgba(255, 117, 31, 0.25);
}

.img-placeholder img {
    transition: transform 0.8s ease;
}

.comp-card:hover .img-placeholder img {
    transform: scale(1.05);
}

/* -------------------- BENEFITS SECTION FLIP CARDS -------------------- */
/* --- BENEFITS SECTION: FLIP & DYNAMIC SHADOW (FIXED REVERSION) --- */

/* 1. Core Card Structure */
.flip-card {
    perspective: 1000px;
    position: relative;
    padding-bottom: 40px;
}

.flip-card-inner {
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), margin-top 0.4s ease-out;
    transform-style: preserve-3d;
    will-change: transform;
}

/* 2. Card Faces */
.flip-card-front, .flip-card-back {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* 3. Intermittent Rotation & Jump */
.flip-card:not(.flip-start-back):hover .flip-card-inner {
    transform: rotateY(180deg);
    margin-top: -15px;
}

.flip-start-back .flip-card-inner {
    transform: rotateY(180deg);
}
.flip-start-back:hover .flip-card-inner {
    transform: rotateY(0deg);
    margin-top: -15px;
}

@media (hover: none), (pointer: coarse) {
    .flip-card:not(.flip-start-back):hover .flip-card-inner {
        transform: none;
        margin-top: 0;
    }

    .flip-start-back:hover .flip-card-inner {
        transform: rotateY(180deg);
        margin-top: 0;
    }

    .flip-card:not(.flip-start-back).is-flipped .flip-card-inner {
        transform: rotateY(180deg);
        margin-top: -15px;
    }

    .flip-start-back.is-flipped .flip-card-inner {
        transform: rotateY(0deg);
        margin-top: -15px;
    }
}

/* 4. The Floor Shadow Base & "Mouse Leave" Animation */
.floor-shadow {
    position: absolute;
    bottom: 10px;
    left: 10%;
    right: 10%;
    height: 15px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 50%;
    filter: blur(12px);
    z-index: -1;
    /* Trigger this when mouse LEAVES the card */
    animation: shadowPulseOut 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* 5. "Mouse Enter" Animation */
.flip-card:hover .floor-shadow {
    animation: shadowPulseIn 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* 6. The Two Keyframes (In and Out) */
@keyframes shadowPulseIn {
    0% { transform: scaleX(1); opacity: 1; filter: blur(12px); }
    50% { transform: scaleX(0.2) scaleY(0.4); opacity: 0.4; filter: blur(20px); }
    100% { transform: scaleX(1); opacity: 1; filter: blur(12px); }
}

@keyframes shadowPulseOut {
    0% { transform: scaleX(1); opacity: 1; filter: blur(12px); }
    50% { transform: scaleX(0.2) scaleY(0.4); opacity: 0.4; filter: blur(20px); }
    100% { transform: scaleX(1); opacity: 1; filter: blur(12px); }
}

/* 7. Color Logic */
.flip-card:not(.flip-start-back):hover .floor-shadow,
.flip-start-back:hover .floor-shadow {
    background: rgba(0, 0, 0, 0.7);
}

@media (hover: none), (pointer: coarse) {
    .flip-card:hover .floor-shadow {
        animation: shadowPulseOut 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }

    .flip-card.is-flipped .floor-shadow {
        animation: shadowPulseIn 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
        background: rgba(0, 0, 0, 0.7);
    }
}

/* 8. Typography */
#benefits-section h3 {
    line-height: 1.1;
    font-weight: 800;
}
#benefits-section p {
    font-family: 'Comfortaa', sans-serif;
}

/* -------------------- WAITLIST FORM MODAL -------------------- */
/* --- Vertical Padding for Inputs --- */
#waitlist-form input, 
#waitlist-form select, 
#waitlist-form textarea {
    /* Change 0.8rem to adjust the height of the input boxes */
    padding-top: 0.8rem !important; 
    padding-bottom: 0.8rem !important;
    font-family: 'Glacial Indifference', sans-serif;
    border: 1px solid transparent;
}

/* --- Responsive Layout: Image below form on mobile --- */
@media (max-width: 1024px) {
    #form-modal {
        flex-direction: column; /* Stacks the children vertically */
        transform: skewX(0deg) !important; /* Removes skew for better mobile alignment */
    }

    #form-modal > div {
        transform: skewX(0deg) !important; /* Resets internal content skew */
    }

    /* Form container takes full width */
    .w-full.lg\:w-3\/5 {
        order: 1; /* Ensures form stays on top */
    }

    /* Image container moves below and gets a defined height */
    .hidden.lg\:block.w-2\/5.bg-\[#001560\] {
        display: block !important; /* Show on mobile */
        width: 100% !important;
        height: 250px; /* Adjust this value to change image height on mobile */
        order: 2; /* Moves image below form */
    }

    #form-visual {
        width: 100%;
        height: 100%;
    }

    /* Reset staggered margins for mobile screens */
    .form-group {
        margin-left: 0 !important;
    }
}

/* FORM MODAL STYLES */

#form-modal p {
    margin-bottom: 2.5rem; /* Creates separation between 'Secure your spot' and inputs */
}

#waitlist-form input, 
#waitlist-form select, 
#waitlist-form textarea {
    font-family: 'Glacial Indifference', sans-serif;
    border: 1px solid transparent;
}

#waitlist-form input::placeholder {
    font-family: 'Glacial Indifference', sans-serif;
    color: #94a3b8;
}

/* -------------------- FORM MODAL VISUAL IMAGE PANEL -------------------- */
/* Background image switch transition */

#form-visual {
    position: absolute;
    height: 100%;
    width: 140%; 
    right: 0;
    left: auto;
    object-fit: cover;
    opacity: 1;
}

/* Ensure the image panel scales correctly with the flexible modal height */
.lg\:block.w-2\/5.bg-\[#001560\] {
    position: relative;
    overflow: hidden;
    min-height: 100%; /* Ensures the blue side stays full height */
}

.hidden.lg\:block.w-2\/5.bg-\[#001560\] {
    position: relative;
    overflow: hidden;
    background-color: #001560;
}

/* -------------------- BODY LOCK WHILE MODAL IS OPEN -------------------- */
/* Preventing scroll when modal is open */
.no-scroll {
    overflow: hidden !important;
}

/* -------------------- CUSTOM USER TYPE SELECT DROPDOWN -------------------- */
/* --- Improved Select Styling --- */
#user-type {
    appearance: none; /* Removes default browser arrow */
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23ff751f'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1.2rem center;
    background-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

#user-type option {
    color: #001560;
    background-color: white;
    padding: 10px;
}

#user-type:hover {
    background-color: #f4f4f5; /* zinc-100 */
    border-color: #ff751f;
}

#user-type:focus {
    background-color: white;
    box-shadow: 0 0 0 4px rgba(255, 117, 31, 0.1);
}

/* -------------------- POSSIBLE CROSSED / DUPLICATED SECTION -------------------- */
/* This repeats #user-type option styling from above. I left it here unchanged so you can decide whether to move or merge it later. */
/* Ensure the text inside the dropdown is clean */
#user-type option {
    color: #001560;
    padding: 10px;
    background: white;
}

/* -------------------- POLICY CHECKBOX AND ERROR STATE -------------------- */
/* --- Policy Checkbox Styling --- */
#policy-check {
    border: 2px solid #001560;
    border-radius: 4px;
}

#policy-check:checked {
    background-color: #ff751f;
}

/* Ensure the warning message doesn't take up space when hidden */
#policy-error {
    pointer-events: none;
}

/* -------------------- PRIVACY POLICY PANEL -------------------- */
.privacy-policy-panel {
    position: absolute;
    inset: 1.5rem;
    z-index: 80;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 28px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
    opacity: 0;
    pointer-events: none;
    transform: skewX(-5deg) translateY(18px) scale(0.98);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.privacy-policy-panel.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: skewX(-5deg) translateY(0) scale(1);
}

.privacy-policy-back {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    padding: 0.7rem 1rem;
    color: #001560;
    background: #f4f4f5;
    border: 1px solid #e4e4e7;
    border-radius: 10px;
    font-family: 'League Spartan', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.privacy-policy-back:hover,
.privacy-policy-back:focus-visible {
    color: #ffffff;
    background: #ff751f;
    outline: none;
}

.privacy-policy-content {
    padding: 4.5rem clamp(1.5rem, 4vw, 3.5rem) 2.5rem;
    overflow-y: auto;
    color: #3f3f46;
    font-family: 'Glacial Indifference', sans-serif;
}

.privacy-policy-content h2 {
    margin-bottom: 1rem;
    color: #ff751f;
    font-size: clamp(2.2rem, 5vw, 4rem);
    line-height: 0.95;
}

.privacy-policy-content h3 {
    margin: 1.8rem 0 0.6rem;
    color: #001560;
    font-size: 1.35rem;
}

#form-modal .privacy-policy-content p {
    max-width: 68ch;
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.7;
}

@media (max-width: 1024px) {
    .privacy-policy-panel {
        transform: translateY(18px) scale(0.98);
    }

    .privacy-policy-panel.is-visible {
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 640px) {
    .privacy-policy-panel {
        inset: 0.75rem;
        border-radius: 22px;
    }

    .privacy-policy-back {
        top: 0.75rem;
        right: 0.75rem;
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }
}
