/* base.css — reset, the mobile column, shared type + controls.
 *
 * The invitation is a single phone-width column. On desktop it stays phone-width and
 * centred over a soft, pre-blurred crop of the darshan art (a tiny JPEG scaled up — no
 * CSS filter, so no scene-sized raster cost).
 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  background: var(--garbha);
  color: var(--ivory);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

html.is-gated,
html.is-gated body {
  overflow: hidden;
  height: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  background: var(--garbha);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

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

button {
  font: inherit;
  color: inherit;
}

/* ---- desktop backdrop ------------------------------------------------ */
.backdrop {
  display: none;
}

@media (min-width: 560px) {
  .backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background:
      radial-gradient(ellipse at 50% 40%, rgba(27, 6, 9, 0.35), rgba(27, 6, 9, 0.88) 70%),
      url("../assets/img/backdrop.jpg") center / cover no-repeat;
  }
}

/* ---- the column -------------------------------------------------------- */
.invite {
  position: relative;
  width: var(--col);
  margin: 0 auto;
  background:
    url("../assets/img/grain.png") repeat,
    linear-gradient(180deg, var(--garbha) 0%, var(--garbha-2) 30%, #33090f 55%, var(--garbha-2) 80%, var(--garbha) 100%);
  overflow-x: clip;
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.55);
}

/* contain: paint keeps each section's compositor layers inside its own box, so a
   running loop in one section can never force the next section's static content onto
   the GPU (overlap promotion chains are what grow the "one huge layer" iOS kills tabs over). */
.section {
  position: relative;
  padding: 88px var(--pad) 80px;
  text-align: center;
  contain: paint;
}

/* a pool of warm lamp-light inside each section; it fades out well before the
   section's edges so neighbouring sections never meet at a visible seam */
.section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 85% 34% at 50% 32%, rgba(210, 69, 30, 0.16), transparent 70%);
  pointer-events: none;
}

.section > * {
  position: relative;
}

/* ---- type ---------------------------------------------------------------- */
.eyebrow {
  margin: 0 0 10px;
  font: 600 12px/1.5 var(--font-display);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--marigold);
}

.section-title {
  margin: 0 0 14px;
  font: 600 clamp(30px, 8.6vw, 38px) / 1.14 var(--font-display);
  letter-spacing: -0.005em;
}

.gold,
.section-title,
.couple__name,
.date-block__day,
.closing__morya {
  padding-block: 0.08em;
  background: var(--gold-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.muted {
  color: var(--ivory-dim);
}

p {
  margin: 0 0 12px;
}

/* ---- garland divider ----------------------------------------------------- */
.toran {
  z-index: 2; /* animated: paint it after the static copy, never beneath it */
  width: calc(100% + 2 * var(--pad));
  max-width: none;
  margin: -88px calc(-1 * var(--pad)) 26px;
  transform-origin: 50% 0;
  pointer-events: none;
}

/* ---- arch-topped niche (like the diya niches in the sanctum wall) -------- */
.niche {
  position: relative;
  padding: 34px 22px 24px;
  border: 1px solid var(--line);
  border-radius: 999px 999px 18px 18px / 150px 150px 18px 18px;
  background:
    radial-gradient(ellipse 80% 55% at 50% 0%, rgba(246, 196, 69, 0.12), transparent 70%),
    rgba(27, 6, 9, 0.55);
  box-shadow:
    inset 0 0 0 5px rgba(27, 6, 9, 0.55),
    inset 0 0 0 6px rgba(217, 168, 78, 0.22),
    0 18px 40px rgba(0, 0, 0, 0.35);
}

/* ---- controls ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: 600 15px/1.2 var(--font-display);
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}

.btn img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.btn:active {
  transform: scale(0.96);
}

.btn--solid {
  color: #3a0a10;
  background: linear-gradient(180deg, #fbe1a0, #dca64b 70%, #c98d34);
  box-shadow: 0 6px 18px rgba(212, 154, 60, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn--ghost {
  color: var(--brass-hi);
  border-color: var(--line);
  background: rgba(27, 6, 9, 0.42);
}

@media (hover: hover) {
  .btn--ghost:hover {
    border-color: var(--brass);
    background: rgba(74, 13, 22, 0.6);
  }
  .btn--solid:hover {
    transform: translateY(-1px);
  }
}

:focus-visible {
  outline: 2px solid var(--haldi);
  outline-offset: 3px;
}

.field {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 241, 220, 0.06);
  color: var(--ivory);
  font: 400 16px/1.45 var(--font-body);
  resize: none;
}

.field::placeholder {
  color: var(--ivory-faint);
}

.field:focus-visible {
  outline-offset: 1px;
  border-color: var(--brass);
}

/* ---- sound toggle -------------------------------------------------------- */
.sound-toggle {
  position: fixed;
  z-index: 60;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, calc((100vw - var(--col)) / 2 + 12px));
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(27, 6, 9, 0.6);
  color: var(--brass-hi);
  cursor: pointer;
}

.sound-toggle[hidden] {
  display: none;
}

.sound-toggle svg {
  width: 22px;
  height: 22px;
}

.sound-toggle__off,
.sound-toggle[aria-pressed="false"] .sound-toggle__on {
  display: none;
}

.sound-toggle[aria-pressed="false"] .sound-toggle__off {
  display: block;
}

/* ---- a11y helpers --------------------------------------------------------- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.noscript {
  position: fixed;
  inset: auto 16px 16px;
  padding: 14px;
  border-radius: 12px;
  background: var(--kumkum);
  text-align: center;
}
