/* ============================== หน้าแรก ============================== */

/* ---------- Preloader ---------- */
.loader { position: fixed; inset: 0; z-index: 200; pointer-events: none; }
.loader__panel { position: absolute; top: 0; bottom: 0; width: 50.5%; background: var(--washi); transition: transform 1.3s var(--ease-io); }
.loader__panel--l { left: 0; box-shadow: inset -1px 0 0 var(--line); }
.loader__panel--r { right: 0; }
.loader__center { position: absolute; inset: 0; display: grid; place-items: center; transition: opacity 0.6s; }
.enso { width: 168px; height: 168px; position: absolute; }
.enso path { fill: none; stroke: var(--sumi); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 520; stroke-dashoffset: 520; animation: enso 1.5s var(--ease) forwards 0.1s; filter: url(#rough); }
@keyframes enso { to { stroke-dashoffset: 0; } }
.loader__seal { --s: 40px; opacity: 0; animation: seal 0.5s var(--ease) forwards 1.1s; }
@keyframes seal { from { opacity: 0; transform: scale(1.6) rotate(-8deg); } to { opacity: 1; transform: none; } }
.loader__count { position: absolute; bottom: 40px; right: var(--gutter); font-size: 12px; letter-spacing: 0.2em; color: var(--ink-mute); }
.loader.is-done .loader__panel--l { transform: translateX(-101%); }
.loader.is-done .loader__panel--r { transform: translateX(101%); }
.loader.is-done .loader__center { opacity: 0; }
.loader.is-gone { display: none; }

/* ---------- เวที 3D (fixed หลังเนื้อหา) ---------- */
.stage3d { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 1; pointer-events: none; transition: opacity 0.6s; }
main { position: relative; }
main > section, .marquee, .site-footer { position: relative; z-index: 2; }
.hero, .story { z-index: 2; background: transparent; }

/* ---------- Hero ---------- */
.hero { min-height: 100svh; display: grid; grid-template-rows: 1fr auto; padding-top: var(--header-h); }
.hero__inner { display: grid; align-items: center; }
.hero__copy { max-width: 640px; padding: 40px 0; }
.hero__eyebrow { margin-bottom: 34px; }
.hero__title { font-size: clamp(42px, 6.4vw, 94px); font-weight: 300; line-height: 1.12; letter-spacing: -0.02em; }
.hero__title em, .sec-title em { font-style: normal; color: var(--kraft-deep); }
.hero__lead { margin-top: 30px; max-width: 46ch; font-size: clamp(15.5px, 1.25vw, 18px); color: var(--ink-soft); line-height: 1.85; }
.hero__cta { margin-top: 42px; display: flex; flex-wrap: wrap; gap: 14px; }
.hero__vert {
  position: absolute; right: calc(var(--gutter) * 0.6); top: 50%; transform: translateY(-46%);
  writing-mode: vertical-rl; font-size: clamp(54px, 7vw, 110px); line-height: 1; letter-spacing: 0.2em; color: rgba(25, 24, 21, 0.08);
  display: flex; gap: 22px; align-items: center; user-select: none; z-index: -1;
}
.hero__vert span { font-size: 0.17em; letter-spacing: 0.6em; color: var(--ink-mute); }
.hero__meta { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-bottom: 28px; }
.hero__badges { display: flex; flex-wrap: wrap; gap: 8px 26px; margin: 0; padding: 0; list-style: none; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-mute); }
.hero__badges li::before { content: '◦'; margin-right: 8px; color: var(--shu); }
.scroll-cue { display: flex; align-items: center; gap: 14px; font-size: 10.5px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--ink-mute); }
.scroll-cue i { width: 1px; height: 54px; background: var(--line); position: relative; overflow: hidden; }
.scroll-cue i::after { content: ''; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: var(--sumi); animation: cue 2s var(--ease-io) infinite; }
@keyframes cue { to { top: 100%; } }
.hero__fallback { position: absolute; right: 0; top: 18%; width: 46%; max-width: 640px; filter: sepia(0.25) saturate(0.85); border-radius: 2px; }
.no-webgl .hero__fallback { display: block; }
@media (max-width: 900px) {
  .hero { min-height: 100svh; }
  .hero__inner { align-items: start; }
  .hero__copy { padding-top: 7vh; }
  .hero__vert { display: none; }
  .hero__fallback { position: static; width: 100%; margin-bottom: 20px; }
  .scroll-cue { display: none; }
}

/* ---------- Marquee ---------- */
.marquee { background: var(--sumi); color: var(--kraft-light); overflow: hidden; padding: 22px 0; border-block: 1px solid var(--sumi-3); }
.marquee__track { display: flex; gap: 56px; width: max-content; font-family: var(--font-display); font-size: clamp(22px, 2.6vw, 36px); font-weight: 300; white-space: nowrap; will-change: transform; }
.marquee__track span { display: inline-flex; align-items: center; gap: 56px; }
.marquee__track span::after { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--shu); }
.marquee__track .mono { font-family: var(--font-mono); font-size: 0.55em; letter-spacing: 0.25em; }

/* ---------- Story ---------- */
.story__step { min-height: 110vh; display: flex; align-items: center; }
.story__card {
  position: relative; max-width: 520px; padding: 44px 44px 40px;
  background: rgba(250, 247, 241, 0.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 3px;
}
.story__card--right { margin-left: auto; }
.story__card h2 { font-size: clamp(30px, 3.4vw, 46px); font-weight: 300; margin: 18px 0 16px; }
.story__card p { color: var(--ink-soft); }
.story__stat { color: var(--shu); font-weight: 400; }
.story__kanji { position: absolute; top: -34px; right: 30px; font-size: 76px; line-height: 1; color: var(--sumi); }
@media (max-width: 900px) {
  .story__step { min-height: 100vh; align-items: flex-end; padding-bottom: 12vh; }
  .story__card { padding: 30px 26px; }
  .story__card--right { margin-left: 0; }
}

/* ---------- หัวข้อ section ---------- */
.sec-head { display: grid; gap: 18px; margin-bottom: clamp(44px, 6vw, 80px); max-width: 760px; }
.sec-head--row { max-width: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.sec-head--row > div { display: grid; gap: 18px; }
.sec-title { font-size: clamp(36px, 5vw, 72px); font-weight: 300; letter-spacing: -0.02em; line-height: 1.15; }
.sec-lead { color: var(--ink-soft); max-width: 52ch; font-size: 16.5px; }
.sec-head--inv .sec-lead { color: rgba(242, 237, 227, 0.65); }
.sec-head--inv .sec-title em { color: var(--kraft-light); }

/* ---------- Collection ---------- */
.collection { background: var(--sumi); color: var(--washi); padding: clamp(100px, 13vw, 180px) 0; }
.collection .eyebrow { color: rgba(242, 237, 227, 0.5); }
.sizes { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line-inv); }
.size-card { position: relative; padding: 44px 36px 40px; border-right: 1px solid var(--line-inv); display: grid; gap: 26px; overflow: hidden; transition: background-color 0.6s var(--ease); }
.size-card:last-child { border-right: 0; }
.size-card:hover { background: var(--sumi-2); }
.size-card__kanji { position: absolute; right: -10px; top: -30px; font-size: 220px; line-height: 1; color: transparent; -webkit-text-stroke: 1px rgba(242, 237, 227, 0.09); transition: transform 1s var(--ease), -webkit-text-stroke-color 0.6s; pointer-events: none; }
.size-card:hover .size-card__kanji { transform: translateY(14px) rotate(-3deg); -webkit-text-stroke-color: rgba(216, 192, 157, 0.3); }
.size-card__no { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.22em; color: rgba(242, 237, 227, 0.45); }
.size-card__size { font-family: var(--font-display); font-size: clamp(64px, 7.4vw, 112px); font-weight: 200; line-height: 0.95; letter-spacing: -0.03em; }
.size-card__size small { font-size: 0.32em; letter-spacing: 0; margin-left: 6px; color: var(--kraft-light); }
.size-card__desc { color: rgba(242, 237, 227, 0.7); font-size: 15px; min-height: 3.4em; }
.xsec { width: 132px; height: 132px; }
.xsec circle { fill: none; transition: r 0.8s var(--ease); }
.size-card__specs { display: grid; grid-template-columns: auto 1fr; gap: 8px 22px; margin: 0; font-size: 13.5px; }
.size-card__specs dt { color: rgba(242, 237, 227, 0.45); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; padding-top: 3px; }
.size-card__specs dd { margin: 0; }
.size-card__foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-top: 22px; border-top: 1px solid var(--line-inv); }
.size-card__price { font-size: 13px; color: rgba(242, 237, 227, 0.55); }
.size-card__price b { display: block; font-family: var(--font-display); font-weight: 300; font-size: 30px; color: var(--washi); }
@media (max-width: 960px) {
  .sizes { grid-template-columns: 1fr; }
  .size-card { border-right: 0; border-bottom: 1px solid var(--line-inv); }
}

/* ---------- Configurator (สไตล์อยู่ใน configurator.css) ---------- */
.configure { background: var(--washi); padding: clamp(100px, 13vw, 180px) 0; }

/* ---------- Pricing ---------- */
.pricing { background: var(--paper); padding: clamp(100px, 13vw, 170px) 0; border-top: 1px solid var(--line); }
.ptable-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 3px; background: var(--paper); -webkit-overflow-scrolling: touch; }
.ptable { width: 100%; border-collapse: collapse; min-width: 880px; font-size: 14px; }
.ptable th, .ptable td { padding: 15px 12px; text-align: right; border-bottom: 1px solid var(--line); transition: background-color 0.25s; white-space: nowrap; }
.ptable thead th { font-family: var(--font-mono); font-weight: 400; font-size: 11px; letter-spacing: 0.06em; color: var(--ink-mute); background: var(--washi); position: sticky; top: 0; }
.ptable thead th small { display: block; font-size: 9.5px; opacity: 0.7; }
.ptable tbody th { text-align: left; font-family: var(--font-mono); font-weight: 500; font-size: 13px; position: sticky; left: 0; background: var(--paper); z-index: 1; box-shadow: 1px 0 0 var(--line); }
.ptable thead th:first-child { left: 0; z-index: 2; text-align: left; box-shadow: 1px 0 0 var(--line); }
.ptable td { font-family: var(--font-mono); font-feature-settings: 'tnum' 1; }
.ptable tbody tr:last-child > * { border-bottom: 0; }
.ptable .is-row, .ptable .is-col { background: rgba(184, 148, 107, 0.09); }
.ptable td.is-cell { background: var(--sumi); color: var(--washi); }
.ptable td.is-best { color: var(--shu); }
.pnotes { margin: 26px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 14px; color: var(--ink-soft); }
.pnotes li::before { content: '— '; color: var(--shu); }

/* ---------- Gallery ---------- */
.gallery { background: var(--washi); padding: clamp(100px, 13vw, 170px) 0 clamp(80px, 10vw, 130px); overflow: hidden; }
.gallery__track { display: flex; gap: clamp(16px, 2vw, 28px); padding: 0 var(--gutter); overflow-x: auto; scrollbar-width: none; cursor: grab; user-select: none; scroll-snap-type: x proximity; }
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__track.is-drag { cursor: grabbing; scroll-snap-type: none; }
.gcard { flex: none; width: clamp(280px, 34vw, 520px); margin: 0; scroll-snap-align: start; }
.gcard--tall { width: clamp(260px, 28vw, 430px); }
.gcard img { width: 100%; aspect-ratio: 4 / 3.2; object-fit: cover; filter: grayscale(0.85) sepia(0.25) contrast(1.02); transition: filter 1s var(--ease), transform 1.2s var(--ease); border-radius: 2px; pointer-events: none; }
.gcard--tall img { aspect-ratio: 3 / 3.7; }
.gcard:hover img { filter: none; transform: scale(1.015); }
.gcard figcaption { margin-top: 14px; font-size: 14px; color: var(--ink-soft); display: flex; gap: 12px; }
.gcard figcaption .mono { color: var(--shu); font-size: 11px; padding-top: 3px; }
.lightbox { position: fixed; inset: 0; z-index: 120; background: rgba(25, 24, 21, 0.92); display: grid; place-items: center; padding: 24px; opacity: 0; visibility: hidden; transition: opacity 0.5s, visibility 0.5s; }
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox img { max-width: min(1100px, 100%); max-height: 88vh; object-fit: contain; transform: scale(0.96); transition: transform 0.7s var(--ease); }
.lightbox.is-open img { transform: none; }
.lightbox .icon-btn { position: absolute; top: 16px; right: 16px; color: var(--washi); }

/* ---------- Why ---------- */
.why { background: var(--washi); padding: clamp(60px, 8vw, 110px) 0 clamp(100px, 13vw, 170px); }
.why__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.why__list li { padding: 40px 36px 44px 0; border-bottom: 1px solid var(--line); display: grid; gap: 14px; align-content: start; }
.why__list li:not(:nth-child(3n + 1)) { padding-left: 36px; border-left: 1px solid var(--line); }
.why__list .jp { font-size: 40px; line-height: 1; color: var(--kraft-deep); }
.why__list h3 { font-size: 22px; font-weight: 400; }
.why__list p { color: var(--ink-soft); font-size: 15px; }
@media (max-width: 900px) {
  .why__list { grid-template-columns: 1fr; }
  .why__list li, .why__list li:not(:nth-child(3n + 1)) { padding: 30px 0; border-left: 0; }
}

/* ---------- FAQ ---------- */
.faq { background: var(--paper); padding: clamp(100px, 13vw, 170px) 0; border-top: 1px solid var(--line); }
.faq__grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.faq__grid .sec-head { position: sticky; top: calc(var(--header-h) + 40px); margin: 0; }
.faq__list details { border-bottom: 1px solid var(--line); }
.faq__list details:first-child { border-top: 1px solid var(--line); }
.faq__list summary { list-style: none; cursor: pointer; padding: 26px 48px 26px 0; position: relative; font-family: var(--font-display); font-size: clamp(18px, 1.7vw, 22px); }
.faq__list summary::-webkit-details-marker { display: none; }
.faq__list summary::before, .faq__list summary::after { content: ''; position: absolute; right: 8px; top: 50%; width: 16px; height: 1px; background: var(--ink); transition: transform 0.5s var(--ease); }
.faq__list summary::after { transform: rotate(90deg); }
.faq__list details[open] summary::after { transform: rotate(0); }
.faq__list details p { padding: 0 48px 28px 0; color: var(--ink-soft); }
@media (max-width: 900px) { .faq__grid { grid-template-columns: 1fr; } .faq__grid .sec-head { position: static; } }

/* ---------- CTA ---------- */
.cta { background: var(--sumi); color: var(--washi); padding: clamp(110px, 14vw, 190px) 0 clamp(40px, 6vw, 60px); text-align: center; overflow: hidden; }
.cta__inner { display: grid; justify-items: center; gap: 26px; }
.cta .sec-title em { color: var(--kraft-light); }
.cta .sec-lead { color: rgba(242, 237, 227, 0.65); margin: 0 auto; }
.cta .hero__cta { justify-content: center; margin-top: 10px; }
.cta__ghost { --fg: var(--washi); box-shadow: inset 0 0 0 1px rgba(242, 237, 227, 0.3); }
.cta__ghost::before { background: var(--washi); }
.cta__ghost:hover { color: var(--sumi); }
.cta__seal { transform: rotate(-6deg); }
.home .site-footer { padding-top: 40px; }
