/* High Ground — static site styles */
:root {
  --paper: #F7F5F0;
  --paper-2: #EEEAE1;
  --white: #FFFFFF;
  --ink: #1B1E23;
  --ink-2: #4B5058;
  --ink-3: #7A7F87;
  --border: #E1DCD1;
  --navy: #0B3052;
  --text-strong: #0B3052;
  --head-bg: rgba(247, 245, 240, .88);
  --stripe: #E7E2D7;
  --ic-bg: #FBF3DC;
  --line-soft: #E7F9EE;
  --navy-2: #071F36;
  --gold: #D4A21C;
  --gold-2: #E9C25A;
  --gold-ink: #8C6A0F;
  --line: #06C755;
  --line-2: #05A847;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(11, 48, 82, .06), 0 8px 24px rgba(11, 48, 82, .08);
  --shadow-lg: 0 24px 60px rgba(7, 31, 54, .22);
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --head-h: 72px;
  --f-head: "Kanit", "IBM Plex Sans Thai", system-ui, sans-serif;
  --f-body: "IBM Plex Sans Thai", "Kanit", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
/* `hidden` must win over component display rules (.card/.pat use display:flex) — used by the catalog filters */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--f-body); font-size: 16px; line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--f-head); line-height: 1.25; margin: 0 0 .5em; color: var(--text-strong); font-weight: 600; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.nw { white-space: nowrap; }
[id] { scroll-margin-top: calc(var(--head-h) + 12px); }
h1, h2, h3 { text-wrap: balance; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  padding: .8em 1.4em; border-radius: 999px; border: 1.5px solid transparent;
  font-family: var(--f-head); font-weight: 500; font-size: 1rem; line-height: 1.2;
  text-decoration: none; transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn svg { width: 1.25em; height: 1.25em; flex: none; }
.btn-line { background: var(--line); color: #fff; box-shadow: 0 6px 18px rgba(6, 199, 85, .28); }
.btn-line:hover { background: var(--line-2); }
.btn-gold { background: var(--gold); color: var(--navy-2); }
.btn-gold:hover { background: var(--gold-2); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-ghost { border-color: currentColor; color: var(--text-strong); background: transparent; }
.btn-ghost-light { border-color: rgba(255,255,255,.7); color: #fff; background: rgba(255,255,255,.06); backdrop-filter: blur(4px); }
.btn-sm { padding: .55em 1em; font-size: .92rem; }
.btn-lg { padding: 1em 1.8em; font-size: 1.08rem; }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50; height: var(--head-h);
  background: var(--head-bg); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s;
}
.site-head.scrolled { border-color: var(--border); box-shadow: 0 4px 20px rgba(11,48,82,.06); }
.site-head .wrap { display: flex; align-items: center; gap: 24px; height: 100%; }
.brand { display: flex; align-items: center; flex: none; }
.brand img { height: 44px; width: auto; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  text-decoration: none; font-family: var(--f-head); font-weight: 400; color: var(--ink-2);
  padding: .45em .8em; border-radius: 999px; transition: color .15s, background .15s; white-space: nowrap;
}
.nav a:hover { color: var(--text-strong); background: var(--paper-2); }
.nav a[aria-current="page"] { color: var(--text-strong); font-weight: 500; background: var(--paper-2); }
.head-cta { flex: none; }
.menu-btn { display: none; margin-left: auto; background: none; border: 0; padding: 8px; color: var(--text-strong); }
.menu-btn svg { width: 28px; height: 28px; }

@media (max-width: 1100px) {
  .nav, .head-cta { display: none; }
  .menu-btn { display: block; }
  .brand img { height: 38px; }
}
.mobile-nav {
  position: fixed; inset: var(--head-h) 0 0 0; z-index: 49; background: var(--paper);
  padding: 24px var(--gutter); display: flex; flex-direction: column; gap: 4px;
  transform: translateY(-8px); opacity: 0; visibility: hidden; transition: .2s ease;
}
.mobile-nav.open { transform: none; opacity: 1; visibility: visible; }
.mobile-nav a:not(.btn) {
  font-family: var(--f-head); font-size: 1.25rem; text-decoration: none; color: var(--text-strong);
  padding: 14px 4px; border-bottom: 1px solid var(--border);
}
.mobile-nav .btn { margin-top: 20px; }

/* ---------- sections ---------- */
.section { padding: clamp(56px, 9vw, 112px) 0; }
.section-alt { background: var(--white); }
.section-navy { background: var(--navy); color: #DCE4EC; }
.section-navy h2, .section-navy h3 { color: #fff; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .6em; font-family: var(--f-head); font-weight: 500;
  font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-ink); margin-bottom: .8em;
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--gold); }
.section-navy .eyebrow { color: var(--gold-2); }
.sec-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: clamp(28px, 4vw, 48px); flex-wrap: wrap; }
.sec-head p { color: var(--ink-2); max-width: 56ch; margin: 0; }
.section-navy .sec-head p { color: #B9C6D3; }
.lead { font-size: 1.12rem; color: var(--ink-2); }

/* ---------- hero ---------- */
.hero { position: relative; min-height: min(88vh, 820px); display: flex; align-items: end; color: #fff; overflow: hidden; background: var(--navy-2); }
.hero picture, .hero > img { position: absolute; inset: 0; }
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(7,31,54,.86) 0%, rgba(7,31,54,.55) 45%, rgba(7,31,54,.1) 80%),
              linear-gradient(0deg, rgba(7,31,54,.7) 0%, rgba(7,31,54,0) 40%);
}
.hero .wrap { position: relative; z-index: 1; padding-top: 80px; padding-bottom: clamp(40px, 8vw, 88px); width: 100%; }
.hero h1 { color: #fff; max-width: 20ch; margin-bottom: .35em; }
.hero h1 em { font-style: normal; color: var(--gold-2); }
.hero p.lead { color: #E3E9EF; max-width: 46ch; font-size: clamp(1.05rem, 1.6vw, 1.25rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: clamp(20px, 5vw, 56px); margin-top: clamp(36px, 6vw, 64px); padding-top: 24px; border-top: 1px solid rgba(255,255,255,.18); }
.hero-stats b { display: block; font-family: var(--f-head); font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 600; color: var(--gold-2); line-height: 1.1; }
.hero-stats span { font-size: .92rem; color: #C9D4DE; }
@media (max-width: 640px) {
  .hero { min-height: 92svh; }
  .hero::after { background: linear-gradient(0deg, rgba(7,31,54,.95) 0%, rgba(7,31,54,.7) 50%, rgba(7,31,54,.25) 100%); }
  .hero-actions .btn { flex: 1 1 100%; }
}

/* page hero (inner pages) */
.page-hero { padding: clamp(48px, 8vw, 96px) 0 clamp(32px, 5vw, 56px); background: linear-gradient(180deg, var(--paper-2), var(--paper)); }
:root:not([data-theme="dark"]) .page-hero { background: linear-gradient(180deg, rgba(247,245,240,0) 60%, var(--paper)), url(../img/art/texture-light.webp) center / cover; }
.page-hero p { color: var(--ink-2); max-width: 60ch; font-size: 1.08rem; }
.crumbs { font-size: .88rem; color: var(--ink-3); margin-bottom: 12px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--text-strong); }

/* ---------- grid & cards ---------- */
.grid { display: grid; gap: clamp(16px, 2.4vw, 28px); }
.g-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.g-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.g-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.g-5 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); }
@media (max-width: 520px) { .g-5 { grid-template-columns: 1fr 1fr; gap: 12px; } .swatch .sw-body { flex-direction: column; align-items: stretch; } }

.card {
  background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column; transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(11,48,82,.06), 0 18px 40px rgba(11,48,82,.14); }
.card-media { position: relative; aspect-ratio: 4 / 3; background: var(--paper-2); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .card-media img { transform: scale(1.04); }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-body h3 { margin: 0; }
.card-body p { margin: 0; color: var(--ink-2); font-size: .95rem; }
.card-meta { font-size: .85rem; color: var(--ink-3); display: flex; gap: 10px; flex-wrap: wrap; }
.card-actions { margin-top: auto; padding-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.media-btn { all: unset; cursor: zoom-in; display: block; width: 100%; height: 100%; }
.media-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }
.badge {
  position: absolute; top: 12px; left: 12px; z-index: 1; background: rgba(7,31,54,.82); color: #fff;
  font-size: .78rem; padding: .25em .7em; border-radius: 999px; font-family: var(--f-head); backdrop-filter: blur(4px);
}
.badge-gold { background: var(--gold); color: var(--navy-2); }

/* service card */
.svc .card-media { aspect-ratio: 4 / 3; }
.svc .card-body { padding: 22px 24px 24px; }
.svc ul { margin: 4px 0 0; padding-left: 1.1em; color: var(--ink-2); font-size: .95rem; }

/* Art placeholder slot */
.art-slot {
  position: relative; width: 100%; height: 100%; min-height: 160px; display: grid; place-items: center; text-align: center;
  background: repeating-linear-gradient(135deg, var(--paper-2) 0 14px, var(--stripe) 14px 28px);
  color: var(--ink-3); font-family: var(--f-head); font-size: .9rem; padding: 16px;
}
.art-slot b { display: block; color: var(--gold-ink); font-size: 1rem; }

/* ---------- chips / filters ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.chip {
  border: 1.5px solid var(--border); background: var(--white); color: var(--ink-2);
  padding: .45em 1.05em; border-radius: 999px; font-family: var(--f-head); font-size: .95rem; transition: .15s;
}
.chip:hover { border-color: var(--navy); color: var(--text-strong); }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip small { opacity: .7; margin-left: .3em; }

/* ---------- pattern card ---------- */
.pat .card-media { aspect-ratio: 1 / 1; }
.pat .code { font-family: var(--f-head); color: var(--gold-ink); font-size: .85rem; font-weight: 500; }
.pick {
  display: inline-flex; align-items: center; gap: .4em; border: 1.5px solid var(--border); background: var(--white);
  color: var(--text-strong); border-radius: 999px; padding: .45em .95em; font-family: var(--f-head); font-size: .9rem; transition: .15s;
}
.pick:hover { border-color: var(--navy); }
.pick[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--navy-2); }
.pick svg { width: 1.1em; height: 1.1em; }

/* colour swatch */
.swatch { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.swatch .sw-img { aspect-ratio: 1; overflow: hidden; background: #2b2a33; }
.swatch .sw-img img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.6); }
.swatch .sw-body { padding: 10px 12px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.swatch .sw-body b { font-family: var(--f-head); font-weight: 500; color: var(--text-strong); }
.swatch .pick { padding: .3em .7em; font-size: .82rem; }

/* ---------- before / after ---------- */
.ba { position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); user-select: none; touch-action: pan-y; background: var(--navy-2); }
.ba img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ba .ba-after { clip-path: inset(0 0 0 var(--pos, 50%)); }
.ba .ba-line { position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 2px; background: #fff; transform: translateX(-1px); pointer-events: none; }
.ba .ba-knob {
  position: absolute; top: 50%; left: var(--pos, 50%); width: 52px; height: 52px; border-radius: 50%; transform: translate(-50%, -50%);
  background: #fff; color: var(--text-strong); display: grid; place-items: center; box-shadow: 0 6px 20px rgba(0,0,0,.3); pointer-events: none;
}
.ba .ba-knob svg { width: 26px; height: 26px; }
.ba input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.ba .tag { position: absolute; bottom: 16px; z-index: 1; background: rgba(7,31,54,.8); color: #fff; padding: .3em .9em; border-radius: 999px; font-family: var(--f-head); font-size: .9rem; pointer-events: none; }
.ba .tag-l { left: 16px; } .ba .tag-r { right: 16px; background: var(--gold); color: var(--navy-2); }

/* ---------- steps ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 20px; counter-reset: step; }
.step { position: relative; padding: 24px 20px; border-radius: var(--radius); background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); }
.step .num { font-family: var(--f-head); font-size: 2.4rem; font-weight: 600; color: var(--gold-2); line-height: 1; margin-bottom: 14px; display: flex; align-items: center; gap: 12px; }
.step .num img { width: 64px; height: 64px; padding: 6px; border-radius: 14px; background: #F7F5F0; }
.step h3 { font-size: 1.1rem; margin-bottom: .3em; }
.step p { font-size: .93rem; color: #B9C6D3; margin: 0; }

/* ---------- why ---------- */
.why { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 28px; }
.why-item .ic { width: 56px; height: 56px; border-radius: 14px; background: var(--ic-bg); color: var(--gold-ink); display: grid; place-items: center; margin-bottom: 16px; }
.why-item .ic svg { width: 28px; height: 28px; }
.why-item .ic img { width: 100%; height: 100%; }
.why-item .ic.ic-art { width: 72px; height: 72px; padding: 8px; background: #FBF3DC; }
.why-item p { color: var(--ink-2); margin: 0; font-size: .96rem; }

/* ---------- CTA band ---------- */
.cta-band { --cta-bg: url(../img/art/cta-band.webp); position: relative; overflow: hidden; background: var(--navy); color: #fff; border-radius: calc(var(--radius) + 6px); padding: clamp(32px, 6vw, 64px); }
.cta-band::before { content: ""; position: absolute; inset: 0; background: var(--cta-bg, none) center / cover; opacity: .9; }
.cta-band::after { content: ""; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(212,162,28,.35), transparent 70%); }
.cta-band > * { position: relative; z-index: 1; }
.cta-band h2 { color: #fff; max-width: 22ch; }
.cta-band p { color: #C9D4DE; max-width: 52ch; }
.cta-band .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* ---------- project card ---------- */
.proj .card-media { aspect-ratio: 3 / 2; }
.proj .count { position: absolute; right: 12px; bottom: 12px; z-index: 1; background: rgba(0,0,0,.6); color: #fff; font-size: .8rem; padding: .2em .65em; border-radius: 999px; display: inline-flex; gap: .35em; align-items: center; }
.proj .count svg { width: 14px; height: 14px; }
.proj button.card-open { all: unset; cursor: pointer; display: contents; }

/* ---------- modal & lightbox ---------- */
dialog { border: 0; padding: 0; max-width: none; max-height: none; background: transparent; color: inherit; }
dialog::backdrop { background: rgba(7, 17, 28, .82); backdrop-filter: blur(3px); }
.gal-dialog { width: min(1100px, 100vw); height: min(92vh, 100%); margin: auto; }
.gal-panel { background: var(--paper); border-radius: var(--radius); height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.gal-top { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--white); }
.gal-top h3 { margin: 0; flex: 1; font-size: 1.15rem; }
.gal-top .sub { font-size: .85rem; color: var(--ink-3); display: block; font-family: var(--f-body); font-weight: 400; }
.gal-scroll { overflow: auto; padding: 20px; flex: 1; }
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 10px; }
.gal-grid button { all: unset; cursor: zoom-in; position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--paper-2); }
.gal-grid button:focus-visible { outline: 3px solid var(--gold); }
.gal-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gal-grid button:hover img { transform: scale(1.05); }
.gal-grid .badge { top: 8px; left: 8px; font-size: .72rem; }
.gal-group-title { font-family: var(--f-head); color: var(--text-strong); margin: 8px 0 12px; font-size: 1rem; }
.gal-group-title:not(:first-child) { margin-top: 28px; }
.gal-foot { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--white); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.x-btn { background: var(--paper-2); border: 0; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--text-strong); flex: none; }
.x-btn svg { width: 20px; height: 20px; }

/* "ภาพประกอบ" label on illustration (non-portfolio) images */
.has-illus { position: relative; }
.illus-tag { position: absolute; right: 10px; bottom: 10px; z-index: 2; font-size: .68rem; line-height: 1; padding: 4px 8px; border-radius: 999px; background: rgba(7, 17, 28, .32); color: rgba(255, 255, 255, .72); backdrop-filter: blur(3px); pointer-events: none; }
.hero .illus-tag { right: 14px; bottom: 14px; }
@media (min-width: 761px) { .hero .illus-tag { right: 100px; bottom: 18px; } } /* clear of the round LINE button */

/* quote details dialog (optional area + location before LINE) */
.qd { width: min(440px, calc(100vw - 24px)); margin: auto; }
.qd-panel { background: var(--white); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-lg); display: grid; gap: 14px; }
.qd-top { display: flex; align-items: center; gap: 12px; }
.qd-top h3 { margin: 0; flex: 1; font-size: 1.15rem; }
.qd-what { margin: 0; white-space: pre-line; font-size: .92rem; background: var(--paper-2); border-radius: var(--radius-sm); padding: 10px 12px; color: var(--text-strong); max-height: 30vh; overflow: auto; }
.qd-hint { margin: 0; font-size: .88rem; color: var(--ink-3); }
.qd-field { display: grid; gap: 6px; font-size: .92rem; color: var(--text-strong); }
.qd-field input { font: inherit; font-size: 16px; padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--paper); color: var(--text-strong); width: 100%; }
.qd-field input:focus { outline: 2px solid var(--line); outline-offset: 1px; border-color: transparent; }
.qd-send { width: 100%; justify-content: center; }
@media (max-width: 640px) { .gal-dialog { height: 100%; width: 100%; } .gal-panel { border-radius: 0; } }

.lb { width: 100vw; height: 100vh; height: 100dvh; margin: 0; }
.lb-inner { position: relative; width: 100%; height: 100%; display: grid; place-items: center; padding: 56px 64px; }
.lb-inner img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lb-cap { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; color: #E6ECF2; font-size: .92rem; padding: 0 64px; }
.lb .x-btn { position: absolute; top: 12px; right: 12px; background: rgba(255,255,255,.12); color: #fff; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.12); color: #fff; border: 0; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; }
.lb-nav:hover, .lb .x-btn:hover { background: rgba(255,255,255,.24); }
.lb-nav svg { width: 24px; height: 24px; }
.lb-prev { left: 10px; } .lb-next { right: 10px; }
@media (max-width: 640px) { .lb-inner { padding: 56px 8px 64px; } .lb-nav { top: auto; bottom: 8px; transform: none; } .lb-cap { bottom: 22px; padding: 0 70px; } }

/* ---------- quote tray ---------- */
.tray {
  position: fixed; left: 50%; bottom: 20px; z-index: 60; transform: translate(-50%, calc(100% + 120px)); visibility: hidden;
  width: min(640px, calc(100vw - 24px)); background: var(--navy-2); color: #fff; border-radius: 18px;
  box-shadow: var(--shadow-lg); padding: 12px 12px 12px 20px; display: flex; align-items: center; gap: 12px;
  transition: transform .3s cubic-bezier(.2,.8,.2,1), visibility .3s;
}
.tray.show { transform: translate(-50%, 0); visibility: visible; }
.tray .t-info { flex: 1; min-width: 0; font: inherit; font-size: .9rem; line-height: 1.35; text-align: left; color: inherit; background: none; border: 0; padding: 4px 6px 4px 0; cursor: pointer; border-radius: 10px; }
.tray .t-info:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.tray .t-more { display: inline-flex; align-items: center; gap: 2px; margin-left: 10px; font-family: var(--f-body); font-size: .8rem; font-weight: 400; color: #fff; background: rgba(255,255,255,.14); border-radius: 999px; padding: 1px 6px 1px 10px; vertical-align: 2px; }
.tray .t-more svg { width: 14px; height: 14px; }
.tray .t-info:hover .t-more { background: rgba(255,255,255,.24); }
.tray .t-info b { font-family: var(--f-head); font-weight: 500; font-size: 1rem; display: block; }
.tray .t-list { color: #A9B8C7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.tray .t-clear { background: none; border: 0; color: #A9B8C7; font-size: .85rem; text-decoration: underline; padding: 4px; }

/* ---------- compare sheet (tap the tray) ---------- */
.cmp { width: min(920px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); margin: auto; }
.cmp-panel { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; max-height: calc(100dvh - 32px); }
.cmp-top { display: flex; align-items: center; gap: 12px; padding: 16px 16px 12px 20px; border-bottom: 1px solid var(--border); }
.cmp-top h3 { margin: 0; flex: 1; font-size: 1.15rem; }
.cmp-grid { list-style: none; margin: 0; padding: 16px 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; grid-auto-rows: max-content; align-content: start; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.cmp-item { position: relative; background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; display: flex; flex-direction: column; }
.cmp-img { display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; background: var(--paper-2); cursor: zoom-in; }
.cmp-img img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; display: block; }
.cmp-noimg { cursor: default; }
.cmp-body { padding: 10px 12px 12px; display: grid; gap: 2px; font-size: .88rem; line-height: 1.35; }
.cmp-body small { color: var(--ink-3); font-size: .78rem; }
.cmp-body b { font-family: var(--f-head); font-weight: 500; font-size: 1rem; color: var(--text-strong); }
.cmp-body b a { color: inherit; }
.cmp-body span { color: var(--ink-2); }
.cmp-del { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(14,19,24,.62); color: #fff; cursor: pointer; }
.cmp-del:hover { background: #B3261E; }
.cmp-del svg { width: 16px; height: 16px; }
.cmp-foot { display: flex; align-items: center; gap: 12px; padding: 12px 20px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
.cmp-clear { background: none; border: 0; color: var(--ink-3); font: inherit; font-size: .9rem; text-decoration: underline; padding: 6px 4px; cursor: pointer; }
.cmp-send { margin-left: auto; }
@media (max-width: 640px) {
  .cmp { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; }
  .cmp-panel { border-radius: 18px 18px 0 0; max-height: 92dvh; }
  .cmp-grid { grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; }
  .cmp-body { padding: 8px 10px 10px; font-size: .82rem; }
  .cmp-send { flex: 1; justify-content: center; }
}

/* ---------- floating LINE / mobile bar ---------- */
.fab-line {
  position: fixed; right: 20px; bottom: 20px; z-index: 55; width: 60px; height: 60px; border-radius: 50%;
  background: var(--line); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 28px rgba(6,199,85,.4);
  transition: transform .2s;
}
.fab-line:hover { transform: scale(1.06); }
.fab-line svg { width: 34px; height: 34px; }

/* back to top: sits above the LINE button (desktop) / mobile bar, and above the quote tray when it is open */
.to-top {
  position: fixed; right: 28px; bottom: 96px; z-index: 54; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--white); color: var(--text-strong); display: grid; place-items: center;
  box-shadow: var(--shadow); cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .25s, transform .25s, visibility .25s, bottom .3s;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { transform: translateY(-2px); }
.to-top svg { width: 20px; height: 20px; }
body.has-tray .to-top { bottom: 110px; }
.mbar { display: none; }
@media (max-width: 760px) {
  .fab-line { display: none; }
  .mbar {
    display: flex; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: var(--head-bg); backdrop-filter: blur(10px); border-top: 1px solid var(--border);
  }
  .mbar .btn { flex: 1; padding: .8em .6em; }
  body { padding-bottom: 76px; }
  .to-top { right: 14px; bottom: calc(88px + env(safe-area-inset-bottom)); }
  /* picks: the floating tray is replaced by a row inside the bottom bar */
  .tray { display: none; }
  .mbar { flex-wrap: wrap; }
  .mb-picks, .mb-send { display: none; }
  body.has-tray .mb-picks { display: flex; align-items: center; gap: 8px; flex: 0 0 100%; min-width: 0; }
  body.has-tray .mb-line { display: none; }
  body.has-tray .mb-send { display: inline-flex; }
  .mb-view { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font: inherit; font-size: .88rem; color: var(--text-strong); background: var(--paper-2); border: 1px solid var(--border); border-radius: 12px; padding: 8px 8px 8px 12px; text-align: left; cursor: pointer; }
  .mb-view b { font-family: var(--f-head); font-weight: 500; white-space: nowrap; }
  .mb-list { flex: 1; min-width: 0; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mb-view .t-more { display: inline-flex; align-items: center; gap: 2px; flex: none; font-size: .8rem; color: #fff; background: var(--navy); border-radius: 999px; padding: 3px 6px 3px 10px; }
  .mb-view .t-more svg { width: 14px; height: 14px; }
  .mb-clear { flex: none; background: none; border: 0; color: var(--ink-3); font: inherit; font-size: .85rem; text-decoration: underline; padding: 8px 4px; cursor: pointer; }
  body.has-tray { padding-bottom: 136px; }
  body.has-tray .to-top { bottom: calc(148px + env(safe-area-inset-bottom)); }
}

/* ---------- footer ---------- */
.site-foot { background: var(--navy-2) url(../img/art/texture-dark.webp) center / cover; color: #B3C1CF; padding: 64px 0 28px; margin-top: 0; font-size: .95rem; }
.site-foot .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.site-foot h4 { color: #fff; font-size: 1rem; margin-bottom: 14px; }
.site-foot a { text-decoration: none; color: #B3C1CF; }
.site-foot a:hover { color: #fff; }
.site-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-foot .logo { height: 48px; width: auto; margin-bottom: 16px; }
.site-foot .legal { border-top: 1px solid rgba(255,255,255,.1); margin-top: 48px; padding-top: 20px; font-size: .85rem; color: #7F91A3; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
@media (max-width: 760px) { .site-foot .cols { grid-template-columns: 1fr; gap: 28px; } }

/* ---------- misc ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.rounded-img { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 3 / 2; background: var(--paper-2); }
.rounded-img img { width: 100%; height: 100%; object-fit: cover; }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.check-list li { display: flex; gap: 12px; align-items: start; }
.check-list li::before { content: ""; flex: none; width: 22px; height: 22px; margin-top: 3px; border-radius: 50%; background: var(--gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23071F36' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 14px no-repeat; }
.quote { font-family: var(--f-head); font-size: clamp(1.2rem, 2.2vw, 1.6rem); color: var(--text-strong); line-height: 1.5; border-left: 4px solid var(--gold); padding-left: 24px; margin: 0; font-weight: 400; }
.faq details { background: var(--white); border-radius: var(--radius-sm); box-shadow: var(--shadow); margin-bottom: 12px; }
.faq summary { cursor: pointer; padding: 18px 22px; font-family: var(--f-head); font-weight: 500; color: var(--text-strong); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--gold-ink); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding: 0 22px 18px; color: var(--ink-2); }
.contact-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(24px, 4vw, 40px); }
.contact-row { display: flex; gap: 16px; align-items: start; padding: 16px 0; border-bottom: 1px solid var(--border); }
.contact-row:last-child { border-bottom: 0; }
.contact-row .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--paper-2); color: var(--text-strong); display: grid; place-items: center; flex: none; }
.contact-row .ic svg { width: 22px; height: 22px; }
.contact-row small { display: block; color: var(--ink-3); font-size: .85rem; }
.contact-row b { font-family: var(--f-head); font-weight: 500; color: var(--text-strong); font-size: 1.05rem; }
.contact-row b a { color: inherit; text-decoration: none; }
.contact-row b a:hover { text-decoration: underline; }
.tel-list { line-height: 1.7; }
.en-note { margin: 12px 0 0; font-size: .9rem; color: var(--ink-3); }
.en-note a { color: var(--line-2); font-weight: 500; }
.contact-row .map-btn { margin-top: 10px; }
.qr { width: 200px; height: 200px; padding: 12px; background: #fff; border-radius: 12px; border: 1px solid var(--border); }
.qr img, .qr canvas { width: 100% !important; height: 100% !important; }
.note { font-size: .88rem; color: var(--ink-3); }
.empty { padding: 48px; text-align: center; color: var(--ink-3); }
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
/* ---------- dark theme (set by theme.js: auto by client local time, or manual) ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0E1318;
  --paper-2: #161D25;
  --white: #151C24;
  --ink: #E4E8EC;
  --ink-2: #B3BCC6;
  --ink-3: #87929E;
  --border: #27323E;
  --text-strong: #F2F5F8;
  --gold-ink: #E9C25A;
  --head-bg: rgba(14, 19, 24, .86);
  --stripe: #1C252F;
  --ic-bg: rgba(212, 162, 28, .14);
  --line-soft: rgba(6, 199, 85, .14);
  --navy: #0D2A45;
  --navy-2: #08131F;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.55);
}
:root[data-theme="dark"] body { background: var(--paper); }
:root[data-theme="dark"] .btn-navy { background: var(--gold); color: #071F36; }
:root[data-theme="dark"] .btn-ghost-light { border-color: rgba(255,255,255,.55); }
:root[data-theme="dark"] .chip[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: #071F36; }
:root[data-theme="dark"] .section-navy { background: #0B2238; }
:root[data-theme="dark"] .cta-band { background: #0B2238; border: 1px solid var(--border); }
:root[data-theme="dark"] .card-media, :root[data-theme="dark"] .rounded-img { background: var(--paper-2); }
:root[data-theme="dark"] .pick[aria-pressed="true"] { color: #071F36; }
:root[data-theme="dark"] .tray { border: 1px solid var(--border); }
:root[data-theme="dark"] img:not(.logo-img) { filter: brightness(.94); }

/* logo swap + theme toggle */
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
.theme-btn {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 999px;
  border: 1.5px solid var(--border); background: transparent; color: var(--text-strong); font-family: var(--f-head); font-size: .85rem;
}
.theme-btn:hover { border-color: var(--text-strong); }
.theme-btn svg { width: 18px; height: 18px; }
/* language switch (TH <-> EN) */
.lang-btn {
  flex: none; display: inline-flex; align-items: center; justify-content: center; height: 40px; min-width: 44px; padding: 0 10px; border-radius: 999px;
  border: 1.5px solid var(--border); color: var(--text-strong); font-family: var(--f-head); font-size: .85rem; font-weight: 600; text-decoration: none; letter-spacing: .04em;
}
.lang-btn:hover { border-color: var(--text-strong); }
.lang-btn + .theme-btn { margin-left: 8px; }
.mnav-lang { display: none; }
@media (max-width: 1100px) { .lang-btn { margin-left: auto; } .lang-btn + .theme-btn { margin-left: 6px; } }
@media (max-width: 1100px) { .theme-btn { margin-left: auto; } .theme-btn + .menu-btn { margin-left: 4px; } .theme-btn .t-lbl { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
