/* Phase U2: หน้าแรก + โทนอุ่นทั้งแอป (ตาม design/home-mockup.png ที่อนุมัติ 2026-10-16) */

/* ---------- โทนสีอุ่น (ทับค่าใน style.css / polish.css) ---------- */
:root {
  --bg: #0c0a08; --panel: #14110e; --card: #1c1814; --raised: #26211b;
  --line: #2d2721; --line-soft: #211c17;
  --text: #f6f2ec; --text-2: #b4aa9d; --text-3: #988d80;
  --card-grad: linear-gradient(180deg, #211c17 0%, #1a1612 100%);
  --panel-grad: linear-gradient(180deg, #16120f 0%, #110e0b 100%);
}
body { background: linear-gradient(180deg, #16120e 0, var(--bg) 520px) var(--bg); }   /* ไม่มีหมอกส้ม/ม่วง — เหลืองเก็บไว้ให้ปุ่มหลัก */
* { scrollbar-color: #33291f transparent; }
::-webkit-scrollbar-thumb { background: #33291f; }
.stage.bg-dark { background-color: #1a1612; background-image: radial-gradient(#2b241d 1px, transparent 1px); }
.mk-stage { background: radial-gradient(circle at 50% 35%, #2e241b, #120f0c 70%); }

/* ---------- แถบบน ---------- */
.top { gap: 18px; position: relative; z-index: 20; transition: background-color 0.3s var(--ease), box-shadow 0.3s; }
.logo { text-decoration: none; letter-spacing: 0.02em; }
.ws-wrap { position: relative; }
.ws-btn {
  display: flex; align-items: center; gap: 6px; padding: 7px 15px; border-radius: 99px; font-weight: 600; font-size: 13.5px;
  border: 1px solid rgba(245, 217, 10, 0.35); background: rgba(245, 217, 10, 0.06); color: var(--accent);
  transition: background-color 0.2s var(--ease), box-shadow 0.2s;
}
.ws-btn:hover, .ws-btn.on { background: rgba(245, 217, 10, 0.12); }
.ws-btn .caret { font-size: 10px; transition: transform 0.25s var(--ease); }
.ws-menu {
  position: absolute; top: calc(100% + 8px); left: 0; width: 290px; padding: 6px; border-radius: 14px; z-index: 40;
  background: rgba(28, 23, 18, 0.96); border: 1px solid var(--line); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(14px); animation: pop-in 0.2s var(--ease);
}
.ws-item { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--text);
  transition: background-color 0.15s, transform 0.15s var(--ease); }
.ws-item:hover { background: rgba(255, 255, 255, 0.06); transform: translateX(2px); }
.ws-item b { display: block; font-weight: 600; font-size: 14px; }
.ws-item small { color: var(--text-3); font-size: 12px; }
.ws-item.soon { opacity: 0.55; }
.ws-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: rgba(245, 217, 10, 0.1); color: var(--accent); flex: none; }
.nav-links { display: flex; gap: 24px; }
.nav-links a { color: #e6dfd5; text-decoration: none; font-weight: 600; font-size: 14px; position: relative; padding: 4px 0; transition: color 0.2s; }
.nav-links a:hover { color: #fff; }
.nav-links a.on::after { content: ""; position: absolute; left: 15%; right: 15%; bottom: -6px; height: 2px; border-radius: 2px; background: #fff; }
.round-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: var(--text);
  display: grid; place-items: center; font-size: 15px; transition: transform 0.2s var(--spring), border-color 0.2s, background-color 0.2s; }
.round-btn:hover { transform: translateY(-1px); border-color: #4a4036; background: rgba(255, 255, 255, 0.08); }
.credit { white-space: nowrap; }
.login-btn { padding: 9px 18px; border-radius: 99px; border: 0; background: var(--accent); color: #111; font-weight: 700; font-size: 13.5px;
  box-shadow: 0 6px 22px rgba(245, 217, 10, 0.3); transition: transform 0.2s var(--spring), box-shadow 0.2s; white-space: nowrap; }
.login-btn:hover { transform: translateY(-1px) scale(1.02); box-shadow: 0 10px 30px rgba(245, 217, 10, 0.45); }
.tabs { background: rgba(12, 10, 8, 0.4); }
.tab.on { color: #fff; }

/* หน้าแรก: แถบบนโปร่งลอยทับภาพ แล้วทึบขึ้นเมื่อเลื่อน */
body.on-home .tabs, body.on-home #file-crumb, body.on-home #file-pill { display: none !important; }
body.on-home .top { position: fixed; top: 0; left: 0; right: 0; border-bottom-color: transparent; background: transparent; }
body.on-home.home-scrolled .top { background: rgba(14, 11, 9, 0.82); backdrop-filter: blur(14px); border-bottom-color: var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }

/* ---------- หน้าแรก ---------- */
.home { position: relative; height: 100%; overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth; }

.hero { position: relative; z-index: 3; text-align: center; padding: calc(var(--top-h) + 64px) 24px 36px; }
.hero h1 { margin: 0; font-size: clamp(30px, 4.2vw, 50px); line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
.hero h1 em { font-style: normal; color: var(--accent); white-space: nowrap; }   /* คำไทยไม่ตัดกลางคำ */
.hero-sub { color: var(--text-2); font-size: 18px; margin: 12px 0 28px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes sheen { to { background-position: -200% 0; } }

.hero-box {
  --mx: 50%; --my: 50%;
  position: relative; z-index: 4; width: min(940px, 100%); margin: 0 auto; padding: 18px; border-radius: 28px; text-align: left;
  background: #17130f;
  border: 1px solid rgba(255, 230, 190, 0.1);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.hero-box.dragover, .hero-box:hover { border-color: rgba(245, 217, 10, 0.35); }
.hero-box.ready { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 30px 80px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(245, 217, 10, 0.25); }
.hero-drop { height: 160px; border-radius: 18px; display: grid; place-items: center; text-align: center; cursor: pointer; color: var(--text-2);
  border: 1.5px dashed rgba(255, 230, 190, 0.16); background: rgba(0, 0, 0, 0.14); transition: border-color 0.2s, background-color 0.2s; }
.hero-drop:hover { border-color: rgba(245, 217, 10, 0.4); background: rgba(245, 217, 10, 0.03); }
.hero-empty svg { width: 34px; height: 34px; color: #fff; display: block; margin: 0 auto 8px; transition: transform 0.35s var(--spring); }
.hero-drop:hover .hero-empty svg { transform: translateY(-3px) scale(1.06); }
.hero-empty b, .hero-picked b { display: block; color: #f3eee6; font-weight: 600; margin-bottom: 4px; }
.hero-empty small, .hero-picked small { color: var(--text-3); font-size: 13px; }
.hero-picked { display: flex; align-items: center; gap: 16px; text-align: left; animation: pop-in 0.3s var(--ease); }
.hero-picked img { width: 110px; height: 110px; object-fit: contain; border-radius: 12px; background: repeating-conic-gradient(#2a241e 0 25%, #1f1a15 0 50%) 0 0/16px 16px; }
.hero-row { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.hero-modes { width: auto; border-radius: 99px; background: rgba(0, 0, 0, 0.25); }
.hero-modes button { flex: none; padding: 9px 16px; border-radius: 99px; color: #e9e3da; font-weight: 600; }
.hero-modes .slider-pill { border-radius: 99px; background: rgba(245, 217, 10, 0.13); box-shadow: inset 0 0 0 1px rgba(245, 217, 10, 0.25); }
.hero-modes button.on { color: var(--accent); }
.go-btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 26px; border: 0; border-radius: 99px; background: var(--accent); color: #111;
  font-weight: 800; font-size: 16px; text-decoration: none; box-shadow: 0 8px 28px rgba(245, 217, 10, 0.35);
  transition: transform 0.2s var(--spring), box-shadow 0.25s; }
.go-btn:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 12px 36px rgba(245, 217, 10, 0.5); }
.go-btn:active { transform: scale(0.97); }
.go-btn.small { padding: 9px 18px; font-size: 14px; }
.tip-pop { position: absolute; right: 18px; bottom: 78px; width: 340px; padding: 14px 16px; border-radius: 14px; z-index: 5; font-size: 13px; color: var(--text-2);
  background: rgba(28, 23, 18, 0.97); border: 1px solid var(--line); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5); animation: pop-in 0.2s var(--ease); }
.tip-pop p { margin: 0 0 8px; } .tip-pop p:last-child { margin: 0; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 20px; color: var(--text-3); font-size: 13.5px; }
.hero-facts b { color: var(--text-2); font-weight: 600; }

.home-section { position: relative; padding: 26px 32px 10px; scroll-margin-top: calc(var(--top-h) + 8px); }
.home-section h2 { font-size: 22px; font-weight: 600; margin: 0 0 16px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.steps { gap: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.step { position: relative; padding: 18px 22px 18px 0; }
.step + .step { padding-left: 22px; border-left: 1px solid var(--line); }
.step .num { display: block; color: var(--accent); font-weight: 700; font-size: 13px; letter-spacing: 0.04em; margin-bottom: 6px;
  font-variant-numeric: tabular-nums; }
.step b { display: block; margin-bottom: 4px; }
.step p { margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.55; }

/* ---------- แกลเลอรี ---------- */
.filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 99px; font-size: 13.5px; font-weight: 600; color: #ddd5ca;
  border: 1px solid transparent; background: transparent; transition: background-color 0.2s, border-color 0.2s, color 0.2s; }
.chip:hover { background: rgba(255, 255, 255, 0.05); }
.chip.on { border-color: var(--line); background: rgba(255, 255, 255, 0.08); color: #fff; }
.sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.feature-btn { padding: 9px 16px; border-radius: 99px; background: #fff; color: #111; font-weight: 700; font-size: 13.5px; text-decoration: none;
  transition: transform 0.2s var(--spring); }
.feature-btn:hover { transform: translateY(-1px); }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); grid-auto-rows: 330px; gap: 16px; padding-bottom: 30px; }
.g-card {
  --split: 50%; --gx: 50%; --gy: 50%;
  position: relative; overflow: hidden; border-radius: 18px; padding: 0; text-align: left; color: var(--text); cursor: pointer; text-decoration: none;
  background: linear-gradient(180deg, #2b221b, #17120e); border: 1px solid rgba(255, 230, 190, 0.07); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  transition: transform 0.35s var(--ease), box-shadow 0.35s, border-color 0.3s; animation: rise 0.5s var(--ease) both;
}
.g-card::before { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(260px 200px at var(--gx) var(--gy), rgba(255, 220, 150, 0.12), transparent 70%); }
.g-card:hover { box-shadow: 0 26px 60px rgba(0, 0, 0, 0.5); border-color: rgba(245, 217, 10, 0.25); }
.g-card:hover::before { opacity: 1; }
.g-card[hidden] { display: none; }
.g-card .art { position: absolute; inset: 22px 16px 60px; display: grid; place-items: center; }
.g-card .art img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.45)); transition: transform 0.5s var(--ease); }
.g-card:hover .art img { transform: scale(1.04); }
.g-card.split .art img { position: absolute; inset: 0; width: 100%; height: 100%; }
.g-card.split .after { clip-path: inset(0 0 0 var(--split)); }
.g-card.split .before { clip-path: inset(0 calc(100% - var(--split)) 0 0); }
.split-line { position: absolute; top: 22px; bottom: 60px; left: var(--split); width: 2px; z-index: 2; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.tag2 { position: absolute; top: 14px; left: 14px; z-index: 4; padding: 4px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 700;
  background: rgba(0, 0, 0, 0.55); color: #fff; backdrop-filter: blur(6px); }
.tag2.r { left: auto; right: 14px; color: var(--accent); }
.meta { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; display: flex; align-items: center; gap: 8px; padding: 14px 16px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.8), transparent); font-size: 13px; }
.meta b { font-weight: 600; }
.badge { padding: 3px 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.1); font-size: 11px; color: #e6dfd5; }
.g-card.promo { grid-column: span 2; background: linear-gradient(135deg, #f6f1e7 0%, #e9e1d2 60%, #d8cbb5 100%); color: #1b1712; padding: 28px; display: flex; flex-direction: column; }
.g-card.promo .kicker { align-self: flex-start; background: var(--accent); padding: 3px 10px; border-radius: 6px; font-weight: 800; font-size: 13px; }
.g-card.promo h3 { font-size: clamp(26px, 3vw, 38px); line-height: 1.08; margin: 14px 0 8px; font-weight: 800; max-width: 60%; }
.g-card.promo p { margin: 0; color: #5d5246; font-size: 14px; max-width: 55%; }
.g-card.promo .cta { margin-top: auto; align-self: flex-start; padding: 9px 16px; border-radius: 99px; background: #1b1712; color: var(--accent); font-weight: 700; font-size: 13px;
  box-shadow: 0 8px 22px rgba(109, 76, 255, 0.35); position: relative; z-index: 2; }
.g-card.promo img { position: absolute; right: -24px; bottom: -18px; width: 52%; transform: rotate(-6deg); filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.25));
  transition: transform 0.6s var(--ease); }
.g-card.promo:hover img { transform: rotate(-2deg) scale(1.05); }
.home-foot { padding: 30px 32px 40px; color: var(--text-3); font-size: 12.5px; text-align: center; border-top: 1px solid var(--line-soft); margin-top: 20px; }

/* ---------- หน้าต่างลอย ---------- */
.lightbox { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 24px; background: rgba(6, 5, 4, 0.72);
  backdrop-filter: blur(6px); animation: fade-in 0.2s var(--ease); }
.lb-card { position: relative; width: min(1000px, 100%); border-radius: 22px; overflow: hidden; background: #17120e; border: 1px solid var(--line);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6); animation: pop-in 0.3s var(--ease); }
.lb-close { position: absolute; top: 14px; right: 14px; z-index: 5; }
.lb-stage { --split: 50%; position: relative; user-select: none; -webkit-user-select: none; height: min(68vh, 640px); background: repeating-conic-gradient(#221c16 0 25%, #1b1612 0 50%) 0 0/22px 22px; cursor: ew-resize; touch-action: none; }
.lb-stage img { pointer-events: none; -webkit-user-drag: none; user-select: none; position: absolute; inset: 20px; width: calc(100% - 40px); height: calc(100% - 40px); object-fit: contain; }
.lb-stage #lb-before { clip-path: inset(0 calc(100% - var(--split)) 0 0); }
.lb-stage #lb-after { clip-path: inset(0 0 0 var(--split)); }
.lb-stage.single #lb-before { clip-path: none; }
.lb-stage.single { cursor: default; }
.lb-stage.dragging { cursor: grabbing; }
.lb-stage.dragging .lb-handle span { transform: translate(-50%, -50%) scale(1.15); }
.lb-handle { pointer-events: none; position: absolute; top: 0; bottom: 0; left: var(--split); width: 2px; margin-left: -1px; background: var(--accent); box-shadow: 0 0 14px var(--accent); }
.lb-handle span { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: #111; display: grid; place-items: center; font-weight: 800; }
.lb-meta { display: flex; align-items: center; gap: 14px; padding: 16px 20px; color: var(--text-2); font-size: 13.5px; }
.lb-meta b { color: var(--text); font-size: 15px; }
.soon-card { width: min(420px, 100%); padding: 28px; border-radius: 22px; text-align: center; background: linear-gradient(180deg, #221b15, #15110d);
  border: 1px solid var(--line); box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6); animation: pop-in 0.3s var(--ease); }
.soon-ico { font-size: 34px; }
.soon-card h3 { margin: 10px 0 8px; font-size: 20px; }
.soon-card p { margin: 0 0 18px; color: var(--text-2); line-height: 1.6; font-size: 14px; }

main:not([hidden]).work { animation: view-in 0.35s var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (max-width: 1100px) {
  .nav-links { display: none; }
  .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .top .ws-btn span:first-child { display: none; }
  .top { gap: 8px; padding: 0 10px; }
  .top #settings-btn { display: none !important; }
  .top .brand-lockup { display: none !important; }
  .top .brand-mark { display: inline-flex !important; }
  .round-btn { width: 32px; height: 32px; }
  .login-btn { padding: 8px 12px; font-size: 12.5px; }
  .hero { padding-top: calc(var(--top-h) + 30px); }
  .hero-row { flex-wrap: wrap; }
  .hero-modes { width: 100%; overflow-x: auto; }
  .steps { grid-template-columns: 1fr; }
  .g-card.promo { grid-column: span 1; }
  .home-section { padding: 20px 16px 6px; }
}
@media (prefers-reduced-motion: reduce) { .home { scroll-behavior: auto; } }

/* ---------- ป้ายเครดิต (สไตล์เรา: สายฟ้าเหลือง + จำนวน + ปุ่มเติมสีทอง) ---------- */
.credit-pill {
  display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 4px 0 6px; border-radius: 99px; cursor: pointer;
  background: linear-gradient(180deg, rgba(40, 32, 24, 0.9), rgba(24, 19, 15, 0.9)); border: 1px solid rgba(245, 217, 10, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 4px 14px rgba(0, 0, 0, 0.3);
  transition: border-color 0.2s, box-shadow 0.25s, transform 0.2s var(--spring);
}
.credit-pill:hover { border-color: rgba(245, 217, 10, 0.45); }
.credit-pill[hidden] { display: none; }
.credit-pill .bolt { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #ffe766, #f5c400 60%, #c99700); }
.credit-pill .bolt svg { width: 15px; height: 15px; fill: #2a1d00; }
.credit-pill b { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.credit-pill b.bump { animation: bump 0.5s var(--spring); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.25); color: var(--accent); } 100% { transform: scale(1); } }
.credit-pill small { color: var(--text-3); font-size: 12px; margin-right: 4px; }
.credit-pill .topup {
  display: flex; align-items: center; gap: 5px; height: 30px; padding: 0 12px; border-radius: 99px; border: 0; font-weight: 700; font-size: 12.5px; color: #2a1d00;
  background: linear-gradient(135deg, #fff3b0 0%, #f5d90a 45%, #e0a800 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 2px 8px rgba(245, 180, 0, 0.35);
  transition: transform 0.2s var(--spring), filter 0.2s;
}
.credit-pill .topup:hover { transform: translateY(-1px); filter: brightness(1.06); }
.credit-pill .topup svg { width: 14px; height: 14px; fill: none; stroke: #2a1d00; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 760px) { .credit-pill small, .credit-pill .topup span { display: none; } .credit-pill .topup { padding: 0 8px; } }

/* การ์ดตัวอย่างเมื่อชี้เมาส์ที่โหมด (ภาพก่อน → หลัง กวาดเส้นเทียบวนไปมา) */
.mode-peek { position: absolute; top: calc(100% + 10px); left: 0; width: 280px; padding: 10px 10px 14px; border-radius: 18px; z-index: 6; text-align: left;
  background: rgba(30, 25, 20, 0.96); border: 1px solid rgba(255, 230, 190, 0.12); backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 24px 60px rgba(0, 0, 0, 0.55);
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(0.97); transform-origin: top left; pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.25s var(--ease), left 0.3s var(--ease), visibility 0s 0.2s; }
.mode-peek.show { opacity: 1; visibility: visible; transform: none; transition: opacity 0.2s var(--ease), transform 0.25s var(--ease), left 0.3s var(--ease); }
.peek-stage { position: relative; height: 158px; border-radius: 12px; overflow: hidden; margin-bottom: 11px;
  background: radial-gradient(circle at 50% 40%, #3a3026, #1d1813); }
.mode-peek[data-mode="cutout"] .peek-stage { background: repeating-conic-gradient(#2c251f 0 25%, #1f1a15 0 50%) 0 0/14px 14px; }
.peek-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.mode-peek[data-mode="cutout"] .peek-a, .mode-peek[data-mode="mockup"] .peek-b { object-fit: cover; }
.mode-peek[data-mode="convert"] .peek-stage img { padding: 10px; box-sizing: border-box; }
.mode-peek[data-mode="mockup"] .peek-a { padding: 22px; box-sizing: border-box; }
.peek-b { clip-path: inset(0 0 0 100%); }
.peek-line { position: absolute; top: 0; bottom: 0; left: 100%; width: 2px; margin-left: -1px; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.mode-peek.show .peek-b { animation: peek-clip 3.2s var(--ease) infinite; }
.mode-peek.show .peek-line { animation: peek-line 3.2s var(--ease) infinite; }
@keyframes peek-clip { 0%, 12% { clip-path: inset(0 0 0 100%); } 45%, 80% { clip-path: inset(0 0 0 0); } 100% { clip-path: inset(0 0 0 100%); } }
@keyframes peek-line { 0%, 12% { left: 100%; opacity: 1; } 45% { left: 0%; opacity: 1; } 50%, 80% { left: 0%; opacity: 0; } 81% { left: 100%; opacity: 0; } 100% { left: 100%; opacity: 1; } }
.mode-peek b { display: block; color: #f3eee6; font-weight: 700; font-size: 14.5px; padding: 0 4px; }
.mode-peek p { margin: 4px 0 0; padding: 0 4px; color: var(--text-3); font-size: 12.5px; line-height: 1.5; }
@media (hover: none), (max-width: 720px) { .mode-peek { display: none; } }
@media (prefers-reduced-motion: reduce) { .mode-peek.show .peek-b, .mode-peek.show .peek-line { animation: none; clip-path: inset(0 0 0 50%); left: 50%; } }

/* กันเบราว์เซอร์ลากรูป/เลือกรูปเองตอนเลื่อนเส้นเทียบ */
.g-card, .g-card img { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; }
.community-links { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- แบรนด์ Grazvyn LAB ---------- */
.brand { display: inline-flex; color: #f3eee6; }
.brand svg { display: block; height: 100%; width: auto; }
.brand .tone { color: #8d847a; }
.logo .brand-lockup { height: 30px; transition: filter 0.3s var(--ease), transform 0.3s var(--ease); }
.logo:hover .brand-lockup { transform: translateY(-1px); }
.logo .brand-mark { display: none; height: 26px; }
.auth-logo .brand { height: 28px; color: #17120e; }
.home-foot { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.home-foot .brand-stack { height: 64px; opacity: 0.85; margin-bottom: 6px; }
.home-foot p { margin: 0; }
.home-foot small { color: var(--text-3); opacity: 0.7; }

/* ---------- เมนูหลักแบบ 4 หมวด (ตามโครงที่เจ้าของโปรเจคเลือก 2026-10-17) ---------- */
.ws-menu.mega { width: min(640px, calc(100vw - 32px)); display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; padding: 10px; }
.mega-col { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.mega-label { padding: 10px 12px 4px; font-size: 11px; font-weight: 800; letter-spacing: 0.12em; color: var(--text-3); text-transform: uppercase; }
.mega-label:first-child { padding-top: 4px; }
.ws-menu.mega .ws-item { padding: 7px 10px; gap: 10px; }
.ws-menu.mega .ws-ico { width: 30px; height: 30px; font-size: 14px; }
.ws-menu.mega .ws-item b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) { .ws-menu.mega { grid-template-columns: 1fr; max-height: 75vh; overflow-y: auto; } }
.ws-menu .ws-item.soon { background: none; color: var(--text); padding: 7px 10px; border-radius: 10px; font-size: inherit; font-weight: inherit; box-shadow: none; }
.ws-menu .ws-item.soon:hover { background: rgba(255, 255, 255, 0.04); }

/* ---------- หน้าแรก (ปรับ design 2026-10-19): สองคอลัมน์ ข้อความซ้าย · ภาพเทียบก่อน/หลังขวา ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 48px; align-items: center;
  max-width: 1240px; margin: 0 auto; text-align: left; padding: calc(var(--top-h) + 48px) 32px 40px; }
.hero h1 { font-size: clamp(32px, 3.6vw, 52px); }
.hero-box { width: 100%; }
.hero-compare { --split: 50%; position: relative; margin: 0; aspect-ratio: 1 / 1; max-height: 560px; border-radius: 22px; overflow: hidden;
  background: #f4f1ec; border: 1px solid rgba(255, 230, 190, 0.12); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  cursor: ew-resize; touch-action: pan-y; user-select: none; outline: none; }
.hero-compare:focus-visible { box-shadow: 0 0 0 3px rgba(245, 217, 10, 0.45), 0 24px 60px rgba(0, 0, 0, 0.45); }
.hero-compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.hero-compare .hc-before { clip-path: inset(0 calc(100% - var(--split)) 0 0); background: #f4f1ec; }
.hc-line { position: absolute; top: 0; bottom: 0; left: var(--split); width: 2px; margin-left: -1px; background: var(--accent);
  box-shadow: 0 0 14px rgba(245, 217, 10, 0.6); pointer-events: none; }
.hc-knob { position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: #111; font-size: 16px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s var(--ease); }
.hero-compare.dragging .hc-knob, .hero-compare:hover .hc-knob { transform: scale(1.08); }
.hero-compare figcaption { position: absolute; left: 14px; right: 14px; bottom: 14px; display: flex; justify-content: space-between; gap: 8px; pointer-events: none; }
.hc-tag { padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: #f3eee6; background: rgba(20, 16, 12, 0.82); }
.hc-tag.r { color: #111; background: var(--accent); }
/* การเคลื่อนไหวเดียวของหน้า: เปิดมาเส้นกวาดจากขวาไปกลาง ให้เห็นว่าลากได้ */
.hero-compare.intro { animation: hc-sweep 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both; }
@property --split { syntax: "<percentage>"; inherits: true; initial-value: 50%; }
@keyframes hc-sweep { from { --split: 88%; } to { --split: 50%; } }
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding: calc(var(--top-h) + 28px) 16px 28px; }
  .hero-compare { width: min(520px, 100%); margin: 0 auto; }
}
@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr 1fr; }
  .step:nth-child(3) { padding-left: 0; border-left: 0; }
  .step:nth-child(n + 3) { border-top: 1px solid var(--line); }
}

/* ---------- จอแคบ / มือถือ (ปรับ design รอบ 2) ---------- */
.mega-nav { display: none; }
.ws-burger { display: none; }
@media (max-width: 1100px) {
  /* ลิงก์หน้าแรก/ผลงาน/วิธีใช้/คอมมูนิตี้ ถูกซ่อนจากแถบบน → อยู่บนสุดของเมนูแทน */
  .mega-nav { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 4px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
  .mega-nav a { padding: 8px 14px; border-radius: 999px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px;
    background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
  .mega-nav a:hover { border-color: rgba(245, 217, 10, 0.4); }
  /* ขั้นตอน 4 ข้อ: 2 คอลัมน์ */
  .steps { grid-template-columns: 1fr 1fr; }
  .step, .step + .step { padding: 16px 18px 16px 0; border-left: 0; }
  .step:nth-child(even) { padding-left: 18px; border-left: 1px solid var(--line); }
  .step:nth-child(n + 3) { border-top: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .top .ws-btn .caret { display: none; }
  .ws-burger { display: inline-grid; place-items: center; font-size: 20px; line-height: 1; }
  .top .ws-btn { padding: 6px 10px; }
  /* ปุ่มเลือกโหมดบนหน้าแรก: 3 ปุ่มเต็มแถว ไม่ถูกตัด */
  .hero-modes { width: 100%; overflow: visible; }
  .hero-modes button { flex: 1 1 0; padding: 9px 6px; font-size: 13px; white-space: nowrap; }
  .hero-row .spacer { display: none; }
  .hero-row #hero-go { flex: 1; justify-content: center; }
  .hero-sub { font-size: 16px; }
  .steps { grid-template-columns: 1fr; }
  .step, .step + .step, .step:nth-child(even) { padding: 14px 0; border-left: 0; }
  .step + .step { border-top: 1px solid var(--line); }
}
@media (max-width: 760px) {
  /* เมนูมือถือ: เต็มความกว้างจอ เว้นขอบเท่ากัน ไม่ล้นขวา */
  .ws-menu.mega { position: fixed; left: 8px; right: 8px; top: calc(var(--top-h) + 4px); width: auto; max-height: calc(100vh - var(--top-h) - 16px); overflow-y: auto; }
}
