/* «Светлый храм» — MD3 tokens + православная светлая палитра */

:root {
  /* Seed: sky blue + soft */
  --md-sys-color-primary: #3d5f82;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #d3e4f7;
  --md-sys-color-on-primary-container: #0d2438;

  --md-sys-color-secondary: #5a6b5e;
  --md-sys-color-on-secondary: #ffffff;
  --md-sys-color-secondary-container: #dce8de;
  --md-sys-color-on-secondary-container: #152118;

  --md-sys-color-tertiary: #9a7b2f;
  --md-sys-color-on-tertiary: #ffffff;
  --md-sys-color-tertiary-container: #f5e6b8;
  --md-sys-color-on-tertiary-container: #2a1f00;

  --md-sys-color-surface: #f7f9fc;
  --md-sys-color-on-surface: #1c2430;
  --md-sys-color-on-surface-variant: #4a5564;
  --md-sys-color-surface-container-low: #eef3f8;
  --md-sys-color-surface-container: #e6edf4;
  --md-sys-color-outline: #7a8696;
  --md-sys-color-outline-variant: #c5ced9;

  --md-sys-shape-corner-medium: 12px;
  --md-sys-shape-corner-large: 16px;
  --md-sys-shape-corner-extra-large: 28px;

  --font-display: "Cormorant Garamond", "Times New Roman", serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;

  --sky-top: #8eb8e0;
  --sky-mid: #c5daf0;
  --sky-bottom: #f4f8fc;
  --gold: #c4a35a;
  --gold-deep: #9a7b2f;

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;
  --space-6: 72px;

  --max: 40rem;
  --max-wide: 56rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--md-sys-color-on-surface);
  background:
    radial-gradient(120% 80% at 50% -10%, var(--sky-mid), transparent 55%),
    linear-gradient(180deg, var(--sky-bottom) 0%, var(--md-sys-color-surface) 40%, #eef4ea 100%);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--md-sys-color-primary);
}

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

/* ——— Intro ——— */
.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 40% 20%, #fff9e8 0%, var(--sky-mid) 45%, var(--sky-top) 100%);
  overflow: hidden;
  transition: opacity 0.9s ease, visibility 0.9s ease;
}

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

.intro__rays {
  position: absolute;
  inset: -20%;
  background:
    conic-gradient(from 200deg at 30% 15%, transparent 0deg, rgba(255, 255, 255, 0.55) 18deg, transparent 40deg),
    radial-gradient(circle at 30% 12%, rgba(255, 248, 220, 0.95), transparent 42%);
  animation: rays-in 2.8s ease-out both;
}

.intro__cross {
  position: relative;
  z-index: 2;
  width: min(68px, 16vw);
  color: var(--gold-deep);
  filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.85));
  opacity: 0;
  transform: translateY(12px) scale(0.92);
  animation: cross-in 1.1s 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.intro__cross svg {
  width: 100%;
  height: auto;
}

.intro__doves {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.dove {
  position: absolute;
  width: clamp(2rem, 5vw, 2.75rem);
  height: auto;
  color: #fff;
  opacity: 0;
  filter: drop-shadow(0 2px 8px rgba(255, 255, 255, 0.75));
  animation: dove-fly 2.4s ease-out forwards;
}

.dove--1 { top: 28%; left: 58%; animation-delay: 1.1s; }
.dove--2 { top: 22%; left: 68%; animation-delay: 1.35s; }
.dove--3 { top: 34%; left: 72%; animation-delay: 1.55s; }

.intro__label {
  position: absolute;
  bottom: max(12vh, 4rem);
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 3.2vw, 1.65rem);
  font-weight: 500;
  font-style: italic;
  color: var(--md-sys-color-on-primary-container);
  letter-spacing: 0.02em;
  opacity: 0;
  animation: fade-up 1s 1.7s ease forwards;
}

.intro__skip {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 3;
  border: 0;
  background: rgba(255, 255, 255, 0.45);
  color: var(--md-sys-color-on-surface-variant);
  font: 500 0.85rem/1 var(--font-body);
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.intro__skip:hover {
  background: rgba(255, 255, 255, 0.7);
}

@keyframes rays-in {
  from { opacity: 0; transform: scale(1.08); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes cross-in {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes dove-fly {
  0% { opacity: 0; transform: translate(0, 20px) scale(0.7); }
  30% { opacity: 1; }
  100% { opacity: 0.85; transform: translate(-28px, -36px) scale(1); }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ——— Site ——— */
.site {
  transition: opacity 0.8s ease;
}

.site.is-ready {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

/* ——— Hero ——— */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  align-items: end;
  color: #fff;
  overflow: hidden;
}

.hero__media {
  position: absolute;
  inset: 0;
}

.hero__media picture {
  display: block;
  width: 100%;
  height: 100%;
}

.hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.04);
  animation: hero-ken 12s ease-out both;
}

.hero__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(18, 36, 56, 0.15) 0%, rgba(18, 36, 56, 0.28) 40%, rgba(12, 24, 38, 0.78) 100%),
    radial-gradient(80% 50% at 70% 20%, rgba(255, 255, 255, 0.18), transparent 60%);
}

.hero__content {
  position: relative;
  z-index: 1;
  padding: var(--space-5) clamp(1.25rem, 5vw, 3rem) var(--space-6);
  max-width: 42rem;
}

.hero__eyebrow {
  margin: 0 0 var(--space-2);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 248, 230, 0.9);
}

.hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.6rem, 8vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.25);
}

.hero__names {
  display: block;
}

.hero__invite {
  margin: var(--space-2) 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3.5vw, 1.7rem);
  font-style: italic;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
}

.hero__date {
  margin: var(--space-2) 0 var(--space-4);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--md-sys-color-tertiary-container);
}

@keyframes hero-ken {
  from { transform: scale(1.08); }
  to { transform: scale(1.04); }
}

/* ——— Sections ——— */
.section {
  padding: var(--space-6) clamp(1.25rem, 5vw, 2.5rem);
}

.section__inner {
  max-width: var(--max);
  margin: 0 auto;
  text-align: center;
}

.section__inner--wide {
  max-width: var(--max-wide);
}

.section__title {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 600;
  color: var(--md-sys-color-primary);
  line-height: 1.15;
}

.section__lead {
  margin: 0 auto var(--space-3);
  max-width: 32rem;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 1.08rem;
}

.section__lead strong {
  color: var(--gold-deep);
  font-weight: 700;
}

.place-name {
  margin: var(--space-3) 0 var(--space-1);
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3.5vw, 1.75rem);
  font-weight: 600;
  line-height: 1.35;
  color: var(--md-sys-color-on-surface);
}

.place-address {
  margin: 0;
  color: var(--md-sys-color-on-surface-variant);
}

.section--banquet {
  background:
    linear-gradient(180deg, transparent, rgba(245, 230, 184, 0.35) 30%, rgba(245, 230, 184, 0.2) 70%, transparent);
}

.banquet-note {
  margin: var(--space-3) 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 4.2vw, 2.05rem);
  font-style: italic;
  font-weight: 600;
  line-height: 1.3;
  color: var(--gold-deep);
}

.banquet-note strong {
  font-style: normal;
  font-weight: 700;
}

/* ——— Map ——— */
.map-tabs {
  display: flex;
  width: fit-content;
  gap: 0.35rem;
  margin: 0 auto var(--space-3);
  padding: 0.3rem;
  border-radius: 999px;
  background: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-outline-variant);
}

.map-tab {
  min-height: 44px;
  min-width: 7.5rem;
  padding: 0.55rem 1.2rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.map-tab:hover {
  color: var(--md-sys-color-on-surface);
}

.map-tab.is-active {
  background: linear-gradient(180deg, #d4b56a, var(--gold-deep));
  color: #fff;
  box-shadow: 0 6px 16px rgba(154, 123, 47, 0.28);
}

.map-frame {
  margin: 0 0 var(--space-3);
  border-radius: var(--md-sys-shape-corner-large);
  overflow: hidden;
  border: 1px solid var(--md-sys-color-outline-variant);
  box-shadow: 0 12px 40px rgba(61, 95, 130, 0.12);
  aspect-ratio: 16 / 11;
  background: var(--md-sys-color-surface-container);
}

.map-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.map-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
  align-items: center;
}

/* ——— Buttons (MD3-ish) ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  border: 0;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn--gold {
  background: linear-gradient(180deg, #d4b56a, var(--gold-deep));
  color: #fff;
  box-shadow: 0 8px 24px rgba(154, 123, 47, 0.28);
}

.btn--gold:hover {
  box-shadow: 0 12px 28px rgba(154, 123, 47, 0.38);
}

.btn--primary {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  box-shadow: 0 8px 22px rgba(61, 95, 130, 0.22);
}

.btn--text {
  background: transparent;
  color: var(--md-sys-color-primary);
  min-height: 40px;
}

.btn--block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

/* ——— RSVP ——— */
.section--rsvp {
  padding-bottom: var(--space-6);
}

.rsvp {
  margin: var(--space-4) auto 0;
  max-width: 22rem;
  text-align: left;
  display: grid;
  gap: var(--space-3);
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface-variant);
}

.field__input {
  width: 100%;
  min-height: 52px;
  padding: 0.85rem 1rem;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-medium);
  background: #fff;
  font: 500 1rem/1.3 var(--font-body);
  color: var(--md-sys-color-on-surface);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field__input:focus {
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 3px var(--md-sys-color-primary-container);
}

.choice {
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  gap: var(--space-1);
}

.choice__legend {
  padding: 0;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface-variant);
}

.choice__option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 48px;
  padding: 0.65rem 1rem;
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-surface-container-low);
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.choice__option:has(input:checked) {
  background: var(--md-sys-color-tertiary-container);
  border-color: rgba(154, 123, 47, 0.35);
}

.choice__option input {
  accent-color: var(--gold-deep);
  width: 1.1rem;
  height: 1.1rem;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.rsvp__status {
  margin: 0;
  min-height: 1.4em;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 500;
}

.rsvp__status.is-ok {
  color: #2f6b45;
}

.rsvp__status.is-err {
  color: #9b2c2c;
}

/* ——— Footer ——— */
.footer {
  padding: var(--space-4) var(--space-3) var(--space-5);
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--md-sys-color-on-surface-variant);
}

/* ——— Reveal ——— */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .intro__rays,
  .intro__cross,
  .dove,
  .intro__label,
  .hero__img {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
