/* Smart Sensor Landing — Botanical Sage redesign */

:root {
    /* Sage / leaf palette */
    --sage-100:  #E8F0E5;
    --leaf-300:  #7BC97B;
    --leaf-700:  #2E7D32;
    --leaf-800:  #1B5E20;
    --pf-700:    #047857;
    --sky-600:   #2563EB;

    /* Ink / surfaces */
    --ink-900:   #1F2937;
    --ink-700:   #374151;
    --line-100:  #E5E7EB;
    --white:     #FFFFFF;

    /* Brand */
    --text-gradient: linear-gradient(90deg, #2563EB 0%, #2E7D32 100%);
    --band-gradient: linear-gradient(120deg, #60A5FA 0%, #7BC97B 100%);
    --glass-bg: rgba(255,255,255,0.62);

    /* Layout */
    --container-max: 1160px;
    --radius-pill: 9999px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    color: var(--ink-900);
    background-color: var(--sage-100);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    position: relative;
}

/* Photographic botanical backdrop — fixed behind all content, always blurred
   so foliage reads as a soft watercolor halo at every viewport.
   The 16:9 source (2560×1440) cannot show both foliage edges on any portrait
   viewport without distortion: with background-size: cover, a portrait viewport
   crops ~30% off each side, slicing out the foliage that lives on the source's
   left/right edges. So portrait-class viewports — phones AND tablet portrait
   (≤1023px) — use background-position: 20% center to keep the left-side foliage
   (fern + monstera) visible; landscape/desktop (≥1024px) centres the full image.
   transform: scale(1.05) prevents blur from leaking transparent edges into the viewport. */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url('/images/bg-botanical.webp');
    background-repeat: no-repeat;
    background-position: 20% center;
    background-size: cover;
    z-index: -1;
    pointer-events: none;
    filter: blur(4px);
    transform: scale(1.05);
    /* Fade the foliage in starting just below the nav so the brand mark sits
       over solid sage instead of leaves it would otherwise blend into. */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, transparent 64px, #000 100px);
    mask-image: linear-gradient(to bottom, transparent 0, transparent 64px, #000 100px);
}
@media (min-width: 1024px) {
    body::before { background-position: center; }
}
a { text-decoration: none; color: inherit; }
img, svg { display: block; max-width: 100%; }

h1, h2, h3, h4 {
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--ink-900);
}

/* ============================================
   Shared
   ============================================ */
.glass {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    backdrop-filter: blur(18px) saturate(1.4);
    border: 1px solid rgba(255,255,255,0.7);
}
.text-gradient, .logo-text {
    background: var(--text-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
a:focus-visible { outline: 2px solid var(--sky-600); outline-offset: 3px; }
.logo { display: flex; align-items: center; gap: 0.5rem; }
.logo-icon { width: 30px; height: 30px; }
.logo-text { font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif; font-size: 20px; font-weight: 800; }
.product-tile {
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    width: 44px; height: 44px; border-radius: 12px; color: #fff;
}
.product-tile svg { width: 22px; height: 22px; }
.product-tile--sai { background: var(--sky-600); }
.product-tile--pf { background: var(--pf-700); }
.product-lema { color: var(--ink-700); }

/* ============================================
   Navigation
   ============================================ */
.navbar {
    position: relative; z-index: 1;
    max-width: 1160px; margin: 0 auto; padding: 24px 20px 0;
    display: flex; align-items: center; justify-content: space-between;
}
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-link { font-size: 15px; font-weight: 500; color: var(--ink-900); }
.btn-nav {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
    border-radius: var(--radius-pill); background: var(--leaf-700); color: #fff;
    font-size: 15px; font-weight: 500;
}

/* ============================================
   Hero
   ============================================ */
.hero {
    max-width: 1160px; margin: 0 auto; padding: 64px 20px 72px;
    display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 32px; align-items: center;
}
.hero-main { display: flex; flex-direction: column; gap: 44px; }
.hero-title { font-size: 60px; line-height: 1.05; font-weight: 800; letter-spacing: -0.02em; }
.product-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.product-card {
    display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
    padding: 16px; border-radius: 20px;
}
.product-card .product-tile { width: 48px; height: 48px; border-radius: 13px; }
.product-card .product-tile svg { width: 24px; height: 24px; }
.product-card__name { font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif; font-size: 20px; font-weight: 800; line-height: 1.15; }
.product-card .product-lema { font-size: 14px; line-height: 1.4; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-primary, .btn-secondary {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 50px; padding: 0 22px; border-radius: var(--radius-pill); font-size: 16px; font-weight: 500;
}
.btn-primary { background: var(--leaf-700); color: #fff; box-shadow: 0 10px 24px rgba(46,125,50,0.28); }
.btn-secondary { border: 1.5px solid var(--leaf-700); color: var(--leaf-800); background: rgba(255,255,255,0.5); }
.hero-art { position: relative; height: 460px; }
.hero-art img { width: 100%; height: 100%; object-fit: contain; }
.metric-pill {
    position: absolute; padding: 12px 14px; border-radius: 16px;
    background: rgba(240,249,255,0.88);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    backdrop-filter: blur(14px) saturate(1.4);
    border: 1px solid rgba(255,255,255,0.85);
    box-shadow: 0 14px 30px rgba(31,41,55,0.12);
}
.metric-pill--sai { left: -8px; top: 38%; }
.metric-pill--pf { right: -8px; top: 8%; }
.metric-pill__label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.metric-pill__label--sai { color: #1D4ED8; }
.metric-pill__label--pf { color: var(--pf-700); }
.metric-pill__value {
    display: block; font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    font-size: 24px; font-weight: 800; line-height: 1.2; color: var(--ink-900);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #22C55E; }

/* ============================================
   Product stories
   ============================================ */
.story-section { max-width: 1160px; margin: 0 auto; padding: 40px 20px 16px; scroll-margin-top: 16px; }
.story-header { display: flex; align-items: center; gap: 14px; }
.story-title { font-size: 30px; font-weight: 800; }
.story-header .product-lema { font-size: 16px; }
.story { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; }
.story-step { min-height: 460px; display: flex; flex-direction: column; justify-content: center; }
.story-step__body { max-width: 420px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.step-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(255,255,255,0.9); color: var(--ink-700); font-size: 14px; font-weight: 700;
}
.step-title { font-size: 30px; font-weight: 800; line-height: 1.15; }
.step-text { font-size: 17px; line-height: 1.6; color: var(--ink-700); }
.story-stage-col { position: relative; }
.story-stage-sticky { position: sticky; top: 40px; display: flex; flex-direction: column; gap: 12px; }
.stage-box { height: 540px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.story-stage {
    width: 640px; height: 520px; flex-shrink: 0; position: relative; overflow: hidden;
    border-radius: 20px; transform-origin: center center; font-family: ui-sans-serif, system-ui, sans-serif;
}
.story-stage[data-story="sensor-ai"] { background: #EFF6FF; color: #111827; }
.story-stage[data-story="planta-flow"] { background: #ECFDF5; color: #0F172A; }
.stage-screen { position: absolute; inset: 0; }
.stage-screen[hidden] { display: none; }
.stage-dots { display: flex; gap: 6px; justify-content: center; }
.stage-dot { width: 8px; height: 6px; border-radius: 999px; }
.story-section--sai .stage-dot { background: rgba(37,99,235,0.3); }
.story-section--pf .stage-dot { background: rgba(4,120,87,0.3); }
.stage-dot.is-active { width: 28px; }
.story-section--sai .stage-dot.is-active { background: var(--sky-600); }
.story-section--pf .stage-dot.is-active { background: var(--pf-700); }
.stories-live .story-step { opacity: 0.4; }
.stories-live .story-step.is-active { opacity: 1; }
.story-section--sai .story-step.is-active .step-badge { background: var(--sky-600); color: var(--white); }
.story-section--pf .story-step.is-active .step-badge { background: var(--pf-700); color: var(--white); }
/* Final state of the stage entrance animations; the motion block below animates towards it */
.an-grow { transform-origin: bottom; }
.an-growx { transform-origin: left; }
.story-cta { display: flex; justify-content: center; padding: 8px 0 24px; }
.btn-story {
    display: inline-flex; align-items: center; min-height: 50px; padding: 0 24px;
    border-radius: var(--radius-pill); color: #fff; font-size: 16px; font-weight: 500;
}
.btn-story--sai { background: var(--sky-600); box-shadow: 0 10px 24px rgba(37,99,235,0.28); }
.btn-story--pf { background: var(--pf-700); box-shadow: 0 10px 24px rgba(4,120,87,0.28); }

/* ============================================
   Closing band + footer
   ============================================ */
.band { margin-top: 160px; background: var(--band-gradient); color: var(--ink-900); }
.band-cta {
    max-width: 1160px; margin: 0 auto; padding: 88px 20px 72px;
    display: flex; flex-direction: column; align-items: center; gap: 28px; text-align: center;
}
.band-title { font-size: 46px; line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; color: var(--ink-900); }
.btn-band {
    display: inline-flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 30px;
    border-radius: var(--radius-pill); background: var(--ink-900); color: #fff;
    font-size: 17px; font-weight: 500; box-shadow: 0 12px 28px rgba(31,41,55,0.22);
}
.footer {
    max-width: 1160px; margin: 0 auto; padding: 24px 20px 40px;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
    border-top: 1px solid rgba(31,41,55,0.22);
}
.footer .logo-text { background: none; -webkit-text-fill-color: currentColor; color: var(--ink-900); }
.footer .logo-icon { stroke: var(--ink-900); }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; font-size: 14px; color: var(--ink-900); }
.footer-copy { font-size: 13px; color: var(--ink-900); }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1180px) {
    .story-stage { transform: scale(0.82); }
    .stage-box { height: 450px; }
}

@media (max-width: 860px) {
    .hero { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 8px 20px 36px; }
    .hero-main { display: contents; }
    .hero-title { font-size: 34px; line-height: 1.12; order: 1; }
    .hero-art { height: 230px; order: 2; }
    .metric-pill { padding: 8px 12px; border-radius: 14px; }
    .metric-pill__value { font-size: 20px; }
    .metric-pill--sai { left: 0; top: auto; bottom: 36px; }
    .metric-pill--pf { right: 0; top: 10px; }
    .product-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; order: 3; }
    .product-card { padding: 12px; border-radius: 16px; gap: 8px; }
    .product-card .product-tile { width: 34px; height: 34px; border-radius: 9px; }
    .product-card .product-tile svg { width: 18px; height: 18px; }
    .product-card__name { font-size: 16px; font-weight: 700; }
    .product-card .product-lema { font-size: 13px; }
    .hero-cta { flex-direction: column; gap: 10px; order: 4; }
    .hero-cta .btn-primary, .hero-cta .btn-secondary { width: 100%; }
    .hero-cta .btn-secondary { min-height: 46px; }
    .nav-link { display: none; }
    .story { grid-template-columns: minmax(0, 1fr); }
    .story-step { min-height: 300px; }
    .story-stage-col { order: -1; position: sticky; top: 0; z-index: 3; padding: 8px 0; }
    .story-stage-sticky { position: static; }
    .stage-box { height: 300px; }
    .story-stage { transform: scale(0.55); }
    .band-title { font-size: 34px; }
}

/* ============================================
   Motion — only for users who have not asked for reduced motion
   ============================================ */
@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
    @keyframes anFloat {
        0%, 100% { transform: translateY(0); }
        50%      { transform: translateY(-10px); }
    }
    @keyframes anPulse {
        0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.55); }
        50%      { box-shadow: 0 0 0 7px rgba(34,197,94,0); }
    }
    .an-float { animation: anFloat 5s ease-in-out infinite; }
    .an-pulse { animation: anPulse 1.6s ease-in-out infinite; }
    .btn-nav, .btn-primary, .btn-secondary, .btn-story, .btn-band, .product-card { transition: transform 0.2s ease-out, box-shadow 0.2s ease-out; }
    .btn-nav:hover, .btn-primary:hover, .btn-secondary:hover, .btn-story:hover, .btn-band:hover, .product-card:hover { transform: translateY(-2px); }

    /* Story stage entrances — re-run each time a screen loses `hidden` */
    @keyframes anUp {
        from { opacity: 0; transform: translateY(18px); }
        to   { opacity: 1; transform: none; }
    }
    @keyframes anFade {
        from { opacity: 0; }
        to   { opacity: 1; }
    }
    @keyframes anPop {
        0%   { opacity: 0; transform: scale(0.6); }
        70%  { opacity: 1; transform: scale(1.06); }
        100% { opacity: 1; transform: scale(1); }
    }
    @keyframes anDraw {
        to { stroke-dashoffset: 0; }
    }
    @keyframes anGrow {
        from { transform: scaleY(0); }
        to   { transform: scaleY(1); }
    }
    @keyframes anGrowX {
        from { transform: scaleX(0); }
        to   { transform: scaleX(1); }
    }
    @keyframes anBlink {
        0%, 100% { opacity: 0.25; }
        50%      { opacity: 1; }
    }
    @keyframes anOut {
        to { opacity: 0; visibility: hidden; height: 0; padding: 0; margin: 0; }
    }
    @keyframes anIn {
        from { opacity: 0; transform: translateY(8px) scale(0.96); }
        to   { opacity: 1; transform: none; }
    }
    .an-up { animation: anUp 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
    .an-fade { animation: anFade 0.6s ease both; }
    .an-pop { animation: anPop 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
    .an-draw { stroke-dasharray: 1000; stroke-dashoffset: 1000; animation: anDraw 1.8s ease forwards; }
    .an-grow { animation: anGrow 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
    .an-growx { animation: anGrowX 1s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
    .an-blink { animation: anBlink 1.1s ease-in-out infinite; }
    .an-hide-at { animation: anOut 0.3s ease forwards; }
    .an-show-at { opacity: 0; animation: anIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
    .story-step { transition: opacity 0.4s ease; }
    .stage-dot { transition: width 0.3s ease, background 0.3s ease; }
}

@media (prefers-reduced-motion: reduce) {
    .an-hide-at { display: none; }
}
