/* ───────────────── Baya Chiang Mai ───────────────── */

@font-face { font-family: "Marcellus"; src: url("../fonts/Marcellus-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Jost"; src: url("../fonts/Jost-300-Light.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Jost"; src: url("../fonts/Jost-400-Book.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Jost"; src: url("../fonts/Jost-500-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  /* Brand — sampled from the Baya logo */
  --earth: #7a6049;        /* wordmark brown */
  --earth-deep: #4a3a2e;
  --ink: #3b2f26;
  --sage: #8fada4;         /* watercolour teal */
  --sage-deep: #5f817a;
  --clay: #d58b62;         /* watercolour terracotta */
  --cream: #f5efe7;
  --sand: #ebe1d4;
  --paper: #fbf8f3;
  --muted: #7d6f64;

  --serif: "Marcellus", "Cormorant Garamond", Georgia, serif;
  --sans: "Jost", "Futura", "Avenir Next", system-ui, sans-serif;

  --wrap: 1200px;
  --gutter: clamp(20px, 5vw, 56px);
  --radius: 18px;
  --ease: cubic-bezier(.2,.7,.2,1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(16px, 1.05vw + 11px, 18px);
  line-height: 1.7;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.12; margin: 0 0 .5em; color: var(--earth-deep); letter-spacing: .005em; }
h1 em, h2 em { font-style: normal; color: var(--clay); }
p { margin: 0 0 1.1em; }

.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 12px; left: 12px; z-index: 100; background: var(--paper); padding: 10px 16px; border-radius: 8px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 820px; text-align: center; }

.eyebrow {
  font-family: var(--sans);
  font-weight: 500;
  font-size: .78rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--sage-deep);
  margin-bottom: 1.1em;
}
.lead { font-size: 1.18em; color: var(--muted); }

section { padding: clamp(80px, 11vw, 150px) 0; }
.section-head { text-align: center; margin-bottom: clamp(40px, 6vw, 72px); }
h2 { font-size: clamp(2rem, 4.2vw, 3.3rem); }

/* ───────── Buttons ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: 1em 2em;
  font: 500 .8rem/1 var(--sans);
  letter-spacing: .2em; text-transform: uppercase; text-decoration: none;
  color: var(--paper); background: var(--earth);
  border: 1px solid var(--earth); border-radius: 999px;
  transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease);
}
.btn:hover { background: var(--earth-deep); border-color: var(--earth-deep); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
.btn-ghost:hover { background: #fff; color: var(--earth-deep); border-color: #fff; }
.btn-light { background: var(--cream); color: var(--earth-deep); border-color: var(--cream); }
.btn-light:hover { background: #fff; border-color: #fff; color: var(--earth-deep); }
.btn-sm { padding: .85em 1.5em; font-size: .72rem; }

/* ───────── Header ───────── */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  padding: 18px 0;
  transition: background .4s var(--ease), padding .4s var(--ease), box-shadow .4s var(--ease);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.brand { position: relative; display: block; width: 116px; transition: width .4s var(--ease); }
.brand img { width: 100%; }
.brand-dark { position: absolute; inset: 0; opacity: 0; transition: opacity .4s var(--ease); }
.brand-light { transition: opacity .4s var(--ease); }

.nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: clamp(18px, 2.4vw, 36px); }
.nav a:not(.btn) {
  font-weight: 400; font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; text-decoration: none;
  color: #fff; position: relative; padding: 6px 0;
}
.nav a:not(.btn)::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px; background: currentColor; transition: right .35s var(--ease); }
.nav a:not(.btn):hover::after { right: 0; }
.nav .btn { background: transparent; border-color: rgba(255,255,255,.7); }
.nav .btn:hover { background: #fff; color: var(--earth-deep); }

.site-header.scrolled { background: rgba(245,239,231,.94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 10px 0; box-shadow: 0 1px 0 rgba(122,96,73,.12); }
.site-header.scrolled .brand { width: 92px; }
.site-header.scrolled .brand-dark { opacity: 1; }
.site-header.scrolled .brand-light { opacity: 0; }
.site-header.scrolled .nav a:not(.btn) { color: var(--earth-deep); }
.site-header.scrolled .nav .btn { background: var(--earth); border-color: var(--earth); color: var(--paper); }
.site-header.scrolled .nav .btn:hover { background: var(--earth-deep); }

.nav-toggle { display: none; }

@media (max-width: 900px) {
  .nav-toggle {
    display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
    background: none; border: 0; cursor: pointer; position: relative; z-index: 60;
  }
  .bars, .bars::before, .bars::after { display: block; width: 24px; height: 1.5px; background: #fff; transition: transform .35s var(--ease), background .35s; }
  .bars { position: relative; }
  .bars::before, .bars::after { content: ""; position: absolute; left: 0; }
  .bars::before { top: -7px; } .bars::after { top: 7px; }
  .site-header.scrolled .bars, .site-header.scrolled .bars::before, .site-header.scrolled .bars::after,
  .menu-open .bars::before, .menu-open .bars::after { background: var(--earth-deep); }
  .menu-open .bars { background: transparent !important; }
  .menu-open .bars::before { transform: translateY(7px) rotate(45deg); }
  .menu-open .bars::after { transform: translateY(-7px) rotate(-45deg); }

  .nav ul {
    position: fixed; inset: 0; z-index: 55;
    flex-direction: column; justify-content: center; gap: 28px;
    background: var(--cream);
    opacity: 0; visibility: hidden; transition: opacity .4s var(--ease), visibility .4s;
  }
  .menu-open .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .menu-open .nav ul { opacity: 1; visibility: visible; }
  .nav ul a:not(.btn) { color: var(--earth-deep) !important; font-family: var(--serif); font-size: 1.9rem; letter-spacing: .02em; text-transform: none; }
  .nav .btn { background: var(--earth) !important; border-color: var(--earth) !important; color: var(--paper) !important; margin-top: 12px; }
  .menu-open .brand-dark { opacity: 1; z-index: 60; }
  .menu-open .brand { z-index: 60; }
}

/* ───────── Hero ───────── */
.hero {
  position: relative; min-height: 100svh; padding: 0;
  display: flex; align-items: flex-end;
  color: #fff; overflow: hidden; isolation: isolate;
}
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transform: scale(1.06); animation: heroZoom 18s var(--ease) forwards; }
@keyframes heroZoom { to { transform: scale(1); } }
.hero-shade { position: absolute; inset: 0; z-index: -1; background:
  linear-gradient(90deg, rgba(40,30,22,.62) 0%, rgba(40,30,22,.25) 55%, rgba(40,30,22,0) 80%),
  linear-gradient(180deg, rgba(40,30,22,.5) 0%, rgba(40,30,22,.05) 28%, rgba(40,30,22,.2) 55%, rgba(40,30,22,.8) 100%); }
.hero-content { padding-bottom: clamp(90px, 14vh, 150px); padding-top: 140px; }
.hero .eyebrow { color: rgba(255,255,255,.85); }
.hero h1, .hero-lede { text-shadow: 0 2px 24px rgba(30,22,16,.35); }
.hero h1 { color: #fff; font-size: clamp(2.8rem, 7.4vw, 6.4rem); max-width: 12ch; margin-bottom: .35em; }
.hero h1 em { color: #f3c9ae; }
.hero-lede { max-width: 34em; font-size: 1.12em; color: rgba(255,255,255,.9); margin-bottom: 2.2em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-actions.center { justify-content: center; }
.hero .btn:not(.btn-ghost) { background: var(--cream); color: var(--earth-deep); border-color: var(--cream); }
.hero .btn:not(.btn-ghost):hover { background: #fff; }

.scroll-cue { position: absolute; left: 50%; bottom: 28px; width: 26px; height: 42px; margin-left: -13px; border: 1px solid rgba(255,255,255,.6); border-radius: 20px; }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 3px; height: 8px; margin-left: -1.5px; border-radius: 2px; background: #fff; animation: cue 2s var(--ease) infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }
@media (max-width: 600px) { .scroll-cue { display: none; } }

/* ───────── Intro ───────── */
.intro { background: var(--cream); }
.intro-drop { width: 64px; margin: 0 auto 28px; }
.intro h2 { font-size: clamp(1.9rem, 3.8vw, 3rem); }

/* ───────── Rituals ───────── */
.rituals { background: var(--paper); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2vw, 28px); }
@media (max-width: 960px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .cards { grid-template-columns: 1fr; } }
.card {
  background: var(--cream); border-radius: var(--radius);
  padding: clamp(28px, 3vw, 40px);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease), background .5s var(--ease);
}
.card:hover { transform: translateY(-6px); box-shadow: 0 24px 50px -28px rgba(74,58,46,.45); background: #fff; }
.card h3 { font-size: 1.55rem; margin-bottom: .45em; }
.card p { color: var(--muted); margin: 0; font-size: .97em; }
.card-icon { width: 54px; height: 54px; margin-bottom: 22px; border-radius: 50%; display: grid; place-items: center; background: rgba(143,173,164,.22); }
.card:nth-child(2n) .card-icon { background: rgba(213,139,98,.18); }
.card-icon svg { width: 28px; height: 28px; fill: none; stroke: var(--earth); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ───────── Split (The Sala) ───────── */
.split { display: grid; grid-template-columns: 1.15fr 1fr; padding: 0; background: var(--sand); }
.split-media { min-height: 520px; }
.split-media img { width: 100%; height: 100%; object-fit: cover; }
.split-text { padding: clamp(56px, 8vw, 120px) clamp(24px, 6vw, 96px); align-self: center; max-width: 640px; }
.split-text p { color: var(--muted); }
.note { font-size: .92em; border-top: 1px solid rgba(122,96,73,.2); padding-top: 1.2em; margin-top: 1.8em; }
.note a { color: var(--earth); text-underline-offset: 3px; }
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .split-media { min-height: 0; aspect-ratio: 4/3; }
}

/* ───────── Opening ───────── */
.opening { position: relative; color: #fff; text-align: center; isolation: isolate; overflow: hidden; }
.opening-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.opening-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(74,58,46,.82), rgba(59,47,38,.88)); }
.opening .eyebrow { color: #cfe0db; }
.opening h2 { color: #fff; font-size: clamp(2.4rem, 6vw, 4.6rem); }
.opening h2 em { color: #f3c9ae; }
.opening p { color: rgba(255,255,255,.85); max-width: 36em; margin-inline: auto; }
.opening-open { font-family: var(--serif); font-size: 1.6rem; }

.countdown { display: flex; justify-content: center; gap: clamp(10px, 2.5vw, 24px); margin: 36px 0 40px; }
.countdown div {
  min-width: clamp(68px, 16vw, 112px);
  padding: 18px 8px 14px;
  border: 1px solid rgba(255,255,255,.25); border-radius: 14px;
  background: rgba(255,255,255,.06); backdrop-filter: blur(4px);
}
.countdown span { display: block; font-family: var(--serif); font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1; font-variant-numeric: tabular-nums; }
.countdown small { display: block; margin-top: 8px; font-size: .68rem; letter-spacing: .24em; text-transform: uppercase; color: rgba(255,255,255,.7); }

/* ───────── Gallery ───────── */
.gallery { background: var(--cream); }
.grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: clamp(150px, 17vw, 230px); grid-auto-flow: dense;
  gap: clamp(8px, 1.2vw, 16px);
}
.g { position: relative; overflow: hidden; border-radius: 12px; background: var(--sand); }
.g img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease), filter .6s var(--ease); }
.g:hover img { transform: scale(1.05); }
.g-wide { grid-column: span 2; grid-row: span 2; }
.g-tall { grid-row: span 2; }
@media (max-width: 760px) {
  .grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 38vw; }
  .g-wide { grid-column: span 2; grid-row: span 1; }
}

/* ───────── Visit ───────── */
.visit { background: var(--paper); }
.visit-inner { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(40px, 6vw, 96px); align-items: center; }
.visit-text > p { color: var(--muted); }
.visit-media img { border-radius: var(--radius); aspect-ratio: 4/5; object-fit: cover; width: 100%; }
@media (max-width: 860px) {
  .visit-inner { grid-template-columns: 1fr; }
  .visit-media img { aspect-ratio: 4/3; }
}
.contact-list { list-style: none; padding: 0; margin: 2em 0; border-top: 1px solid rgba(122,96,73,.18); }
.contact-list li { padding: 1.05em 0; border-bottom: 1px solid rgba(122,96,73,.18); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 20px; }
.contact-list .label { font-weight: 500; font-size: .74rem; letter-spacing: .22em; text-transform: uppercase; color: var(--sage-deep); padding-top: .3em; }
.contact-list a { text-decoration: none; color: var(--earth-deep); font-size: 1.05em; transition: color .3s; }
.contact-list a:hover { color: var(--clay); }

.socials { display: flex; flex-wrap: wrap; gap: 10px; }
.socials a {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px 10px 12px;
  border: 1px solid rgba(122,96,73,.25); border-radius: 999px; text-decoration: none;
  font-size: .9rem; color: var(--earth-deep); transition: background .3s, border-color .3s, color .3s;
}
.socials a:hover { background: var(--earth); border-color: var(--earth); color: #fff; }
.socials svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.socials svg .fill { fill: currentColor; stroke: none; }

/* ───────── Footer ───────── */
.site-footer { background: var(--earth-deep); color: rgba(255,255,255,.75); text-align: center; padding: 80px 0 48px; }
.footer-logo { width: 96px; margin: 0 auto 26px; }
.footer-tag { font-size: .76rem; letter-spacing: .26em; text-transform: uppercase; color: #cfe0db; }
.footer-meta { font-size: .95rem; }
.footer-meta a { color: #fff; text-decoration: none; }
.footer-meta a:hover { text-decoration: underline; }
.footer-copy { font-size: .8rem; margin: 2.4em 0 0; color: rgba(255,255,255,.45); }

/* ───────── Lightbox ───────── */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: rgba(30,23,18,.92); }
.lightbox img { max-width: min(92vw, 1400px); max-height: 86vh; border-radius: 8px; object-fit: contain; }
.lightbox button {
  position: fixed; background: rgba(255,255,255,.1); color: #fff; border: 0; cursor: pointer;
  width: 52px; height: 52px; border-radius: 50%; font-size: 28px; line-height: 1; transition: background .3s;
}
.lightbox button:hover { background: rgba(255,255,255,.25); }
.lb-close { top: 20px; right: 20px; }
.lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 20px; top: 50%; transform: translateY(-50%); }

/* ───────── Reveal on scroll ───────── */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.js .cards .reveal:nth-child(3n+2) { transition-delay: .1s; }
.js .cards .reveal:nth-child(3n+3) { transition-delay: .2s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
