:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-raised: #f0efec;
  --ink: #202124;
  --muted: #686b70;
  --line: rgba(32, 33, 36, .14);
  --coffee: #9b6243;
  --coffee-dark: #75452f;
  --coffee-on: #fff;
  --panel-bg: rgba(255, 255, 255, .88);
  --radius: 16px;
  --content: 1120px;
  --font: "Prompt", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0b0b0c;
  --surface: #151619;
  --surface-raised: #202226;
  --ink: #f5f5f7;
  --muted: #a1a1a6;
  --line: rgba(255, 255, 255, .14);
  --coffee: #c79b7f;
  --coffee-dark: #8d5b45;
  --coffee-on: #191310;
  --panel-bg: rgba(15, 16, 18, .84);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  transition: background-color .25s ease, color .25s ease;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--coffee); outline-offset: 4px; }


.stage { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
#scene { width: 100%; height: 100%; display: block; }
.loader { position: absolute; inset: 0; display: grid; place-items: center; transition: opacity .35s ease; }
.loader span { width: 28px; height: 28px; border: 2px solid var(--line); border-top-color: var(--coffee); border-radius: 50%; animation: spin 1s linear infinite; }
.loader.is-done { opacity: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

main { position: relative; z-index: 1; }
.panel {
  width: min(var(--content), 100%);
  min-height: 80vh; /* ระยะห่างระหว่างกลุ่มข้อความ (เดิม 118vh ห่างเกินไป) */
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
}
.panel--hero { min-height: 100svh; padding-top: 76px; padding-bottom: 28px; flex-direction: column; justify-content: space-between; text-align: center; }
.panel--left { justify-content: flex-start; }
.panel--right { justify-content: flex-end; }
.panel--top { align-items: flex-start; justify-content: center; padding-top: 15vh; }
.panel--bottom { min-height: 85svh; align-items: flex-end; justify-content: center; padding-bottom: 10vh; }
.copy { width: min(430px, 100%); }
.copy--center { width: min(680px, 100%); text-align: center; }
.eyebrow { margin: 0 0 14px; color: var(--coffee); font-size: 14px; font-weight: 500; letter-spacing: 0; }
h1, h2 { margin: 0; font-weight: 600; line-height: 1.16; letter-spacing: -.025em; text-wrap: balance; overflow-wrap: break-word; min-width: 0; }
h1 { font-size: clamp(42px, 7.2vw, 82px); }
h2 { font-size: clamp(34px, 4.6vw, 56px); }
sup { font-size: .48em; }
.copy p, .lead { margin: 18px 0 0; color: var(--muted); font-size: clamp(16px, 1.45vw, 19px); line-height: 1.75; }
.copy p b { color: var(--ink); font-weight: 500; }
.grad { color: var(--coffee); }
.hero__copy { max-width: 700px; padding-top: 7vh; animation: rise .7s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.scroll-hint { display: flex; flex-direction: column; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.scroll-hint span { position: relative; width: 20px; height: 30px; border: 1px solid var(--muted); border-radius: 12px; }
.scroll-hint span::after { content: ""; position: absolute; top: 6px; left: 50%; width: 3px; height: 6px; margin-left: -1.5px; border-radius: 2px; background: var(--coffee); animation: wheel 1.7s infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 35% { opacity: 1; } 100% { opacity: 0; transform: translateY(9px); } }

.specs { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.specs li { padding-top: 13px; border-top: 1px solid var(--line); }
.specs b { display: block; font-size: 34px; font-weight: 500; line-height: 1; }
.specs span { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.cupping { margin-top: 24px; display: grid; gap: 8px; }
.cupping div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.cupping i { display: flex; gap: 5px; }
.cupping .dot { width: 10px; height: 10px; border: 1px solid #777a7e; border-radius: 50%; transition: background-color .2s ease, border-color .2s ease; }
.panel.is-in .cupping .dot.on { background: var(--coffee); border-color: var(--coffee); }
.methods { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.methods li { padding: 7px 12px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font-size: 13px; }
.sizes { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
/* ปุ่มขนาด: กดแล้วซองขนาดนั้นในฉาก 3D สว่างขึ้น (home.js) */
.sizes button { padding: 9px 18px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; transition: border-color .18s ease, background-color .18s ease, color .18s ease; }
.sizes button:hover { border-color: var(--coffee); }
.sizes button[aria-pressed="true"] { border-color: var(--coffee); background: var(--coffee); color: var(--coffee-on); }
.sizes button:focus-visible { outline: 2px solid var(--coffee); outline-offset: 3px; }
.note { font-size: 14px !important; }
.steps { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; }
.steps li { display: flex; gap: 13px; align-items: flex-start; color: var(--muted); font-size: 15px; line-height: 1.65; }
.steps b { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--coffee); font-size: 12px; font-weight: 500; }
.btn { display: inline-block; margin-top: 26px; padding: 11px 20px; border: 1px solid var(--coffee); border-radius: 8px; color: var(--ink); font-size: 15px; transition: background-color .18s ease, color .18s ease; }
.btn:hover { background: var(--coffee); color: var(--coffee-on); }

.solid { position: relative; padding: 96px 24px; background: var(--surface); color: var(--ink); border-top: 1px solid var(--line); }
.solid--alt { background: var(--bg); }
.solid h2 { font-size: clamp(34px, 4.6vw, 56px); }
.solid .eyebrow { color: var(--coffee); }
.gallery { width: min(760px, 100%); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.gallery figure { min-width: 0; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.gallery img { width: 100%; height: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.gallery figcaption { padding: 12px 15px; color: var(--muted); font-size: 13px; }
.contact { text-align: center; background: var(--surface); }
.contact p { color: var(--muted); font-size: 16px; }
.social { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.social__btn { display: inline-flex; align-items: center; gap: 9px; padding: 10px 15px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); font-size: 14px; transition: border-color .18s ease, background-color .18s ease; }
.social__btn:hover { border-color: var(--coffee); background: var(--surface-raised); }
.social__btn svg { width: 19px; height: 19px; flex: none; }
.social__btn--main { border-color: var(--coffee); background: var(--coffee); color: var(--coffee-on); }
.social__btn--main:hover { background: #d3a184; }
.contact .ct { margin-top: 26px; }
.contact__chips { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.contact__chips span { padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font-size: 12px; }
.foot { position: relative; z-index: 1; padding: 22px 16px; border-top: 1px solid var(--line); background: var(--bg); color: var(--muted); text-align: center; font-size: 12px; }

@media (max-width: 760px) {
  .panel { min-height: 72svh; padding: 0 18px 5vh; align-items: flex-end; }
  .panel--hero { min-height: 100svh; padding: 88px 18px 24px; align-items: center; }
  .panel--left, .panel--right { justify-content: center; }
  .panel--top { min-height: 90svh; align-items: flex-start; padding-top: 13vh; } /* เผื่อที่ให้ซอง 3 ใบใต้ปุ่มขนาด */
  .panel--bottom { min-height: 80svh; padding-bottom: 8vh; }
  .copy { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
  .panel--hero .copy, .copy--center { border: 0; background: transparent; backdrop-filter: none; }
  .specs b { font-size: 28px; }
  .cupping { grid-template-columns: 1fr 1fr; gap: 8px 14px; }
  .cupping div { gap: 7px; font-size: 12px; }
  .cupping i { gap: 3px; }
  .cupping .dot { width: 8px; height: 8px; }
  .gallery { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .solid { padding: 68px 18px; }
}
@media (max-width: 400px) {
  .cupping { grid-template-columns: 1fr; }
  .social__btn { padding: 9px 12px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .copy, .hero__copy { opacity: 1; transform: none; }
}

/* เชื่อมกับหน้าอื่นของเว็บ · แถบเมนูบน (nav.css) ลอยทับฉาก 3D แบบเดิม */
body.home .sitenav { position: fixed; top: 0; left: 0; right: 0; }
.scroll-hint__t { margin: 0; }
@media (max-width: 760px) {
  .panel--hero { padding-top: 124px; }
}
