/* หน้าแรกโฉมใหม่ตาม Figma "Allable New Web" (frame ALLABLE WEBSITE 1512x5967)
   โทเคนทั้งหมดถอดมาจาก Design System 1401:1483 — font Poppins · 8-point grid
   ดีไซน์ตั้งต้นเป็น desktop 1512px แล้วย่อลงมือถือด้วย clamp() + breakpoint 1024/768/480 */

:root {
    --v2-ink: #404040;
    --v2-muted: #9F9F9F;
    --v2-gray: #5D5D5D;
    --v2-orange: #FF8B07;
    --v2-cream: #FFF8F0;
    /* แถบบนสุดของทุกหน้าเป็นส้มอ่อน แล้วส่วนถัดไปเป็นขาว สลับกันไป (วัดจาก Figma 2026-08-21) */
    --v2-peach: #FFF4E5;
    --v2-peach-strong: #FFD8AC;
    --v2-mark: #FFEDBD;
    --v2-chip: #F6F6F6;
    --v2-line: #EDEDED;
    --v2-people: #F1B6FD;
    --v2-process: #FFCE96;
    --v2-data: #B4FAFF;
    --v2-marquee: #EEE9E3;
    --v2-grad: linear-gradient(90deg, #FF8B07 0%, #E14BFF 49%, #8BF7FF 100%);
    --v2-shell: 1132px;
    --v2-pad: 40px;
    --v2-header-h: 125px;
}

/* ---------- ฐาน ---------- */
.v2 * { box-sizing: border-box; }

.v2 {
    margin: 0;
    background: #fff;
    color: var(--v2-ink);
    /* Poppins ไม่มีตัวอักษรไทย ต้องมีฟอนต์ไทยต่อท้ายเสมอ ไม่งั้นภาษาไทยจะตกไปใช้ฟอนต์ระบบที่หน้าตาไม่เข้ากัน */
    font-family: 'Poppins', 'Noto Sans Thai', 'Kanit', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* height:auto สำคัญ — ทุกรูปมี attribute width/height ติดมา ถ้าไม่ปล่อยอิสระรูปจะโดนบีบตอนย่อ */
.v2 img { max-width: 100%; height: auto; display: block; }
.v2 a { color: inherit; text-decoration: none; }
/* :where() ทำให้ reset นี้มีน้ำหนักเป็นศูนย์ ไม่งั้นมันจะไปทับ margin ของคลาสจริง (.v2-hero-sub ฯลฯ) */
.v2 :where(h1, h2, h3, p) { margin: 0; }

.v2-shell {
    width: 100%;
    max-width: var(--v2-shell);
    margin: 0 auto;
    padding: 0 var(--v2-pad);
}

/* ข้อความไล่สีตามแบรนด์ (ส้ม → ม่วง → ฟ้า) */
.v2-grad-text {
    background: var(--v2-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

/* ไฮไลต์สีเหลืองใต้คำ — ใน Figma เป็นสี่เหลี่ยม #FFEDBD วางหลังตัวอักษร */
.v2-mark {
    background: linear-gradient(var(--v2-mark), var(--v2-mark)) no-repeat;
    background-size: 100% 62%;
    background-position: 0 76%;
    padding: 0 .12em;
}

.v2-orange { color: var(--v2-orange); }

/* ---------- ปุ่ม ---------- */
.v2-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    height: 37px;
    padding: 5px 18px;
    border-radius: 100px;
    font-family: 'Red Hat Display', 'Poppins', 'Noto Sans Thai', sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -.02em;
    white-space: nowrap;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease;
}

.v2-btn-primary {
    background: var(--v2-grad);
    color: #fff;
}

.v2-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(225, 75, 255, .25);
    color: #fff;
}

.v2-btn-primary .v2-btn-ico {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
}

.v2-btn-ghost {
    background: transparent;
    border-color: var(--v2-gray);
    color: var(--v2-gray);
    font-weight: 400;
}

.v2-btn-ghost:hover {
    border-color: var(--v2-orange);
    color: var(--v2-orange);
}

/* ---------- ส่วนหัว ---------- */
.v2-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(255, 244, 229, .92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
    transition: border-color .25s ease, box-shadow .25s ease;
}

.v2-header.is-stuck {
    background: rgba(255, 255, 255, .94);
    border-bottom-color: var(--v2-line);
    box-shadow: 0 6px 24px rgba(0, 0, 0, .04);
}

.v2-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 11px 50px 0;
}

/* โลโก้หัวเว็บใช้ตัวเต็มที่มีตัวอักษร (720x158) จึงคุมด้วยความสูงให้พอดีแถบเมนู */
.v2-logo img { height: 60px; width: auto; }

.v2-header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.v2-header-btns {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ตัวสลับภาษา — เนื้อหาภาษามาจาก api/languages/nation.json ที่เดียว */
.v2-lang { position: relative; }

.v2-lang-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 0;
    padding: 4px;
    cursor: pointer;
}

.v2-lang-toggle img {
    width: 23px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
}

.v2-lang-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    min-width: 168px;
    background: #fff;
    border: 1px solid var(--v2-line);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .12);
    padding: 6px;
    display: none;
}

.v2-lang.is-open .v2-lang-menu { display: block; }

.v2-lang-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 15px;
    color: var(--v2-ink);
}

.v2-lang-menu a:hover { background: var(--v2-chip); }

.v2-lang-menu img {
    width: 24px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
}

.v2-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 80px;
    padding: 10px 50px;
    font-family: 'Red Hat Display', 'Poppins', 'Noto Sans Thai', sans-serif;
    font-size: 16px;
    letter-spacing: -.03em;
}

.v2-nav a {
    color: var(--v2-gray);
    padding: 4px 0;
    position: relative;
    transition: color .2s ease;
}

.v2-nav a:hover { color: var(--v2-orange); }

.v2-nav a.is-active {
    color: var(--v2-orange);
    font-weight: 700;
}

.v2-nav-caret {
    display: inline-block;
    margin-left: 8px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 7px solid var(--v2-orange);
    vertical-align: middle;
}

/* ปุ่มแฮมเบอร์เกอร์ + ลิ้นชักเมนูมือถือ */
.v2-burger {
    display: none;
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    padding: 10px;
    cursor: pointer;
}

.v2-burger span {
    display: block;
    height: 2px;
    background: var(--v2-ink);
    border-radius: 2px;
    transition: transform .25s ease, opacity .2s ease;
}

.v2-burger span + span { margin-top: 6px; }

.v2-burger.is-open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.v2-burger.is-open span:nth-child(2) { opacity: 0; }
.v2-burger.is-open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.v2-drawer {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(88vw, 380px);
    background: #fff;
    z-index: 80;
    transform: translateX(100%);
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
    display: flex;
    flex-direction: column;
    padding: 24px 24px 40px;
    overflow-y: auto;
    /* ห้ามใส่เงาตอนปิด — ลิ้นชักเป็น position:fixed จอดอยู่นอกจอขวา
       body { overflow-x: hidden } ตัดตัวมันได้ก็จริง แต่ "เงา" ยังพาดกลับเข้ามาเป็นแถบดำที่ขอบขวา
       (เห็นชัดตอนเลื่อนหน้า) จึงใส่เงาเฉพาะตอนเปิด + ซ่อนไม่ให้ถูกโฟกัส/อ่านโดยสกรีนรีดเดอร์ */
    visibility: hidden;
    box-shadow: none;
    transition: transform .3s cubic-bezier(.4, 0, .2, 1), visibility 0s linear .3s;
}

.v2-drawer.is-open {
    transform: translateX(0);
    visibility: visible;
    box-shadow: -20px 0 60px rgba(0, 0, 0, .12);
    transition: transform .3s cubic-bezier(.4, 0, .2, 1), visibility 0s;
}

.v2-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.v2-drawer-head img { height: 44px; width: auto; }

.v2-drawer nav {
    display: flex;
    flex-direction: column;
    margin: 16px 0 24px;
}

.v2-drawer nav a {
    padding: 16px 4px;
    font-size: 20px;
    font-weight: 500;
    border-bottom: 1px solid var(--v2-line);
}

.v2-drawer nav a.is-active { color: var(--v2-orange); }

.v2-drawer-btns {
    display: grid;
    gap: 12px;
}

.v2-drawer-btns .v2-btn {
    height: 48px;
    width: 100%;
    font-size: 17px;
}

.v2-drawer-langs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.v2-drawer-langs a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--v2-line);
    border-radius: 100px;
    font-size: 14px;
}

.v2-drawer-langs a.is-active {
    border-color: var(--v2-orange);
    color: var(--v2-orange);
}

.v2-drawer-langs img {
    width: 22px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
}

.v2-scrim {
    position: fixed;
    inset: 0;
    background: rgba(20, 20, 20, .4);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
    z-index: 70;
}

.v2-scrim.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* ---------- ฮีโร่ ---------- */
.v2-hero {
    position: relative;
    background: var(--v2-peach);
    text-align: center;
    padding: 120px 0 96px;
    overflow: hidden;
    /* ความสูงตามสัดส่วนแถบฮีโร่ใน Figma (846/1512 ≈ 56%) รูปลอยถึงวางตรงตำแหน่งเดิมได้ */
    min-height: clamp(560px, 56vw, 846px);
}

.v2-hero h1 {
    font-size: clamp(38px, 6.35vw, 96px);
    line-height: .86;
    font-weight: 500;
    letter-spacing: -.01em;
    /* ห้ามตัดบรรทัด — คำที่พิมพ์สลับต้องอยู่บรรทัดเดียวกับข้อความหน้าเสมอ
       ถ้าจอแคบจน ไม่พอ JS จะย่อขนาดตัวอักษรลงให้พอดีเอง (fitHeroLines) */
    white-space: nowrap;
}

.v2-hero h1 .v2-grad-text { font-weight: 700; }

/* คำที่พิมพ์สลับวน — จองความกว้างเท่าคำที่ยาวสุด (ตั้งค่าจาก JS)
   ข้อความข้างหน้าจะได้ไม่ขยับไปมาตอนเปลี่ยนคำ */
.v2-hero-word-wrap {
    display: inline-block;
    text-align: left;
    white-space: nowrap;
    max-width: 100%;
    vertical-align: baseline;
}

.v2-hero-word {
    display: inline;
}

/* เคอร์เซอร์พิมพ์ดีด — สีเดียวกับตัวหนังสือ (ไม่ใช่ส้ม) และบาง */
.v2-hero-caret {
    display: inline-block;
    width: .028em;
    height: .72em;
    margin-left: .06em;
    background: var(--v2-ink);
    vertical-align: -.03em;
    animation: v2caret 1.06s steps(1) infinite;
}

@keyframes v2caret {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .v2-hero-caret { display: none; }
}

/* จีน/ญี่ปุ่น/เกาหลี ตัวอักษรกว้างกว่าละติน ถ้าใช้ขนาดเดียวกันหัวเรื่องจะตัดบรรทัดกลางคำ */
:where(html[lang="cn"], html[lang="jp"], html[lang="kr"]) .v2-hero h1 {
    font-size: clamp(30px, 4.4vw, 68px);
    line-height: 1.18;
    word-break: keep-all;
}

:where(html[lang="cn"], html[lang="jp"], html[lang="kr"]) .v2-hero-sub {
    word-break: keep-all;
    line-break: strict;
}

.v2-hero h1 span.v2-hero-line {
    display: block;
    margin-top: 15px;
}

.v2-hero-sub {
    /* 776/1512 ≈ 51% ของความกว้างใน Figma — ผูกกับ vw ด้วย ไม่งั้นพอจอแคบข้อความจะไปชนรูปที่ลอยอยู่ */
    max-width: min(776px, 60vw);
    margin: clamp(32px, 5.3vw, 80px) auto 0;
    font-size: clamp(16px, 1.6vw, 24px);
    line-height: 1.7;
    font-weight: 500;
    color: var(--v2-muted);
    letter-spacing: .02em;
}

.v2-hero-sub b {
    color: #404040;
    font-weight: 600;
}

.v2-badge {
    display: inline-flex;
    align-items: center;
    margin-top: 80px;
    padding: 10px 22px;
    background: var(--v2-line);
    border-radius: 130px;
    font-size: clamp(13px, 1.1vw, 16px);
    font-weight: 600;
    color: var(--v2-ink);
}

/* รูปกระดาษพับลอยรอบฮีโร่
   ตำแหน่ง/ขนาดคิดจากพิกัดจริงใน Figma (กรอบ 1512 กว้าง · แถบฮีโร่ y136–982 สูง 846)
   แปลงเป็น % เพื่อให้ย่อ-ขยายตามจอ · ไฟล์ PNG ตัดขอบโปร่งออกแล้วกล่องรูปจะได้ไม่กินทับตัวหนังสือ */
.v2-hero-art {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.v2-hero-art img {
    position: absolute;
    transform: translateY(-50%);
    filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .08));
    animation: v2float 7s ease-in-out infinite;
}

.v2-hero .v2-shell {
    position: relative;
    z-index: 1;
}

/* จุดยึด = จุดกึ่งกลางของกรอบรูปใน Figma (translateY(-50%) กันความสูงรูปที่ไม่เท่ากัน) */

.v2-art-cap {
    left: 3.5%;
    top: 44%;
    width: 13.5%;
    animation-delay: -1.4s;
}

.v2-art-wallet {
    left: 7%;
    top: 74%;
    width: 13%;
    animation-delay: -3.1s;
}

.v2-art-target {
    left: 81%;
    top: 18%;
    width: 13%;
    animation-delay: -.6s;
}

.v2-art-folder {
    left: 79%;
    top: 68%;
    width: 13.5%;
    animation-delay: -4.4s;
}

@keyframes v2float {
    0%, 100% { transform: translateY(-50%); }
    50% { transform: translateY(calc(-50% - 14px)); }
}

@media (prefers-reduced-motion: reduce) {
    .v2-hero-art img { animation: none; }
}

/* ---------- แถบลูกค้า ---------- */
.v2-trusted {
    padding: 24px 0 40px;
    text-align: center;
}

.v2-trusted p {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 16px;
}

.v2-trusted img {
    width: 100%;
    max-width: 874px;
    margin: 0 auto;
}

/* ---------- ปัญหา ---------- */
/* วัดจาก Figma 2026-08-21: แถบนี้เป็นสีขาว ไม่ใช่ครีม (เดิมตั้ง --v2-cream ไว้) */
.v2-problem {
    position: relative;
    background: #fff;
    padding: 64px 0 96px;
    overflow: hidden;
}

.v2-h2 {
    font-size: clamp(26px, 3.2vw, 48px);
    line-height: 1.06;
    font-weight: 600;
    letter-spacing: -.015em;
}

.v2-problem .v2-h2 { max-width: 900px; }

.v2-marquee {
    position: absolute;
    left: 0;
    right: 0;
    top: 42%;
    overflow: hidden;
    pointer-events: none;
    user-select: none;
}

.v2-marquee-track {
    display: flex;
    width: max-content;
    animation: v2marquee 38s linear infinite;
}

.v2-marquee span {
    font-family: 'Albert Sans', 'Poppins', sans-serif;
    font-weight: 900;
    font-size: clamp(80px, 15.3vw, 231px);
    line-height: .64;
    letter-spacing: -.01em;
    color: var(--v2-marquee);
    padding-right: 64px;
    white-space: nowrap;
}

@keyframes v2marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.v2-cards {
    position: relative;
    margin-top: 64px;
    display: grid;
    gap: 48px;
}

.v2-card-outline {
    background: #fff;
    border: 2px dashed var(--v2-orange);
    border-radius: 16px;
    padding: 36px 40px;
}

.v2-card-outline h3 {
    font-size: clamp(24px, 3.2vw, 48px);
    line-height: 1.06;
    font-weight: 600;
    letter-spacing: -.015em;
    color: var(--v2-orange);
    margin-bottom: 8px;
}

.v2-card-outline p {
    font-size: clamp(15px, 1.6vw, 24px);
    line-height: 1.42;
    letter-spacing: -.02em;
}

/* ---------- สามสิ่ง ---------- */
/* ต่อพื้นขาวจาก .v2-problem ให้เป็นผืนเดียวกัน (วัดจาก Figma: #FFFFFF ทั้งสอง section) */
.v2-three {
    position: relative;
    background: #fff;
    padding: 96px 0;
    text-align: center;
    overflow: hidden;
}

.v2-three-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 56px;
}

.v2-three-card {
    padding: 16px 20px 24px;
    text-align: center;
}

.v2-three-card:nth-child(1) { background: var(--v2-people); }
.v2-three-card:nth-child(2) { background: var(--v2-process); }
.v2-three-card:nth-child(3) { background: var(--v2-data); }

.v2-three-card h3 {
    font-size: clamp(26px, 3.2vw, 48px);
    line-height: 1.06;
    font-weight: 600;
    letter-spacing: -.015em;
    margin-bottom: 20px;
}

.v2-three-card p {
    font-size: 16px;
    line-height: 2.1;
    letter-spacing: -.03em;
}

.v2-three-note {
    margin-top: 48px;
    font-size: clamp(16px, 1.4vw, 20px);
    font-weight: 600;
    letter-spacing: -.03em;
}

/* ---------- โซลูชันตามปัญหา ---------- */
.v2-solutions {
    position: relative;
    isolation: isolate;
    padding: 96px 0 80px;
    text-align: center;
    background: var(--v2-peach);
}

/* โดมส้มเข้มหลังเนื้อหา — ในแบบเป็นบล็อกสีส้มที่ขอบล่างโค้งเป็นวงกลมกว้างกว่าหน้าจอ */
.v2-solutions::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0 -15% auto;
    height: 100%;
    background: var(--v2-peach-strong);
    border-radius: 0 0 50% 50%;
}

.v2-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    margin-top: 48px;
}

.v2-chip {
    background: var(--v2-chip);
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 16px;
    line-height: 2;
    letter-spacing: -.06em;
    color: var(--v2-ink);
    cursor: pointer;
    transition: border-color .2s ease, color .2s ease, background-color .2s ease;
}

.v2-chip:hover { border-color: var(--v2-orange); }

.v2-chip.is-active {
    background: #fff;
    border-color: #FF8000;
    color: #FF7F00;
    font-weight: 600;
}

.v2-answer {
    margin-top: 48px;
    background: var(--v2-cream);
    border: 2px dashed var(--v2-orange);
    border-radius: 15px;
    padding: 40px 48px;
    text-align: left;
    color: var(--v2-orange);
    font-size: clamp(16px, 1.6vw, 24px);
    font-weight: 600;
    line-height: 1.34;
    min-height: 184px;
    display: flex;
    align-items: center;
}

/* ---------- ORIGAMI AI ---------- */
.v2-ai {
    padding: 64px 0 0;
    /* วัดจาก Figma: ช่วงหัวเรื่องเป็นส้มอ่อนเรียบ ๆ #FFF4E5 แล้วตัดเป็นขาวทันทีที่แถบวิดีโอ
       (ไม่ใช่ไล่สี — .v2-scrub ทาขาวทับเองอยู่แล้ว) */
    background: var(--v2-peach);
}

.v2-ai .v2-h2 { max-width: 860px; }

.v2-ai-logo {
    width: 493px;
    max-width: 70%;
    margin-top: 30px;
}

/* กรอบตรึงหน้าจอ — ความสูงของ .v2-scrub คือ "ระยะเลื่อน" ที่ใช้ไล่เฟรมวิดีโอ
   🔑 พื้นขาวเต็มแถบ: เวทีวิดีโอกว้างแค่ .v2-shell ถ้าไม่ทาขาวตรงนี้ พื้นส้มของ .v2-ai จะโผล่ที่ขอบซ้าย-ขวา */
.v2-scrub {
    position: relative;
    /* ระยะเลื่อน = 605 เฟรม + การ์ดข้อความ 5 ใบ คิดเป็นหน่วยเฟรมเท่า ๆ กัน
       (ของเดิม 420vh ตอนยังไม่มีการ์ดคั่น) */
    height: 560vh;
    margin-top: 96px;
    background: #fff;
}

/* ตรึงไว้ใต้ header พอดี ไม่งั้นหัวกรอบจะถูก header บัง */
.v2-scrub-sticky {
    position: sticky;
    top: var(--v2-header-h);
    height: calc(100svh - var(--v2-header-h));
    display: flex;
    align-items: center;
}

.v2-scrub-sticky > .v2-shell { width: 100%; }

.v2-ai-panel {
    /* ขนาดเวทีวิดีโอ คิดครั้งเดียวที่นี่ แล้วให้กรอบข้างในอิงค่าเดียวกัน
       จะได้ไม่มีพื้นที่ว่างเหลือรอบ ๆ เยอะเกินไปบนจอใหญ่ */
    --v2-stage: min(1100px, 86vw, calc(100svh - var(--v2-header-h) - 56px));
}

/* แบบใหม่: ไม่มีกรอบเส้นประและกล่องขาวครอบอีกแล้ว เหลือเฉพาะเวทีวิดีโอล้วน ๆ */
.v2-ai-inner {
    width: min(100%, var(--v2-stage));
    margin: 0 auto;
    display: grid;
    place-items: center;
}

/* เวทีวิดีโอ = สี่เหลี่ยมจัตุรัสเท่าเฟรมคลิป (640x640)
   container-type ทำให้ตัวหนังสือคิดขนาดจากความกว้างของเวที ข้อความเลยอยู่บนแผ่นกระดาษพอดีทุกจอ */
.v2-ai-square {
    position: relative;
    overflow: hidden;
    width: var(--v2-stage, min(1100px, 100%));
    aspect-ratio: 1 / 1;
    background: #fff;
    container-type: inline-size;
    /* Figma "Rectangle 12446" 646x646 — เงาใต้เวทีวิดีโอ */
    box-shadow: 0 4px 50px rgba(0, 0, 0, .15);
}

/* กรอบข้อความทาบตรงแผ่นกระดาษกลางเฟรม (กระดาษกินราว 78% x 83% ของเฟรม)
   มี 5 ใบซ้อนกันอยู่ที่เดิม โผล่ทีละใบคั่นระหว่างท่อนวิดีโอ — JS คุมด้วย opacity
   ปิดจาวาสคริปต์: เห็นใบแรกใบเดียว ไม่ทับกันมั่ว */
.v2-ai-copy {
    position: absolute;
    inset: 16% 14%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3.5cqw;
    z-index: 2;
    opacity: 0;
}

.v2-ai-copy:first-of-type { opacity: 1; }

/* ไล่สีคิดจากกรอบของกล่อง ถ้าปล่อยให้ h3 กว้างเต็มการ์ดจะเห็นแค่ช่วงส้ม-ชมพู ปลายฟ้าหลุดออกนอกตัวอักษร
   บีบให้กว้างเท่าคำจริง สีจึงไล่ครบเหมือนในแบบ */
.v2-ai-copy h3.v2-grad-text { width: fit-content; }

/* การ์ดชื่อโมดูล — จัดกลางทั้งแนวตั้งแนวนอน สัดส่วนวัดจากภาพที่ทีมออกแบบส่งมา
   (ตัวย่อสูงราว 7.4% ของการ์ด · คำอธิบาย 2 บรรทัดกว้างราว 37%) */
.v2-ai-copy-mod {
    inset: 0;
    align-items: center;
    text-align: center;
    gap: 5.5cqw;
}

.v2-ai-copy-mod h3 {
    font-size: 10.5cqw;
    line-height: 1;
    font-weight: 700;
    letter-spacing: -.005em;
}

.v2-ai-copy-mod p {
    font-size: 3.8cqw;
    line-height: 1.35;
    letter-spacing: 0;
    max-width: 64%;
    color: var(--v2-ink);
}

.v2-ai-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 1;
    background: #fff;
}

/* cqw = % ของความกว้างเวที ตัวหนังสือจึงโตพร้อมแผ่นกระดาษเสมอ ไม่ล้นกรอบ */
.v2-ai-square h3 {
    font-size: 8cqw;
    line-height: 1.05;
    font-weight: 600;
    letter-spacing: -.015em;
}

.v2-ai-square p {
    font-size: 2.9cqw;
    line-height: 1.42;
    letter-spacing: -.02em;
}

/* ---------- ตัวเลขผลลัพธ์ ---------- */
.v2-stats {
    background: var(--v2-cream);
    padding: 108px 0 0;
}

.v2-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, auto);
    justify-content: space-between;
    gap: 40px 86px;
}

.v2-stat-num {
    display: flex;
    align-items: flex-start;
    font-family: 'Albert Sans', 'Poppins', sans-serif;
    font-weight: 700;
    color: var(--v2-orange);
    line-height: .8;
    font-size: clamp(56px, 6.6vw, 100px);
}

.v2-stat-num em {
    font-style: normal;
    background: linear-gradient(var(--v2-mark), var(--v2-mark)) no-repeat;
    background-size: 100% 86%;
    background-position: 0 0;
    padding: 0 .04em;
}

.v2-stat-num sup {
    font-size: .5em;
    line-height: 1.6;
    top: 0;
}

.v2-stat-label {
    margin-top: 15px;
    font-size: 16px;
    color: var(--v2-ink);
}

/* ---------- ชวนคุย ---------- */
.v2-cta {
    background: var(--v2-cream);
    padding: 104px 0 96px;
}

.v2-cta-box {
    background: var(--v2-cream);
    border: 2px dashed var(--v2-orange);
    border-radius: 15px;
    padding: 33px 24px;
    text-align: center;
}

.v2-cta-box h2 {
    font-size: clamp(26px, 3.2vw, 48px);
    line-height: 1.25;
    font-weight: 600;
    letter-spacing: -.015em;
}

.v2-cta-btns {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 28px;
}

/* ---------- ท้ายหน้า ---------- */
.v2-footer {
    background: #fff;
    border-top: 4px solid transparent;
    border-image: var(--v2-grad) 1;
    padding: 68px 0 40px;
}

.v2-footer-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr .9fr .9fr 1.05fr;
    gap: 40px 16px;
}

.v2-footer-brand img {
    width: 179px;
    height: auto;
    margin-bottom: 36px;
}

.v2-footer-line {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
    font-size: 16px;
}

.v2-footer-line svg {
    flex: 0 0 24px;
    margin-top: 2px;
}

.v2-footer h4 {
    font-size: 24px;
    font-weight: 500;
    margin: 0 0 20px;
}

.v2-footer ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.v2-footer li { margin-bottom: 18px; }

.v2-footer li a {
    font-size: 16px;
    color: var(--v2-ink);
    transition: color .2s ease;
}

.v2-footer li a:hover { color: var(--v2-orange); }

.v2-footer-col-gap { margin-top: 64px; }

.v2-footer-social {
    display: flex;
    gap: 16px;
    margin: 24px 0;
}

.v2-footer-social a {
    width: 16px;
    height: 16px;
    color: var(--v2-gray);
}

.v2-footer-social svg { width: 16px; height: 16px; }

.v2-footer-map {
    width: 100%;
    max-width: 326px;
    border-radius: 6px;
    overflow: hidden;
}

.v2-footer-bottom {
    margin-top: 48px;
    font-size: 16px;
    line-height: 1.9;
}

/* ---------- จอเล็ก ---------- */
@media (max-width: 1200px) {
    .v2-nav { gap: 44px; }
    .v2-header-top { padding: 11px 24px 0; }
    .v2-nav { padding: 10px 24px; }
}

@media (max-width: 1024px) {
    :root {
        --v2-pad: 24px;
        --v2-header-h: 72px;
    }

    .v2-nav,
    .v2-header-btns { display: none; }

    .v2-burger { display: block; }

    .v2-header-top {
        padding: 10px 16px;
        height: 72px;
    }

    .v2-logo img { height: 44px; }

    .v2-hero { padding: 64px 0 56px; }

    .v2-hero-sub {
        margin-top: 40px;
        max-width: 74%;
    }

    .v2-badge { margin-top: 44px; }

    /* จอกลาง: ดันรูปออกริมมากขึ้นกันทับหัวเรื่อง */
    .v2-art-cap { left: -2%; top: 46%; width: 15%; }
    .v2-art-wallet { left: 2%; top: 82%; width: 14%; }
    .v2-art-target { left: 86%; top: 14%; width: 14%; }
    .v2-art-folder { left: 84%; top: 74%; width: 15%; }

    .v2-three-grid { grid-template-columns: 1fr; }

    .v2-footer-grid { grid-template-columns: 1fr 1fr 1fr; }

    .v2-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }

    .v2-ai-inner { padding: 40px 20px; }

    .v2-problem { padding: 56px 0 72px; }

    .v2-three,
    .v2-solutions { padding: 64px 0; }

    .v2-stats { padding: 72px 0 0; }

    .v2-cta { padding: 64px 0 72px; }
}

@media (max-width: 768px) {
    .v2-hero {
        padding: 48px 0 40px;
        text-align: center;
    }

    /* บนมือถือรูปพับลอยอยู่หลังตัวหนังสือ ให้จางลง + หลบออกริมจอ */
    .v2-hero-art img {
        opacity: .45;
        filter: none;
        width: 24%;
    }

    .v2-art-cap { left: -5%; top: 20%; }
    .v2-art-wallet { left: -4%; top: 84%; }
    .v2-art-target { left: 82%; top: 12%; }
    .v2-art-folder { left: 84%; top: 80%; }

    .v2-hero h1 span.v2-hero-line { margin-top: 6px; }

    .v2-hero-sub { max-width: 90%; }

    .v2-card-outline { padding: 24px 20px; }

    .v2-cards { gap: 24px; margin-top: 40px; }

    .v2-chips { gap: 12px; }

    .v2-chip {
        font-size: 14px;
        line-height: 1.6;
        padding: 8px 12px;
    }

    .v2-answer {
        padding: 24px 20px;
        min-height: 0;
        line-height: 1.5;
    }

    .v2-ai-panel { padding: 12px; }

    .v2-scrub { height: 430vh; }

    .v2-ai-square {
        width: min(100%, 62vh);
        box-shadow: 0 10px 30px rgba(0, 0, 0, .08);
    }

    .v2-ai-copy {
        padding: 0 24px;
        gap: 14px;
    }

    .v2-footer-grid { grid-template-columns: 1fr 1fr; }

    .v2-footer-col-gap { margin-top: 40px; }

    .v2-footer-bottom { margin-top: 32px; font-size: 14px; }

    .v2-marquee { top: 46%; }

    .v2-cta-btns { flex-direction: column; align-items: stretch; }

    .v2-cta-btns .v2-btn { width: 100%; height: 48px; }
}

@media (max-width: 480px) {
    .v2-stats-grid { grid-template-columns: 1fr; gap: 32px; }

    .v2-footer-grid { grid-template-columns: 1fr; }

    .v2-three-card { padding: 20px 16px; }

    .v2-trusted { padding: 8px 0 32px; }
}


/* ---------- เส้นหยักสีส้มบนพื้นครีม ---------- */
/* ถอดจากดีไซน์: บล็อกครีมคือ 1511 x 1384 พื้น #FFF8F0 มีเส้น Vector สีส้ม "2 เส้น"
   รูปทรงไม่ใช่คลื่นสมมาตร แต่เป็น "โค้งเบา ๆ ช่วงซ้าย แล้วเชิดขึ้นทางขวา"
   เส้นบนพาดใต้หัวเรื่องคำพูด · เส้นล่างลอดใต้การ์ด With ORIGAMI ก่อนถึงหัวข้อ three things
   วาดด้วย SVG ฝังใน background-image เพื่อไม่ต้องเพิ่มไฟล์และไม่แตะโครง HTML */
.v2-problem::before,
.v2-problem::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    pointer-events: none;
    z-index: 0;
}

/* เส้นบน — พิกัดในดีไซน์ y 96 → 296 (สูง 200) */
.v2-problem::before {
    top: 12.3%;
    height: 200px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1512 200' preserveAspectRatio='none'%3E%3Cpath d='M0 190C180 170 400 149 590 155c210 7 400-45 590-95 120-31 240-50 332-59' fill='none' stroke='%23FF8B07' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* เส้นล่าง — พิกัดในดีไซน์ y 632 → 872 (สูง 240) แอ่นลงก่อนแล้วค่อยเชิดขึ้น */
.v2-problem::after {
    bottom: -18px;
    height: 240px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1512 240' preserveAspectRatio='none'%3E%3Cpath d='M0 214c200 14 420 20 700 17 200-3 380-65 540-140 110-51 200-70 272-83' fill='none' stroke='%23FF8B07' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* เนื้อหาต้องอยู่เหนือเส้นเสมอ — การ์ดพื้นขาวจะบังเส้นตรงที่ทับกัน เหมือนในดีไซน์ */
.v2-problem > .v2-shell,
.v2-three > .v2-shell {
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    /* จอแคบเส้นพาดทับตัวหนังสือจนอ่านยาก เหลือไว้เส้นล่างเส้นเดียว */
    .v2-problem::before { display: none; }
    .v2-problem::after { height: 150px; bottom: -10px; }
}

/* ---------- เมนู Product แบบกางลง (เมกะเมนู) ----------
   Figma "Product Dropdown-processing" 1524:6149 · แผงขาว 1231 x 728 วางใต้แถบเมนู
   ⛔ รายการข้างในยังไม่มีหน้าปลายทาง จึงเป็น <span> ไม่ใช่ลิงก์ — กดแล้วไม่ไปไหน */
.v2-nav-mega-toggle {
    background: none;
    border: 0;
    padding: 4px 0;
    cursor: pointer;
    font: inherit;
    color: var(--v2-gray);
    letter-spacing: inherit;
    transition: color .2s ease;
}

.v2-nav-mega-toggle:hover,
.v2-nav-mega-toggle[aria-expanded="true"] { color: var(--v2-orange); }

.v2-nav-mega-toggle.is-active {
    color: var(--v2-orange);
    font-weight: 700;
}

/* ลูกศรหมุนขึ้นตอนเมนูกางอยู่ */
.v2-nav-mega-toggle[aria-expanded="true"] .v2-nav-caret { transform: rotate(180deg); }

.v2-nav-caret { transition: transform .2s ease; }

.v2-mega {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    display: flex;
    justify-content: center;
    padding: 0 var(--v2-pad) 24px;
    z-index: 70;
}

.v2-mega[hidden] { display: none; }

.v2-mega-panel {
    width: 100%;
    max-width: 1231px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 18px 48px rgba(10, 13, 23, .16);
    border: 1px solid rgba(10, 13, 23, .06);
    padding: 32px 40px 40px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 32px;
}

.v2-mega-col {
    display: grid;
    align-content: start;
    gap: 24px;
}

.v2-mega-badge {
    justify-self: start;
    padding: 3px 14px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    color: #fff;
}

.v2-mega-badge-orange { background: var(--v2-orange); }
.v2-mega-badge-magenta { background: #E14BFF; }

.v2-mega-group h3 {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #12141D;
}

.v2-mega-group ul {
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.v2-mega-group li span,
.v2 .v2-mega-group li a {
    font-size: 14px;
    line-height: 1.4;
    color: var(--v2-gray);
    cursor: default;
    text-decoration: none;
}

/* รายการที่มีหน้าปลายทางจริง (ORIGAMI AI, SIP Voice Service) กดได้ */
.v2 .v2-mega-group li a {
    cursor: pointer;
    transition: color .18s ease;
}

.v2 .v2-mega-group li a:hover {
    color: var(--v2-orange);
}

/* หัวเว็บต้องเป็นจุดอ้างอิงของแผง ไม่งั้นแผงจะไปเกาะขอบหน้าจอแทน */
.v2-header { position: sticky; }

@media (max-width: 1024px) {
    .v2-mega-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: calc(100vh - var(--v2-header-h) - 40px);
        overflow-y: auto;
    }
}

@media (max-width: 767px) {
    /* จอแคบใช้ลิ้นชักเมนูอยู่แล้ว ไม่ต้องมีเมกะเมนู */
    .v2-mega { display: none !important; }
}
