/* ---------- Theme tokens ---------- */
    :root {
      --bg: 255 255 255; --bg-soft: 248 250 252; --surface: 255 255 255; --surface-2: 241 245 249;
      --line: 226 232 240; --fg: 15 23 42; --body: 71 85 105; --muted: 100 116 139;
      --grid: 15 23 42; --aurora: .22; color-scheme: light;
    }
    .dark {
      --bg: 11 13 17; --bg-soft: 15 18 24; --surface: 21 25 32; --surface-2: 30 35 44;
      --line: 42 48 60; --fg: 241 245 249; --body: 168 177 192; --muted: 120 130 148;
      --grid: 255 255 255; --aurora: .30; color-scheme: dark;
    }
    html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
    body { font-family: 'Noto Sans Thai', sans-serif; background: rgb(var(--bg)); color: rgb(var(--body)); -webkit-font-smoothing: antialiased; overflow-x: hidden; overflow-x: clip; transition: background-color .4s, color .4s; }
    .i18n-pending body { visibility: hidden; }
    [hidden] { display: none !important; }
    ::selection { background: rgba(99,102,241,.22); }

    /* ---------- Backgrounds ---------- */
    .bg-grid {
      background-image: linear-gradient(to right, rgb(var(--grid) / .05) 1px, transparent 1px), linear-gradient(to bottom, rgb(var(--grid) / .05) 1px, transparent 1px);
      background-size: 48px 48px;
      mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 25%, transparent 75%);
      -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 25%, transparent 75%);
    }
    .bg-dots { background-image: radial-gradient(rgb(var(--grid) / .12) 1px, transparent 1px); background-size: 18px 18px; }
    .aurora {
      opacity: calc(var(--aurora) * 4);
      background:
        radial-gradient(38% 50% at 22% 25%, rgba(99,102,241,.22), transparent 70%),
        radial-gradient(34% 45% at 78% 18%, rgba(139,92,246,.18), transparent 70%),
        radial-gradient(30% 40% at 55% 60%, rgba(16,185,129,.14), transparent 70%);
      filter: blur(30px); animation: aurora 18s ease-in-out infinite alternate;
    }
    @keyframes aurora { to { transform: translate3d(0,-24px,0) scale(1.06); } }

    /* ---------- Text ---------- */
    .text-gradient { background: linear-gradient(100deg, #6366F1, #8B5CF6 50%, #10B981); -webkit-background-clip: text; background-clip: text; color: transparent; }
    .font-brand { font-family: Poppins, "Noto Sans Thai", sans-serif; }
    .dark { --tf-stem: #C7D2FE; }
    .text-gradient-sm { background: linear-gradient(100deg, #6366F1, #8B5CF6); -webkit-background-clip: text; background-clip: text; color: transparent; } /* short/small text: no green stop */
    .shimmer-text { background: linear-gradient(90deg, #4f46e5 0%, #a78bfa 25%, #4f46e5 50%, #4f46e5 100%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 4s linear infinite; }
    .dark .shimmer-text { background-image: linear-gradient(90deg, #a5b4fc 0%, #fff 25%, #a5b4fc 50%, #a5b4fc 100%); }
    @keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

    /* ---------- Glass ---------- */
    .glass { background: rgb(var(--surface) / .72); border: 1px solid rgb(var(--line) / .8); backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%); }

    /* ---------- Spotlight card ---------- */
    .glow-card { position: relative; isolation: isolate; border-radius: 22px; background: rgb(var(--surface) / .85); border: 1px solid rgb(var(--line) / .8); box-shadow: 0 1px 2px rgba(15,23,42,.04); transition: transform .45s cubic-bezier(.2,.8,.2,1), box-shadow .45s; }
    .glow-card::before, .glow-card::after { content: ""; position: absolute; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s; }
    .glow-card::before { inset: -1px; padding: 1px; background: radial-gradient(320px circle at var(--mx,50%) var(--my,50%), var(--glow, #8B5CF6), transparent 45%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; z-index: 1; }
    .glow-card::after { inset: 0; background: radial-gradient(420px circle at var(--mx,50%) var(--my,50%), var(--glow-soft, rgba(139,92,246,.07)), transparent 50%); z-index: -1; }
    .glow-card:hover { box-shadow: 0 18px 40px -16px rgba(15,23,42,.2); }
    .glow-card:hover::before, .glow-card:hover::after { opacity: 1; }
    .g-indigo { --glow: #6366F1; --glow-soft: rgba(99,102,241,.08); }
    .g-emerald { --glow: #10B981; --glow-soft: rgba(16,185,129,.08); }
    .g-violet { --glow: #8B5CF6; --glow-soft: rgba(139,92,246,.08); }
    .g-amber { --glow: #F59E0B; --glow-soft: rgba(245,158,11,.08); }
    .g-sky { --glow: #0EA5E9; --glow-soft: rgba(14,165,233,.08); }
    .g-rose { --glow: #F43F5E; --glow-soft: rgba(244,63,94,.07); }
    .tilt { will-change: transform; }
    .tilt.reveal.in { transition: opacity .9s, transform .3s ease-out, box-shadow .45s; }

    /* ---------- Border beam ---------- */
    @property --angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
    .beam { position: relative; isolation: isolate; }
    .beam::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; background: conic-gradient(from var(--angle), transparent 0 60%, #6366F1 74%, #8B5CF6 82%, #10B981 90%, transparent 100%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: spin-angle 6s linear infinite; pointer-events: none; z-index: 2; }
    @keyframes spin-angle { to { --angle: 360deg; } }

    /* ---------- Buttons ---------- */
    .btn-primary { color: #fff; background: #4F46E5; box-shadow: 0 6px 18px -8px rgba(79,70,229,.55); transition: background .2s, box-shadow .2s, transform .2s; }
    .btn-primary:hover { background: #4338CA; box-shadow: 0 8px 22px -8px rgba(79,70,229,.7); }
    .btn-primary:active { transform: translateY(1px); }
    .btn-solid { color: rgb(var(--bg)); background: rgb(var(--fg)); transition: background .2s, transform .2s; }
    .btn-solid:hover { background: rgb(var(--fg) / .82); }
    .btn-solid:active { transform: translateY(1px); }
    .btn-ghost { color: rgb(var(--fg) / .85); background: rgb(var(--surface) / .6); border: 1px solid rgb(var(--line)); transition: background .2s, border-color .2s, color .2s; }
    .btn-ghost:hover { background: rgb(var(--surface)); border-color: rgb(var(--muted) / .45); color: rgb(var(--fg)); }
    :focus-visible { outline: 2px solid #6366F1; outline-offset: 2px; border-radius: 10px; }

    #progress { transform-origin: 0 50%; transform: scaleX(0); }

    .badge-dot { position: relative; }
    .badge-dot::after { content: ""; position: absolute; inset: -3px; border-radius: 999px; background: currentColor; opacity: .45; animation: ping 1.8s cubic-bezier(0,0,.2,1) infinite; }
    @keyframes ping { 75%, 100% { transform: scale(2.2); opacity: 0; } }

    /* ---------- Blur-fade reveal ---------- */
    .reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s cubic-bezier(.2,.8,.2,1), transform .9s cubic-bezier(.2,.8,.2,1); }
    .reveal.in { opacity: 1; transform: none; }
    /* Hero: CSS-only entrance so the headline (LCP) paints without waiting for the script */
    .hero-in { animation: heroIn .8s cubic-bezier(.2,.8,.2,1) both; }
    .hero-in.fade { animation-name: heroFade; }
    @keyframes heroIn { from { transform: translateY(14px); } to { transform: none; } }
    @keyframes heroFade { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

    .order-in { animation: orderIn .55s cubic-bezier(.2,.8,.2,1); }
    @keyframes orderIn { from { opacity: 0; transform: translateY(-8px); background: rgba(99,102,241,.12); } to { opacity: 1; transform: none; } }
    .flash { animation: flash 1s ease-out; }
    @keyframes flash { 0% { background-color: rgba(16,185,129,.18); } 100% { background-color: transparent; } }
    .pop { animation: pop .5s cubic-bezier(.2,.8,.2,1); }
    @keyframes pop { 0% { transform: scale(.85); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
    .spin { animation: spin .9s linear infinite; }
    @keyframes spin { to { transform: rotate(360deg); } }

    /* ---------- Content cards (reviews / articles, server-rendered) ---------- */
    .card-hover { transition: transform .25s, box-shadow .25s; }
    .card-hover:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -18px rgba(15,23,42,.28); }

    /* ---------- Marquee ---------- */
    .marquee { mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
    .marquee-track { animation: marquee 40s linear infinite; }
    .marquee:hover .marquee-track { animation-play-state: paused; }
    @keyframes marquee { to { transform: translateX(-50%); } }

    /* ---------- Text reveal on scroll ---------- */
    .w { opacity: .55; transition: opacity .35s; } /* .45 was 2.9:1 on white (Lighthouse colour-contrast); .55 ≈ 4:1, still reads as "not yet lit" */
    .w.on { opacity: 1; }

    /* ---------- Animated beam (bento) ---------- */
    .beam-path { stroke-dasharray: 6 8; animation: dash 1.2s linear infinite; }
    @keyframes dash { to { stroke-dashoffset: -28; } }
    /* Kitchen card: the status steps light up one after another */
    .flow-step { transition: none; animation: stepLit 4.5s ease-in-out infinite; }
    @keyframes stepLit { 0%, 30%, 100% { transform: none; box-shadow: none; } 8%, 22% { transform: translateY(-2px); box-shadow: 0 0 0 1.5px currentColor, 0 6px 14px -6px currentColor; } }
    .flow-arrow { display: inline-block; animation: nudge 1.5s ease-in-out infinite; }
    @keyframes nudge { 0%, 100% { transform: none; opacity: .45; } 50% { transform: translateX(3px); opacity: 1; } }
    /* Buffet card: timer ring + queue number */
    .timer-ring { stroke-dasharray: 100; animation: ringDown 12s linear infinite; }
    @keyframes ringDown { from { stroke-dashoffset: 0; } to { stroke-dashoffset: 100; } }
    .q-call { animation: qCall 3s ease-in-out infinite; }
    @keyframes qCall { 0%, 60%, 100% { transform: none; } 70% { transform: scale(1.08); } 80% { transform: scale(1); } 90% { transform: scale(1.05); } }

    /* ---------- Scan story ---------- */
    .stage { perspective: 1400px; }
    .stage > * { transform-style: preserve-3d; }
    #phone { will-change: transform; }
    .scr { position: absolute; inset: 0; opacity: 0; transition: opacity .5s ease; }
    [data-step="0"] .scr-cam { opacity: 1; }
    [data-step="1"] .scr-menu, [data-step="2"] .scr-menu, [data-step="3"] .scr-menu { opacity: 1; }
    .scanline { position: absolute; left: 10%; right: 10%; top: 12%; height: 2px; will-change: transform; background: linear-gradient(90deg, transparent, #34d399, transparent); box-shadow: 0 0 14px 2px rgba(52,211,153,.7); animation: scan 2.2s ease-in-out infinite; }
    @keyframes scan { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(100px); } }
    .qr-frame { transition: border-color .3s, transform .3s; }
    .detected .qr-frame { border-color: #10B981 !important; transform: scale(1.05); }
    .detected-pill { opacity: 0; transform: translateY(8px) scale(.95); transition: all .35s cubic-bezier(.2,.8,.2,1); }
    .detected .detected-pill { opacity: 1; transform: none; }
    .noapp { transition: box-shadow .4s, transform .4s; }
    [data-step="1"] .noapp { box-shadow: 0 0 0 2px #10B981, 0 8px 20px -6px rgba(16,185,129,.6); transform: scale(1.04); }
    .ai-picks { transition: box-shadow .4s; }
    [data-step="2"] .ai-picks { box-shadow: 0 0 0 2px #8B5CF6, 0 12px 28px -10px rgba(139,92,246,.7); }
    .cart-sheet { transform: translateY(105%); transition: transform .6s cubic-bezier(.2,.8,.2,1); }
    [data-step="3"] .cart-sheet { transform: none; }
    .sent-overlay { opacity: 0; pointer-events: none; transition: opacity .4s; }
    .sent .sent-overlay { opacity: 1; }
    .sent .sent-check { animation: pop .5s cubic-bezier(.2,.8,.2,1); }
    #kds { opacity: 0; transform: translateX(40px) rotateY(-24deg) scale(.95); transition: opacity .6s, transform .7s cubic-bezier(.2,.8,.2,1); }
    .sent #kds { opacity: 1; transform: translateX(24px) rotateY(-16deg); }
    .ticket { opacity: 0; }
    .sent .ticket { animation: fly 1s cubic-bezier(.4,0,.2,1) forwards; }
    @keyframes fly { 0% { opacity: 1; transform: translate(0,0) scale(1); } 100% { opacity: 0; transform: translate(190px,-70px) scale(.5) rotate(8deg); } }
    .step-item { opacity: .38; transition: opacity .4s; }
    .step-item.active { opacity: 1; }
    .step-item .step-num { transition: background .4s, color .4s, box-shadow .4s; }
    .step-item.active .step-num { background: linear-gradient(135deg,#6366F1,#8B5CF6); color: #fff; box-shadow: 0 6px 18px -6px rgba(99,102,241,.8); }
    @media (max-width: 1023px) { .step-item:not(.active) { display: none; } }

    /* ---------- Simulator ---------- */
    .sim-tab[aria-selected="true"] { color: rgb(var(--fg)); background: rgb(var(--surface)); box-shadow: 0 1px 2px rgba(15,23,42,.06), 0 0 0 1px rgb(var(--line)), 0 6px 18px -8px rgba(99,102,241,.45); }
    .sim-panel { animation: panelIn .45s cubic-bezier(.2,.8,.2,1); }
    @keyframes panelIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

    .fc-grid { stroke: rgb(var(--line)); }
    .fc-txt { fill: rgb(var(--muted)); }
    .line-stroke { stroke: rgb(var(--line)); }

    .toggle-knob { transition: transform .35s cubic-bezier(.2,.8,.2,1); }
    [aria-checked="true"] .toggle-knob { transform: translateX(20px); }
    .price-swap { display: inline-block; transition: opacity .25s, transform .25s; }
    .price-swap.out { opacity: 0; transform: translateY(-6px); }

    .thin-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
    .thin-scroll::-webkit-scrollbar-thumb { background: rgb(var(--muted) / .3); border-radius: 99px; }
    .no-scrollbar::-webkit-scrollbar { display: none; } .no-scrollbar { scrollbar-width: none; }


    /* ---------- Below-the-story sections (features tour, finder, pricing, FAQ) ---------- */
    .eyebrow { display: inline-flex; align-items: center; gap: .5rem; border-radius: 999px; background: rgb(var(--surface)); padding: .25rem .75rem; font-size: 12.5px; font-weight: 700; box-shadow: 0 1px 2px rgba(15,23,42,.05), 0 0 0 1px rgb(var(--line)); }
    .ico { display: grid; place-items: center; flex-shrink: 0; border-radius: 12px; }
    .ftab { transition: background .2s, color .2s, box-shadow .2s; }
    .ftab[aria-selected="true"] { background: rgb(var(--surface)); color: rgb(var(--fg)); box-shadow: 0 1px 2px rgba(15,23,42,.06), 0 0 0 1px rgb(var(--line)), 0 8px 20px -10px rgba(99,102,241,.45); }
    .ftab[aria-selected="true"] .ftab-ico { background: #4F46E5; color: #fff; }
    .fpanel { animation: panelIn .45s cubic-bezier(.2,.8,.2,1); }
    .tbl { border-radius: 14px; padding: 10px; font-size: 12px; line-height: 1.25; }
    .tbl-free { background: rgb(var(--surface-2)); color: rgb(var(--muted)); }
    .ring-timer { transition: stroke-dashoffset 1s linear; }
    .q-pop { animation: qPop .9s cubic-bezier(.2,.8,.2,1); }
    @keyframes qPop { 0% { transform: scale(.9); opacity: .4; } 60% { transform: scale(1.06); opacity: 1; } 100% { transform: none; } }
    .seg-btn[aria-checked="true"] { background: #4F46E5; color: #fff; box-shadow: 0 4px 12px -4px rgba(79,70,229,.6); }
    .faq summary::-webkit-details-marker { display: none; }
    .faq[open] .faq-chev { transform: rotate(180deg); }
    .faq-chev { transition: transform .2s; }
    .fd-opt { border-radius: 10px; padding: .45rem .8rem; font-size: 13.5px; font-weight: 600; color: rgb(var(--body)); background: rgb(var(--surface)); box-shadow: 0 0 0 1px rgb(var(--line)); transition: background .2s, color .2s, box-shadow .2s; }
    .fd-opt:hover { box-shadow: 0 0 0 1px rgb(var(--muted) / .5); }
    .fd-opt[aria-pressed="true"] { background: #4F46E5; color: #fff; box-shadow: 0 6px 16px -8px rgba(79,70,229,.8); }
    .fd-pop { animation: panelIn .4s cubic-bezier(.2,.8,.2,1); }
    .qnum { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 999px; font-size: 12px; font-weight: 800; background: rgb(var(--surface-2)); color: rgb(var(--muted)); transition: background .3s, color .3s; }
    .qstep { transition: transform .35s, box-shadow .35s, opacity .35s; }
    .qstep:not(.on) { opacity: .72; }
    .qstep.on { transform: translateY(-3px); box-shadow: 0 18px 40px -20px rgba(79,70,229,.55); }
    .qstep.on .qnum { background: #4F46E5; color: #fff; }
    .qbar { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: linear-gradient(90deg, #6366F1, #8B5CF6, #10B981); }
    .qstep.on .qbar { animation: qFill 2.2s linear forwards; }
    @keyframes qFill { to { width: 100%; } }

    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
      .reveal { opacity: 1; transform: none; }
      .w { opacity: 1; }
    }
    /* ---------- TabFlow AI demo + billing cycle ---------- */
    .ai-avatar { background: linear-gradient(135deg, #7C3AED, #4F46E5); box-shadow: 0 6px 16px -6px rgba(124,58,237,.6); }
    .ai-chip { background: rgb(var(--surface)); color: rgb(var(--body)); box-shadow: 0 0 0 1px rgb(var(--line)); }
    .ai-chip:hover:not(:disabled) { color: rgb(var(--fg)); box-shadow: 0 0 0 1px #8B5CF6; }
    .ai-chip[aria-pressed="true"] { color: #6D28D9; background: rgba(139,92,246,.08); box-shadow: 0 0 0 1px rgba(139,92,246,.35); }
    .dark .ai-chip[aria-pressed="true"] { color: #C4B5FD; }
    .ai-chip:disabled { opacity: .55; cursor: default; }
    .ai-in { animation: aiIn .35s cubic-bezier(.2,.8,.2,1) both; }
    @keyframes aiIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
    .ai-typing i { width: 6px; height: 6px; border-radius: 999px; background: rgb(var(--muted)); animation: aiDot 1s infinite; }
    .ai-typing i:nth-child(2) { animation-delay: .15s; }
    .ai-typing i:nth-child(3) { animation-delay: .3s; }
    @keyframes aiDot { 0%, 80%, 100% { opacity: .3; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }
    .cyc-btn[aria-checked="true"] { background: rgb(var(--fg)); color: rgb(var(--bg)); }
    .cyc-save { background: rgba(16,185,129,.14); color: #047857; }
    .dark .cyc-save { color: #6EE7B7; }
    .cyc-btn[aria-checked="true"] .cyc-save { background: #10B981; color: #fff; }
    @media (prefers-reduced-motion: reduce) { .ai-in, .ai-typing i { animation: none; } }
