/* ============================================================
   Fridge Vision: Smart Recipes — cinematic 3D scroll site
   Palette: ink black · emerald accent · electric blue (AI only) · bone
   ============================================================ */

:root {
    --ink: #07100c;
    --ink-2: #0b1710;
    --bone: #f2efe6;
    --bone-dim: rgba(242, 239, 230, 0.62);
    --emerald: #10b981;
    --emerald-bright: #34d399;
    --blue: #38bdf8;
    --glass: rgba(242, 239, 230, 0.05);
    --glass-border: rgba(242, 239, 230, 0.1);
    --display: "Archivo Expanded", "Archivo", sans-serif;
    --body: "Archivo", sans-serif;
}

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

html { scroll-behavior: auto; }

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
    background: var(--ink);
    color: var(--bone);
    font-family: var(--body);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

::selection { background: var(--emerald); color: var(--ink); }

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

.container { width: min(1200px, 92vw); margin: 0 auto; }
.container-narrow { width: min(800px, 92vw); }

/* ============ Preloader ============ */
.preloader {
    position: fixed; inset: 0; z-index: 100;
    background: var(--ink);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 24px;
    transition: opacity 0.7s ease, visibility 0.7s;
}
.preloader.done { opacity: 0; visibility: hidden; }
.preloader-logo { width: 160px; border-radius: 26px; filter: drop-shadow(0 0 30px rgba(16, 185, 129, 0.35)); }
.preloader-bar {
    width: 220px; height: 2px; border-radius: 2px;
    background: rgba(242, 239, 230, 0.12); overflow: hidden;
}
.preloader-fill {
    width: 0%; height: 100%;
    background: linear-gradient(90deg, var(--emerald), var(--emerald-bright));
    transition: width 0.2s ease;
}
.preloader-text {
    font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--bone-dim);
}

/* ============ Header ============ */
.header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 50;
    transition: background 0.4s ease, backdrop-filter 0.4s ease;
}
.header.scrolled {
    background: rgba(7, 16, 12, 0.72);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--glass-border);
}
.nav {
    width: min(1400px, 94vw); margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 0;
}
.nav-brand .logo { height: 52px; width: auto; border-radius: 12px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4); }
.nav-menu { display: flex; align-items: center; gap: 32px; list-style: none; }
.nav-link {
    text-decoration: none; font-size: 14px; font-weight: 500;
    letter-spacing: 0.04em; color: var(--bone-dim);
    transition: color 0.25s;
}
.nav-link:hover { color: var(--emerald-bright); }
.nav-cta {
    text-decoration: none; font-size: 14px; font-weight: 600;
    padding: 10px 22px; border-radius: 999px;
    background: var(--emerald); color: var(--ink);
    transition: transform 0.25s, box-shadow 0.25s;
    box-shadow: 0 0 18px rgba(16, 185, 129, 0.35);
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 0 28px rgba(16, 185, 129, 0.55); }

/* ============ Journey rail ============ */
.journey-rail {
    position: fixed; right: 28px; top: 50%; transform: translateY(-50%);
    z-index: 40; display: flex; gap: 14px; align-items: stretch;
    opacity: 0; transition: opacity 0.5s ease;
    pointer-events: none;
}
.journey-rail.visible { opacity: 1; }
.rail-line {
    width: 2px; border-radius: 2px;
    background: rgba(242, 239, 230, 0.14);
    overflow: hidden;
}
.rail-fill {
    width: 100%; height: 0%;
    background: linear-gradient(180deg, var(--emerald), var(--emerald-bright));
}
.rail-stages { list-style: none; display: flex; flex-direction: column; justify-content: space-between; padding: 2px 0; }
.rail-stage {
    font-size: 15px; letter-spacing: 0.22em; text-transform: uppercase;
    color: var(--bone-dim); transition: color 0.3s;
    writing-mode: horizontal-tb;
    padding: 6px 0;
}
.rail-stage.active { color: var(--emerald-bright); }

/* ============ Hero (continuous looping video) ============ */
.hero {
    position: relative;
    height: 100vh; min-height: 640px;
    overflow: hidden;
    text-align: center;
}
.hero-video {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: -2;
}
.hero-vignette {
    position: absolute; inset: 0; pointer-events: none; z-index: -1;
    background:
        radial-gradient(ellipse 82% 72% at 50% 46%, transparent 30%, rgba(7, 16, 12, 0.6) 100%),
        linear-gradient(180deg, rgba(7, 16, 12, 0.74) 0%, rgba(7, 16, 12, 0.12) 20%, transparent 42%, rgba(7, 16, 12, 0.52) 72%, rgba(7, 16, 12, 0.92) 100%);
}
.hero-content {
    position: relative; z-index: 1;
    display: flex; flex-direction: column; align-items: center;
}

/* Intro overlay (first few seconds) — original title + CTA, fades out to the steps */
.hero-intro {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
    padding: 31vh 6vw 0; z-index: 2;
    opacity: 0; transition: opacity 0.64s ease;
    pointer-events: none;
}
.hero-intro.visible { opacity: 1; }
.hero-intro.visible .hero-actions { pointer-events: auto; }

/* Step captions, timed to the looping video (upper band, clear of the title/CTA) */
.hero-captions {
    position: absolute; inset: 0 0 26vh 0;
    display: flex; align-items: center; justify-content: center;
    padding: 0 6vw; z-index: 1; pointer-events: none;
}
.hero-caption {
    position: absolute; text-align: center; max-width: 780px;
    opacity: 0; transform: translateY(16px);
    transition: opacity 0.56s ease, transform 0.56s ease;
}
.hero-caption.active { opacity: 1; transform: none; }
.hero-caption::before {
    content: "";
    position: absolute; left: 50%; top: 50%;
    width: min(760px, 88vw); height: min(360px, 46vh);
    transform: translate(-50%, -50%);
    background: radial-gradient(ellipse at center, rgba(7, 16, 12, 0.72) 0%, rgba(7, 16, 12, 0.42) 45%, transparent 72%);
    z-index: -1; pointer-events: none;
}
.grain {
    position: absolute; inset: -100%; pointer-events: none; opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    animation: grain-shift 0.9s steps(4) infinite;
}
@keyframes grain-shift {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-2%, 3%); }
    50% { transform: translate(3%, -2%); }
    75% { transform: translate(-3%, -3%); }
    100% { transform: translate(2%, 2%); }
}

/* Stages (overlay copy) */
.stage {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 0 6vw;
    opacity: 0; pointer-events: none;
}
.stage-hero { justify-content: flex-end; padding-bottom: 7vh; }

/* Soft dark halo behind journey copy so it reads over bright video frames */
.stage-copy::before {
    content: "";
    position: absolute;
    left: 50%; top: 50%;
    width: min(760px, 88vw); height: min(420px, 52vh);
    transform: translate(-50%, -50%);
    background: radial-gradient(ellipse at center, rgba(7, 16, 12, 0.72) 0%, rgba(7, 16, 12, 0.45) 45%, transparent 72%);
    pointer-events: none;
    z-index: -1;
}

.hero-title {
    font-family: var(--display);
    font-weight: 900;
    font-size: clamp(44px, 9.5vw, 150px);
    line-height: 0.95;
    letter-spacing: 0.01em;
    background: linear-gradient(180deg, #6ee7b7 0%, #34d399 44%, #10b981 74%, #059669 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.9)) drop-shadow(0 6px 22px rgba(0, 0, 0, 0.55));
}
.hero-sub {
    margin-top: 10px;
    font-size: clamp(16px, 2.2vw, 26px);
    font-weight: 600; letter-spacing: 0.42em; text-transform: uppercase;
    color: var(--emerald-bright);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9), 0 0 24px rgba(16, 185, 129, 0.45);
}
.hero-tagline { margin-top: 14px; font-size: clamp(15px, 1.6vw, 19px); color: var(--bone); text-shadow: 0 2px 8px rgba(0, 0, 0, 0.92); }

.hero-actions { margin-top: 30px; display: flex; flex-direction: column; align-items: center; gap: 18px; pointer-events: auto; }
.btn-primary {
    display: inline-block; text-decoration: none;
    font-weight: 700; font-size: 17px;
    color: var(--ink); background: var(--emerald);
    padding: 15px 36px; border-radius: 12px;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.45);
    animation: pulse-glow 2.4s ease-in-out infinite;
    transition: transform 0.25s;
}
.btn-primary:hover { transform: translateY(-2px) scale(1.02); background: var(--emerald-bright); }
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 14px rgba(16, 185, 129, 0.45), 0 0 34px rgba(16, 185, 129, 0.2); }
    50% { box-shadow: 0 0 26px rgba(16, 185, 129, 0.75), 0 0 60px rgba(16, 185, 129, 0.35); }
}
.store-badges { display: flex; gap: 14px; align-items: center; }
.store-badges img { height: 42px; width: auto; transition: transform 0.25s, opacity 0.25s; }
.store-badges a:hover img { transform: translateY(-2px); opacity: 0.9; }
.trust-text { font-size: 12.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--bone-dim); text-shadow: 0 1px 5px rgba(0, 0, 0, 0.95); }

.scroll-hint {
    margin-top: 4vh;
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--bone-dim);
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.95);
}
.scroll-hint-line {
    width: 1px; height: 44px;
    background: linear-gradient(180deg, var(--emerald), transparent);
    animation: hint-drop 1.8s ease-in-out infinite;
}
@keyframes hint-drop {
    0% { transform: scaleY(0); transform-origin: top; }
    45% { transform: scaleY(1); transform-origin: top; }
    55% { transform: scaleY(1); transform-origin: bottom; }
    100% { transform: scaleY(0); transform-origin: bottom; }
}

/* Journey copy stages */
.stage-kicker {
    font-size: 18px; font-weight: 600; letter-spacing: 0.34em; text-transform: uppercase;
    color: var(--emerald-bright); margin-bottom: 16px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9), 0 0 18px rgba(16, 185, 129, 0.55);
}
.stage-line {
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(34px, 6vw, 84px);
    line-height: 1.02;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.92), 0 8px 40px rgba(0, 0, 0, 0.7);
}
.stage-detail {
    margin: 18px auto 0; font-size: clamp(14px, 1.5vw, 18px);
    color: var(--bone); max-width: 520px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.92), 0 2px 16px rgba(0, 0, 0, 0.8);
}

/* ============ Shared section styles ============ */
section { position: relative; }
.section-kicker {
    font-size: 12px; font-weight: 600; letter-spacing: 0.34em; text-transform: uppercase;
    color: var(--emerald); margin-bottom: 18px;
}
.section-title {
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(30px, 4.6vw, 58px);
    line-height: 1.06;
}
.section-title em { font-style: italic; color: var(--emerald-bright); }

/* ============ Features ============ */
.features { padding: 140px 0 110px; background: linear-gradient(180deg, var(--ink) 0%, var(--ink-2) 100%); }
.features-grid {
    margin-top: 64px;
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
}
.feature-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 34px 28px;
    backdrop-filter: blur(8px);
    transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
.feature-card:hover {
    transform: translateY(-6px);
    border-color: rgba(16, 185, 129, 0.45);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4), 0 0 24px rgba(16, 185, 129, 0.08);
}
.feature-icon { font-size: 30px; margin-bottom: 18px; }
.feature-card h3 { font-size: 19px; font-weight: 700; margin-bottom: 10px; }
.feature-card p { font-size: 14.5px; color: var(--bone-dim); }

/* ============ Metrics ============ */
.metrics {
    padding: 110px 0;
    background: var(--ink-2);
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
}
.metrics-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; text-align: center; }
.metric-value {
    display: block;
    font-family: var(--display);
    font-weight: 900;
    font-size: clamp(40px, 5.4vw, 72px);
    color: var(--emerald-bright);
    text-shadow: 0 0 34px rgba(16, 185, 129, 0.35);
}
.metric-label { font-size: 13.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--bone-dim); }

/* ============ Screenshots ============ */
.screenshots {
    height: 100vh;
    display: flex; flex-direction: column; justify-content: center;
    padding: 0;
    background: var(--ink); overflow: hidden;
}
.phone-track { margin-top: 48px; padding-bottom: 0; }
@media (max-height: 780px) {
    .phone { width: 210px; }
    .phone img { border-radius: 20px; }
}
.phone-row { display: flex; gap: 34px; width: max-content; padding: 0 8vw; will-change: transform; }
.phone {
    flex: 0 0 auto;
    width: 250px;
    border-radius: 34px;
    border: 1px solid rgba(242, 239, 230, 0.14);
    background: #0d0f0e;
    padding: 10px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.6);
    transition: transform 0.4s ease;
}
.phone:hover { transform: translateY(-10px); }
.phone img { border-radius: 26px; }

/* ============ FAQ ============ */
.faq { padding: 120px 0; background: linear-gradient(180deg, var(--ink) 0%, var(--ink-2) 100%); }
.faq-list { margin-top: 54px; display: flex; flex-direction: column; gap: 14px; }
.faq-item {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    overflow: hidden;
    transition: border-color 0.3s;
}
.faq-item[open] { border-color: rgba(16, 185, 129, 0.4); }
.faq-item summary {
    cursor: pointer; list-style: none;
    padding: 22px 26px;
    font-weight: 600; font-size: 16.5px;
    display: flex; justify-content: space-between; align-items: center;
    gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: "+";
    font-size: 22px; font-weight: 400; color: var(--emerald-bright);
    transition: transform 0.3s;
    flex: 0 0 auto;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding: 0 26px 24px; font-size: 15px; color: var(--bone-dim); }
.faq-item a { color: var(--emerald-bright); }

/* ============ Final CTA ============ */
.final-cta {
    position: relative;
    min-height: 92vh;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.final-bg {
    position: absolute; inset: 0;
    background-size: cover; background-position: center;
    transform: scale(1.08);
    filter: brightness(0.65);
}
.final-cta::after {
    content: "";
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at center, transparent 30%, rgba(7, 16, 12, 0.82) 100%);
}
.final-inner { position: relative; z-index: 2; text-align: center; padding: 0 6vw; }
.final-title {
    font-family: var(--display);
    font-weight: 900;
    font-size: clamp(38px, 6.6vw, 96px);
    line-height: 1.02;
    text-shadow: 0 8px 44px rgba(0, 0, 0, 0.8);
}
.final-title em { font-style: italic; color: var(--emerald-bright); }

/* ============ Footer ============ */
.footer { background: #050b08; border-top: 1px solid var(--glass-border); padding: 70px 0 36px; }
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
}
.footer-logo { width: 96px; border-radius: 18px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45); }
.footer-tagline { margin-top: 16px; font-size: 14px; color: var(--bone-dim); }
.footer-col h3 {
    font-size: 12px; letter-spacing: 0.24em; text-transform: uppercase;
    color: var(--emerald); margin-bottom: 18px;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { text-decoration: none; font-size: 14.5px; color: var(--bone-dim); transition: color 0.25s; }
.footer-col a:hover { color: var(--emerald-bright); }
.footer-bottom {
    margin-top: 56px; padding-top: 26px;
    border-top: 1px solid rgba(242, 239, 230, 0.07);
    font-size: 12.5px; color: rgba(242, 239, 230, 0.4);
}

/* ============ Responsive ============ */
@media (max-width: 900px) {
    .features-grid { grid-template-columns: 1fr 1fr; }
    .metrics-row { grid-template-columns: 1fr 1fr; gap: 44px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
    .nav-menu { gap: 18px; }
    .nav-link { display: none; }
    .nav-brand .logo { height: 44px; }
    .features-grid { grid-template-columns: 1fr; }
    .hero { padding-bottom: 5vh; }
    .hero-captions { inset: 0 0 26vh 0; }
    .store-badges img { height: 38px; }
    .phone { width: 200px; }
    .phone-row { gap: 20px; }
    .footer-grid { grid-template-columns: 1fr; gap: 34px; }
}

@media (prefers-reduced-motion: reduce) {
    .grain, .scroll-hint-line, .btn-primary { animation: none; }
    .hero-video { display: none; }
    .hero { background: var(--ink); }
    .hero::after {
        content: ""; position: absolute; inset: 0; z-index: -2;
        background: url("/assets/img/hero-poster.jpg") center/cover;
    }
}
