:root {
    --clr-cream: #FDFBF7;
    --clr-white: #FFFFFF;
    --clr-forest: #2A5C41;
    --clr-sage: #A3B899;
    --clr-ink: #1F2924;
    --clr-forest-light: #3a7554;
    
    --font-main: 'Outfit', sans-serif;
    --transition-smooth: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    font-family: var(--font-main);
    background-color: var(--clr-cream);
    color: var(--clr-ink);
    overflow-x: hidden;
    scroll-behavior: smooth;
    opacity: 0; /* For page transition */
    animation: fadeInPage 0.8s forwards;
}

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

a {
    text-decoration: none;
    color: inherit;
}

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

/* =========================================
   TYPOGRAPHY
   ========================================= */
h1, h2, h3, h4 {
    font-weight: 700;
    color: var(--clr-forest);
    line-height: 1.1;
}

.text-sage { color: var(--clr-sage); }
.text-cream { color: var(--clr-cream); }

/* =========================================
   NAVIGATION
   ========================================= */
.navbar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    padding: 16px 32px;
    z-index: 1000;
    transition: var(--transition-smooth);
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 100px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border: 1px solid rgba(255,255,255,0.4);
}

.navbar.scrolled {
    background: rgba(253, 251, 247, 0.85);
    padding: 12px 32px;
    box-shadow: 0 15px 40px rgba(42, 92, 65, 0.08);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--clr-forest);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    font-weight: 500;
    position: relative;
    padding-bottom: 4px;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--clr-forest);
    transition: var(--transition-smooth);
}

.nav-links a:hover::after, .nav-links a.active::after {
    width: 100%;
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 100px;
    font-weight: 600;
    transition: var(--transition-smooth);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--clr-forest);
    color: var(--clr-cream);
}

.btn-primary:hover {
    background: var(--clr-forest-light);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(42, 92, 65, 0.2);
}

/* =========================================
   LANGUAGE SWITCHER
   ========================================= */
.lang-switcher {
    display: flex;
    gap: 8px;
    align-items: center;
    background: rgba(253, 251, 247, 0.5);
    padding: 6px 12px;
    border-radius: 100px;
    border: 1px solid rgba(42, 92, 65, 0.1);
}

.lang-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--clr-sage);
    transition: var(--transition-smooth);
    text-transform: uppercase;
}

.lang-btn:hover {
    color: var(--clr-forest-light);
}

.lang-btn.active {
    color: var(--clr-forest);
}

/* =========================================
   ANIMATIONS & SECTIONS
   ========================================= */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.section-padding {
    padding: 120px 0;
}

/* =========================================
   SCENE 1: HERO
/* =========================================
   SCROLLYTELLING (SCENES)
   ========================================= */
.scroll-scene {
    position: relative;
    width: 100%;
    height: 200vh; /* Normal scroll duration */
}

.scene__sticky {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================
   SCENE 1: HERO
   ========================================= */
.hero-scene {
    background: #000;
}

.bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    opacity: 0.7;
    transform: scale(1.05); /* To allow slight parallax scaling */
    transition: transform 0.1s linear, opacity 0.1s linear;
}

.hero-overlay-dark {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, rgba(31,41,36,1) 100%);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.1s linear;
}

.story-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 100%;
    max-width: 800px;
    padding: 0 24px;
    color: var(--clr-white);
    transition: opacity 0.1s linear, transform 0.1s linear;
}

.story-1 {
    opacity: 1;
}

.story-2 {
    opacity: 0;
    transform: translate(-50%, 50px);
}

.hero-badge {
    display: inline-block;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border-radius: 100px;
    color: var(--clr-cream);
    font-weight: 600;
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.story-1 h1 {
    font-size: 5rem;
    color: var(--clr-white);
    margin-bottom: 24px;
    letter-spacing: -0.03em;
}

.story-1 p {
    font-size: 1.25rem;
    color: rgba(253, 251, 247, 0.9);
    margin-bottom: 40px;
    max-width: 600px;
    margin-inline: auto;
}

.story-2 h2 {
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    margin-bottom: 16px;
}

.story-2 h1 {
    font-size: 5rem;
    color: var(--clr-sage);
}

/* =========================================
   SCENE 2: OCR SCANNER
   ========================================= */
.ocr-section {
    background: var(--clr-white);
    color: var(--clr-ink);
}

.ocr-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
}

.ocr-text {
    flex: 1;
}

.ocr-text h2 {
    font-size: 3.5rem;
    color: var(--clr-ink);
    margin-bottom: 24px;
}

.ocr-text p {
    font-size: 1.3rem;
    color: var(--clr-ink);
    opacity: 0.8;
    line-height: 1.6;
}

.ocr-visual {
    flex: 1;
    position: relative;
}

.phone-frame {
    width: 320px;
    height: 640px;
    background: #000;
    border-radius: 40px;
    border: 12px solid #333;
    position: relative;
    margin: 0 auto;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
}

.phone-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 25px;
    background: #333;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    z-index: 10;
}

.scan-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
}

.laser-scanner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: #38f9d7;
    box-shadow: 0 0 15px 5px rgba(56, 249, 215, 0.6);
    z-index: 5;
    opacity: 0;
}

.macro-popups {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 6;
}

.macro-pop {
    position: absolute;
    background: rgba(255,255,255,0.95);
    color: var(--clr-ink);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.p-cal { top: 30%; left: 10%; color: #d81b60; }
.p-protein { top: 45%; right: 10%; color: #2A5C41; }
.p-carbs { top: 60%; left: 15%; color: #f6d365; }
.p-fat { top: 75%; right: 15%; color: #667eea; }

/* Auto animations for OCR Scanner */
@keyframes scanLaser {
    0% { top: 0; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

.laser-scanner.auto-laser {
    animation: scanLaser 3s infinite linear;
}

.macro-popups.show-auto .macro-pop {
    opacity: 1;
    transform: scale(1);
}

.macro-popups.show-auto .p-cal { transition-delay: 0.5s; }
.macro-popups.show-auto .p-protein { transition-delay: 0.8s; }
.macro-popups.show-auto .p-carbs { transition-delay: 1.1s; }
.macro-popups.show-auto .p-fat { transition-delay: 1.4s; }

/* =========================================
   SCENE 3: ECOSYSTEM
   ========================================= */
.ecosystem-section {
    background: var(--clr-cream);
    color: var(--clr-ink);
}

.ecosystem-header {
    text-align: center;
    margin-bottom: 60px;
}

.ecosystem-header h2 {
    font-size: 3rem;
}

.ecosystem-header p {
    font-size: 1.2rem;
    opacity: 0.8;
    max-width: 500px;
    margin: 16px auto 0;
}

.traditional-bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.bento-card {
    background: var(--clr-white);
    border-radius: 32px;
    padding: 40px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(42, 92, 65, 0.05);
    transition: var(--transition-smooth);
}

.card-wide {
    grid-column: span 2;
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}

.card-icon svg {
    animation: iconBounce 3s ease-in-out infinite;
    transform-origin: center;
}

.bento-card:hover .card-icon {
    transform: scale(1.15) rotate(5deg);
}

.bento-card:hover .card-icon svg {
    animation-play-state: paused;
}

/* Colorful Gradient Backgrounds */
.bento-card:nth-child(1) .card-icon { background: linear-gradient(135deg, #f2709c, #ff9472); color: white; box-shadow: 0 8px 20px rgba(242, 112, 156, 0.25); }
.bento-card:nth-child(2) .card-icon { background: linear-gradient(135deg, #43e97b, #38f9d7); color: white; box-shadow: 0 8px 20px rgba(67, 233, 123, 0.25); }
.bento-card:nth-child(3) .card-icon { background: linear-gradient(135deg, #fa709a, #fee140); color: white; box-shadow: 0 8px 20px rgba(250, 112, 154, 0.25); }
.bento-card:nth-child(4) .card-icon { background: linear-gradient(135deg, #667eea, #764ba2); color: white; box-shadow: 0 8px 20px rgba(102, 126, 234, 0.25); }
.bento-card:nth-child(5) .card-icon { background: linear-gradient(135deg, #f6d365, #fda085); color: white; box-shadow: 0 8px 20px rgba(246, 211, 101, 0.25); }
.bento-card:nth-child(6) .card-icon { background: linear-gradient(135deg, #84fab0, #8fd3f4); color: white; box-shadow: 0 8px 20px rgba(132, 250, 176, 0.25); }
.bento-card:nth-child(7) .card-icon { background: linear-gradient(135deg, #a18cd1, #fbc2eb); color: white; box-shadow: 0 8px 20px rgba(161, 140, 209, 0.25); }
.bento-card:nth-child(8) .card-icon { background: linear-gradient(135deg, #ff0844, #ffb199); color: white; box-shadow: 0 8px 20px rgba(255, 8, 68, 0.25); }
.bento-card:nth-child(9) .card-icon { background: linear-gradient(135deg, #0ba360, #3cba92); color: white; box-shadow: 0 8px 20px rgba(11, 163, 96, 0.25); }

/* Stagger animation timing */
.bento-card:nth-child(even) .card-icon svg { animation-delay: 0.5s; animation-duration: 3.5s; }
.bento-card:nth-child(3n) .card-icon svg { animation-delay: 1s; animation-duration: 4s; }

.bento-card h3 {
    font-size: 1.8rem;
    margin-bottom: 16px;
}

.bento-card p {
    color: var(--clr-ink);
    line-height: 1.6;
    opacity: 0.8;
}

/* =========================================
   FOOTER
   ========================================= */
.footer {
    background: var(--clr-forest);
    color: var(--clr-cream);
    padding: 80px 0 40px;
    border-radius: 40px 40px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 60px;
}

.footer-logo {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 16px;
}

.footer-desc {
    max-width: 300px;
    opacity: 0.8;
    line-height: 1.6;
}

.footer h4 {
    color: var(--clr-cream);
    font-size: 1.2rem;
    margin-bottom: 24px;
}

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

.footer-links a {
    opacity: 0.8;
    transition: opacity 0.3s;
}

.footer-links a:hover {
    opacity: 1;
}

.footer-bottom {
    text-align: center;
    padding-top: 40px;
    border-top: 1px solid rgba(253, 251, 247, 0.1);
    opacity: 0.6;
    font-size: 0.9rem;
}

/* =========================================
   PAGE SPECIFIC (ABOUT & VOP)
   ========================================= */
.page-header {
    padding: 180px 0 80px;
    background: var(--clr-white);
    text-align: center;
    border-radius: 0 0 40px 40px;
}

.page-header h1 {
    font-size: 4rem;
}

.page-content {
    padding: 80px 0;
    max-width: 800px;
    margin: 0 auto;
}

.legal-document {
    max-width: 900px;
    padding: 80px 28px 120px;
}

.legal-document__title {
    max-width: 720px;
    margin: 0 0 36px;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    line-height: 1.2;
}

.legal-meta {
    margin: 0 0 64px;
    padding: 24px 0;
    border-top: 1px solid rgba(42, 92, 65, 0.18);
    border-bottom: 1px solid rgba(42, 92, 65, 0.18);
}

.legal-meta__row {
    display: grid;
    grid-template-columns: minmax(150px, 0.36fr) 1fr;
    gap: 20px;
    padding: 7px 0;
}

.legal-meta dt {
    color: var(--clr-forest);
    font-weight: 700;
}

.legal-meta dd {
    min-width: 0;
    margin: 0;
    color: var(--clr-ink);
}

.legal-document h3 {
    margin: 56px 0 20px;
    padding-top: 28px;
    border-top: 1px solid rgba(42, 92, 65, 0.12);
    font-size: clamp(1.35rem, 2vw, 1.65rem);
    line-height: 1.25;
    scroll-margin-top: 120px;
}

.legal-document p {
    max-width: 78ch;
}

.legal-document a {
    color: var(--clr-forest);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(42, 92, 65, 0.35);
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

.legal-loading,
.legal-error {
    min-height: 30vh;
    display: grid;
    place-items: center;
    text-align: center;
}

.legal-error {
    color: #8b2d2d;
}

.prose h2 {
    font-size: 2rem;
    margin: 40px 0 20px;
}

.prose p {
    line-height: 1.8;
    margin-bottom: 20px;
    opacity: 0.85;
}

.prose ul {
    margin-bottom: 20px;
    padding-left: 20px;
}

.prose li {
    line-height: 1.8;
    margin-bottom: 10px;
    opacity: 0.85;
}

/* =========================================
   RESPONSIVE DESIGN
   ========================================= */
@media (max-width: 992px) {
    .traditional-bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .card-tall { grid-row: span 1; }
    .card-wide { grid-column: span 1; }
    
    .story-1 h1, .story-2 h1 { font-size: 4rem; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    
    .ocr-grid {
        flex-direction: column;
        gap: 30px;
        text-align: center;
    }
    .phone-frame {
        transform: scale(0.8);
        transform-origin: top center;
    }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .story-1 h1, .story-2 h1 { font-size: 3rem; }
    .story-2 h2 { font-size: 1.8rem; }
    .traditional-bento-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .page-header { padding: 140px 0 60px; }
    .page-header h1 { font-size: 2.5rem; }
    .legal-document { padding: 56px 22px 88px; }
    .legal-meta { margin-bottom: 48px; }
    .legal-meta__row {
        grid-template-columns: 1fr;
        gap: 2px;
        padding: 8px 0;
    }
    .legal-document h3 { margin-top: 44px; }
    
    .ecosystem-header h2 { font-size: 2.2rem; }
    .bento-card { width: 100%; padding: 24px; }
    .card-wide img { height: 120px; }
    .ocr-text h2 { font-size: 2.5rem; }
}

/* =========================================
   ANIMATED LOGO
   ========================================= */
.animated-logo-icon {
    animation: leaf-sway 4s ease-in-out infinite;
    transform-origin: bottom center;
}

@keyframes leaf-sway {
    0%, 100% { transform: rotate(-8deg) scale(1); }
    50% { transform: rotate(8deg) scale(1.05); }
}
