/* Shared scroll effects. Themeable: --fx-bg, --fx-ink, --fx-ink-2, --fx-accent, --fx-card, --fx-display */
.fxs, .fxw, .fxk { --fx-bg: #f8f3ea; --fx-ink: #1d2f2f; --fx-ink-2: #55625f; --fx-accent: #e8664a; --fx-card: #fffdf8; --fx-display: inherit; }

/* 1. scatter → zoom */
.fxs { background: var(--fx-bg); color: var(--fx-ink); position: relative; }
.fxs-pin { position: relative; height: 100vh; overflow: hidden; }
.fxs-card { position: absolute; margin: 0; z-index: 2; transform: rotate(var(--r)); will-change: transform, opacity; }
.fxs-card > div { border-radius: 16px; overflow: hidden; box-shadow: 0 24px 50px -24px rgba(20, 30, 30, .45); transition: translate .8s cubic-bezier(.22, 1, .36, 1); animation: fxFloat 7s ease-in-out infinite alternate; animation-delay: var(--fd); }
.fxs-card img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
@keyframes fxFloat { to { transform: translateY(-12px) rotate(1.2deg); } }
.fxs-title { position: absolute; z-index: 3; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(720px, 86vw); text-align: center; }
.fxs-kicker { display: inline-flex; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--fx-accent); }
html[lang=th] .fxs-kicker { text-transform: none; letter-spacing: 0; font-size: 14px; }
.fxs-kicker::before, .fxs-kicker::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.fxs-title h2 { margin: 16px 0 28px; font-family: var(--fx-display); font-size: clamp(38px, 5.4vw, 84px); line-height: 1.12; font-weight: 500; letter-spacing: -.02em; color: var(--fx-ink); }
html[lang=th] .fxs-title h2 { line-height: 1.32; letter-spacing: 0; }
.fxs-cta { display: inline-flex; align-items: center; gap: 10px; height: 50px; padding: 0 26px; border-radius: 999px; background: var(--fx-accent); color: #fff; text-decoration: none; font-weight: 600; font-size: 14px; transition: transform .35s cubic-bezier(.34, 1.56, .64, 1); }
.fxs-cta:hover { transform: translateY(-3px); }
.fxs-zoom { position: absolute; z-index: 1; left: 50%; top: calc(50% + 32px); transform: translate(-50%, -50%); width: 20vw; height: 28vh; margin: 0; overflow: hidden; border-radius: 24px; opacity: 0; background: #1d2f2f; box-shadow: 0 40px 90px -40px rgba(20, 30, 30, .6); }
.fxs-slide { position: absolute; inset: 0; overflow: hidden; }
.fxs-slide.z1, .fxs-slide.z2 { clip-path: inset(100% 0 0 0); }
.fxs-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(1.05) contrast(1.03); }
.fxs-zoom::after { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(90deg, rgba(10, 20, 20, .55) 0%, rgba(10, 20, 20, .18) 42%, transparent 65%), linear-gradient(0deg, rgba(10, 20, 20, .35), transparent 35%); }
.fxs-cap { position: absolute; z-index: 2; left: clamp(28px, 5vw, 80px); bottom: clamp(36px, 7vh, 80px); max-width: min(560px, 60%); display: grid; gap: 10px; color: #fff; opacity: 0; }
.fxs-cap .n { font-size: 12px; font-weight: 600; letter-spacing: .2em; opacity: .8; }
.fxs-cap b { font-family: var(--fx-display); font-size: clamp(40px, 5vw, 78px); line-height: 1.05; font-weight: 500; letter-spacing: -.01em; }
.fxs-cap > span:last-child { font-size: clamp(16px, 1.4vw, 20px); line-height: 1.6; opacity: .92; }
html[lang=th] .fxs-cap > span:last-child { line-height: 1.75; }
.fxs-dots { position: absolute; z-index: 2; right: clamp(24px, 4vw, 56px); bottom: clamp(36px, 7vh, 80px); display: flex; gap: 8px; align-items: center; }
.fxs-dots i { display: block; width: 8px; height: 8px; border-radius: 4px; background: #fff; opacity: .5; }
.fxs.static .fxs-zoom { display: none; }
@media (max-width: 760px) {
  .fxs.static .fxs-pin { height: auto; padding: 96px 16px 40px; display: grid; gap: 18px; }
  .fxs.static .fxs-card { display: none; }
  .fxs.static .fxs-title { position: static; transform: none; width: auto; }
  .fxs.static .fxs-zoom { position: relative; left: auto; top: auto; transform: none; width: 100%; height: 62vh; opacity: 1; border-radius: 20px; }
  .fxs.static .fxs-slide.z1, .fxs.static .fxs-slide.z2, .fxs.static .fxs-cap.z1, .fxs.static .fxs-cap.z2, .fxs.static .fxs-dots { display: none; }
  .fxs.static .fxs-cap.z0 { opacity: 1; left: 20px; bottom: 22px; max-width: calc(100% - 40px); }
  .fxs-cap b { font-size: 36px; }
}
@media (prefers-reduced-motion: reduce) { .fxs-card > div { animation: none; } }

/* 2. words colour in */
.fxw { background: var(--fx-bg); color: var(--fx-ink); padding: clamp(100px, 14vw, 200px) var(--gutter, 24px); text-align: center; }
.fxw p { margin: 0 auto; max-width: 22em; font-family: var(--fx-display); font-size: clamp(26px, 3.4vw, 50px); line-height: 1.38; font-weight: 400; }
html[lang=th] .fxw p { line-height: 1.6; max-width: 20em; }
.fxw .fw { transition: opacity .2s; }
.fxw.static .fw { opacity: 1 !important; }

/* 3. stacked product cards */
.fxk { background: var(--fx-bg); color: var(--fx-ink); padding: clamp(90px, 11vw, 150px) 0 clamp(60px, 8vw, 110px); }
.fxk-title { font-family: var(--fx-display); font-size: clamp(34px, 4.4vw, 66px); line-height: 1.15; font-weight: 500; margin: 0 0 clamp(30px, 4vw, 56px); }
html[lang=th] .fxk-title { line-height: 1.32; }
.fxk-list { display: grid; gap: 28px; }
.fxk-card { position: sticky; top: calc(88px + var(--i) * 16px); display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(20px, 3vw, 44px); align-items: center; padding: 18px; background: var(--fx-card); border-radius: 28px; box-shadow: 0 30px 70px -40px rgba(20, 30, 30, .45); transform-origin: 50% 0; min-height: min(620px, 76vh); }
.fxk-card.flip .fxk-img { order: 2; }
.fxk-img { position: relative; height: 100%; min-height: 380px; border-radius: 20px; overflow: hidden; cursor: pointer; }
.fxk-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s cubic-bezier(.22, 1, .36, 1); }
.fxk-card:hover .fxk-img img { transform: scale(1.04); }
.fxk-count { position: absolute; right: 14px; bottom: 14px; padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, .9); color: var(--fx-ink); font-size: 11.5px; font-weight: 600; letter-spacing: .06em; }
.fxk-body { padding: clamp(6px, 2vw, 30px); }
.fxk-col { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--fx-accent); }
.fxk-body h3 { font-family: var(--fx-display); font-size: clamp(30px, 3.2vw, 48px); line-height: 1.15; font-weight: 500; margin: 10px 0 22px; }
html[lang=th] .fxk-body h3 { line-height: 1.35; }
.fxk-body dl { display: grid; grid-template-columns: 110px 1fr; gap: 10px 14px; margin: 0 0 20px; font-size: 14px; }
.fxk-body dt { font-size: 11.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--fx-ink-2); padding-top: 2px; }
html[lang=th] .fxk-body dt { text-transform: none; letter-spacing: 0; font-size: 13px; }
.fxk-body dd { margin: 0; display: flex; align-items: center; gap: 8px; }
.fxk-body dd i { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.fxk-body p { margin: 0 0 24px; max-width: 32em; color: var(--fx-ink-2); line-height: 1.75; font-size: 15px; }
.fxk-act { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.fxk-price { font-size: 20px; font-weight: 600; margin-right: 6px; }
.fxk-price s { font-size: 14px; font-weight: 400; opacity: .55; }
.fxk-add { height: 48px; padding: 0 24px; border-radius: 999px; background: var(--fx-ink); color: var(--fx-card); font-weight: 600; font-size: 14px; transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), background .3s; }
.fxk-add:hover { transform: translateY(-2px); background: var(--fx-accent); }
.fxk-more { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-decoration: underline; text-underline-offset: 4px; color: var(--fx-ink); }
@media (max-width: 820px) {
  .fxk-card { grid-template-columns: 1fr; top: calc(76px + var(--i) * 10px); min-height: 0; }
  .fxk-card.flip .fxk-img { order: 0; }
  .fxk-img { min-height: 0; aspect-ratio: 4 / 3.4; height: auto; }
  .fxk-body dl { grid-template-columns: 90px 1fr; }
}

/* per-design themes */
body.d1 .fxs, body.d1 .fxw, body.d1 .fxk { --fx-bg: #eaf4fb; --fx-ink: #12385a; --fx-ink-2: #3d5a78; --fx-accent: #2f86c6; --fx-card: #ffffff; --fx-display: 'Bricolage Grotesque', 'IBM Plex Sans Thai', sans-serif; }
body.d2 .fxs, body.d2 .fxw, body.d2 .fxk { --fx-bg: #fdf0d5; --fx-ink: #9a3412; --fx-ink-2: #9a3412; --fx-accent: #c2410c; --fx-card: #fffaf0; --fx-display: 'Newsreader', 'Noto Sans Thai', serif; }
html[lang=th] body.d2 .fxs h2, html[lang=th] body.d2 .fxw p, html[lang=th] body.d2 .fxk h2, html[lang=th] body.d2 .fxk h3 { font-family: 'Noto Sans Thai', sans-serif; font-weight: 500; }
body.d3 .fxs, body.d3 .fxw, body.d3 .fxk { --fx-bg: transparent; --fx-ink: #12343b; --fx-ink-2: #2c4f55; --fx-accent: #0b4a51; --fx-card: rgba(255, 255, 255, .92); --fx-display: 'Caprasimo', 'Noto Serif Thai', serif; }
html[lang=th] body.d3 .fxs h2, html[lang=th] body.d3 .fxw p, html[lang=th] body.d3 .fxk h2, html[lang=th] body.d3 .fxk h3 { font-family: 'Noto Serif Thai', serif; }
body.d4 .fxs, body.d4 .fxw, body.d4 .fxk { --fx-bg: #fdf8f0; --fx-ink: #7a1630; --fx-ink-2: #5b2a33; --fx-accent: #e8561e; --fx-card: #fffdf8; --fx-display: 'Caprasimo', 'Kanit', serif; }
html[lang=th] body.d4 .fxs h2, html[lang=th] body.d4 .fxw p, html[lang=th] body.d4 .fxk h2, html[lang=th] body.d4 .fxk h3 { font-family: 'Kanit', serif; font-weight: 400; line-height: 1.5; }
body.d4 .fxs-card > div, body.d4 .fxk-card, body.d4 .fxs-zoom { border: 2.5px solid #7a1630; }
body.d4 .fxk-card { box-shadow: 6px 6px 0 #7a1630; }

/* phones: pinned scatter -> zoom */
.fxs.mob .fxs-pin { height: 100svh; }
.fxs.mob .fxs-card > div { border-radius: 12px; }
.fxs.mob .fxs-title { width: calc(100vw - 40px); }
.fxs.mob .fxs-title h2 { font-size: clamp(30px, 8.4vw, 40px); margin: 12px 0 20px; }
.fxs.mob .fxs-cta { height: 46px; padding: 0 22px; }
.fxs.mob .fxs-zoom { top: calc(50% + 30px); }
.fxs.mob .fxs-cap { left: 20px; bottom: 30px; max-width: calc(100% - 40px); }
.fxs.mob .fxs-cap b { font-size: 38px; }
.fxs.mob .fxs-cap > span:last-child { font-size: 15px; }
.fxs.mob .fxs-dots { right: 20px; bottom: auto; top: 22px; }
.fxs.mob .fxs-zoom::after { background: linear-gradient(0deg, rgba(10, 20, 20, .65) 0%, rgba(10, 20, 20, .15) 45%, transparent 70%); }
