/* ═══════════════════════════════════════════════════════════════════════════
   web.css — ดีไซน์หลักของเว็บหน้าบ้าน chanasoft.co.th (รื้อใหม่ 17/11/2026)
   โหลดต่อจาก site.css เฉพาะหน้าที่ไม่ใช่ /portal (ดู _Layout) → หน้าพอร์ทัลไม่เปลี่ยนเลย
   แนวทาง: เรียบ สะอาด ที่ว่างเยอะ หัวข้อใหญ่ ภาพโปรแกรมเด่นกลางจอ
   โทนเดียวทั้งหน้า — ทุกส่วนใช้ตัวแปรสีของธีม (site.css) ไม่มีกล่องสีเข้มตายตัว
     ธีมสว่าง = สว่างทั้งหน้า (สลับแค่พื้นขาว/เทาอ่อน) · ธีมมืด = มืดทั้งหน้า
   ค่าที่ปรับได้จาก Content Studio มาเป็น attribute บน <html>:
     data-radius (sharp/soft/round) · data-font · data-nav (bar/floating)
     data-hero (aurora/grid/plain) · data-motion (on/off) · สีหลักมาเป็น <style> แยก
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    --font-head: "Anuphan";
    --font-display: var(--font-head), var(--font-th), var(--font-en);
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 28px;
    --radius-xl: 36px;
    --nav-h: 52px;
    --nav-gap: 0px;
    --nav-space: calc(var(--nav-h) + var(--nav-gap) * 2);
    --ring: color-mix(in srgb, var(--brand) 35%, transparent);
    --hairline: color-mix(in srgb, var(--text-primary) 10%, transparent);
    --glass: color-mix(in srgb, var(--bg-base) 72%, transparent);
    --tile: var(--bg-elev-1);            /* พื้นของการ์ด — สลับตามพื้นของส่วน */
    --shadow-soft: 0 2px 10px -4px rgba(15, 23, 42, .08);
    --shadow-lift: 0 24px 60px -24px rgba(15, 23, 42, .28);
    --section-y: clamp(72px, 10vw, 140px);
}
html[data-nav="floating"] { --nav-h: 60px; --nav-gap: 12px; }

/* ── ฟอนต์หัวข้อ ── */
html[data-font="prompt"] { --font-head: "Prompt"; }
html[data-font="kanit"]  { --font-head: "Kanit"; }
html[data-font="plex"]   { --font-head: "IBM Plex Sans Thai"; }
html[data-font="noto"]   { --font-head: "Noto Sans Thai"; }

/* ── ความโค้งมุม ── */
html[data-radius="sharp"] { --radius-sm: 4px; --radius-md: 6px; --radius-lg: 8px; --radius-xl: 10px; --radius-pill: 6px; }
html[data-radius="round"] { --radius-sm: 16px; --radius-md: 24px; --radius-lg: 36px; --radius-xl: 44px; }

/* ── พื้นฐาน ── */
body { background: var(--bg-base); overflow-x: clip; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: color-mix(in srgb, var(--brand) 22%, transparent); }
h1, h2, h3, h4, h5 { font-family: var(--font-display); letter-spacing: -0.025em; text-wrap: balance; color: var(--text-primary); }
body { font-size: 1.0625rem; line-height: 1.6; }
h1 { font-size: clamp(2.8rem, 6.6vw, 5.6rem); line-height: 1.06; font-weight: 600; }
h2 { font-size: clamp(2.2rem, 4.8vw, 3.9rem); line-height: 1.1; font-weight: 600; }
h3 { line-height: 1.25; font-weight: 600; }
p { text-wrap: pretty; }
.lead { color: var(--text-secondary); }
.container { max-width: 1120px; padding: 0 clamp(18px, 4vw, 28px); }
section { padding: var(--section-y) 0; }
.gradient-text, .text-gradient {
    background: linear-gradient(100deg, var(--brand) 0%, var(--accent-cyan) 50%, var(--accent-violet) 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ═══ ปุ่ม — ปุ่มหลักเป็นแคปซูลสีหลัก · ปุ่มรองเป็นลิงก์ข้อความมีลูกศร ═════════ */
.btn {
    border-radius: var(--radius-pill);
    font-weight: 600;
    padding: 11px 22px;
    transition: transform .2s ease, background-color .2s ease, border-color .2s ease, color .2s ease, opacity .2s ease;
}
.btn-primary { background: var(--brand); color: var(--text-on-brand); box-shadow: none; }
.btn-primary:hover { background: var(--brand-600); color: var(--text-on-brand); transform: scale(1.03); box-shadow: none; }
.btn-ghost { background: transparent; border: 1px solid var(--brand); color: var(--brand); }
.btn-ghost:hover { background: var(--brand); color: var(--text-on-brand); border-color: var(--brand); }
.btn-lg { padding: 15px 30px; font-size: 1.05rem; }
/* ปุ่มที่สองของ hero = ลิงก์ข้อความ */
.hero .hero-actions .btn-ghost { border: 0; padding-left: 10px; padding-right: 10px; background: none; color: var(--brand); }
.hero .hero-actions .btn-ghost::after { content: " \203A"; font-size: 1.3em; line-height: 0; margin-left: 4px; transition: margin .2s ease; }
.hero .hero-actions .btn-ghost:hover { background: none; color: var(--brand); text-decoration: underline; text-underline-offset: 4px; }
.hero .hero-actions .btn-ghost:hover::after { margin-left: 8px; }

/* ═══ แถบเมนู ═══════════════════════════════════════════════════════════════ */
.navbar {
    position: sticky; top: 0; z-index: 100;
    background: var(--glass);
    border-bottom: 1px solid var(--hairline);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    transition: background-color .3s ease, border-color .3s ease;
}
.nav-inner { height: var(--nav-h); gap: 16px; max-width: 1120px; }
/* ยังไม่เลื่อน = แถบใสกลืนกับพื้น hero */
.navbar:not(.is-scrolled) { background: transparent; border-bottom-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }

/* แคปซูลลอย (ตัวเลือกใน Content Studio) */
html[data-nav="floating"] .navbar {
    top: var(--nav-gap); margin: var(--nav-gap) 0;
    background: transparent; border-bottom: 0;
    backdrop-filter: none; -webkit-backdrop-filter: none;
    pointer-events: none;
}
html[data-nav="floating"] .nav-inner {
    pointer-events: auto;
    width: calc(100% - 2 * clamp(12px, 3vw, 24px));
    margin: 0 auto; padding: 0 8px 0 20px;
    background: var(--glass);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-pill);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    transition: box-shadow .3s ease;
}
html[data-nav="floating"] .navbar.is-scrolled .nav-inner { box-shadow: var(--shadow-lift); }

.nav-brand { font-family: var(--font-display); font-weight: 700; font-size: 1.08rem; gap: 9px; flex: 0 0 auto; }
.nav-brand:hover { color: inherit; }
.nav-brand .logo-dot { width: 22px; height: 22px; border-radius: 7px; background: var(--gradient); box-shadow: none; }
.nav-brand-logo { height: 28px; }

.nav-menu { gap: 0; }
.nav-menu > li { position: relative; }
.nav-menu a, .nav-drop-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 13px;
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-size: .82rem; font-weight: 400;
    white-space: nowrap;
    background: none;
    transition: color .15s ease;
}
.nav-menu a:hover, .nav-drop-btn:hover { color: var(--text-primary); background: none; }
.nav-menu a.active, .nav-drop.has-active > .nav-drop-btn { color: var(--text-primary); background: none; font-weight: 600; }

.nav-drop-btn { border: 0; font-family: inherit; cursor: pointer; }
.nav-drop-btn svg { width: 12px; height: 12px; transition: transform .2s ease; }
.nav-drop-panel {
    list-style: none; margin: 0; padding: 8px;
    position: absolute; top: calc(100% + 10px); left: 50%;
    min-width: 220px;
    transform: translate(-50%, 6px);
    background: var(--bg-card);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lift);
    opacity: 0; visibility: hidden;
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.nav-drop-panel::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.nav-drop-panel a { display: flex; width: 100%; padding: 10px 12px; border-radius: var(--radius-sm); color: var(--text-secondary) !important; font-size: .92rem; }
.nav-drop-panel a:hover { color: var(--text-primary) !important; background: var(--bg-elev-1) !important; }
.nav-drop-panel a.active { color: var(--brand) !important; }
@media (hover: hover) and (min-width: 1101px) {
    .nav-drop:hover > .nav-drop-panel { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
    .nav-drop:hover > .nav-drop-btn svg { transform: rotate(180deg); }
}
.nav-drop.is-open > .nav-drop-panel, .nav-drop:focus-within > .nav-drop-panel { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.nav-drop.is-open > .nav-drop-btn svg { transform: rotate(180deg); }

.nav-cta { gap: 4px; flex: 0 0 auto; }
.theme-toggle, .lang-toggle {
    height: 32px; min-width: 32px;
    border-radius: var(--radius-pill);
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
}
.lang-toggle { padding: 0 9px; font-size: .76rem; letter-spacing: .04em; }
.theme-toggle:hover, .lang-toggle:hover { background: var(--bg-elev-1); color: var(--text-primary); }
.nav-cta .btn-primary { padding: 7px 16px; font-size: .84rem; }
.nav-cta .btn-primary:hover { transform: none; }
.btn-portal-link { border: 0; background: transparent; font-size: .84rem; }

/* hero อยู่ใต้แถบเมนู (แถบเมนูใส ตอนยังไม่เลื่อน) */
main > .hero:first-child,
main > .home-blocks > .hero:first-child {
    margin-top: calc(-1 * var(--nav-space));
}

/* เมนูจอเล็ก — พับตั้งแต่ 1100px */
@media (max-width: 1100px) {
    .nav-toggle { display: flex; }
    .navbar:has(.nav-menu.is-open) { background: var(--bg-base); }
    .nav-menu {
        position: fixed;
        top: var(--nav-space); left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 0;
        padding: 8px clamp(18px, 4vw, 28px) 24px;
        background: var(--bg-base);
        border: 0;
        border-bottom: 1px solid var(--hairline);
        border-radius: 0;
        box-shadow: var(--shadow-lift);
        max-height: calc(100dvh - var(--nav-space));
        overflow-y: auto;
        transform: translateY(-8px);
        opacity: 0; pointer-events: none;
        transition: transform .22s ease, opacity .18s ease;
    }
    html[data-nav="floating"] .nav-menu { left: 12px; right: 12px; top: calc(var(--nav-space) + 6px); border-radius: var(--radius-lg); border: 1px solid var(--hairline); }
    .nav-menu.is-open { transform: none; opacity: 1; pointer-events: auto; }
    .nav-menu a, .nav-drop-btn {
        display: flex; width: 100%;
        padding: 14px 4px; font-size: 1.2rem; font-weight: 600;
        border-radius: 0; color: var(--text-primary);
        border-bottom: 1px solid var(--hairline);
    }
    .nav-drop-btn { justify-content: space-between; }
    .nav-drop-panel {
        position: static; transform: none; opacity: 1; visibility: visible;
        box-shadow: none; border: 0; padding: 0 0 0 14px; min-width: 0; background: transparent;
        display: none;
    }
    .nav-drop.is-open > .nav-drop-panel { display: block; transform: none; }
    .nav-drop:focus-within > .nav-drop-panel { transform: none; }
    .nav-drop-panel::before { display: none; }
    .nav-drop-panel a { font-size: 1.05rem; font-weight: 500; padding: 12px 4px; border-radius: 0; }
}
@media (max-width: 600px) {
    .nav-cta .btn-primary { display: none; }
}

/* ═══ Hero — ข้อความใหญ่กลางจอ + ภาพโปรแกรมเด่นด้านล่าง ════════════════════ */
.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: var(--bg-base);
    color: var(--text-primary);
    text-align: center;
    padding: calc(var(--nav-space) + clamp(56px, 9vw, 112px)) 0 clamp(56px, 8vw, 104px) !important;
}
.hero p, .hero .lead { color: var(--text-secondary); }

/* แสงสีนุ่ม ๆ หลังภาพโปรแกรม (หน้าแรกมี .hero-bg · หน้าย่อยใช้ ::before ของ hero) */
.hero > .hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.hero-bg::before, .hero-bg::after { content: ""; position: absolute; border-radius: 50%; filter: blur(90px); }
.hero-bg::before {
    width: 62vw; height: 40vw; max-width: 860px; max-height: 520px;
    left: 50%; bottom: 4%; transform: translateX(-62%);
    background: radial-gradient(closest-side, color-mix(in srgb, var(--brand) 40%, transparent), transparent);
}
.hero-bg::after {
    width: 50vw; height: 36vw; max-width: 720px; max-height: 460px;
    left: 50%; bottom: 10%; transform: translateX(-20%);
    background: radial-gradient(closest-side, color-mix(in srgb, var(--accent-violet) 32%, transparent), transparent);
}
.hero-bg > i { display: none; }
html[data-motion="on"] .hero-bg::before { animation: glowA 14s ease-in-out infinite alternate; }
html[data-motion="on"] .hero-bg::after  { animation: glowB 18s ease-in-out infinite alternate; }
@keyframes glowA { to { transform: translateX(-50%) scale(1.12); } }
@keyframes glowB { to { transform: translateX(-34%) scale(1.1); } }

html[data-hero="grid"] .hero-bg > i {
    display: block; position: absolute; inset: 0;
    background:
        linear-gradient(var(--hairline) 1px, transparent 1px) 0 0 / 56px 56px,
        linear-gradient(90deg, var(--hairline) 1px, transparent 1px) 0 0 / 56px 56px;
    -webkit-mask-image: radial-gradient(70% 60% at 50% 20%, #000, transparent 80%);
    mask-image: radial-gradient(70% 60% at 50% 20%, #000, transparent 80%);
}
html[data-hero="plain"] .hero-bg::before, html[data-hero="plain"] .hero-bg::after { display: none; }

.hero:not(:has(> .hero-bg))::before {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(45% 70% at 30% 100%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 70%),
        radial-gradient(40% 70% at 75% 100%, color-mix(in srgb, var(--accent-violet) 12%, transparent), transparent 70%);
}
html[data-hero="plain"] .hero:not(:has(> .hero-bg))::before { display: none; }

/* โครงหน้าแรก: ข้อความกลาง → ภาพด้านล่าง */
.hero-grid { display: flex; flex-direction: column; align-items: center; gap: clamp(48px, 7vw, 88px); }
.hero-copy { max-width: 880px; display: flex; flex-direction: column; align-items: center; }
.hero-copy h1 { margin: 0 0 22px; }
.hero-copy .lead { margin: 0 auto 32px; max-width: 640px; }
.hero-copy .hero-actions { justify-content: center; align-items: center; gap: 12px; }
.hero .badge {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 0; margin-bottom: 20px;
    border: 0; border-radius: 0; background: none;
    color: var(--brand);
    font-size: .95rem; font-weight: 600;
}
.hero .badge::before { display: none; }
.hero .lead { font-size: clamp(1.1rem, 1.8vw, 1.42rem); line-height: 1.6; font-weight: 500; }
.hero-trust { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 24px; color: var(--text-muted); font-size: .9rem; }
.hero-trust b { color: var(--text-primary); font-weight: 700; }
.hero-trust .ht-stars { display: inline-flex; gap: 2px; }
.hero-trust .ht-stars svg { width: 16px; height: 16px; fill: #F5A623; }

/* ภาพโปรแกรม */
.hero-stage { position: relative; width: 100%; max-width: 980px; }
.hero-visual {
    position: relative;
    margin: 0; max-width: none; aspect-ratio: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--hairline);
    background: var(--bg-card);
    color: var(--text-primary);
    text-align: left;
    overflow: hidden;
    box-shadow: 0 40px 100px -40px rgba(15, 23, 42, .35), 0 0 0 8px color-mix(in srgb, var(--text-primary) 3%, transparent);
}
.hero-visual::before { display: none; }
.hero-visual > img { display: block; width: 100%; height: auto; }
html[data-motion="on"] .hero-stage { animation: stageIn 1.1s cubic-bezier(.2, .7, .2, 1) both .15s; }
@keyframes stageIn { from { opacity: 0; transform: translateY(40px) scale(.97); } }

.hv-bar { display: flex; align-items: center; gap: 7px; padding: 12px 18px; border-bottom: 1px solid var(--hairline); background: var(--bg-elev-1); }
.hv-bar i { width: 11px; height: 11px; border-radius: 50%; background: #FF5F57; }
.hv-bar i:nth-child(2) { background: #FEBC2E; }
.hv-bar i:nth-child(3) { background: #28C840; }
.hv-bar span { margin-left: 10px; font-size: .78rem; color: var(--text-muted); font-weight: 600; }
.hv-body { display: grid; grid-template-columns: 190px 1fr; min-height: 400px; }
.hv-side { padding: 18px 14px; border-right: 1px solid var(--hairline); background: var(--bg-elev-1); display: flex; flex-direction: column; gap: 4px; }
.hv-side span { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; font-size: .82rem; color: var(--text-secondary); }
.hv-side span::before { content: ""; width: 13px; height: 13px; border-radius: 4px; background: var(--border-strong); flex: 0 0 auto; }
.hv-side span.on { background: var(--bg-card); color: var(--brand); font-weight: 600; box-shadow: var(--shadow-soft); }
.hv-side span.on::before { background: var(--brand); }
.hv-main { padding: 20px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.hv-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.hv-kpi { border-radius: 14px; padding: 14px 16px; background: var(--bg-elev-1); }
.hv-kpi small { display: block; font-size: .72rem; color: var(--text-muted); }
.hv-kpi b { display: block; font-family: var(--font-display); font-size: 1.3rem; color: var(--text-primary); margin-top: 2px; }
.hv-kpi em { font-style: normal; font-size: .72rem; font-weight: 700; color: #16A34A; }
.hv-chart { flex: 1; min-height: 140px; display: flex; align-items: flex-end; gap: 8px; padding: 16px; border-radius: 14px; background: var(--bg-elev-1); }
.hv-chart span { flex: 1; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, var(--brand), color-mix(in srgb, var(--brand) 25%, transparent)); }
.hv-chart span:nth-child(3n) { background: linear-gradient(180deg, var(--accent-violet), color-mix(in srgb, var(--accent-violet) 25%, transparent)); }
.hv-rows { display: flex; flex-direction: column; gap: 8px; }
.hv-rows span { height: 10px; border-radius: 99px; background: var(--bg-elev-2); }
.hv-rows span:nth-child(1) { width: 92%; } .hv-rows span:nth-child(2) { width: 74%; } .hv-rows span:nth-child(3) { width: 84%; }

.hv-kpi b.hv-skel { height: 14px; width: 70%; margin-top: 10px; border-radius: 99px; background: var(--bg-elev-2); }

@media (max-width: 720px) {
    .hv-body { grid-template-columns: 1fr; min-height: 0; }
    .hv-side { display: none; }
    .hv-main { padding: 14px; }
    .hv-kpis { grid-template-columns: repeat(2, 1fr); }
    .hv-kpi:nth-child(3) { display: none; }
}

/* ภาพโปรแกรมใน hero ค่อย ๆ ตั้งตรงตามการเลื่อน (เบราว์เซอร์ที่รองรับ scroll timeline · ที่ไม่รองรับ = ภาพตรงเฉย ๆ) */
@supports (animation-timeline: view()) {
    html[data-motion="on"] .hero-visual {
        transform-origin: center top;
        animation: heroTilt linear both;
        animation-timeline: view();
        animation-range: entry 0% cover 45%;
    }
    @keyframes heroTilt { from { transform: perspective(1400px) rotateX(16deg) scale(.92); } to { transform: none; } }
}

/* ═══ แผ่นสินค้า (แนว apple.com) ═══════════════════════════════════════════
   แผ่นเต็มจอ/ครึ่งจอ ห่างกัน 12px · ชื่อใหญ่ + คำโปรย + ปุ่มแคปซูลเล็ก 2 ปุ่ม · ภาพชิดขอบล่าง */
.tiles { padding: 12px 0 !important; }
.tiles-wrap { display: flex; flex-direction: column; gap: 12px; max-width: 1680px; margin: 0 auto; padding: 0 12px; }
.tiles-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile {
    position: relative; overflow: hidden; isolation: isolate;
    display: flex; flex-direction: column; align-items: center;
    padding: clamp(44px, 5vw, 60px) clamp(20px, 4vw, 40px) 0;
    border-radius: var(--radius-lg);
    background: var(--bg-elev-1);
    text-align: center;
}
.tile-full { min-height: clamp(560px, 62vw, 720px); }
.tile-half { min-height: clamp(480px, 46vw, 600px); }
.tile-wide { min-height: clamp(440px, 40vw, 560px); }
.tile-name { font-size: clamp(2.2rem, 4.6vw, 3.5rem); font-weight: 600; letter-spacing: -0.03em; margin: 0 0 8px; }
.tile-half .tile-name { font-size: clamp(1.9rem, 3.4vw, 2.6rem); }
.tile-tagline { font-size: clamp(1.08rem, 1.8vw, 1.5rem); line-height: 1.45; color: var(--text-primary); max-width: 640px; margin: 0 auto 20px; }
.tile-half .tile-tagline { font-size: clamp(1.02rem, 1.5vw, 1.22rem); max-width: 460px; }
.tile-tag { display: block; margin-bottom: 8px; color: var(--brand); font-size: .9rem; font-weight: 600; }
.tile-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.tile-links .btn { padding: 9px 20px; font-size: .95rem; }
.tile-media { position: relative; width: 100%; max-width: 980px; margin-top: auto; padding-top: 40px; }
.tile-half .tile-media { max-width: 560px; }
.tile-media > img { display: block; width: 100%; height: auto; border-radius: var(--radius-md) var(--radius-md) 0 0; box-shadow: 0 -10px 60px -30px rgba(15, 23, 42, .35); }
.tile-art {
    display: grid; place-items: center;
    aspect-ratio: 16 / 7;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background:
        radial-gradient(60% 90% at 30% 100%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 70%),
        radial-gradient(55% 90% at 75% 100%, color-mix(in srgb, var(--accent-violet) 18%, transparent), transparent 70%);
}
.tile-half .tile-art { aspect-ratio: 16 / 9; }
.tile-logo {
    width: clamp(96px, 12vw, 148px); height: clamp(96px, 12vw, 148px);
    display: grid; place-items: center; overflow: hidden;
    border-radius: 28%;
    background: var(--bg-card);
    box-shadow: var(--shadow-lift);
    font-size: clamp(3rem, 6vw, 4.6rem);
}
.tile-logo img { width: 100%; height: 100%; object-fit: cover; }
/* แผ่นสลับพื้น — แผ่นที่ 2 ของระบบหลักใช้พื้นขาวมีเส้นขอบบาง */
.tiles-wrap > .tile-full:nth-child(2) { background: var(--bg-base); box-shadow: inset 0 0 0 1px var(--hairline); }
@supports (animation-timeline: view()) {
    html[data-motion="on"] .tile-media {
        animation: tileRise linear both;
        animation-timeline: view();
        animation-range: entry 0% cover 35%;
    }
    @keyframes tileRise { from { transform: translateY(60px) scale(.9); opacity: .3; } to { transform: none; opacity: 1; } }
}
@media (max-width: 760px) {
    .tiles-grid { grid-template-columns: 1fr; }
    .tile-full, .tile-half, .tile-wide { min-height: 0; }
    .tile-art { aspect-ratio: 16 / 10; }
}

/* ปุ่มขอบ (ปุ่มรอง) · ปุ่มข้อความ · ปุ่มที่ยังกดไม่ได้ */
.btn-outline { background: transparent; border: 1px solid var(--brand); color: var(--brand); }
.btn-outline:hover { background: var(--brand); color: var(--text-on-brand); transform: none; }
.btn-link { background: none; border: 0; color: var(--brand); padding-left: 6px; padding-right: 6px; }
.btn-link:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 4px; }
.btn.is-disabled { opacity: .45; pointer-events: none; cursor: default; }

/* ═══ ข้อความใหญ่สว่างทีละคำตามการเลื่อน ══════════════════════════════════
   web.js ห่อแต่ละกลุ่มคำเป็น <span class="w"> แล้วใส่ .on ตามสัดส่วนที่เลื่อนผ่าน */
.statement { padding: clamp(96px, 14vw, 200px) 0; }
.statement-text {
    max-width: 980px; margin: 0 auto;
    font-family: var(--font-display);
    font-size: clamp(2rem, 4.8vw, 3.9rem); line-height: 1.22; font-weight: 600;
    letter-spacing: -0.025em; text-align: center; text-wrap: balance;
    color: var(--text-primary);
}
.statement-text.is-split .w { color: color-mix(in srgb, var(--text-primary) 18%, transparent); transition: color .35s ease; }
.statement-text.is-split .w.on { color: var(--text-primary); }
.statement-text.is-split .w.on:nth-last-child(-n+4) { background: linear-gradient(100deg, var(--brand), var(--accent-violet)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* ═══ หน้า /demo ═══════════════════════════════════════════════════════════ */
.demo-hero { padding-bottom: clamp(40px, 5vw, 64px) !important; }
.demo-tiles { padding-top: 0; }
.demo-tiles .tiles-grid { margin: 0 -12px; }
.demo-notes { max-width: 900px; margin: clamp(64px, 9vw, 120px) auto 0; }
.demo-notes h2 { text-align: center; font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin-bottom: 36px; }
.demo-notes ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.demo-notes li { padding: 26px 28px; border-radius: var(--radius-md); background: var(--bg-elev-1); color: var(--text-secondary); line-height: 1.6; }
.demo-notes li b { display: block; margin-bottom: 6px; color: var(--text-primary); font-size: 1.08rem; }
@media (max-width: 760px) {
    .demo-notes ul { grid-template-columns: 1fr; }
    .demo-tiles .tiles-grid { margin: 0; }
}

/* หัวหน้าย่อย (hero แบบข้อความล้วน) */
.hero:not([data-block]) h1 { font-size: clamp(2.4rem, 5.4vw, 4.4rem); }
.hero:not([data-block]) .lead { max-width: 680px; margin-left: auto; margin-right: auto; }

/* ═══ หัวข้อของแต่ละส่วน ═══════════════════════════════════════════════════ */
.section-header { margin-bottom: clamp(40px, 6vw, 72px); max-width: 820px; }
.section-header h2 { margin-bottom: 16px; }
.section-header p { font-size: clamp(1.05rem, 1.6vw, 1.3rem); line-height: 1.6; color: var(--text-secondary); font-weight: 500; }
.section-eyebrow {
    display: inline-block;
    padding: 0; margin-bottom: 14px;
    border: 0; border-radius: 0; background: none; box-shadow: none;
    color: var(--brand);
    font-size: .95rem; font-weight: 600; letter-spacing: 0; text-transform: none;
}
.section-eyebrow::before { display: none; }
html[lang^="th"] .section-eyebrow, html[lang^="th"] .suite-eyebrow { letter-spacing: 0; }
html[lang^="th"] #logos p { letter-spacing: .02em !important; text-transform: none !important; }

/* ลำดับส่วนของหน้าแรก — เดิม reviews/products/help ไม่มีลำดับ (= 0) เลยขึ้นก่อน hero ทำให้ hero ไปอยู่ล่างสุด */
.home-blocks > [data-block="reviews"]  { order: 16; }
.home-blocks > [data-block="products"] { order: 18; }
.home-blocks > [data-block="statement"] { order: 19; }
.home-blocks > [data-block="help"]     { order: 65; }
.home-blocks > [data-block="cta"]      { order: 90; }

/* พื้นของแต่ละส่วน — สลับขาว/เทาอ่อน (โทนเดียวกัน) · การ์ดสลับสีกลับกันให้แยกจากพื้น */
.home-blocks > [data-block="reviews"],
.home-blocks > [data-block="features"],
.home-blocks > [data-block="cases"],
.home-blocks > [data-block="testimonials"] { background: var(--bg-elev-1); --tile: var(--bg-card); }

/* ═══ การ์ด — พื้นทึบ มุมโค้งมาก ไม่มีขอบ ไม่มีเงา ══════════════════════════ */
.feature-grid { gap: clamp(14px, 2vw, 22px); grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.home-blocks > [data-block="cases"] .feature-grid,
.home-blocks > [data-block="news"] .feature-grid,
.home-blocks > [data-block="help"] .feature-grid,
.home-blocks > [data-block="testimonials"] .feature-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 360px));
    justify-content: center;
}
.card {
    border-radius: var(--radius-lg);
    border: 1px solid transparent;
    background: var(--tile);
    box-shadow: none;
    padding: clamp(26px, 3vw, 40px);
    transition: transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .35s ease;
}
html[data-site-theme] .card { border-color: color-mix(in srgb, var(--text-primary) 4%, transparent); }
.card::after { display: none; }
.card:hover { transform: scale(1.015); box-shadow: var(--shadow-lift); border-color: transparent; }
.card h3 { font-size: clamp(1.2rem, 1.7vw, 1.45rem); margin-bottom: 10px; }
.card p { line-height: 1.65; color: var(--text-secondary); }
.card-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    font-size: 1.4rem; margin-bottom: 22px;
    box-shadow: none;
}

/* ── Bento จุดเด่น 6 ข้อ ── */
.bento { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; grid-auto-flow: dense; }
.bento .bento-1 { grid-column: span 2; grid-row: span 2; display: flex; flex-direction: column; }
.bento .bento-6 { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; align-items: center; }
.bento-1 h3 { font-size: clamp(1.7rem, 2.8vw, 2.4rem); letter-spacing: -0.03em; }
.bento-1 p { font-size: 1.08rem; max-width: 460px; }
.bento-art { margin-top: auto; padding-top: 30px; }
.bento-chart { position: relative; color: var(--brand); }
.bento-chart svg { display: block; width: 100%; height: 180px; }
.bento-tag {
    position: absolute; right: 8px; top: 30px;
    padding: 6px 12px; border-radius: var(--radius-pill);
    background: var(--bg-base); box-shadow: var(--shadow-soft);
    font-size: .78rem; font-weight: 600; color: var(--text-secondary);
}
.bento-roles { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.bento-roles span {
    padding: 8px 15px; border-radius: var(--radius-pill);
    background: var(--bg-base);
    font-size: .88rem; font-weight: 600; color: var(--text-secondary);
}
.bento-roles span:nth-child(3n+1) { background: var(--brand); color: var(--text-on-brand); }
@media (max-width: 960px) {
    .bento { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .bento .bento-1 { grid-row: auto; }
    .bento .bento-6 { grid-template-columns: 1fr; }
    .bento-roles { justify-content: flex-start; }
}
@media (max-width: 600px) {
    .bento { grid-template-columns: 1fr !important; }
    .bento .bento-1 { grid-column: auto; }
}

/* ── ตระกูลซอฟต์แวร์ ── */
.suite { background: var(--bg-base); }
.suite-group-head { margin-bottom: 24px; }
.suite-group-head h3 { font-size: clamp(1.6rem, 3vw, 2.3rem); letter-spacing: -0.03em; }
.suite-eyebrow { border-radius: var(--radius-pill); }
.suite-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: clamp(14px, 2vw, 22px); align-items: stretch; }
.suite-card {
    position: relative; overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid transparent;
    background: var(--tile);
    box-shadow: none;
    padding: clamp(26px, 3vw, 40px);
    transition: transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .35s ease;
}
.suite-card::before { display: none; }
.suite-card:hover { transform: scale(1.015); box-shadow: var(--shadow-lift); border-color: transparent; }
.suite-card-head .card-icon { margin-bottom: 0; flex: 0 0 auto; }
.suite-card-head h4 { font-size: 1.3rem; }
.suite-more { display: inline-flex; align-items: center; gap: 6px; transition: gap .2s ease; }
.suite-more:hover { text-decoration: none; gap: 10px; }
.suite-group:first-of-type .suite-card { padding: clamp(30px, 3.6vw, 48px); }
.suite-group:first-of-type .suite-card-head .card-icon { width: 58px; height: 58px; }
.suite-group:first-of-type .suite-card-head h4 { font-size: clamp(1.4rem, 2.2vw, 1.8rem); }
.suite-service {
    position: relative; overflow: hidden; isolation: isolate;
    border-radius: var(--radius-xl);
    border: 0;
    background: var(--tile);
    box-shadow: none;
    padding: clamp(30px, 4vw, 56px);
}
.suite-service::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: radial-gradient(55% 90% at 100% 100%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 70%);
}

/* ── สถิติ — ตัวเลขใหญ่บนพื้นเดียวกับหน้า ── */
.home-blocks > [data-block="stats"] { padding-top: clamp(56px, 8vw, 100px); padding-bottom: clamp(56px, 8vw, 100px); }
.stats { border: 0; border-radius: 0; padding: 0; background: none; box-shadow: none; }
.stat + .stat { border-left: 1px solid var(--hairline); }
.stat-num {
    background: linear-gradient(100deg, var(--brand), var(--accent-violet));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    font-size: clamp(3rem, 6.4vw, 5rem); font-family: var(--font-display); letter-spacing: -0.04em;
}
.stat-label { color: var(--text-secondary); font-size: 1rem; font-weight: 500; }
@media (max-width: 760px) { .stat + .stat { border-left: 0; } }

/* ── โลโก้เลื่อนวน ── */
.marquee {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track { display: flex; width: max-content; }
.marquee .logo-strip { flex-wrap: nowrap; gap: 0; justify-content: space-around; min-width: min(1080px, 100vw); }
.marquee .logo-strip > * { margin: 0 clamp(22px, 3vw, 40px); }
html[data-motion="on"] .marquee-track { animation: marquee 36s linear infinite; }
html[data-motion="on"] .marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
html[data-motion="off"] .marquee { -webkit-mask-image: none; mask-image: none; }
html[data-motion="off"] .marquee-track { width: auto; }
html[data-motion="off"] .marquee .logo-strip { flex-wrap: wrap; min-width: 0; justify-content: center; }
html[data-motion="off"] .marquee .logo-strip[aria-hidden="true"] { display: none; }

/* ── การ์ดข่าว/กรณีศึกษา ── */
.news-card { padding: 0; overflow: hidden; }
.news-card .news-card-img { aspect-ratio: 16 / 10; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.news-card:hover .news-card-img { transform: scale(1.04); }
.news-card .news-card-body { padding: clamp(22px, 2.4vw, 30px); }

/* ── รีวิวจากผู้ใช้จริง ── */
.urv { border-bottom: 0; padding: clamp(56px, 7vw, 96px) 0; }
.urv-avg { font-family: var(--font-display); font-size: clamp(40px, 5.4vw, 60px); letter-spacing: -0.04em; }
.urv-card { border-radius: var(--radius-lg); border: 0; background: var(--tile); box-shadow: none; padding: clamp(22px, 2.6vw, 32px); }
.urv-card::before { content: "\201C"; font-family: Georgia, serif; font-size: 3rem; line-height: .6; color: var(--brand); opacity: .4; height: 18px; }
.urv-text { font-size: 1.02rem; color: var(--text-primary); }
.urv-nav { box-shadow: var(--shadow-soft); background: var(--bg-card); border-color: var(--hairline); }

/* ── ปิดท้ายชวนติดต่อ — ข้อความใหญ่กลางจอบนการ์ดเทาอ่อน ── */
#cta .container {
    position: relative; overflow: hidden; isolation: isolate;
    max-width: 1080px;
    padding: clamp(56px, 9vw, 120px) clamp(22px, 5vw, 64px);
    border-radius: var(--radius-xl);
    background: var(--bg-elev-1);
}
#cta .container::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background:
        radial-gradient(45% 80% at 20% 120%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 70%),
        radial-gradient(40% 80% at 85% 120%, color-mix(in srgb, var(--accent-violet) 15%, transparent), transparent 70%);
}
#cta h2 { font-size: clamp(2.2rem, 5vw, 4rem); }
#cta .lead, #cta p { color: var(--text-secondary); }

/* ── ราคา / ฟอร์ม / FAQ / อื่น ๆ ── */
.price-card, .pr-card, .prod-detail, .try-card, .try-app, .faq-item { border-radius: var(--radius-lg); box-shadow: none; }
.pr-card:hover, .price-card:hover { box-shadow: var(--shadow-lift); }
.form-control { border-radius: var(--radius-sm); background: var(--bg-card); }
.form-control:focus { background: var(--bg-card); box-shadow: 0 0 0 4px var(--ring); }
.faq-item summary { font-family: var(--font-display); }
.prod-jump a, .urv-filter a { border-radius: var(--radius-pill); }

/* ═══ ส่วนท้าย — เทาอ่อน ตัวอักษรเล็ก เรียบ ══════════════════════════════════ */
.footer {
    margin-top: 0;
    padding: clamp(48px, 6vw, 72px) 0 24px;
    border-top: 1px solid var(--hairline);
    background: var(--bg-elev-1);
    color: var(--text-secondary);
    font-size: .88rem;
}
main:not(:has(.home-blocks)) + .footer { margin-top: var(--section-y); }
.footer p { color: var(--text-secondary); }
.footer-grid { grid-template-columns: 1.6fr repeat(3, 1fr); gap: clamp(28px, 4vw, 56px); }
.footer h4 { font-family: var(--font-display); font-size: .86rem; font-weight: 600; letter-spacing: 0; text-transform: none; margin-bottom: 14px; color: var(--text-primary); }
.footer ul li { margin-bottom: 9px; }
.footer ul li a { color: var(--text-secondary); font-size: .86rem; transition: color .15s ease; }
.footer ul li a:hover { color: var(--text-primary); text-decoration: underline; }
.footer .newsletter-row { padding: 4px; border: 1px solid var(--hairline); border-radius: var(--radius-pill); background: var(--bg-card); }
.footer .newsletter-row .form-control { border: 0; background: transparent; box-shadow: none; padding: 8px 12px; }
.footer .newsletter-row .btn { padding: 8px 16px; }
.footer-bottom, .footer-company { border-color: var(--hairline) !important; color: var(--text-muted) !important; font-size: .8rem; }
.footer-visitor { border-color: var(--hairline); }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > div:first-child { grid-column: 1 / -1; } }
@media (max-width: 600px) {
    .footer-grid { grid-template-columns: 1fr; }
    .footer .newsletter-row { flex-direction: row; }
    .footer .newsletter-row .btn { width: auto; }
}

/* ปุ่มลอย/คุกกี้ */
.float-fab { box-shadow: var(--shadow-lift); }
.float-fab-top { background: var(--glass); color: var(--text-primary); border: 1px solid var(--hairline); font-size: 1.2rem; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.float-fab-top:hover { color: var(--brand); }
.cookie-banner { border-radius: var(--radius-lg); border-color: var(--hairline); box-shadow: var(--shadow-lift); background: var(--glass); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); }

/* ═══ เอฟเฟกต์โผล่ตอนเลื่อน ═════════════════════════════════════════════════ */
.reveal { transform: translateY(36px); transition: opacity 1s cubic-bezier(.2, .7, .2, 1), transform 1s cubic-bezier(.2, .7, .2, 1); }
html[data-motion="off"] .reveal { opacity: 1; transform: none; transition: none; }
html[data-motion="off"] .hero-stage { animation: none; }

/* ═══ จอเล็ก ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    :root { --nav-h: 50px; }
    html[data-nav="floating"] { --nav-h: 54px; --nav-gap: 8px; }
}
@media (max-width: 420px) {
    .hero-actions { flex-direction: column; align-items: center; }
}
