:root {
  --brown: #5f330d;
  --brown-deep: #3b1e08;
  --gold-light: #fff6ce;
  --gold: #d79a26;
  --gold-deep: #98600e;
  --cream: #fffaf0;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; }

body {
  font-family: "Sarabun", system-ui, sans-serif;
  overflow: hidden;
  background: #eebd62;
  opacity: 0;
  animation: pageFadeIn 1s ease forwards;
}

.khao-phansa-landing {
  position: relative;
  width: 100vw;
  height: 100svh;
  min-height: 620px;
  overflow: hidden;
  isolation: isolate;
}

.bg-layer {
  position: absolute;
  inset: 0;
  z-index: -5;
  background: url("../images/bg.webp") center center / cover no-repeat;
  transform: scale(1.01);
  animation: sceneBreath 16s ease-in-out infinite alternate;
}

.light-overlay {
  position: absolute;
  inset: 0;
  z-index: -4;
  background:
    linear-gradient(90deg, rgba(255,250,232,.38) 0%, rgba(255,244,207,.23) 34%, rgba(155,90,15,.03) 62%, rgba(69,31,3,.11) 100%),
    linear-gradient(180deg, rgba(255,255,255,.06) 0%, rgba(115,55,5,.03) 62%, rgba(69,31,3,.18) 100%);
}

.sparkles {
  position: absolute;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  opacity: .28;
  background-image:
    radial-gradient(circle, rgba(255,247,200,.95) 0 1px, transparent 2px),
    radial-gradient(circle, rgba(255,255,255,.75) 0 1px, transparent 2px);
  background-size: 180px 180px, 275px 275px;
  background-position: 12px 24px, 90px 118px;
  animation: twinkle 6s ease-in-out infinite alternate;
}

.content-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(26px, 5vw, 82px);
}

.content-panel {
  width: min(48vw, 760px);
  margin-top: -2vh;
  padding: 30px 20px 34px;
  text-align: center;
  color: var(--brown-deep);
}

.pre-title {
  margin: 0 0 5px;
  font-family: "Noto Serif Thai", serif;
  font-size: clamp(15px, 1.2vw, 20px);
  color: rgba(91,47,9,.82);
  letter-spacing: .03em;
  text-shadow: 0 1px 8px rgba(255,250,225,.72);
}

h1 {
  margin: 0;
  font-family: "Noto Serif Thai", serif;
  font-size: clamp(58px, 6.6vw, 112px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .01em;
  color: var(--brown);
  background: linear-gradient(180deg, #744212 0%, #9b6018 43%, #5e310b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 1px rgba(255,250,223,.85)) drop-shadow(0 7px 12px rgba(104,50,7,.14));
}

.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: min(82%, 540px);
  margin: 10px auto 9px;
  color: var(--gold-deep);
}
.ornament span { height: 1px; flex: 1; background: linear-gradient(90deg, transparent, rgba(155,96,18,.75), transparent); }
.ornament b { font-size: 17px; font-weight: 400; text-shadow: 0 0 9px rgba(255,216,111,.7); }

.date,
.main-text,
.sub-text,
.org-label {
  font-family: "Noto Serif Thai", serif;
  text-shadow: 0 1px 8px rgba(255,250,225,.82);
}
.date {
  margin: 0 0 9px;
  font-size: clamp(24px, 2.4vw, 38px);
  color: #74410d;
}
.main-text {
  margin: 0;
  font-size: clamp(18px, 1.55vw, 25px);
  line-height: 1.5;
  color: #4f2909;
}
.sub-text {
  margin: 2px 0 0;
  font-size: clamp(17px, 1.38vw, 22px);
  line-height: 1.44;
  color: rgba(75,36,6,.9);
}
.org-label {
  margin: 9px auto 0;
  max-width: 660px;
  font-size: clamp(14px, 1.05vw, 17px);
  color: rgba(82,42,9,.75);
}

.enter-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 238px;
  margin-top: 22px;
  padding: 13px 36px 14px;
  border-radius: 999px;
  font-family: "Noto Serif Thai", serif;
  font-size: clamp(17px, 1.25vw, 20px);
  font-weight: 600;
  color: #fff7d7;
  text-decoration: none;
  background: linear-gradient(180deg, rgba(184,119,20,.97), rgba(114,64,8,.98));
  border: 1px solid rgba(255,225,139,.95);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.28), 0 11px 28px rgba(81,39,4,.25), 0 0 22px rgba(255,205,84,.22);
  transition: transform .22s ease, filter .22s ease, box-shadow .22s ease;
}
.enter-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 55%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.48), transparent);
  animation: buttonShine 4.8s ease-in-out infinite;
}
.enter-btn:hover {
  transform: translateY(-3px);
  filter: brightness(1.07);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.4), 0 15px 34px rgba(81,39,4,.3), 0 0 28px rgba(255,205,84,.28);
}
.enter-btn:active { transform: translateY(0); }

@keyframes pageFadeIn { to { opacity: 1; } }
@keyframes sceneBreath { from { transform: scale(1.01); } to { transform: scale(1.025); } }
@keyframes twinkle { from { opacity: .18; transform: translateY(0); } to { opacity: .38; transform: translateY(-5px); } }
@keyframes buttonShine { 0%,55% { left:-120%; } 100% { left:170%; } }

@media (max-height: 760px) and (min-width: 901px) {
  .khao-phansa-landing { min-height: 560px; }
  .content-panel { transform: scale(.9); transform-origin: center left; }
}

@media (max-width: 900px) {
  .khao-phansa-landing { min-height: 620px; }
  .bg-layer { background-position: 62% center; }
  .light-overlay {
    background:
      linear-gradient(180deg, rgba(255,248,220,.2), rgba(100,47,4,.18)),
      linear-gradient(90deg, rgba(255,248,220,.3), rgba(115,54,5,.05));
  }
  .content-wrap { align-items: flex-end; justify-content: center; padding: 28px 22px 38px; }
  .content-panel {
    width: min(94vw, 700px);
    margin: 0;
    padding: 24px 24px 28px;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(255,249,226,.78), rgba(255,244,207,.64));
    border: 1px solid rgba(255,255,255,.55);
    box-shadow: 0 20px 55px rgba(85,42,5,.18);
    backdrop-filter: blur(6px);
  }
  h1 { font-size: clamp(50px, 10vw, 78px); }
}

@media (max-width: 600px) {
  .khao-phansa-landing { min-height: 560px; }
  .bg-layer { background-position: 69% center; }
  .content-wrap { padding: 14px 14px 22px; }
  .content-panel { width: 100%; padding: 18px 14px 22px; border-radius: 22px; }
  h1 { font-size: clamp(43px, 14.2vw, 64px); line-height: 1.08; }
  .ornament { width: 92%; margin: 7px auto 6px; }
  .date { margin-bottom: 7px; }
  .main-text, .sub-text { line-height: 1.38; }
  .org-label { margin-top: 7px; }
  .enter-btn { min-width: 205px; margin-top: 16px; padding: 12px 27px 13px; }
}

@media (max-height: 700px) and (max-width: 600px) {
  .content-panel { transform: scale(.88); width: 112%; transform-origin: center bottom; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
