/* ===== Палитры (design/palettes/palettes.md) ===== */

:root,
[data-palette="silk"] {
  --bg-primary: #FAF6F0;
  --bg-surface: #F2EAE0;
  --text-primary: #2B211C;
  --text-muted: #6E5A4F;
  --accent-primary: #B88655;
  --accent-secondary: #D4A59A;
  --graphic-line: #C8B29B;
  --on-accent: #FFFDF9;
}

[data-palette="garden"] {
  --bg-primary: #F6F7F4;
  --bg-surface: #E9EDE6;
  --text-primary: #1F2A24;
  --text-muted: #53635A;
  --accent-primary: #4A6B5B;
  --accent-secondary: #C59B6D;
  --graphic-line: #9EB0A5;
  --on-accent: #FBFCFA;
}

[data-palette="moonlit"] {
  --bg-primary: #F4F5F8;
  --bg-surface: #E8ECF2;
  --text-primary: #1B2234;
  --text-muted: #525D73;
  --accent-primary: #9E6B7B;
  --accent-secondary: #7B8FA8;
  --graphic-line: #A9B3C4;
  --on-accent: #FDFBFC;
}

/* ===== Наборы шрифтов ===== */

:root,
[data-fonts="a"] {
  --font-script: "Marck Script", cursive;
  --script-style: normal;
  --script-scale: 1;
  --font-heading: "Cormorant Garamond", Georgia, serif;
  --font-body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-fonts="d"] {
  --font-script: "Cormorant Garamond", Georgia, serif;
  --script-style: italic;
  --script-scale: 1.02;
  --font-heading: "Cormorant Garamond", Georgia, serif;
  --font-body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-fonts="b"] {
  --font-script: "Playfair Display", Georgia, serif;
  --script-style: italic;
  --script-scale: 0.86;
  --font-heading: "Playfair Display", Georgia, serif;
  --font-body: "Jost", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-fonts="c"] {
  --font-script: "Great Vibes", cursive;
  --script-style: normal;
  --script-scale: 1.08;
  --font-heading: "Oranienbaum", Georgia, serif;
  --font-body: "Raleway", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root {
  --radius: 22px;
  --maxw: 560px;
  --error: #A8323A;
  --line: color-mix(in srgb, var(--accent-primary) 24%, transparent);
}

/* ===== База ===== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  transition: background-color 0.4s, color 0.4s;
}

a {
  color: var(--accent-primary);
}

.svg svg {
  display: block;
  width: 100%;
  height: auto;
}

[hidden] {
  display: none !important;
}

/* ===== Параллакс ===== */

.parallax {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.p-item {
  position: absolute;
  top: 0;
  will-change: transform;
  transition: color 0.4s;
}

.p-item--far {
  color: var(--graphic-line);
  opacity: 0.3;
}

.p-item--mid {
  color: var(--graphic-line);
  opacity: 0.55;
}

.p-item--near {
  color: var(--accent-primary);
  opacity: 0.5;
}

main {
  position: relative;
  z-index: 1;
  padding: 0 16px calc(40px + env(safe-area-inset-bottom));
}

/* ===== Главный экран ===== */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 0 24px;
  text-align: center;
}

.hero__kicker {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.hero__art {
  position: relative;
  width: 100%;
  max-width: 520px;
  color: var(--accent-primary);
}

.hero__names {
  margin: 0;
  color: var(--text-primary);
  font-family: var(--font-script);
  font-style: var(--script-style);
  font-weight: 400;
  line-height: 1;
}

.hero__name {
  display: block;
  font-size: calc(clamp(54px, 16.5vw, 104px) * var(--script-scale));
}

.hero__amp {
  display: none;
}

[data-hero="stave"] .hero__graphic {
  padding: 12% 0 8%;
}

[data-hero="stave"] .hero__names {
  position: absolute;
  inset: 0;
}

[data-hero="stave"] .hero__name--a {
  position: absolute;
  top: 6%;
  left: 0;
}

[data-hero="stave"] .hero__name--r {
  position: absolute;
  right: 0;
  bottom: 0;
}

[data-hero="heart"] .hero__graphic {
  width: 76%;
  margin: 0 auto;
}

[data-hero="monogram"] .hero__graphic {
  width: 58%;
  margin: 0 auto;
}

html:not([data-hero="stave"]) .hero__names {
  margin-top: 20px;
}

html:not([data-hero="stave"]) .hero__name {
  display: inline;
  font-size: calc(clamp(44px, 13vw, 88px) * var(--script-scale));
}

html:not([data-hero="stave"]) .hero__amp {
  display: inline;
  margin: 0 0.12em;
  color: var(--accent-primary);
  font-family: var(--font-heading);
  font-size: clamp(32px, 9vw, 60px);
  font-style: italic;
}

.hero__date {
  margin: 28px 0 0;
  font-family: var(--font-heading);
  font-size: clamp(32px, 9.5vw, 48px);
  letter-spacing: 0.08em;
  line-height: 1.1;
}

.hero__date span {
  color: var(--accent-primary);
}

.hero__meta {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero__scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 36px;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-decoration: none;
  text-transform: uppercase;
}

.hero__scroll svg {
  width: 14px;
  animation: nudge 2.4s ease-in-out infinite;
}

@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ===== Секции ===== */

.section {
  max-width: var(--maxw);
  margin: 0 auto;
  scroll-margin-top: 16px;
}

.card {
  padding: 32px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg-surface) 84%, transparent);
  text-align: center;
  transition: background-color 0.4s, border-color 0.4s;
}

.section__icon {
  width: 40px;
  margin: 0 auto 12px;
  color: var(--accent-primary);
}

.section__title {
  margin: 0;
  color: var(--accent-primary);
  font-family: var(--font-heading);
  font-size: clamp(26px, 7.5vw, 36px);
  font-weight: 400;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
}

.section__subtitle {
  margin: 6px 0 22px;
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.divider {
  max-width: 340px;
  margin: 36px auto;
  color: var(--accent-primary);
}

.text p {
  margin: 0 0 14px;
}

.text p:last-child {
  margin-bottom: 0;
}

.text em {
  color: var(--accent-primary);
  font-family: var(--font-heading);
  font-size: 1.2em;
  font-style: italic;
}

.place__name {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 26px;
}

.place__when {
  margin: 4px 0 20px;
  color: var(--text-muted);
}

.map {
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-primary);
}

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

/* ===== Тайминг ===== */

.timeline {
  position: relative;
  max-width: 400px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
  text-align: left;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 62px;
  width: 1px;
  background: var(--line);
}

.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr;
  column-gap: 22px;
  padding: 8px 0;
}

.timeline li::before {
  content: "";
  position: absolute;
  top: 17px;
  left: 59px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-primary);
}

.timeline time {
  grid-row: span 2;
  font-family: var(--font-heading);
  font-size: 19px;
  line-height: 1.4;
}

.timeline__tempo {
  color: var(--accent-primary);
  font-family: var(--font-heading);
  font-size: 14px;
  font-style: italic;
  line-height: 1.3;
}

.timeline__note {
  margin: 16px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

/* ===== Анкета ===== */

.rsvp__form {
  text-align: left;
}

.rsvp__lead {
  margin: 0 0 20px;
  text-align: center;
}

.guest {
  min-width: 0;
  margin: 0 0 14px;
  padding: 18px 14px 4px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--bg-primary) 75%, transparent);
}

.guest__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.guest__title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 21px;
  font-weight: 500;
}

.guest__remove {
  padding: 4px 10px;
  border: 0;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  column-gap: 10px;
}

.field,
.group {
  display: block;
  min-width: 0;
  margin: 0 0 16px;
  padding: 0;
  border: 0;
}

.field__label {
  display: block;
  margin: 0 0 6px;
  padding: 0;
  font-size: 14px;
  font-weight: 500;
}

.field__label small {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 400;
}

.input {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--text-muted) 35%, transparent);
  border-radius: 12px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font: inherit;
  font-size: 16px;
  -webkit-appearance: none;
  appearance: none;
}

.input::placeholder {
  color: color-mix(in srgb, var(--text-muted) 70%, transparent);
}

.input:focus {
  border-color: var(--accent-primary);
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 30%, transparent);
  outline-offset: 0;
}

textarea.input {
  resize: vertical;
}

.input--other {
  margin-top: 10px;
}

.seg {
  display: flex;
  gap: 8px;
}

.seg .opt {
  flex: 1;
}

.opt {
  position: relative;
  cursor: pointer;
}

.opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.opt span {
  display: block;
  padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--accent-primary) 45%, transparent);
  border-radius: 999px;
  background: var(--bg-primary);
  text-align: center;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
  -webkit-user-select: none;
  user-select: none;
}

.opt input:checked + span {
  border-color: var(--accent-primary);
  background: var(--accent-primary);
  color: var(--on-accent);
}

.opt input:focus-visible + span {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips .opt span {
  padding: 8px 14px;
  font-size: 14px;
}

.hint {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.hint--top {
  margin: -2px 0 10px;
}

.error {
  margin: 6px 0 0;
  color: var(--error);
  font-size: 13px;
}

.is-invalid .input,
.is-invalid .opt span {
  border-color: var(--error);
}

.common {
  margin-top: 22px;
}

.btn {
  display: block;
  width: 100%;
  padding: 16px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--accent-primary);
  color: var(--on-accent);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.2s, background-color 0.4s;
}

.btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

.btn--ghost {
  border: 1px dashed color-mix(in srgb, var(--accent-primary) 60%, transparent);
  background: transparent;
  color: var(--accent-primary);
  letter-spacing: 0.06em;
  text-transform: none;
}

.form-status {
  margin: 0 0 14px;
  color: var(--error);
  text-align: center;
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.rsvp__state p {
  margin: 0 0 14px;
}

.thanks__art {
  max-width: 300px;
  margin: 0 auto 16px;
  color: var(--accent-primary);
}

.thanks__title {
  margin: 0 0 12px;
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 400;
}

/* ===== Подвал ===== */

.footer {
  max-width: var(--maxw);
  margin: 40px auto 0;
  color: var(--text-muted);
  text-align: center;
}

.footer__icon {
  width: 34px;
  margin: 0 auto 12px;
  color: var(--accent-primary);
}

.footer__sign {
  margin-top: 18px;
  color: var(--text-primary);
  font-family: var(--font-script);
  font-size: calc(30px * var(--script-scale));
  font-style: var(--script-style);
}

/* ===== Появление блоков ===== */

.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero__scroll svg {
    animation: none;
  }
}

/* ===== Десктоп ===== */

@media (min-width: 900px) {
  :root {
    --maxw: 640px;
  }

  .card {
    padding: 44px 48px;
  }

  .divider {
    margin: 48px auto;
  }
}
