/* ============ Tokens ============ */
:root {
  --paper: #f7f1e6;
  --paper-2: #efe5d3;
  --ink: #2b211b;
  --ink-soft: #5e4f43;
  --line: #dccdb5;
  --saffron: #c8781e;
  --saffron-deep: #a35d12;
  --maroon: #6b2a22;
  --maroon-deep: #3e1813;
  --radius: 14px;
  --max: 1120px;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mm: "Noto Serif Myanmar", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.1; margin: 0; }
h2 { font-size: clamp(2rem, 4vw, 2.9rem); }
h3 { font-size: 1.45rem; }
p { margin: 0 0 1em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--saffron); outline-offset: 3px; border-radius: 4px; }

/* Placeholder text to replace */
.todo { color: var(--saffron-deep); background: rgba(200,120,30,.1); border-radius: 4px; padding: 0 .2em; }

.eyebrow {
  font: 600 .74rem/1 var(--sans);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--saffron-deep);
  margin-bottom: 1rem;
}

/* ============ Buttons ============ */
.btn {
  display: inline-block;
  padding: .85em 1.5em;
  border-radius: 999px;
  font: 500 .95rem/1 var(--sans);
  text-decoration: none;
  transition: background .2s, color .2s, transform .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--maroon); color: #fff; }
.btn--primary:hover { background: var(--maroon-deep); }
.btn--ghost { border: 1px solid var(--line); }
.btn--ghost:hover { background: var(--paper-2); }

/* ============ Nav ============ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247,241,230,.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.nav.is-scrolled { border-color: var(--line); }
.nav__inner {
  max-width: var(--max); margin: 0 auto;
  padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav__brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
  font: 600 1.35rem/1 var(--serif);
  color: var(--maroon);
}
.lotus { width: 34px; height: 24px; color: var(--saffron); }
.nav__menu { display: flex; align-items: center; gap: 28px; }
.nav__menu a { text-decoration: none; font-size: .93rem; color: var(--ink-soft); }
.nav__menu a:hover { color: var(--ink); }
.nav__menu .nav__cta {
  color: var(--maroon); border: 1px solid var(--maroon);
  padding: .5em 1.1em; border-radius: 999px;
}
.nav__menu .nav__cta:hover { background: var(--maroon); color: #fff; }
.nav__toggle { display: none; }

/* ============ Hero ============ */
.hero {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(48px, 8vw, 110px) 24px;
  display: grid; grid-template-columns: 1.1fr .9fr;
  gap: clamp(32px, 6vw, 80px); align-items: center;
}
.hero h1 { font-size: clamp(3.4rem, 9vw, 6.4rem); color: var(--maroon); letter-spacing: -.01em; }
.hero__mm { font: 400 1.5rem/1.6 var(--mm); color: var(--saffron-deep); margin: .3em 0 1.2em; }
.hero__lead { font-size: 1.12rem; color: var(--ink-soft); max-width: 34ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2rem; }

.hero__portrait { margin: 0; }
.frame {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 220px 220px var(--radius) var(--radius);
  overflow: hidden;
  background: linear-gradient(160deg, var(--saffron) 0%, var(--maroon) 100%);
  box-shadow: 0 30px 60px -30px rgba(62,24,19,.45);
}
.frame::after {
  content: ""; position: absolute; inset: 10px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 210px 210px 8px 8px; pointer-events: none;
}
.frame img { width: 100%; height: 100%; object-fit: cover; }
.hero__portrait figcaption {
  font: italic 400 1.2rem/1.5 var(--serif);
  color: var(--ink-soft); text-align: center; margin-top: 1.2rem;
}

/* Image fallback (when photo file is missing) */
.ph {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  color: rgba(255,255,255,.85);
  font: 500 clamp(2rem, 6vw, 4.5rem)/1 var(--serif);
  background: linear-gradient(160deg, var(--saffron) 0%, var(--maroon) 100%);
  text-align: center;
}
.ph small { display: block; font: 500 .7rem/1.4 var(--sans); letter-spacing: .12em; text-transform: uppercase; opacity: .8; margin-top: .6rem; }

/* ============ Sections ============ */
.section { padding: clamp(64px, 9vw, 120px) 24px; }
.section > * { max-width: var(--max); margin-left: auto; margin-right: auto; }
.section--tint { background: var(--paper-2); }
.section__head { margin-bottom: 3rem; }
.section__sub { color: var(--ink-soft); margin-top: .8rem; }

/* About */
.about { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.about__body p:first-child::first-letter {
  float: left; font: 500 4.2rem/.8 var(--serif); color: var(--maroon);
  margin: .08em .1em 0 0;
}
.facts { margin: 0; border-top: 1px solid var(--line); }
.facts div, .contact div {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.facts dt { color: var(--ink-soft); font-size: .9rem; }
.facts dd { margin: 0; font-weight: 500; text-align: right; }

/* Timeline */
.timeline { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 0; right: 0; top: 7px;
  height: 1px; background: var(--line);
}
.timeline li { position: relative; padding-top: 34px; }
.timeline li::before {
  content: ""; position: absolute; top: 0; left: 0;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--paper-2); border: 2px solid var(--saffron);
}
.timeline__year { font: 600 .8rem/1 var(--sans); letter-spacing: .1em; color: var(--saffron-deep); display: inline-block; margin-bottom: .7rem; }
.timeline h3 { margin-bottom: .4rem; }
.timeline p { color: var(--ink-soft); font-size: .95rem; }

/* Teachings */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 2rem; }
.chip {
  font: 500 .88rem/1 var(--sans);
  padding: .6em 1.1em; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--ink-soft);
  cursor: pointer; transition: all .2s;
}
.chip:hover { border-color: var(--saffron); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--maroon); border-color: var(--maroon); color: #fff; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: #fffaf2; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; display: flex; flex-direction: column;
  transition: transform .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -24px rgba(62,24,19,.35); }
.card__meta { display: flex; justify-content: space-between; font-size: .8rem; color: var(--ink-soft); margin-bottom: 1rem; }
.card__tag { color: var(--saffron-deep); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.card h3 { margin-bottom: .6rem; }
.card p { color: var(--ink-soft); font-size: .95rem; flex: 1; }
.card__link {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 500; font-size: .92rem; color: var(--maroon); text-decoration: none;
}
.card__link::before {
  content: ""; width: 30px; height: 30px; border-radius: 50%;
  background: var(--maroon) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 7v10l8-5z' fill='white'/%3E%3C/svg%3E") center/16px no-repeat;
}

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 200px; gap: 14px; }
.gallery button {
  padding: 0; border: 0; border-radius: var(--radius); overflow: hidden;
  cursor: zoom-in; background: var(--line); position: relative;
}
.gallery button:nth-child(1) { grid-column: span 2; grid-row: span 2; }
.gallery button:nth-child(4) { grid-row: span 2; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.gallery button:hover img { transform: scale(1.04); }
.gallery .ph { font-size: 1.6rem; }

/* Events */
.events { list-style: none; padding: 0; margin-top: 0; margin-bottom: 0; border-top: 1px solid var(--line); }
.event {
  display: grid; grid-template-columns: 110px 1fr auto; gap: 24px; align-items: center;
  padding: 24px 0; border-bottom: 1px solid var(--line);
}
.event__date { text-align: center; line-height: 1.1; }
.event__day { display: block; font: 500 2.6rem/1 var(--serif); color: var(--maroon); }
.event__mon { font: 600 .75rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--saffron-deep); }
.event h3 { margin-bottom: .25rem; }
.event p { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.event__type { font-size: .8rem; padding: .4em .9em; border-radius: 999px; background: var(--paper-2); color: var(--ink-soft); white-space: nowrap; }
.events__empty { padding: 24px 0; color: var(--ink-soft); }

/* Visit */
.section--dark { background: var(--maroon-deep); color: #f3e6d6; }
.section--dark .eyebrow { color: #e7a85b; }
.section--dark h2 { color: #fff; margin-bottom: 1rem; }
.section--dark .todo { color: #f0bb78; background: rgba(240,187,120,.12); }
.visit { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.contact { margin: 0; border-top: 1px solid rgba(255,255,255,.15); }
.contact div { border-color: rgba(255,255,255,.15); }
.contact dt { color: #c9b39e; font-size: .9rem; }
.contact dd { margin: 0; text-align: right; }
.contact a { color: #f0bb78; text-decoration: none; }
.contact a:hover { text-decoration: underline; }
.hero__portrait figcaption small { font: 500 .75rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; font-style: normal; color: var(--saffron-deep); display: inline-block; margin-top: .6rem; }

/* Footer */
.footer { text-align: center; padding: 48px 24px; background: var(--maroon-deep); color: #c9b39e; border-top: 1px solid rgba(255,255,255,.1); }
.footer p:first-child { font: italic 400 1.25rem/1.4 var(--serif); color: #f3e6d6; }
.footer__small { font-size: .85rem; margin: 0; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(30,14,10,.94);
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 24px;
}
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: min(1000px, 100%); text-align: center; }
.lightbox img, .lightbox .ph { max-height: 80vh; width: auto; margin: 0 auto; border-radius: 8px; }
.lightbox .ph { width: min(600px, 80vw); aspect-ratio: 4/3; height: auto; }
.lightbox figcaption { color: #e9dccb; margin-top: 14px; font: italic 1.15rem var(--serif); }
.lightbox button { background: none; border: 0; color: #fff; cursor: pointer; }
.lightbox__close { position: absolute; top: 14px; right: 20px; font-size: 2.4rem; line-height: 1; }
.lightbox__nav { font-size: 3rem; padding: 0 10px; opacity: .7; }
.lightbox__nav:hover { opacity: 1; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { transition: none !important; }
}

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .timeline { grid-template-columns: 1fr 1fr; row-gap: 40px; }
  .timeline::before { display: none; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav__inner { padding: 12px 16px; }
  .nav__toggle {
    display: flex; flex-direction: column; gap: 5px;
    background: none; border: 0; padding: 10px; cursor: pointer;
  }
  .nav__toggle span:not(.sr-only) { width: 22px; height: 2px; background: var(--ink); transition: transform .3s; }
  .nav__toggle[aria-expanded="true"] span:nth-child(2) { transform: translateY(3.5px) rotate(45deg); }
  .nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-3.5px) rotate(-45deg); }
  .nav__menu {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 8px 16px 16px;
    display: none;
  }
  .nav__menu.is-open { display: flex; }
  .nav__menu a { padding: 12px 0; font-size: 1rem; }
  .nav__menu .nav__cta { text-align: center; margin-top: 8px; }

  .hero { grid-template-columns: 1fr; padding: 40px 16px 64px; }
  .hero__portrait { order: -1; max-width: 340px; margin: 0 auto; width: 100%; }
  .section { padding-left: 16px; padding-right: 16px; }
  .about, .visit { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr 1fr; grid-auto-rows: 150px; }
  .gallery button:nth-child(4) { grid-row: auto; }
  .event { grid-template-columns: 70px 1fr; gap: 16px; }
  .event__type { grid-column: 2; justify-self: start; }
  .event__day { font-size: 2rem; }
  .lightbox__nav { position: absolute; bottom: 20px; }
  .lightbox__prev { left: 20px; } .lightbox__next { right: 20px; }
}
