:root {
  --paper: #FBF6EC;
  --paper-2: #F4EAD6;
  --ink: #2B1B12;
  --ink-soft: #5E4A3C;
  --maroon: #7A1F1F;
  --maroon-deep: #4A1212;
  --gold: #C99A3E;
  --gold-light: #E8C37A;
  --saffron: #D9822B;
  --line: rgba(122, 31, 31, .14);
  --radius: 14px;
  --shadow: 0 18px 40px -22px rgba(74, 18, 18, .45);
  --serif: "Noto Serif Thai", serif;
  --sans: "Sarabun", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.8 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.35; margin: 0; }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  color: #fff;
  transition: background .35s, box-shadow .35s, color .35s;
}
.site-header.scrolled, .site-header.solid {
  background: rgba(251, 246, 236, .94);
  backdrop-filter: blur(10px);
  color: var(--ink);
  box-shadow: 0 1px 0 var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; color: var(--gold-light); }
.scrolled .brand-mark, .solid .brand-mark { color: var(--maroon); }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-family: var(--serif); font-size: 1.2rem; }
.brand-text small { font-size: .75rem; opacity: .8; letter-spacing: .02em; }

.site-nav { display: flex; gap: 4px; align-items: center; }
.site-nav a {
  text-decoration: none; font-weight: 500; font-size: .95rem;
  padding: 8px 14px; border-radius: 999px;
  transition: background .2s;
}
.site-nav a:hover { background: rgba(255, 255, 255, .14); }
.scrolled .site-nav a:hover, .solid .site-nav a:hover { background: var(--paper-2); }
.site-nav a[aria-current="page"]:not(.nav-cta) { box-shadow: inset 0 -2px 0 var(--gold); border-radius: 0; }
.site-nav .nav-cta { background: var(--gold); color: var(--maroon-deep); }
.site-nav .nav-cta:hover { background: var(--gold-light); }

.nav-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; color: inherit; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: currentColor; margin: 5px 0; transition: transform .3s, opacity .3s; }
.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: flex; align-items: flex-end;
  color: #fff; overflow: hidden;
}
/* Slideshow: crossfade + slow Ken Burns zoom/pan, a different direction per slide */
.hero-slides { position: absolute; inset: 0; background: var(--maroon-deep); }
.hero-slide { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity 1.6s ease; }
.hero-slide.is-active { opacity: 1; z-index: 1; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; object-position: center 40%; will-change: transform; }
.hero-slide.is-active img { animation: kenburns 9s ease-out both; }
.hero-slide:nth-child(4n+1) img { --from: scale(1.07) translate(1.5%, 1%); }
.hero-slide:nth-child(4n+2) img { --from: scale(1.07) translate(-1.5%, -1%); }
.hero-slide:nth-child(4n+3) img { --from: scale(1.07) translate(-1%, 1.5%); }
.hero-slide:nth-child(4n+4) img { --from: scale(1.07) translate(1%, -1.5%); }
@keyframes kenburns { from { transform: var(--from); } to { transform: scale(1) translate(0, 0); } }

.hero-sparkles { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }

/* Lighter than before so the photo stays crisp; darkness sits only behind the text */
.hero-shade {
  position: absolute; inset: 0; z-index: 2;
  background:
    linear-gradient(180deg, rgba(43, 12, 8, .45) 0%, rgba(43, 12, 8, 0) 22%),
    linear-gradient(90deg, rgba(43, 12, 8, .72) 0%, rgba(43, 12, 8, .35) 45%, rgba(43, 12, 8, 0) 70%),
    linear-gradient(0deg, rgba(43, 12, 8, .8) 0%, rgba(43, 12, 8, 0) 45%);
}
.hero-content { position: relative; z-index: 3; padding-bottom: clamp(72px, 12vh, 130px); will-change: transform, opacity; }
.eyebrow {
  display: inline-block; margin: 0 0 14px;
  padding: 4px 14px; border: 1px solid rgba(232, 195, 122, .6); border-radius: 999px;
  color: var(--gold-light); font-size: .9rem; letter-spacing: .04em;
  background: rgba(43, 12, 8, .45); backdrop-filter: blur(4px);
}
.hero-en, .hero-addr { text-shadow: 0 2px 12px rgba(0, 0, 0, .6); }
.hero h1 {
  font-size: clamp(3.4rem, 11vw, 7.5rem); font-weight: 700; line-height: 1.1;
  text-shadow: 0 4px 30px rgba(0, 0, 0, .35);
}
.hero-en { margin: 4px 0 18px; font-family: var(--serif); font-size: clamp(1.1rem, 2.5vw, 1.5rem); color: var(--gold-light); letter-spacing: .12em; text-transform: uppercase; }
.hero-addr { max-width: 560px; margin: 0 0 30px; font-size: 1.05rem; opacity: .92; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Text rises in line by line */
.hero-home .hero-content > * { animation: rise .9s cubic-bezier(.2, .7, .2, 1) both; }
.hero-home .hero-content > :nth-child(1) { animation-delay: .15s; }
.hero-home .hero-content > :nth-child(2) { animation-delay: .3s; }
.hero-home .hero-content > :nth-child(3) { animation-delay: .5s; }
.hero-home .hero-content > :nth-child(4) { animation-delay: .65s; }
.hero-home .hero-content > :nth-child(5) { animation-delay: .8s; }
@keyframes rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }

/* A band of gold light sweeps across the temple name every few seconds */
.shimmer {
  background: linear-gradient(105deg, #fff 0%, #fff 42%, #FFE3A3 48%, #FFF6DC 50%, #FFE3A3 52%, #fff 58%, #fff 100%);
  background-size: 300% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 6s ease-in-out 1.4s infinite;
}
.hero-home h1 { text-shadow: none; filter: drop-shadow(0 4px 22px rgba(0, 0, 0, .45)); }
@keyframes shimmer { 0% { background-position: 100% 0; } 35%, 100% { background-position: 0 0; } }

/* Caption + dots with a progress fill for the current slide */
.hero-meta {
  position: absolute; z-index: 3; right: max(16px, calc((100% - 1160px) / 2)); bottom: 26px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
}
.hero-caption { margin: 0; font-size: .92rem; color: rgba(255, 255, 255, .9); text-shadow: 0 1px 8px rgba(0, 0, 0, .7); transition: opacity .5s; }
.hero-caption.fading { opacity: 0; }
.hero-dots { display: flex; gap: 8px; }
.hero-dot {
  position: relative; width: 34px; height: 4px; padding: 0; border: 0; border-radius: 4px;
  background: rgba(255, 255, 255, .35); cursor: pointer; overflow: hidden;
}
.hero-dot::before { content: ""; position: absolute; inset: -10px 0; } /* bigger tap target */
.hero-dot::after { content: ""; position: absolute; inset: 0; width: 0; background: var(--gold-light); border-radius: inherit; }
.hero-dot.is-active::after { animation: dotfill var(--slide-ms, 7000ms) linear forwards; }
.hero-dot.paused::after { animation-play-state: paused; }
@keyframes dotfill { to { width: 100%; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 26px; border-radius: 999px;
  font-weight: 600; text-decoration: none; font-size: 1rem;
  transition: transform .2s, background .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-gold { background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: var(--maroon-deep); box-shadow: 0 10px 24px -10px rgba(201, 154, 62, .8); }
.btn-ghost { border: 1.5px solid rgba(255, 255, 255, .7); color: #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, .12); }
.btn-maroon { background: var(--maroon); color: #fff; }
.btn-maroon:hover { background: var(--maroon-deep); }

.scroll-cue {
  position: absolute; z-index: 3; left: 50%; bottom: 22px; translate: -50% 0;
  width: 26px; height: 42px; border: 2px solid rgba(255, 255, 255, .6); border-radius: 14px;
}
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: #fff; animation: cue 1.8s infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Facts ---------- */
.facts { background: var(--maroon); color: #fff; position: relative; }
.facts::before, .facts::after {
  content: ""; position: absolute; left: 0; right: 0; height: 6px;
  background: repeating-linear-gradient(90deg, var(--gold) 0 14px, transparent 14px 20px);
  opacity: .7;
}
.facts::before { top: 0; } .facts::after { bottom: 0; }
.facts-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.fact { padding: 34px 16px; text-align: center; display: flex; flex-direction: column; gap: 4px; }
.fact + .fact { border-left: 1px solid rgba(232, 195, 122, .22); }
.fact-num { font-family: var(--serif); font-size: clamp(1.25rem, 2.4vw, 1.75rem); font-weight: 700; color: var(--gold-light); }
.fact-label { font-size: .92rem; opacity: .85; }

/* ---------- Sections ---------- */
.section { padding: clamp(72px, 10vw, 120px) 0; }
.section-tint { background: var(--paper-2); }
.section-dark { background: radial-gradient(ellipse at top, #5A1818, var(--maroon-deep) 70%); color: #fff; }
.section-head { text-align: center; margin-bottom: clamp(40px, 6vw, 64px); }
.kicker { margin: 0 0 6px; color: var(--saffron); font-weight: 600; letter-spacing: .08em; font-size: .95rem; }
.section-dark .kicker { color: var(--gold-light); }
.section-head h2 { font-size: clamp(1.9rem, 4.2vw, 2.8rem); color: var(--maroon); }
.section-dark .section-head h2 { color: #fff; }
.ornament {
  width: 160px; height: 18px; margin: 16px auto 0;
  background:
    radial-gradient(circle, var(--gold) 4px, transparent 5px) center / 18px 18px no-repeat,
    linear-gradient(90deg, transparent, var(--gold) 45%, transparent 45%, transparent 55%, var(--gold) 55%, transparent) center / 100% 1.5px no-repeat;
}

/* ---------- History ---------- */
.history-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.lead { font-family: var(--serif); font-size: 1.35rem; color: var(--maroon); margin-top: 0; }
.history-text p { color: var(--ink-soft); }
.bounds { margin-top: 28px; padding: 24px 26px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.bounds h3 { font-size: 1.15rem; color: var(--maroon); margin-bottom: 10px; }
.bounds dl { margin: 0; display: grid; gap: 2px; }
.bounds dl div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.bounds dl div:last-child { border-bottom: 0; }
.bounds dt { color: var(--ink-soft); font-size: .95rem; }
.bounds dd { margin: 0; font-weight: 600; text-align: right; }
.history-figure { margin: 0; position: relative; }
.history-figure img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 55% center;
  border-radius: 200px 200px var(--radius) var(--radius);
  background: linear-gradient(180deg, #7FB7E6, #CDE6F7);
  box-shadow: var(--shadow);
  border: 6px solid #fff;
}
.history-figure figcaption { text-align: center; margin-top: 12px; color: var(--ink-soft); font-size: .9rem; }

.timeline { margin-top: clamp(56px, 8vw, 88px); }
.timeline-title { text-align: center; font-size: 1.4rem; color: var(--maroon); margin-bottom: 28px; }
.timeline ol {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px;
}
.timeline li {
  position: relative; padding: 20px 20px 18px; background: #fff;
  border-radius: var(--radius); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px;
  transition: transform .25s, box-shadow .25s;
}
.timeline li:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.timeline li::before { content: ""; position: absolute; left: 20px; top: 0; width: 36px; height: 3px; background: var(--gold); border-radius: 0 0 3px 3px; }
.t-year { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; color: var(--maroon); }
.t-text { color: var(--ink-soft); font-size: .95rem; line-height: 1.6; }

/* ---------- Sacred ---------- */
.sacred-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.sacred-card {
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(232, 195, 122, .25);
  border-radius: 20px; overflow: hidden;
}
.sacred-img { aspect-ratio: 4 / 3; overflow: hidden; }
.sacred-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s; }
.sacred-card:hover .sacred-img img { transform: scale(1.05); }
.sacred-body { padding: 26px 28px 30px; }
.sacred-body h3 { font-size: 1.4rem; color: var(--gold-light); }
.posture { margin: 2px 0 18px; opacity: .8; }
.specs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.specs li { padding: 12px; border-radius: 10px; background: rgba(0, 0, 0, .2); display: flex; flex-direction: column; text-align: center; }
.specs span { font-size: .8rem; opacity: .75; }
.specs b { font-family: var(--serif); font-size: 1.1rem; color: #fff; }

/* ---------- Buildings ---------- */
.buildings-feature { position: relative; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); margin-bottom: 28px; }
.buildings-feature img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; }
.feature-card {
  position: absolute; left: 28px; bottom: 28px; max-width: 340px;
  padding: 22px 26px; background: rgba(251, 246, 236, .95); border-radius: var(--radius);
  backdrop-filter: blur(6px);
}
.feature-card .kicker { margin-bottom: 0; }
.feature-card h3 { font-size: 1.3rem; color: var(--maroon); }
.feature-card p:last-child { margin: 6px 0 0; color: var(--ink-soft); }

.building-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.building {
  padding: 26px 26px 22px; background: #fff; border-radius: var(--radius);
  border: 1px solid var(--line); position: relative; overflow: hidden;
  transition: transform .25s, box-shadow .25s;
}
.building:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.building::after {
  content: ""; position: absolute; right: -24px; top: -24px; width: 90px; height: 90px;
  border-radius: 50%; border: 12px solid var(--paper-2);
}
.building h3 { font-size: 1.2rem; color: var(--maroon); position: relative; z-index: 1; }
.building .dim { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; color: var(--saffron); margin: 4px 0 6px; }
.building p { margin: 0; color: var(--ink-soft); font-size: .95rem; line-height: 1.6; }
.building-misc ul { margin: 10px 0 0; padding-left: 1.1em; color: var(--ink-soft); font-size: .95rem; line-height: 1.8; }

/* ---------- Abbots ---------- */
.abbot-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(28px, 5vw, 56px); align-items: center; }
.abbot-portrait { margin: 0; background: #fff; padding: 12px; border-radius: 20px; box-shadow: var(--shadow); }
.abbot-portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 70% center; border-radius: 12px; }
.abbot-portrait figcaption { padding: 16px 8px 6px; text-align: center; display: flex; flex-direction: column; }
.abbot-portrait strong { font-family: var(--serif); font-size: 1.25rem; color: var(--maroon); }
.abbot-portrait span { color: var(--ink-soft); font-size: .92rem; }

.abbot-list { list-style: none; margin: 0; padding: 0; position: relative; }
.abbot-list::before { content: ""; position: absolute; left: 39px; top: 30px; bottom: 30px; width: 2px; background: linear-gradient(var(--gold), var(--maroon)); }
.abbot-list li { position: relative; display: flex; align-items: center; gap: 22px; padding: 14px 0; }
.abbot-no {
  flex: none; width: 80px; height: 80px; border-radius: 50%;
  display: grid; place-items: center; text-align: center;
  background: #fff; border: 2px solid var(--gold); color: var(--maroon);
  font-family: var(--serif); font-weight: 600; font-size: .95rem; position: relative; z-index: 1;
}
.abbot-list .current .abbot-no { background: var(--maroon); color: var(--gold-light); border-color: var(--maroon); box-shadow: 0 0 0 6px rgba(122, 31, 31, .15); }
.abbot-list h3 { font-size: 1.25rem; }
.abbot-list p { margin: 0; color: var(--ink-soft); }
.abbot-list .current h3 { color: var(--maroon); }

.dhamma-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: clamp(48px, 7vw, 72px); }
.dhamma { background: #fff; border-radius: var(--radius); padding: 28px; border: 1px solid var(--line); }
.dhamma-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--paper-2); color: var(--maroon); margin-bottom: 14px; }
.dhamma-icon svg { width: 26px; height: 26px; }
.dhamma h3 { font-size: 1.25rem; color: var(--maroon); margin-bottom: 6px; }
.dhamma p { margin: 4px 0; color: var(--ink-soft); }
.dhamma b { color: var(--ink); }

/* ---------- Gallery ---------- */
.gallery { columns: 3; column-gap: 12px; }
.gallery .g-item { display: block; margin-bottom: 12px; break-inside: avoid; }
.gallery .g-item img { height: auto; }
.g-item { position: relative; border-radius: 12px; overflow: hidden; cursor: zoom-in; background: var(--paper-2); }
.g-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s, filter .6s; }
.g-item:hover img { transform: scale(1.06); filter: saturate(1.1); }

/* ---------- Visit ---------- */
.visit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 4vw, 48px); align-items: start; }
.visit-info h3 { font-size: 1.4rem; color: var(--maroon); }
.visit-info p { color: var(--ink-soft); }
.visit-info .en { font-size: .92rem; font-style: italic; }
.map-embed { margin-top: 24px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 4 / 3; background: #e7ddc9; }
.map-embed iframe { width: 100%; height: 100%; border: 0; }
.plans { display: grid; gap: 18px; }
.plan { display: block; border-radius: var(--radius); box-shadow: var(--shadow); background: #fff; }
.plan img { aspect-ratio: 3 / 2; object-fit: cover; object-position: top; }
.plan span {
  position: absolute; left: 14px; bottom: 14px; padding: 6px 14px; border-radius: 999px;
  background: var(--maroon); color: #fff; font-size: .9rem; font-weight: 500;
}

/* ---------- Footer ---------- */
.site-footer { background: var(--maroon-deep); color: rgba(255, 255, 255, .8); padding: 56px 0 28px; }
.footer-inner { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.footer-name { font-family: var(--serif); font-size: 1.6rem; color: var(--gold-light); margin: 0 0 6px; }
.footer-inner p { margin: 0; font-size: .95rem; }
.footer-nav { display: grid; grid-template-columns: repeat(2, auto); gap: 6px 36px; align-content: start; }
.footer-nav a { text-decoration: none; font-size: .95rem; }
.footer-nav a:hover { color: var(--gold-light); }
.footer-credit { margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: .82rem; opacity: .6; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(20, 8, 6, .94);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: min(1200px, 100%); }
.lightbox img { max-height: 82vh; width: auto; margin: auto; border-radius: 8px; }
.lightbox figcaption { color: rgba(255, 255, 255, .8); text-align: center; margin-top: 12px; }
.lightbox button { position: absolute; background: rgba(255, 255, 255, .1); border: 0; color: #fff; width: 48px; height: 48px; border-radius: 50%; font-size: 28px; line-height: 1; cursor: pointer; }
.lightbox button:hover { background: rgba(255, 255, 255, .22); }
.lb-close { top: 18px; right: 18px; }
.lb-prev { left: 18px; top: 50%; translate: 0 -50%; }
.lb-next { right: 18px; top: 50%; translate: 0 -50%; }

/* ---------- Shared bits for multi-page ---------- */
.hero-home { min-height: 88svh; }
.btn-outline { border: 1.5px solid var(--maroon); color: var(--maroon); }
.btn-outline:hover { background: var(--maroon); color: #fff; }
.center { text-align: center; }
.muted { color: var(--ink-soft); }
.empty { padding: 40px 20px; text-align: center; color: var(--ink-soft); background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); }
.section-tight { padding: clamp(48px, 6vw, 72px) 0; }
.sub-title { font-size: clamp(1.4rem, 3vw, 1.8rem); color: var(--maroon); margin-bottom: 24px; }
.link-arrow { color: var(--maroon); font-weight: 600; text-decoration: none; white-space: nowrap; }
.link-arrow:hover { text-decoration: underline; }
.abbot-grid.no-photo { grid-template-columns: 1fr; max-width: 640px; margin-inline: auto; }

.page-hero {
  padding: calc(72px + clamp(48px, 7vw, 88px)) 0 clamp(44px, 6vw, 72px);
  background:
    radial-gradient(ellipse at 80% 0%, rgba(232, 195, 122, .18), transparent 60%),
    linear-gradient(135deg, var(--maroon-deep), var(--maroon));
  color: #fff; text-align: center; position: relative;
}
.page-hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px;
  background: repeating-linear-gradient(90deg, var(--gold) 0 14px, transparent 14px 20px); opacity: .7;
}
.page-hero .kicker { color: var(--gold-light); }
.page-hero h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); }
.page-hero-sub { margin: 8px 0 0; opacity: .85; }

/* ---------- Home: updates ---------- */
.updates-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: clamp(28px, 4vw, 48px); align-items: start; }
.updates-grid.no-events { grid-template-columns: 1fr; }
.row-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; }
.row-head h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); color: var(--maroon); }
.row-head .kicker { margin-bottom: 0; }
.news-stack { display: grid; gap: 16px; }
.news-stack .news-link { display: grid; grid-template-columns: 220px 1fr; }
.news-stack .news-img { aspect-ratio: auto; min-height: 170px; }
.no-events .news-stack { grid-template-columns: repeat(3, 1fr); }
.no-events .news-stack .news-link { display: block; }
.no-events .news-stack .news-img { aspect-ratio: 16 / 10; min-height: 0; }

.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.news-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .25s, box-shadow .25s; }
.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.news-link { display: block; text-decoration: none; height: 100%; }
.news-img { position: relative; aspect-ratio: 16 / 10; background: var(--paper-2); overflow: hidden; }
.news-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.news-noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--gold); }
.news-noimg .brand-mark { width: 56px; height: 56px; opacity: .6; }
.badge { position: absolute; left: 12px; top: 12px; background: var(--saffron); color: #fff; font-size: .8rem; font-weight: 600; padding: 3px 12px; border-radius: 999px; }
.news-body { padding: 18px 22px 20px; display: flex; flex-direction: column; gap: 4px; }
.news-body time { color: var(--saffron); font-size: .9rem; font-weight: 500; }
.news-body h3 { font-size: 1.2rem; color: var(--ink); }
.news-body p { margin: 2px 0 6px; color: var(--ink-soft); font-size: .95rem; line-height: 1.65; }
.news-body .more { color: var(--maroon); font-weight: 600; font-size: .95rem; margin-top: auto; }

.events-card {
  background: linear-gradient(160deg, var(--maroon), var(--maroon-deep)); color: #fff;
  border-radius: 20px; padding: 28px 26px; box-shadow: var(--shadow);
  position: sticky; top: 92px;
}
.events-card .kicker { color: var(--gold-light); margin-bottom: 0; }
.events-card h2 { font-size: 1.6rem; margin-bottom: 14px; }
.event-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.event { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px solid rgba(232, 195, 122, .2); }
.event:last-child { border-bottom: 0; }
.event-date {
  flex: none; width: 62px; height: 66px; border-radius: 12px; background: var(--gold); color: var(--maroon-deep);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1;
}
.event-day { font-family: var(--serif); font-size: 1.6rem; font-weight: 700; }
.event-mon { font-size: .82rem; font-weight: 600; }
.event-body h3 { font-size: 1.1rem; }
.event-body p { margin: 2px 0 0; font-size: .92rem; opacity: .85; line-height: 1.6; }
.event-body .event-when { color: var(--gold-light); opacity: 1; }
.events-note { margin: 12px 0 0; font-size: .88rem; opacity: .7; }
.event-list-wide { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.event-list-wide .event { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.event-list-wide .event-body h3 { color: var(--maroon); }
.event-list-wide .event-body p { color: var(--ink-soft); opacity: 1; }
.event-list-wide .event-body .event-when { color: var(--saffron); }

/* ---------- Home: intro / teaser / visit ---------- */
.intro-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.intro-figure { margin: 0; }
.intro-figure img { width: 100%; aspect-ratio: 4 / 5; max-height: 520px; object-fit: cover; border-radius: 200px 200px var(--radius) var(--radius); box-shadow: var(--shadow); border: 6px solid #fff; }
.intro-title { font-size: clamp(1.6rem, 3.2vw, 2.2rem); color: var(--maroon); margin: 4px 0 12px; }
.intro-grid .hero-actions { margin-top: 20px; }
.teaser-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 28px; }
.teaser-grid .g-item { aspect-ratio: 4 / 3; }
.visit-band { background: var(--maroon-deep); color: #fff; padding: clamp(44px, 6vw, 64px) 0; }
.visit-band-inner { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.visit-band .kicker { color: var(--gold-light); margin: 0; }
.visit-band h2 { font-size: 1.8rem; }
.visit-band p { margin: 4px 0 0; opacity: .85; }

/* ---------- News article ---------- */
.article { padding: calc(72px + clamp(36px, 5vw, 56px)) 0 clamp(56px, 8vw, 88px); }
.article-wrap { max-width: 780px; }
.link-back { display: inline-block; margin-bottom: 24px; color: var(--maroon); text-decoration: none; font-weight: 600; }
.article time { display: block; color: var(--saffron); font-weight: 500; }
.article h1 { font-size: clamp(1.8rem, 4.4vw, 2.6rem); color: var(--maroon); margin: 6px 0 24px; }
.article-img { display: block; border-radius: var(--radius); margin-bottom: 28px; box-shadow: var(--shadow); }
.article-img img { width: 100%; max-height: 560px; object-fit: cover; }
.article-body { font-size: 1.1rem; }
.article-body p { margin: 0 0 1.1em; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(28px, 4vw, 48px); align-items: start; }
.contact-list { margin: 0 0 24px; display: grid; }
.contact-list div { display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.contact-list dt { color: var(--ink-soft); }
.contact-list dd { margin: 0; font-weight: 500; }
.contact-list .en { font-weight: 400; font-size: .9rem; font-style: italic; color: var(--ink-soft); }
.contact-list a { color: var(--maroon); }
.donate { display: grid; gap: 18px; }
.donate-card { background: linear-gradient(160deg, var(--maroon), var(--maroon-deep)); color: #fff; border-radius: 20px; padding: 30px 28px; box-shadow: var(--shadow); }
.donate-card .kicker { color: var(--gold-light); margin: 0; }
.donate-card h2 { font-size: 1.6rem; margin-bottom: 8px; }
.donate-card p { opacity: .88; }
.donate-list { margin: 16px 0 0; display: grid; gap: 2px; }
.donate-list div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(232, 195, 122, .2); }
.donate-list dt { opacity: .75; }
.donate-list dd { margin: 0; text-align: right; font-weight: 600; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.donate-list .acc { font-family: var(--serif); font-size: 1.2rem; color: var(--gold-light); letter-spacing: .03em; }
.copy-btn { background: var(--gold); color: var(--maroon-deep); border: 0; border-radius: 999px; padding: 4px 14px; font: 600 .85rem var(--sans); cursor: pointer; }
.donate-qr { margin: 20px auto 0; max-width: 240px; border-radius: 12px; background: #fff; padding: 10px; }
.footer-contact a { color: var(--gold-light); }
.footer-credit a { color: inherit; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-cue span, .hero-slide.is-active img, .shimmer, .hero-home .hero-content > * { animation: none; }
  .hero-slide { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1120px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: fixed; inset: 72px 0 auto; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); color: var(--ink); padding: 8px 16px 20px;
    box-shadow: 0 20px 30px -20px rgba(0, 0, 0, .3);
    transform: translateY(-12px); opacity: 0; pointer-events: none; transition: .25s;
  }
  .nav-open .site-nav { transform: none; opacity: 1; pointer-events: auto; }
  .nav-open.site-header { background: var(--paper); color: var(--ink); }
  .nav-open .brand-mark { color: var(--maroon); }
  .site-nav a { padding: 14px 12px; border-radius: 10px; border-bottom: 1px solid var(--line); }
  .site-nav .nav-cta { margin-top: 12px; text-align: center; border: 0; }

}
@media (max-width: 960px) {
  .facts-grid { grid-template-columns: repeat(2, 1fr); }
  .fact:nth-child(3) { border-left: 0; }
  .fact:nth-child(n+3) { border-top: 1px solid rgba(232, 195, 122, .22); }
  .history-grid, .abbot-grid, .visit-grid { grid-template-columns: 1fr; }
  .history-figure { max-width: 420px; margin-inline: auto; }
  .abbot-portrait { max-width: 420px; margin-inline: auto; }
  .building-grid { grid-template-columns: repeat(2, 1fr); }
  .updates-grid, .contact-grid, .intro-grid { grid-template-columns: 1fr; }
  .events-card { position: static; }
  .news-grid, .no-events .news-stack { grid-template-columns: repeat(2, 1fr); }
  .intro-figure { max-width: 420px; margin-inline: auto; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .sacred-grid, .building-grid, .dhamma-grid { grid-template-columns: 1fr; }
  .buildings-feature img { aspect-ratio: 4 / 3; }
  .feature-card { position: static; max-width: none; border-radius: 0; }
  .gallery { columns: 2; column-gap: 8px; }
  .gallery .g-item { margin-bottom: 8px; }
  .bounds dl div { flex-direction: column; gap: 0; }
  .bounds dd { text-align: left; }
  .abbot-list::before { left: 31px; }
  .abbot-no { width: 64px; height: 64px; font-size: .82rem; }
  .abbot-list li { gap: 16px; }
  .lb-prev, .lb-next { top: auto; bottom: 18px; translate: none; }
  .news-grid, .no-events .news-stack { grid-template-columns: 1fr; }
  .hero-meta ~ .scroll-cue { display: none; }
  .hero-meta { left: 16px; right: 16px; align-items: flex-start; bottom: 20px; }
  .hero-caption { font-size: .85rem; }
  .hero-shade {
    background:
      linear-gradient(180deg, rgba(43, 12, 8, .45) 0%, rgba(43, 12, 8, 0) 22%),
      linear-gradient(0deg, rgba(43, 12, 8, .88) 0%, rgba(43, 12, 8, .4) 50%, rgba(43, 12, 8, .1) 75%);
  }
  .news-stack .news-link { grid-template-columns: 1fr; }
  .news-stack .news-img { aspect-ratio: 16 / 10; min-height: 0; }
  .row-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .teaser-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .contact-list div { grid-template-columns: 1fr; gap: 2px; }
  .donate-list div { flex-direction: column; align-items: flex-start; }
  .donate-list dd { text-align: left; justify-content: flex-start; }
}

/* ---------- Background music toggle (bottom-left) ---------- */
.music-toggle {
  position: fixed; left: 16px; bottom: 16px; z-index: 40;
  display: flex; align-items: center; height: 46px; min-width: 46px; padding: 0 15px;
  border-radius: 999px; border: 1px solid rgba(232, 195, 122, .45);
  background: rgba(43, 12, 8, .72); color: var(--gold-light);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 10px 28px -10px rgba(0, 0, 0, .55);
  cursor: pointer; font: 500 .85rem var(--sans);
  transition: background .3s, border-color .3s, transform .2s;
}
.music-toggle:hover { background: rgba(74, 18, 18, .9); border-color: var(--gold-light); }
.music-toggle:active { transform: scale(.95); }
.eq { display: flex; align-items: flex-end; gap: 3px; height: 16px; width: 18px; }
.eq i { flex: 1; height: 28%; background: currentColor; border-radius: 2px; transition: height .4s; }
.music-toggle:not(.is-playing) .eq { opacity: .75; }
.music-toggle.is-playing .eq i { animation: eq 1.1s ease-in-out infinite; }
.music-toggle.is-playing .eq i:nth-child(2) { animation-duration: .9s; animation-delay: -.35s; }
.music-toggle.is-playing .eq i:nth-child(3) { animation-duration: 1.3s; animation-delay: -.7s; }
.music-toggle.is-playing .eq i:nth-child(4) { animation-duration: 1s; animation-delay: -.2s; }
@keyframes eq { 0%, 100% { height: 25%; } 50% { height: 100%; } }
/* label slides out on hover / keyboard focus */
.music-label { max-width: 0; overflow: hidden; white-space: nowrap; opacity: 0; transition: max-width .35s ease, opacity .25s, margin .35s; }
.music-toggle:hover .music-label, .music-toggle:focus-visible .music-label { max-width: 80px; opacity: 1; margin-left: 10px; }
/* soft pulse until the music has started, hinting it's there */
.music-toggle.hint::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit;
  border: 1px solid var(--gold-light); animation: ring 2.4s ease-out infinite; pointer-events: none;
}
@keyframes ring { from { opacity: .8; transform: scale(1); } to { opacity: 0; transform: scale(1.45); } }
@media (prefers-reduced-motion: reduce) {
  .music-toggle.is-playing .eq i, .music-toggle.hint::before { animation: none; }
  .music-toggle.is-playing .eq i { height: 70%; }
}
@media (max-width: 640px) {
  .music-toggle { left: 12px; bottom: 12px; }
  /* keep the slideshow dots clear of the music button */
  .hero-meta { left: auto; right: 16px; align-items: flex-end; }
}

/* ---------- Welcome gate (one tap = enter site + start music) ---------- */
.gate { display: none; }
.show-gate body { overflow: hidden; }
.show-gate .gate {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(232, 195, 122, .16), transparent 60%),
    radial-gradient(ellipse at 50% 120%, #5A1818, var(--maroon-deep) 70%);
  color: #fff; text-align: center;
  transition: opacity .9s ease, visibility .9s;
}
.gate.leaving { opacity: 0; visibility: hidden; }
.gate.leaving .gate-inner { transform: scale(1.04); }
.gate-inner { display: flex; flex-direction: column; align-items: center; transition: transform .9s ease; animation: rise 1s cubic-bezier(.2, .7, .2, 1) both; }
.gate-wheel { width: 84px; height: 84px; color: var(--gold-light); margin-bottom: 18px; animation: spin 40s linear infinite; filter: drop-shadow(0 0 18px rgba(232, 195, 122, .45)); }
@keyframes spin { to { transform: rotate(360deg); } }
.gate-kicker { margin: 0; color: var(--gold-light); letter-spacing: .12em; }
.gate h2 { font-size: clamp(2.8rem, 10vw, 4.6rem); line-height: 1.2; margin: 4px 0 6px; }
.gate-sub { margin: 0 0 32px; opacity: .75; }
.gate-enter { gap: 10px; padding: 14px 34px; font-size: 1.1rem; }
.gate-enter svg { width: 20px; height: 20px; }
.gate-quiet { margin-top: 18px; background: none; border: 0; color: rgba(255, 255, 255, .7); font: 500 .95rem var(--sans); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; padding: 8px; }
.gate-quiet:hover { color: #fff; }
/* hold the home-page entrance animations until the gate opens */
.show-gate:not(.gate-closing) .hero-home .hero-content > * { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .gate-wheel, .gate-inner { animation: none; } }

/* ---------- Next วันพระ card (home) ---------- */
.updates-events { display: grid; gap: 18px; align-content: start; position: sticky; top: 92px; }
.updates-events .events-card { position: static; }
.holy-card {
  display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; align-items: center;
  padding: 22px 24px; border-radius: 20px; text-decoration: none; color: #fff; position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 18% 30%, rgba(255, 226, 160, .22), transparent 42%),
    linear-gradient(160deg, #1d1330, #120b1f 60%, #2a1208);
  box-shadow: var(--shadow); transition: transform .25s, box-shadow .25s;
}
.holy-card:hover { transform: translateY(-3px); box-shadow: 0 24px 50px -24px rgba(20, 10, 40, .8); }
.holy-card::after { /* a few stars */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .7;
  background-image: radial-gradient(1.4px 1.4px at 72% 18%, #fff, transparent), radial-gradient(1px 1px at 88% 44%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 60% 78%, #fff, transparent), radial-gradient(1px 1px at 94% 82%, #fff, transparent);
}
.holy-moon .moon { filter: drop-shadow(0 0 18px rgba(255, 226, 160, .55)); animation: float 6s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.holy-info .kicker { color: var(--gold-light); margin: 0; }
.holy-count { margin: 0; font-family: var(--serif); font-size: 1.5rem; line-height: 1.3; }
.holy-count b { color: var(--gold-light); font-size: 2.1rem; }
.holy-date { margin: 2px 0 0; font-weight: 500; }
.holy-lunar { margin: 0; opacity: .8; font-size: .92rem; }
.holy-lunar span { color: var(--gold-light); opacity: 1; }
.holy-today { grid-column: 1 / -1; margin: 10px 0 0; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: .88rem; opacity: .85; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.holy-link { color: var(--gold-light); font-weight: 600; }

/* ---------- Calendar page: night-sky hero ---------- */
.moon-hero {
  position: relative; overflow: hidden; color: #fff;
  padding: calc(72px + clamp(28px, 5vw, 56px)) 0 clamp(48px, 7vw, 80px);
  background:
    radial-gradient(ellipse at 30% 40%, rgba(255, 220, 150, .14), transparent 45%),
    radial-gradient(ellipse at 80% 10%, rgba(120, 90, 200, .18), transparent 50%),
    linear-gradient(180deg, #0c0818 0%, #160d26 55%, #2a1208 100%);
}
.stars, .stars::before {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 10% 20%, #fff, transparent), radial-gradient(1px 1px at 22% 68%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 35% 12%, #fff, transparent), radial-gradient(1px 1px at 48% 82%, #fff, transparent),
    radial-gradient(1.6px 1.6px at 63% 30%, #fff, transparent), radial-gradient(1px 1px at 72% 62%, #fff, transparent),
    radial-gradient(1.3px 1.3px at 84% 18%, #fff, transparent), radial-gradient(1px 1px at 92% 74%, #fff, transparent),
    radial-gradient(1px 1px at 56% 50%, #fff, transparent), radial-gradient(1.2px 1.2px at 5% 88%, #fff, transparent);
}
.stars { opacity: .8; }
.stars::before { content: ""; transform: translate(3%, 7%) scale(1.3); animation: twinkle 5s ease-in-out infinite alternate; }
@keyframes twinkle { from { opacity: .15; } to { opacity: .9; } }
.moon-hero-inner { position: relative; display: grid; grid-template-columns: auto 1fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.moon-stage { position: relative; width: min(340px, 78vw); aspect-ratio: 1; display: grid; place-items: center; }
.dial { position: absolute; inset: 0; width: 100%; height: 100%; }
.dial-track { fill: none; stroke: rgba(255, 255, 255, .08); stroke-width: 2; }
.dial-progress { fill: none; stroke: var(--gold-light); stroke-width: 2; stroke-linecap: round; opacity: .7; animation: dialin 1.6s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes dialin { from { stroke-dasharray: 0 2000; } }
.tick { stroke: rgba(255, 255, 255, .35); stroke-width: 2; stroke-linecap: round; }
.tick.past { stroke: rgba(255, 226, 160, .6); }
.tick.holy { stroke: var(--gold-light); stroke-width: 3; }
.holy-dot { fill: var(--gold); }
.holy-dot.now { fill: #fff; }
.dial-now { fill: #fff; filter: drop-shadow(0 0 8px #FFE2A0); animation: pulse 2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes pulse { 50% { transform: scale(1.35); } }
.dial-label { fill: rgba(255, 255, 255, .45); font: 500 12px var(--sans); }
.moon-big .moon { width: min(190px, 44vw); height: auto; }
.moon-glow { filter: drop-shadow(0 0 28px rgba(255, 226, 160, .55)) drop-shadow(0 0 70px rgba(255, 200, 120, .25)); }
.moon-big .moon { animation: float 7s ease-in-out infinite; }
.moon-text .kicker { color: var(--gold-light); }
.moon-text h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
.moon-sub { margin: 4px 0 26px; opacity: .8; }
.countdown { display: inline-block; padding: 18px 22px; border-radius: 18px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 226, 160, .25); backdrop-filter: blur(6px); }
.cd-label { margin: 0 0 10px; font-size: .95rem; opacity: .85; }
.cd-units { display: flex; gap: 10px; }
.cd-units div { min-width: 68px; padding: 10px 8px; border-radius: 12px; background: rgba(0, 0, 0, .28); text-align: center; display: flex; flex-direction: column; }
.cd-units b { font-family: var(--serif); font-size: 1.9rem; line-height: 1.2; color: var(--gold-light); font-variant-numeric: tabular-nums; }
.cd-units span { font-size: .78rem; opacity: .75; }
.cd-lunar { margin: 10px 0 0; font-size: .92rem; color: var(--gold-light); }
.cd-today { margin: 0; font-family: var(--serif); font-size: 1.5rem; color: var(--gold-light); }

/* ---------- Month grid ---------- */
.cal-layout { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; align-items: start; }
.cal-card { background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 22px; box-shadow: var(--shadow); overflow: hidden; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cal-title { text-align: center; }
.cal-title h2 { font-size: 1.6rem; color: var(--maroon); }
.cal-title p { margin: 0; color: var(--ink-soft); font-size: .92rem; }
.cal-nav { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); color: var(--maroon); font-size: 1.6rem; line-height: 1; cursor: pointer; transition: background .2s; }
.cal-nav:hover:not(:disabled) { background: var(--paper-2); }
.cal-nav:disabled { opacity: .3; cursor: default; }
.cal-today-btn { display: block; margin: 8px auto 0; background: none; border: 0; color: var(--saffron); font: 600 .9rem var(--sans); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 16px; }
.cal-grid.slide-left { animation: slidel .35s ease both; }
.cal-grid.slide-right { animation: slider .35s ease both; }
@keyframes slidel { from { opacity: 0; transform: translateX(24px); } }
@keyframes slider { from { opacity: 0; transform: translateX(-24px); } }
.cal-wd { text-align: center; font-size: .85rem; font-weight: 600; color: var(--ink-soft); padding: 4px 0; }
.cal-wd.weekend { color: var(--saffron); }
.cal-day {
  position: relative; min-height: 84px; padding: 6px 4px 8px; border-radius: 12px;
  border: 1px solid transparent; background: var(--paper); cursor: pointer; font: inherit; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; gap: 2px; transition: transform .15s, border-color .2s, background .2s;
}
.cal-day:hover { border-color: var(--gold); transform: translateY(-2px); }
.d-num { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; }
.d-lunar { font-size: .7rem; color: var(--ink-soft); line-height: 1.2; }
.d-moon .moon { display: block; filter: drop-shadow(0 0 6px rgba(201, 154, 62, .6)); }
.cal-day.holy { background: linear-gradient(170deg, #2a1a3a, #1a1128); color: #fff; }
.cal-day.holy .d-lunar { color: var(--gold-light); }
.cal-day.special { background: linear-gradient(170deg, var(--maroon), var(--maroon-deep)); }
.d-tag { font-size: .66rem; line-height: 1.2; color: #FFE3A3; text-align: center; font-weight: 600; }
.d-event { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--saffron); box-shadow: 0 0 0 2px #fff; }
.cal-day.today { border-color: var(--saffron); box-shadow: inset 0 0 0 1px var(--saffron); }
.cal-day.today .d-num::after { content: "วันนี้"; display: block; font: 600 .6rem var(--sans); color: var(--saffron); margin-top: -2px; }
.cal-day.holy.today .d-num::after { color: #FFE3A3; }
.cal-day.selected { outline: 3px solid var(--gold); outline-offset: 1px; }

/* ---------- Day detail + legend ---------- */
.cal-side { display: grid; gap: 16px; position: sticky; top: 92px; }
.cal-detail {
  text-align: center; padding: 26px 22px; border-radius: 22px; color: #fff;
  background: radial-gradient(circle at 50% 22%, rgba(255, 226, 160, .18), transparent 50%), linear-gradient(170deg, #1d1330, #120b1f 70%, #2a1208);
  box-shadow: var(--shadow);
}
.detail-moon { display: grid; place-items: center; margin-bottom: 8px; }
.detail-moon .moon { animation: float 6s ease-in-out infinite; }
.detail-rel { margin: 0; color: var(--gold-light); font-weight: 600; font-size: .9rem; }
.cal-detail h3 { font-size: 1.25rem; margin: 2px 0; }
.detail-lunar { margin: 0 0 12px; opacity: .85; }
.detail-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.tag { padding: 4px 12px; border-radius: 999px; font-size: .85rem; background: rgba(255, 255, 255, .1); }
.tag-holy { background: rgba(232, 195, 122, .2); color: #FFE3A3; }
.tag-special { background: var(--maroon); color: #FFE3A3; }
.detail-events { list-style: none; margin: 14px 0 0; padding: 0; text-align: left; display: grid; gap: 8px; }
.detail-events li { padding: 10px 14px; border-radius: 12px; background: rgba(255, 255, 255, .08); display: flex; flex-direction: column; }
.detail-events span { font-size: .85rem; opacity: .8; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .88rem; color: var(--ink-soft); padding: 0 6px; }
.cal-legend span { display: inline-flex; align-items: center; }
.lg { flex: none; display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 6px; }
.lg.holy { background: #2a1a3a; }
.lg.special { background: var(--maroon); }
.lg.event { background: var(--saffron); border-radius: 50%; }

/* ---------- Upcoming + subscribe ---------- */
.upcoming-wrap { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: start; }
.upcoming { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.up-item { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.up-item.special { border-color: var(--gold); background: #FFFBF2; }
.up-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.up-main span { font-size: .9rem; color: var(--ink-soft); }
.up-main em { font-style: normal; color: var(--maroon); font-weight: 600; }
.up-chip { flex: none; padding: 4px 12px; border-radius: 999px; background: var(--paper-2); color: var(--maroon); font-weight: 600; font-size: .85rem; }
.subscribe {
  padding: 30px 28px; border-radius: 22px; color: #fff; text-align: center; position: sticky; top: 92px;
  background: radial-gradient(circle at 80% 0%, rgba(255, 226, 160, .2), transparent 50%), linear-gradient(160deg, var(--maroon), var(--maroon-deep));
  box-shadow: var(--shadow);
}
.subscribe-icon { font-size: 2.2rem; }
.subscribe h2 { font-size: 1.5rem; margin: 6px 0; }
.subscribe p { opacity: .85; font-size: .95rem; }
.subscribe-actions { display: grid; gap: 10px; margin-top: 16px; }
.subscribe-file { display: inline-block; margin-top: 12px; color: rgba(255, 255, 255, .75); font-size: .88rem; }

@media (max-width: 960px) {
  .moon-hero-inner { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .cal-layout, .upcoming-wrap { grid-template-columns: 1fr; }
  .cal-side, .subscribe, .updates-events { position: static; }
}
@media (max-width: 640px) {
  .cal-card { padding: 14px 10px; border-radius: 18px; }
  .cal-grid { gap: 4px; }
  .cal-day { min-height: 64px; padding: 4px 2px 6px; border-radius: 10px; }
  .d-num { font-size: .98rem; }
  .cal-day:not(.holy) .d-lunar { display: none; }
  .d-lunar { font-size: .62rem; }
  .d-moon .moon { width: 20px; height: 20px; }
  .d-tag { font-size: .58rem; }
  .cd-units div { min-width: 58px; }
  .cd-units b { font-size: 1.5rem; }
  .holy-card { grid-template-columns: auto 1fr; padding: 18px; }
  .holy-moon .moon { width: 72px; height: 72px; }
}
@media (prefers-reduced-motion: reduce) {
  .holy-moon .moon, .moon-big .moon, .detail-moon .moon, .stars::before, .dial-now, .dial-progress, .cal-grid { animation: none !important; }
}

/* ---------- เซียมซี ---------- */
.siamsi-app {
  position: relative; overflow: hidden; color: #fff; min-height: 100svh;
  padding: calc(72px + clamp(24px, 4vw, 44px)) 0 clamp(48px, 7vw, 80px);
  background:
    radial-gradient(ellipse at 50% 58%, rgba(255, 196, 110, .28), transparent 42%),
    radial-gradient(ellipse at 50% 120%, #7A1F1F, transparent 60%),
    linear-gradient(180deg, #2A0C08 0%, #3E1109 55%, #22080A 100%);
}
.siamsi-inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; }
.siamsi-head .kicker { color: var(--gold-light); }
.siamsi-head h1 { font-size: clamp(2.4rem, 7vw, 3.6rem); text-shadow: 0 0 30px rgba(255, 200, 120, .35); }
.siamsi-step { margin: 6px 0 18px; font-size: 1.1rem; opacity: .9; min-height: 1.8em; }
.siamsi-step b { color: var(--gold-light); font-family: var(--serif); font-size: 1.5em; }
.topic-pick { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 10px; }
.topic { border: 1px solid rgba(243, 212, 138, .45); background: rgba(0, 0, 0, .2); color: #fff; border-radius: 999px; padding: 8px 16px; font: 500 .95rem var(--sans); cursor: pointer; transition: background .2s; }
.topic.on { background: var(--gold); border-color: var(--gold); color: var(--maroon-deep); font-weight: 600; }

.stage { position: relative; width: min(300px, 70vw); height: min(400px, 90vw); margin: 10px 0 6px; }
.tube-btn { position: absolute; inset: 0; background: none; border: 0; padding: 0; cursor: pointer; }
.tube-btn:focus-visible { outline: 3px solid var(--gold-light); border-radius: 24px; }
.tube { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 20px 30px rgba(0, 0, 0, .5)); transform-origin: 50% 92%; }
.tube-btn:hover .tube { transform: rotate(-3deg); transition: transform .3s; }
.is-shaking .tube { animation: tubeshake .16s ease-in-out infinite alternate; }
.is-shaking .tube-sticks { animation: sticks .1s linear infinite alternate; }
@keyframes tubeshake { from { transform: rotate(-11deg) translateY(-4px); } to { transform: rotate(11deg) translateY(2px); } }
@keyframes sticks { to { transform: translateY(-5px); } }
.shake-ring { position: absolute; left: 50%; bottom: -6px; width: 70%; height: 16px; translate: -50% 0; border-radius: 50%; background: radial-gradient(rgba(0, 0, 0, .45), transparent 70%); }
.fallen-stick {
  position: absolute; left: 50%; top: 18%; width: 26px; height: 200px; margin-left: -13px;
  border-radius: 13px; background: linear-gradient(90deg, #B98F48, #F1DDAA 50%, #C9A25E);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .45); opacity: 0; pointer-events: none;
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 18px;
}
.fallen-stick::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 28px; border-radius: 13px 13px 4px 4px; background: #B3261E; }
.fallen-stick span { writing-mode: vertical-rl; font-family: var(--serif); font-weight: 700; font-size: 1.4rem; color: var(--maroon-deep); }
.fallen-stick.drop { animation: stickdrop 1.1s cubic-bezier(.3, .7, .3, 1) forwards; }
@keyframes stickdrop {
  0% { opacity: 1; transform: translateY(0) rotate(0); }
  35% { opacity: 1; transform: translateY(-120px) rotate(-8deg); }
  75% { transform: translate(90px, 150px) rotate(72deg); }
  88% { transform: translate(96px, 138px) rotate(70deg); }
  100% { opacity: 1; transform: translate(96px, 150px) rotate(72deg) scale(1.15); }
}
.siamsi-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 8px; }
.btn-big { font-size: 1.2rem; padding: 16px 36px; }
.siamsi-note { margin: 22px auto 0; max-width: 520px; font-size: .85rem; opacity: .65; }
.incense { position: absolute; inset: 0; pointer-events: none; }
.incense span {
  position: absolute; bottom: -40px; width: 180px; height: 420px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 255, 255, .07), transparent 65%); filter: blur(12px);
  animation: smoke 14s ease-in-out infinite;
}
.incense span:nth-child(1) { left: 10%; }
.incense span:nth-child(2) { left: 60%; animation-delay: -5s; }
.incense span:nth-child(3) { left: 82%; animation-delay: -9s; }
@keyframes smoke { 0% { transform: translateY(40px) scaleX(.8); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(-420px) scaleX(1.4); opacity: 0; } }

/* the slip */
.fortune-wrap { position: relative; z-index: 1; width: min(640px, 100% - 32px); margin: 40px auto 0; perspective: 1400px; }
.fortune { transform-origin: 50% 0; }
.fortune.flip-in { animation: flipin .9s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes flipin { from { opacity: 0; transform: rotateX(-80deg) translateY(-30px); } to { opacity: 1; transform: none; } }
.f-paper {
  position: relative; color: var(--ink); text-align: center; padding: 0 0 26px; border-radius: 8px; overflow: hidden;
  background: linear-gradient(180deg, #FFF8E7, #F4E4C1); border: 6px solid var(--maroon); outline: 2px solid var(--gold); outline-offset: -14px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .7);
}
.f-head { background: var(--maroon); color: #fff; padding: 18px 20px 14px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.f-temple { color: var(--gold-light); font-weight: 600; letter-spacing: .04em; }
.f-no { display: flex; align-items: baseline; gap: 10px; font-family: var(--serif); }
.f-no small { font-size: 1.1rem; opacity: .85; }
.f-no b { font-size: 2.8rem; line-height: 1.1; }
.f-level { display: inline-block; margin: 18px 0 6px; padding: 4px 22px; border-radius: 999px; color: #fff; font-weight: 700; font-size: 1.05rem; }
.lv-best { background: linear-gradient(135deg, #C99A3E, #A87A12); }
.lv-good { background: #2E7D32; }
.lv-mid { background: #1565C0; }
.lv-fair { background: #B26A00; }
.lv-warn { background: #B3261E; }
.f-title { font-size: clamp(1.8rem, 5vw, 2.4rem); color: var(--maroon); margin: 4px 16px 10px; }
.f-poem { margin: 0 20px 18px; font-family: var(--serif); font-size: 1.18rem; line-height: 1.9; color: #3B2A1E; }
.f-poem p { margin: 0; }
.f-meaning { margin: 0 28px; padding-top: 14px; border-top: 1px dashed rgba(122, 31, 31, .35); text-align: left; display: grid; gap: 4px; }
.f-meaning div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 8px 10px; border-radius: 10px; }
.f-meaning dt { font-weight: 700; color: var(--maroon); }
.f-meaning dd { margin: 0; }
.f-meaning .focus { background: rgba(201, 154, 62, .22); box-shadow: inset 3px 0 0 var(--saffron); }
.f-dhamma { margin: 18px 28px 0; padding: 14px 18px; border-radius: 12px; background: rgba(201, 154, 62, .16); }
.f-dhamma span { display: block; font-size: .85rem; font-weight: 600; color: #A87A12; }
.f-dhamma p { margin: 2px 0 0; font-family: var(--serif); font-size: 1.12rem; color: var(--maroon-deep); }
.f-foot { margin: 16px 0 0; font-size: .8rem; color: #8A7A6A; }
.fortune-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.siamsi-toast { position: fixed; left: 50%; bottom: 90px; translate: -50% 20px; z-index: 120; background: rgba(20, 8, 6, .9); color: #fff; padding: 10px 20px; border-radius: 999px; opacity: 0; transition: .3s; pointer-events: none; }
.siamsi-toast.show { opacity: 1; translate: -50% 0; }

/* home teaser */
.siamsi-teaser { background: radial-gradient(ellipse at 20% 50%, rgba(255, 196, 110, .25), transparent 50%), linear-gradient(135deg, #2A0C08, #4A1212); color: #fff; padding: clamp(40px, 6vw, 64px) 0; overflow: hidden; }
.siamsi-teaser-inner { display: grid; grid-template-columns: auto 1fr; gap: clamp(24px, 5vw, 56px); align-items: center; }
.teaser-tube { width: 150px; height: 210px; }
.teaser-tube .tube { animation: tubeidle 3.2s ease-in-out infinite; }
@keyframes tubeidle { 0%, 70%, 100% { transform: rotate(0); } 76% { transform: rotate(-7deg); } 82% { transform: rotate(7deg); } 88% { transform: rotate(-4deg); } 94% { transform: rotate(3deg); } }
.siamsi-teaser .kicker { color: var(--gold-light); margin: 0; }
.siamsi-teaser h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); }
.siamsi-teaser p { opacity: .85; }

/* ---------- Install app ---------- */
.nav-install { border: 1px dashed var(--gold); background: transparent; color: inherit; border-radius: 999px; padding: 8px 14px; font: 600 .95rem var(--sans); cursor: pointer; }
.footer-app { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 28px; padding: 18px 22px; border-radius: 16px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(232, 195, 122, .25); }
.footer-app div { display: flex; flex-direction: column; }
.footer-app strong { color: var(--gold-light); font-size: 1.05rem; }
.footer-app span { font-size: .9rem; opacity: .8; }
.ios-sheet { position: fixed; inset: 0; z-index: 150; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-end; justify-content: center; padding: 16px; }
.ios-sheet[hidden] { display: none; }
.ios-sheet-card { background: #fff; color: var(--ink); border-radius: 22px; padding: 24px 22px calc(18px + env(safe-area-inset-bottom)); width: min(460px, 100%); animation: rise .4s both; }
.ios-sheet-card h2 { font-size: 1.3rem; color: var(--maroon); margin-bottom: 8px; }
.ios-sheet-card ol { padding-left: 1.2em; line-height: 2; margin: 0 0 16px; }
.ios-share { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; background: #E8F0FE; color: #1a73e8; }

/* running as an installed app: respect notches / home bar */
@media (display-mode: standalone) {
  .site-header { padding-top: env(safe-area-inset-top); }
  .site-nav { top: calc(72px + env(safe-area-inset-top)); }
  .music-toggle { bottom: calc(16px + env(safe-area-inset-bottom)); }
  .footer-app, .nav-install { display: none !important; }
}

@media (max-width: 640px) {
  .siamsi-teaser-inner { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .teaser-tube { width: 120px; height: 170px; }
  .f-meaning { margin: 0 16px; }
  .f-meaning div { grid-template-columns: 1fr; gap: 0; }
  .f-dhamma { margin: 16px 16px 0; }
  .btn-big { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .is-shaking .tube, .is-shaking .tube-sticks, .teaser-tube .tube, .incense span, .fortune.flip-in { animation: none !important; }
}
/* desktop menu is already full: offer install in the footer there, and in the ☰ menu on phones */
@media (min-width: 1121px) { .nav-install { display: none !important; } }
