:root {
  --ink: #070807;
  --ink-2: #11100d;
  --gold: #b88427;
  --gold-soft: #f0cf79;
  --red: #7f1f19;
  --red-deep: #461411;
  --green: #263b25;
  --paper: #efe2c7;
  --paper-light: #fbf3df;
  --paper-deep: #dcc491;
  --text: #261a10;
  --muted: #67533d;
  --line: rgba(184, 132, 39, 0.52);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
  font-family: "Noto Sans Sinhala", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -10%, rgba(184, 132, 39, 0.15), transparent 34%),
    linear-gradient(135deg, #070807, #18130e 48%, #080706);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.13;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 42px 42px;
  mix-blend-mode: screen;
}

img {
  max-width: 100%;
  display: block;
}

.preloader {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  background:
    radial-gradient(circle at 50% 38%, rgba(184, 132, 39, 0.3), transparent 32%),
    linear-gradient(145deg, #050504 0%, #15120d 52%, #060504 100%);
  transition: opacity 700ms ease, visibility 700ms ease;
}

.preloader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader__glow {
  position: absolute;
  width: min(56vw, 560px);
  aspect-ratio: 1;
  border: 1px solid rgba(240, 207, 121, 0.28);
  border-radius: 999px;
  animation: halo 1800ms ease-in-out infinite;
}

.preloader__logo {
  position: relative;
  width: min(52vw, 430px);
  max-width: 84%;
  filter: drop-shadow(0 20px 48px rgba(0, 0, 0, 0.56));
  animation: logoRise 1200ms ease both;
}

.preloader__bar {
  position: relative;
  width: min(240px, 58vw);
  height: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
}

.preloader__bar span {
  display: block;
  height: 100%;
  width: 45%;
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
  animation: loadingBar 1200ms ease-in-out infinite;
}

.site-shell {
  min-height: 100vh;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.site-shell.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.temple-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 5vw, 78px);
  background:
    linear-gradient(90deg, rgba(6, 6, 5, 0.98), rgba(22, 17, 11, 0.98)),
    var(--ink);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  color: var(--gold-soft);
  text-decoration: none;
}

.brand img {
  width: 96px;
  height: 96px;
  object-fit: contain;
}

.brand strong {
  display: block;
  font-family: Georgia, "Times New Roman", "Noto Sans Sinhala", serif;
  font-size: clamp(1.42rem, 3vw, 2.55rem);
  font-weight: 500;
  line-height: 1.08;
}

.brand small {
  display: block;
  margin-top: 4px;
  color: rgba(240, 207, 121, 0.82);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.92rem, 1.4vw, 1.22rem);
}

.language-note {
  color: rgba(255, 244, 213, 0.84);
  white-space: nowrap;
}

.page-tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid rgba(240, 207, 121, 0.22);
  border-bottom: 1px solid var(--line);
  background: #0f0c08;
}

.page-tabs button,
.page-tabs a {
  min-height: 66px;
  padding: 10px 12px;
  border: 0;
  border-right: 1px solid rgba(184, 132, 39, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
    #15100b;
  color: #f7e4b5;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.page-tabs span {
  display: block;
  margin-top: 4px;
  color: rgba(240, 207, 121, 0.68);
  font-size: 0.82rem;
}

.page-tabs .is-active,
.page-tabs button:hover,
.page-tabs a:hover {
  background:
    linear-gradient(180deg, rgba(240, 207, 121, 0.12), transparent),
    var(--red-deep);
  color: white;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: grid;
}

.hero {
  position: relative;
  grid-template-columns: minmax(320px, 0.86fr) minmax(420px, 1.14fr);
  gap: clamp(24px, 4vw, 60px);
  align-items: center;
  min-height: calc(100vh - 190px);
  padding: clamp(34px, 6vw, 84px) clamp(20px, 6vw, 92px);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(8, 8, 7, 0.96), rgba(29, 19, 10, 0.84)),
    url("assets/temple-murals.jpg") center / cover;
  overflow: hidden;
}

.hero::before,
.parchment::before,
.contact-panel::before {
  content: "";
  position: absolute;
  inset: 10px;
  pointer-events: none;
  border: 1px solid rgba(240, 207, 121, 0.42);
  box-shadow: inset 0 0 0 1px rgba(105, 69, 20, 0.22);
}

.hero__copy {
  position: relative;
  z-index: 1;
  color: white;
}

.overline {
  margin: 0 0 12px;
  color: var(--gold-soft);
  font-weight: 800;
  letter-spacing: 0.04em;
}

h1,
h2,
h3 {
  margin-top: 0;
  font-family: Georgia, "Times New Roman", "Noto Sans Sinhala", serif;
  font-weight: 500;
  letter-spacing: 0;
}

.hero h1 {
  margin-bottom: 18px;
  color: var(--gold-soft);
  font-size: clamp(3.3rem, 7vw, 6.6rem);
  line-height: 1.02;
  text-shadow: 0 18px 42px rgba(0, 0, 0, 0.5);
}

.lead,
.hero .english {
  max-width: 720px;
  color: rgba(255, 246, 222, 0.9);
  font-size: clamp(1rem, 1.35vw, 1.24rem);
  line-height: 1.78;
}

.hero .english {
  color: rgba(255, 246, 222, 0.75);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

.hero__image {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(10, 8, 6, 0.78);
  box-shadow: var(--shadow);
}

.hero__image img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid rgba(240, 207, 121, 0.24);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 4px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button--gold {
  color: #211407;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
}

.button--outline {
  color: var(--gold-soft);
  border-color: var(--gold);
  background: rgba(0, 0, 0, 0.22);
}

.button--red {
  color: white;
  background: linear-gradient(180deg, #9b2a23, var(--red));
}

.parchment,
.contact-panel {
  position: relative;
  padding: clamp(40px, 6vw, 76px) clamp(20px, 6vw, 92px);
  background:
    radial-gradient(circle at 12% 20%, rgba(184, 132, 39, 0.14), transparent 28%),
    linear-gradient(135deg, var(--paper-light), var(--paper) 58%, var(--paper-deep));
}

.panel-heading {
  max-width: 900px;
  margin-bottom: 30px;
}

.panel-heading h2,
.ceremony h2,
.contact-panel h2 {
  margin-bottom: 12px;
  color: var(--red-deep);
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 1.08;
}

.panel-heading p,
.timeline-list p,
.institution-grid p,
.project-board p,
.booking-form,
.contact-panel p,
.english {
  color: var(--muted);
  line-height: 1.72;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.56fr) minmax(320px, 1.44fr);
  gap: 34px;
  align-items: start;
}

.framed-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 10px solid rgba(78, 42, 16, 0.16);
  outline: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(75, 45, 17, 0.22);
}

.timeline-list {
  display: grid;
  gap: 14px;
}

.timeline-list article,
.institution-grid article,
.project-board article,
.booking-form,
.ceremony-card {
  border: 1px solid rgba(121, 76, 22, 0.3);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.12)),
    rgba(250, 239, 209, 0.62);
}

.timeline-list article {
  padding: 20px 22px;
}

.timeline-list span {
  color: var(--gold);
  font-weight: 800;
}

.timeline-list h3,
.institution-grid h3,
.project-board h3 {
  margin: 8px 0 8px;
  color: var(--red-deep);
  font-size: 1.45rem;
  line-height: 1.28;
}

.institution-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.institution-grid article {
  min-height: 178px;
  padding: 22px;
}

.ceremony {
  grid-template-columns: minmax(300px, 1fr) minmax(260px, 0.42fr);
  gap: 34px;
  align-items: center;
  padding: clamp(46px, 7vw, 88px) clamp(20px, 7vw, 104px);
  color: white;
  background:
    linear-gradient(90deg, rgba(8, 8, 7, 0.92), rgba(70, 20, 17, 0.84)),
    url("assets/temple-courtyard.jpg") center / cover;
}

.ceremony h2 {
  color: var(--gold-soft);
}

.ceremony p {
  color: rgba(255, 246, 222, 0.88);
  line-height: 1.8;
}

.ceremony-card {
  display: grid;
  gap: 14px;
  padding: 26px;
  background: rgba(10, 8, 6, 0.72);
  backdrop-filter: blur(10px);
}

.ceremony-card strong {
  color: var(--gold-soft);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.3rem;
}

.ceremony-card span {
  color: rgba(255, 246, 222, 0.86);
}

.project-board {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.project-board article {
  overflow: hidden;
}

.project-board img {
  width: 100%;
  height: 230px;
  object-fit: cover;
}

.project-board div {
  padding: 22px;
}

.booking-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 940px;
  padding: clamp(22px, 4vw, 38px);
}

.donation-page-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(320px, 1.2fr);
  gap: 0;
  min-height: calc(100vh - 190px);
}

.donation-hero {
  padding: clamp(44px, 7vw, 92px);
  color: white;
  background:
    linear-gradient(90deg, rgba(8, 8, 7, 0.9), rgba(70, 20, 17, 0.72)),
    url("assets/temple-murals.jpg") center / cover;
}

.donation-hero h1 {
  margin-bottom: 18px;
  color: var(--gold-soft);
  font-size: clamp(3rem, 7vw, 6rem);
  line-height: 1;
}

.donation-hero p {
  color: rgba(255, 246, 222, 0.88);
  line-height: 1.78;
}

.donation-form {
  display: grid;
  gap: 18px;
  padding: clamp(26px, 5vw, 54px);
  background:
    radial-gradient(circle at 16% 12%, rgba(184, 132, 39, 0.12), transparent 28%),
    linear-gradient(135deg, var(--paper-light), var(--paper));
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 12px;
  color: var(--red-deep);
  font-family: Georgia, "Times New Roman", "Noto Sans Sinhala", serif;
  font-size: 1.28rem;
}

.donation-form fieldset:first-child {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.donation-form fieldset:first-child legend {
  grid-column: 1 / -1;
}

.donation-form fieldset:first-child label,
.amount-grid button,
.bank-card {
  min-height: 56px;
  padding: 14px;
  border: 1px solid rgba(121, 76, 22, 0.3);
  background: rgba(250, 239, 209, 0.6);
}

.amount-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.amount-grid button {
  color: var(--red-deep);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.bank-card h2 {
  margin: 0 0 6px;
  color: var(--red-deep);
  font-size: 1.35rem;
}

.bank-card p,
.form-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-submit {
  width: 100%;
}

.booking-form .wide,
.booking-form button {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 8px;
  color: var(--red-deep);
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(121, 76, 22, 0.34);
  border-radius: 4px;
  padding: 0 13px;
  color: var(--text);
  background: rgba(255, 253, 246, 0.78);
  font: inherit;
}

textarea {
  min-height: 100px;
  padding-top: 12px;
  resize: vertical;
}

.contact-panel {
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 28px;
  align-items: center;
}

.contact-panel a:not(.button) {
  color: var(--red);
  font-size: 1.35rem;
  font-weight: 800;
  text-decoration: none;
}

.temple-footer {
  padding: 24px 20px;
  border-top: 1px solid var(--line);
  color: rgba(240, 207, 121, 0.82);
  text-align: center;
  background: #070807;
}

.amount-grid button.is-selected {
  border-color: var(--red);
  background: rgba(127, 31, 25, 0.1);
  color: var(--red);
}

.success-note {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(38, 59, 37, 0.3);
  border-radius: 4px;
  background: rgba(38, 59, 37, 0.1);
  color: var(--green);
  line-height: 1.5;
}

@keyframes halo {
  0%,
  100% {
    transform: scale(0.92);
    opacity: 0.55;
  }
  50% {
    transform: scale(1.04);
    opacity: 1;
  }
}

@keyframes logoRise {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes loadingBar {
  from {
    transform: translateX(-110%);
  }
  to {
    transform: translateX(240%);
  }
}

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

@media (max-width: 1100px) {
  .page-tabs {
    display: flex;
    overflow-x: auto;
  }

  .page-tabs button,
  .page-tabs a {
    min-width: 145px;
  }

  .institution-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 850px) {
  .temple-header,
  .contact-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero,
  .split-layout,
  .ceremony,
  .project-board,
  .booking-form {
    grid-template-columns: 1fr;
  }

  .donation-page-layout,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero__image {
    order: -1;
  }
}

@media (max-width: 560px) {
  .brand img {
    width: 68px;
    height: 68px;
  }

  .brand strong {
    font-size: 1.1rem;
  }

  .brand small {
    font-size: 0.74rem;
  }

  .hero h1 {
    font-size: clamp(2.55rem, 16vw, 4.2rem);
  }

  .institution-grid {
    grid-template-columns: 1fr;
  }

  .donation-form fieldset:first-child,
  .amount-grid {
    grid-template-columns: 1fr;
  }
}
