/* LUMORA ริมน้ำเจ้าพระยา — บัตรเชิญพรีวิวส่วนตัว
   ลายเซ็น: ลิฟต์ขึ้นชั้น 58 (ตัวเลขชั้น + ประตูโลหะบรอนซ์) · วัสดุ: หินทราเวอร์ทีน กระจกรมควัน บรอนซ์ขัดด้าน */

:root {
  --stone: #E6E0D5;      /* หินทราเวอร์ทีน = พื้นหลักของหน้า */
  --stone-2: #D6CDBE;    /* เส้นแบ่ง / ขอบบนพื้นหิน */
  --paper: #F3EFE8;      /* ช่องกรอก / การ์ดบนพื้นหิน */
  --graphite: #1E2226;   /* ตัวหนังสือหลัก */
  --muted: #5B5F63;      /* ตัวหนังสือรองบนพื้นสว่าง */
  --night: #121A23;      /* ฟ้าพลบค่ำ / ภายในลิฟต์ / คีย์การ์ด */
  --glass: #8FA3AD;      /* ตัวหนังสือรองบนพื้นมืด (กระจกรมควัน) */
  --bronze: #8C6C45;     /* เส้นและปุ่มบนพื้นสว่าง */
  --bronze-lt: #C9A978;  /* บรอนซ์บนพื้นมืด */
  --window: #F3CD8E;     /* ไฟหน้าต่างอุ่นๆ — ใช้น้อยที่สุด */

  --f-body: 'Prompt', system-ui, sans-serif;
  --f-mark: 'Syncopate', 'Prompt', sans-serif;  /* เฉพาะชื่อ LUMORA และตัวเลขชั้น */
  --f-mono: 'IBM Plex Mono', 'Prompt', ui-monospace, monospace;
  --gutter: clamp(16px, 5vw, 64px);
  --ease: cubic-bezier(.65, 0, .35, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--stone); color: var(--graphite); font: 300 16px/1.7 var(--f-body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body.is-gated { overflow: hidden; }
h1, h2, h3, p, dl, dd, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button, input { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--bronze-lt); outline-offset: 3px; }
.wrap { width: min(1120px, 100%); margin: 0 auto; padding: 0 var(--gutter); }
.wrap--narrow { width: min(600px, 100%); }
.mark { font-family: var(--f-mark); font-weight: 700; letter-spacing: .42em; margin-right: -.42em; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 30px;
  border: 1px solid transparent; border-radius: 2px; cursor: pointer; text-decoration: none;
  font-weight: 400; letter-spacing: .06em; transition: background .25s, color .25s, border-color .25s;
}
.btn--bronze { background: var(--bronze-lt); color: var(--night); }
.btn--bronze:hover { background: var(--window); }
.btn--dark { background: var(--night); color: var(--stone); }
.btn--dark:hover { background: var(--bronze); }
.btn--line { border-color: var(--graphite); background: transparent; color: var(--graphite); }
.btn--line:hover { background: var(--graphite); color: var(--stone); }
.btn[disabled] { opacity: .6; cursor: progress; }

/* =============== ลิฟต์ =============== */
.gate { position: fixed; inset: 0; z-index: 50; background: var(--night); display: grid; place-items: center; padding: 16px; }
.lift { width: min(440px, 100%); height: min(92svh, 760px); display: grid; grid-template-rows: auto 1fr auto; gap: 18px; }

.indicator {
  justify-self: center; display: flex; align-items: center; gap: 14px;
  padding: 10px 22px; border: 1px solid rgba(201, 169, 120, .35); background: #0B1017;
  color: var(--window); font-family: var(--f-mark); font-weight: 700;
}
.indicator .arrow { font-size: 12px; opacity: .35; transition: opacity .3s; }
.indicator .floor { font-size: 26px; letter-spacing: .08em; min-width: 2.2ch; text-align: center; text-shadow: 0 0 12px rgba(243, 205, 142, .55); }
.gate.is-moving .indicator .arrow { opacity: 1; animation: blink .8s steps(2) infinite; }
@keyframes blink { 50% { opacity: .3; } }

.doors { position: relative; overflow: hidden; border: 1px solid rgba(201, 169, 120, .3); background: #0B1017; }
.door {
  position: absolute; top: 0; bottom: 0; width: 50%;
  /* บรอนซ์ขัดลายเส้นแนวตั้ง */
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 3px),
    linear-gradient(90deg, #5E4C38, #A88B63 38%, #C2A57C 50%, #9C7F59 62%, #5A4935);
  transition: transform 1.1s var(--ease);
}
.door--l { left: 0; box-shadow: inset -1px 0 0 rgba(0, 0, 0, .45); }
.door--r { right: 0; box-shadow: inset 1px 0 0 rgba(255, 255, 255, .12); }
.gate.is-open .door--l { transform: translateX(-100%); }
.gate.is-open .door--r { transform: translateX(100%); }

.plaque {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 82%;
  padding: 24px 18px; text-align: center; color: #F6EEDF;
  background: rgba(18, 26, 35, .82); border: 1px solid rgba(201, 169, 120, .5);
  transition: opacity .5s;
}
.gate.is-moving .plaque, .gate.is-open .plaque { opacity: 0; }
.plaque-eyebrow { font-size: 12px; letter-spacing: .12em; color: var(--bronze-lt); }
.plaque-to { margin-top: 12px; font-size: 16px; color: var(--glass); }
.plaque-to b { display: block; margin-top: 4px; font-weight: 300; font-size: 26px; line-height: 1.3; color: #F6EEDF; }
.plaque-dest { margin-top: 14px; font-size: 13px; color: var(--glass); }
.plaque-dest .mark { font-size: 11px; color: #F6EEDF; margin-right: .2em; }

.call-panel { display: grid; justify-items: center; gap: 10px; }
.call {
  width: 68px; height: 68px; border-radius: 50%; cursor: pointer; color: var(--night);
  border: 2px solid #6E5639; font-size: 18px;
  background: radial-gradient(circle at 35% 30%, #E6CFA6, #B08F62 60%, #7A6040);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .45), inset 0 -3px 6px rgba(0, 0, 0, .25);
  transition: box-shadow .3s, transform .15s;
}
.call:active { transform: scale(.95); }
.gate.is-moving .call { box-shadow: 0 0 0 3px rgba(243, 205, 142, .35), 0 0 24px 6px rgba(243, 205, 142, .55); }
.call-label { font-size: 14px; color: var(--glass); letter-spacing: .04em; }
.sound-toggle { border: 0; background: none; cursor: pointer; font-size: 12px; color: var(--glass); text-decoration: underline; text-underline-offset: 3px; padding: 6px; }
.sound-toggle[aria-pressed="false"] { opacity: .6; }
.gate.is-gone { opacity: 0; transition: opacity .6s .2s; pointer-events: none; }

/* =============== hero =============== */
.hero { position: relative; min-height: 100svh; display: grid; background: var(--night); color: #F6EEDF; }
.hero-img { position: absolute; inset: 0; }
.hero-img img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.hero-img::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, var(--night) 12%, rgba(18, 26, 35, .78) 45%, rgba(18, 26, 35, .1) 75%); }
.hero-copy { position: relative; align-self: end; padding: 40vh var(--gutter) 56px; max-width: 620px; }
body.is-live .hero-copy > * { animation: rise .9s var(--ease) both; }
body.is-live .hero-copy > :nth-child(2) { animation-delay: .1s; }
body.is-live .hero-copy > :nth-child(3) { animation-delay: .2s; }
body.is-live .hero-copy > :nth-child(n+4) { animation-delay: .3s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

.wordmark { display: flex; align-items: baseline; gap: 14px; }
.wordmark .mark { font-size: 22px; }
.wordmark-th { font-size: 15px; color: var(--bronze-lt); letter-spacing: .08em; }
.eyebrow { margin-top: 26px; font-size: 13px; letter-spacing: .18em; text-transform: uppercase; color: var(--bronze-lt); }
h1 { margin-top: 10px; font-weight: 200; font-size: clamp(30px, 7.4vw, 46px); line-height: 1.3; }
h1 .nw { display: inline-block; }
.facts { display: flex; gap: 28px; margin-top: 26px; }
.facts li { display: grid; font-size: 13px; color: var(--glass); }
.facts b { font: 400 30px/1.1 var(--f-mark); color: #F6EEDF; }
.when { display: grid; gap: 10px; margin-top: 28px; padding-top: 20px; border-top: 1px solid rgba(201, 169, 120, .35); }
.when div { display: grid; grid-template-columns: 70px 1fr; }
.when dt { font-size: 13px; color: var(--glass); }
.when dd { font-weight: 400; }
.hero .btn { margin-top: 30px; }
.countdown { margin-top: 14px; font: 400 12.5px/1.5 var(--f-mono); color: var(--glass); }

/* =============== ส่วนหัวข้อ =============== */
.sec-eyebrow { font-size: 12.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--bronze); }
.sec-title { margin-top: 6px; font-weight: 200; font-size: clamp(30px, 6vw, 44px); line-height: 1.25; }
.sec-note { margin-top: 12px; color: var(--muted); }

/* =============== ค่ำคืนนั้น: ป้ายไดเรกทอรีอาคาร =============== */
.evening { padding: clamp(72px, 12vh, 120px) 0; }
.evening .wrap { text-align: center; }
.directory {
  margin: 36px auto 0; max-width: 760px; text-align: left;
  background: var(--night); color: #EDE4D3; padding: 10px 24px;
  border: 1px solid #0B1017; box-shadow: inset 0 0 0 6px var(--night), inset 0 0 0 7px rgba(201, 169, 120, .45);
}
.directory li { display: grid; grid-template-columns: 58px 1fr; gap: 4px 18px; padding: 20px 8px; border-bottom: 1px solid rgba(201, 169, 120, .18); }
.directory li:last-child { border-bottom: 0; }
.directory time { font: 400 15px/1.6 var(--f-mono); color: var(--bronze-lt); }
.directory h3 { font-weight: 400; font-size: 18px; line-height: 1.5; }
.directory p { font-size: 14.5px; color: var(--glass); }
.directory .where { grid-column: 2; font: 400 11px/1 var(--f-mark); letter-spacing: .2em; text-transform: uppercase; color: var(--bronze-lt); margin-top: 6px; }
.directory .is-key h3 { color: var(--window); }
@media (min-width: 760px) {
  .directory li { grid-template-columns: 70px 1fr auto; align-items: baseline; padding: 22px 12px; }
  .directory .where { grid-column: 3; margin-top: 0; }
}

/* =============== ห้องตัวอย่าง + ส่วนกลาง: สไลด์ภาพ =============== */
.units, .facilities { padding-bottom: clamp(72px, 12vh, 120px); }
.units .wrap:first-child, .facilities .wrap:first-child { margin-bottom: 28px; }
.carousel { position: relative; }
.car-track {
  display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  padding: 0 var(--gutter); scroll-padding: 0 var(--gutter); scrollbar-width: none;
}
.car-track::-webkit-scrollbar { display: none; }
.car-track:focus-visible { outline-offset: -2px; }
/* มือถือ: เห็นขอบภาพถัดไป 40px + เว้นท้ายพอให้ภาพสุดท้ายเลื่อนมาชิดซ้ายได้ (ลูกศรจะได้ทับภาพที่ดูอยู่เสมอ) */
.car-slide { flex: 0 0 calc(100vw - var(--gutter) - 56px); scroll-snap-align: start; }
@media (max-width: 899px) { .car-track { padding-right: 56px; } }
.car-slide img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; background: var(--stone-2); }
.car-slide figcaption { display: grid; grid-template-columns: auto 1fr; gap: 14px; padding-top: 14px; }
.car-no { font: 400 13px/1.9 var(--f-mark); letter-spacing: .1em; color: var(--bronze); }
.car-text { font-size: 14.5px; color: var(--muted); }
.car-text b { display: block; font-weight: 400; font-size: 18px; color: var(--graphite); }
.car-ctrl { display: flex; align-items: center; gap: 14px; margin-top: 22px; padding: 0 var(--gutter); }
.car-count { font: 400 13px/1 var(--f-mono); color: var(--muted); }
.car-count b { font-weight: 500; color: var(--graphite); }
.car-bar { flex: 1; height: 1px; background: var(--stone-2); }
.car-bar i { display: block; height: 100%; width: 0; background: var(--bronze); transition: width .4s var(--ease); }
/* ลูกศรวางทับขอบภาพที่กำลังดู (ตำแหน่งคำนวณใน carousel.js) — วงกลมทึบ ลูกศรขาว เห็นชัดบนภาพทุกโทน */
.car-btn {
  position: absolute; z-index: 2; top: calc(var(--car-ih, 240px) / 2 - 28px);
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid rgba(243, 205, 142, .85); background: rgba(18, 26, 35, .82); color: #fff;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35); cursor: pointer;
  transition: background .2s, color .2s, transform .2s, opacity .25s;
}
.car-btn svg { width: 26px; height: 26px; }
.car-btn--prev { left: calc(var(--car-pl, 16px) + 12px); }
.car-btn--prev svg { transform: scaleX(-1); }
.car-btn--next { left: calc(var(--car-pl, 16px) + var(--car-sw, 300px) - 68px); }
.car-btn:hover:not(:disabled) { background: var(--bronze-lt); color: var(--night); transform: scale(1.06); }
.car-btn:focus-visible { outline: 3px solid var(--window); outline-offset: 3px; }
.car-btn:disabled { opacity: 0; pointer-events: none; }
.car-hint { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
@media (max-width: 899px) {
  .car-btn { width: 48px; height: 48px; top: calc(var(--car-ih, 200px) / 2 - 24px); }
  .car-btn svg { width: 22px; height: 22px; }
  .car-btn--prev { left: calc(var(--car-pl, 16px) + 10px); }
  .car-btn--next { left: calc(var(--car-pl, 16px) + var(--car-sw, 300px) - 58px); }
}
@media (min-width: 900px) {
  /* ขอบซ้ายภาพแรกตรงกับหัวข้อ (.wrap กว้างสุด 1120) · ขวาเว้นพอให้ภาพสุดท้ายเลื่อนมาชิดซ้ายได้ */
  .car-track {
    gap: 24px;
    padding-left: calc(max(0px, (100% - 1120px) / 2) + var(--gutter));
    scroll-padding-left: calc(max(0px, (100% - 1120px) / 2) + var(--gutter));
    padding-right: calc(100% - min(860px, 64vw) - max(0px, (100% - 1120px) / 2) - var(--gutter));
  }
  .car-slide { flex-basis: min(860px, 64vw); }
  .car-ctrl { width: min(1120px, 100%); margin-left: auto; margin-right: auto; }
}
.unit-list { margin-top: 36px; border-top: 1px solid var(--stone-2); }
.unit-list li { display: grid; grid-template-columns: 1fr auto; gap: 2px 20px; padding: 18px 0; border-bottom: 1px solid var(--stone-2); }
.unit-list h3 { font-weight: 400; font-size: 20px; }
.unit-list .size { font: 400 18px/1.6 var(--f-mark); letter-spacing: .04em; text-align: right; }
.unit-list .floors { grid-column: 1 / -1; font-size: 14px; color: var(--muted); }

/* =============== รายละเอียด =============== */
.details { padding-bottom: clamp(72px, 12vh, 120px); }
.details-grid { display: grid; gap: 28px; }
.detail { padding-top: 18px; border-top: 1px solid var(--bronze); }
.detail h3 { font-size: 12.5px; font-weight: 400; letter-spacing: .2em; color: var(--bronze); }
.detail p { margin-top: 10px; }
.detail b { font-weight: 500; }
.link { display: inline-block; margin-top: 10px; color: var(--graphite); text-decoration: underline; text-decoration-color: var(--bronze); text-underline-offset: 5px; }
@media (min-width: 760px) { .details-grid { grid-template-columns: repeat(3, 1fr); } }

/* =============== ตอบรับ =============== */
.rsvp { padding: clamp(56px, 10vh, 96px) 0; background: var(--paper); border-top: 1px solid var(--stone-2); }
#rsvpForm { margin-top: 32px; display: grid; gap: 24px; }
.choice { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.choice legend { width: 100%; margin-bottom: 10px; font-weight: 400; }
.choice legend small, .field small { font-size: 13px; color: var(--muted); }
.choice label { flex: 1 1 150px; position: relative; cursor: pointer; }
.choice input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.choice input + span {
  display: grid; align-content: center; min-height: 54px; padding: 10px 16px; text-align: center;
  border: 1px solid var(--stone-2); background: #fff; transition: border-color .2s, background .2s, color .2s;
}
.choice input:checked + span { background: var(--night); color: #F6EEDF; border-color: var(--night); }
.choice input:focus-visible + span { outline: 2px solid var(--bronze); outline-offset: 3px; }
.choice input:disabled + span { opacity: .45; cursor: not-allowed; text-decoration: line-through; }
.choice--slots label { flex: 1 1 30%; }
.choice--slots .t { font: 400 20px/1.3 var(--f-mono); }
.choice--slots .left { font-size: 12.5px; color: var(--muted); }
.choice--slots input:checked + span .left { color: var(--bronze-lt); }
.choice--units input + span { font-size: 15px; }

.field { display: grid; gap: 6px; }
.field label { font-weight: 400; }
.field input { width: 100%; min-height: 52px; padding: 0 14px; border: 1px solid var(--stone-2); border-radius: 0; background: #fff; }
.field input:focus { outline: none; border-color: var(--bronze); box-shadow: 0 0 0 3px rgba(140, 108, 69, .18); }
.hint { font-size: 13.5px; color: var(--muted); }
.only-yes { display: grid; gap: 24px; }
.form-error { color: #8E2436; border-left: 2px solid #8E2436; padding-left: 12px; font-weight: 400; }
#rsvpForm .btn { width: 100%; }

/* =============== คีย์การ์ด =============== */
.pass-wrap { display: grid; justify-items: center; text-align: center; }
.keycard {
  width: min(360px, 100%); padding: 24px 24px 22px; text-align: left; color: #EDE4D3;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .06), transparent 40%),
    var(--night);
  border: 1px solid #0B1017; border-radius: 16px;
  box-shadow: inset 0 0 0 1px rgba(201, 169, 120, .55), 0 30px 60px -25px rgba(18, 26, 35, .6);
  animation: rise .8s var(--ease) both;
}
.keycard-head { display: flex; justify-content: space-between; align-items: center; }
.keycard-head .mark { font-size: 15px; color: #F6EEDF; }
.keycard-kind { font: 400 10px/1.4 var(--f-mono); letter-spacing: .08em; color: var(--bronze-lt); text-align: right; }
.keycard-qr { width: 72%; margin: 26px auto 0; aspect-ratio: 1; padding: 12px; background: #F6EEDF; }
.keycard-qr svg { display: block; width: 100%; height: 100%; }
.keycard-code { margin-top: 12px; text-align: center; font: 400 14px/1 var(--f-mono); letter-spacing: .24em; color: var(--glass); }
.keycard-name { margin-top: 22px; font-weight: 300; font-size: 24px; line-height: 1.3; }
.keycard-meta { display: grid; gap: 6px; margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(201, 169, 120, .3); }
.keycard-meta div { display: grid; grid-template-columns: 110px 1fr; font-size: 14px; }
.keycard-meta dt { color: var(--glass); }
.keycard-state { margin-top: 14px; font: 400 11.5px/1.4 var(--f-mono); color: var(--bronze-lt); }
.pass-tip { margin-top: 20px; color: var(--muted); }
.pass-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 12px; }
.declined { text-align: center; display: grid; justify-items: center; gap: 6px; }
.declined .btn { margin-top: 18px; }

.foot { padding: 28px var(--gutter) 90px; text-align: center; font-size: 13px; color: var(--muted); background: var(--paper); }

/* ปุ่มเพลงลอย */
.music-fab {
  position: fixed; left: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 55;
  display: inline-flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 16px;
  border: 1px solid rgba(201, 169, 120, .6); border-radius: 999px; cursor: pointer;
  background: rgba(18, 26, 35, .88); color: #EDE4D3; font-size: 13px; letter-spacing: .04em;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.eq { display: inline-flex; align-items: flex-end; gap: 3px; height: 14px; }
.eq i { width: 2px; height: 4px; background: var(--bronze-lt); }
.music-fab[aria-pressed="true"] .eq i { animation: eq 1.1s ease-in-out infinite; }
.music-fab[aria-pressed="true"] .eq i:nth-child(2) { animation-delay: -.35s; }
.music-fab[aria-pressed="true"] .eq i:nth-child(3) { animation-delay: -.7s; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 14px; } }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 60;
  transform: translate(-50%, calc(100% + 48px)); visibility: hidden; transition: transform .35s var(--ease), visibility .35s;
  max-width: calc(100% - 32px); padding: 12px 20px; background: var(--night); color: #F6EEDF; font-size: 15px;
}
.toast.is-on { transform: translate(-50%, 0); visibility: visible; }

/* =============== จอกว้าง: hero แบ่งซ้ายข้อความ ขวาภาพตึก =============== */
@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(460px, 1fr) minmax(0, 1.05fr); }
  .hero-img { position: relative; grid-column: 2; }
  .hero-img::after { background: linear-gradient(90deg, var(--night), transparent 22%); }
  .hero-copy { grid-column: 1; grid-row: 1; align-self: center; padding: 64px var(--gutter); max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
