:root {
  --bg: #e9e2d8;
  --bg-deep: #ddd4c7;
  --paper: #f6f2ec;
  --paper-edge: #ece6dd;
  --ink: #1f1c19;
  --ink-soft: #4a443e;
  --muted: #8a8177;
  --line: #d8cfc3;
  --accent: #b08a5a;
  --petal: #fbf8f3;
  --shadow: 0 30px 60px -30px rgba(70, 55, 35, .35), 0 8px 20px -10px rgba(70, 55, 35, .18);
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --script: "Marck Script", "Great Vibes", cursive;
  --sans: "Montserrat", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html { background: var(--bg); overflow-x: hidden; }
/* iOS Safari ignores overflow on body — clip decorative branches inside main */
html, body { max-width: 100%; }
main { overflow-x: hidden; overflow-x: clip; }

body {
  margin: 0;
  min-height: 100vh;
  font-variant-numeric: lining-nums;
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  background:
    radial-gradient(1200px 700px at 85% -10%, #f4efe7 0%, transparent 60%),
    radial-gradient(900px 600px at -10% 110%, #f1ebe2 0%, transparent 60%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-deep) 100%);
  overflow-x: hidden;
}

/* soft leaf shadows falling across the page, like in the invitation photo */
body::before {
  content: "";
  position: fixed;
  inset: -10%;
  pointer-events: none;
  z-index: 0;
  opacity: .16;
  filter: blur(14px);
  background-image: url("leaf-shadow.svg");
  background-size: 900px auto;
  background-repeat: no-repeat;
  background-position: -120px 40%;
  animation: sway 14s ease-in-out infinite alternate;
}

@keyframes sway {
  from { transform: rotate(-2deg) translate(0, 0); }
  to   { transform: rotate(1.5deg) translate(18px, -10px); }
}

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

main { position: relative; z-index: 1; }

/* ---------- paper card ---------- */
.paper {
  position: relative;
  width: min(680px, calc(100% - 32px));
  margin: 72px auto;
  padding: 88px 56px 72px;
  background:
    linear-gradient(115deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,0) 45%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-edge) 100%);
  box-shadow: var(--shadow);
  text-align: center;
}

.paper + .paper { margin-top: 0; }

.branch {
  position: absolute;
  pointer-events: none;
  z-index: 2;
}
.branch--top { top: -70px; right: -60px; width: 360px; }
.branch--bottom { bottom: -60px; left: -70px; width: 240px; transform: rotate(160deg); }
.branch--side { top: 46%; right: -48px; width: 120px; transform: rotate(40deg); }

/* ---------- typography ---------- */
.date-stack {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(64px, 14vw, 112px);
  line-height: .95;
  letter-spacing: -.01em;
  margin: 0 0 48px;
}
.date-stack span { display: block; position: relative; }
.date-stack span + span::before {
  content: "";
  position: absolute;
  top: -.06em;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink);
  transform: translateX(-50%);
}
.date-stack span + span { margin-top: .14em; }

.eyebrow {
  font-size: 14px;
  letter-spacing: .12em;
  color: var(--ink-soft);
  margin: 0;
}

.names {
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(48px, 10vw, 76px);
  line-height: 1.1;
  margin: 8px 0 18px;
  color: var(--ink);
}

.lead {
  font-size: 16px;
  letter-spacing: .14em;
  margin: 0 0 28px;
  color: var(--ink-soft);
}

.when {
  font-size: 22px;
  letter-spacing: .12em;
  margin: 0 0 40px;
  line-height: 1.6;
}

.signature {
  font-size: 14px;
  letter-spacing: .3em;
  color: var(--ink-soft);
  margin: 0;
}

h2 {
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(40px, 8vw, 58px);
  line-height: 1.1;
  margin: 0 0 8px;
}

.section-note {
  font-size: 13px;
  letter-spacing: .14em;
  color: var(--muted);
  margin: 0 0 36px;
}

.rule {
  width: 64px;
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 36px auto;
}

/* ---------- countdown ---------- */
.countdown {
  display: flex;
  justify-content: center;
  gap: clamp(14px, 4vw, 36px);
  margin: 0;
}
.countdown div { min-width: 64px; }
.countdown b {
  display: block;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(38px, 9vw, 56px);
  line-height: 1;
}
.countdown small {
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- timeline ---------- */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 420px;
  text-align: left;
}
.timeline li {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.timeline li:last-child { border-bottom: 0; }
.timeline time {
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.1;
}
.timeline strong { font-weight: 500; letter-spacing: .06em; display: block; }
.timeline span { font-size: 14px; color: var(--muted); }

/* ---------- details grid ---------- */
.details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 28px;
  text-align: center;
}
.details h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  margin: 0 0 6px;
  letter-spacing: .04em;
}
.details p { margin: 0; font-size: 14px; color: var(--ink-soft); }


/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: .28em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  padding: 16px 34px;
  cursor: pointer;
  transition: background .3s, color .3s;
}
.btn:hover, .btn:focus-visible { background: var(--ink); color: var(--paper); outline: none; }
.btn--solid { background: var(--ink); color: var(--paper); }
.btn--solid:hover, .btn--solid:focus-visible { background: #3a342e; }
.btn--ghost { border-color: transparent; padding: 10px 14px; color: var(--muted); }
.btn--ghost:hover { background: transparent; color: var(--ink); }
.btn[disabled] { opacity: .5; cursor: progress; }

.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }

/* ---------- form ---------- */
.form { text-align: left; }

fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 34px;
}
legend, .label {
  display: block;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  margin-bottom: 4px;
  padding: 0;
  color: var(--ink);
}
.hint { display: block; font-size: 13px; color: var(--muted); margin-bottom: 12px; letter-spacing: .02em; }

input[type="text"], input[type="tel"], input[type="number"], textarea, select {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 10px 2px;
  border-radius: 0;
  transition: border-color .3s;
}
textarea { resize: vertical; min-height: 84px; border: 1px solid var(--line); padding: 12px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--ink); }

.choices { display: flex; flex-wrap: wrap; gap: 10px; }
.choices label { position: relative; cursor: pointer; }
.choices input { position: absolute; opacity: 0; pointer-events: none; }
.choices span {
  display: inline-block;
  padding: 10px 18px;
  font-size: 14px;
  letter-spacing: .06em;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.4);
  transition: all .25s;
  user-select: none;
}
.choices label:hover span { border-color: var(--muted); }
.choices input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.choices input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }


[hidden] { display: none !important; }

.only-attending { transition: opacity .3s; }

.progress {
  height: 2px;
  background: var(--line);
  margin: 8px 0 44px;
  position: relative;
  overflow: hidden;
}
.progress i {
  position: absolute; inset: 0 auto 0 0;
  width: 0;
  background: var(--ink);
  transition: width .4s ease;
}

.error { color: #9b3d2e; font-size: 13px; margin-top: 6px; }

.thanks { text-align: center; }
.thanks .names { margin-top: 0; }

/* ---------- footer ---------- */
.foot {
  text-align: center;
  font-size: 12px;
  letter-spacing: .2em;
  color: var(--muted);
  padding: 0 16px 48px;
  position: relative;
  z-index: 1;
}
.foot a { color: inherit; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 1s ease, transform 1s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 560px) {
  .paper { padding: 72px 22px 56px; margin: 56px auto; }
  .branch--top { width: 230px; top: -48px; right: -30px; }
  .branch--bottom { width: 170px; left: -40px; }
  .branch--side { display: none; }
  .lead { font-size: 14px; letter-spacing: .08em; }
  .when { font-size: 18px; }
  .row { grid-template-columns: 1fr; }
  .timeline li { grid-template-columns: 68px 1fr; }
}

/* ---------- drinks with quantity ---------- */
.drink-list { display: grid; gap: 10px; }
.drink { display: flex; align-items: center; gap: 14px; min-height: 44px; }
.drink .choices span { min-width: 150px; text-align: center; }
.drink-qty { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); letter-spacing: .06em; }
.drink-qty output { min-width: 44px; text-align: right; font-family: var(--serif); font-size: 24px; color: var(--ink); }
.drink-qty .step {
  width: 36px; height: 36px; padding: 0;
  font: inherit; font-size: 18px; line-height: 1; color: var(--ink);
  background: transparent; border: 1px solid var(--line); border-radius: 50%;
  cursor: pointer; transition: border-color .2s, background .2s;
}
.drink-qty .step:first-child { margin-right: 4px; }
.drink-qty .step:last-of-type { margin-left: 8px; }
.drink-qty .step:hover:not(:disabled) { border-color: var(--ink); }
.drink-qty .step:disabled { opacity: .35; cursor: default; }

/* ---------- add to calendar ---------- */
.cal { position: relative; }
.cal summary { list-style: none; }
.cal summary::-webkit-details-marker { display: none; }
.cal[open] summary { background: var(--ink); color: var(--paper); }
.cal-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  width: max-content;
  max-width: min(300px, calc(100vw - 32px));
  display: grid;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 16px 36px -18px rgba(70, 55, 35, .45);
  text-align: center;
}
.cal-menu a {
  padding: 14px 22px;
  font-size: 13px;
  letter-spacing: .12em;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.cal-menu a:hover { background: rgba(0,0,0,.04); }
.cal-menu small {
  padding: 10px 16px 12px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
  white-space: normal;
}

/* ---------- joke BAC meter ---------- */
.meter {
  margin-top: 22px;
  padding: 18px 18px 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.4);
}
.meter { text-align: center; }
.meter-head span { display: block; font-size: 11px; font-weight: 400; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); line-height: 1.4; }
.meter-head b { display: block; font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: 1.1; margin-top: 4px; white-space: nowrap; }
.meter-bar {
  position: relative;
  height: 10px;
  margin: 14px 10px 6px;
  border-radius: 6px;
  background: linear-gradient(90deg, #e7ded1 0%, #d8c39f 30%, #c39a62 55%, #a4643e 78%, #7a2e22 100%);
  opacity: .9;
}
.meter-bar i {
  position: absolute; inset: 0 auto 0 0;
  width: 0;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
  transition: width .5s ease;
}
.meter-mark {
  position: absolute;
  top: 50%;
  left: 0;
  width: 20px; height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
  transition: left .5s cubic-bezier(.3,1.4,.5,1);
}
.meter-scale { margin: 0 4px; display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); letter-spacing: .08em; }
.meter-joke { margin: 12px 0 6px; font-size: 15px; line-height: 1.5; min-height: 2.9em; }
.meter small { display: block; font-size: 11px; color: var(--muted); line-height: 1.5; }
.meter[data-level="6"] .meter-mark { animation: wobble .6s ease-in-out infinite alternate; }
@keyframes wobble { from { transform: rotate(-12deg) translateX(-2px); } to { transform: rotate(12deg) translateX(2px); } }
@media (prefers-reduced-motion: reduce) { .meter[data-level="6"] .meter-mark { animation: none; } }

/* ---------- main course cards ---------- */
.dish-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dish-grid label, .dish-grid span { display: block; height: 100%; }
.dish-grid span { padding: 12px 12px 10px; overflow-wrap: anywhere; hyphens: auto; text-align: left; letter-spacing: 0; }
.dish-grid b { display: block; font-family: var(--serif); font-size: 18px; line-height: 1.2; font-weight: 500; letter-spacing: .02em; }
.dish-grid small { display: block; font-size: 12px; line-height: 1.45; color: var(--muted); margin-top: 2px; }
.dish-grid input:checked + span small { color: rgba(246, 242, 236, .75); }
.dish-grid label:last-child:nth-child(odd) { grid-column: 1 / -1; }
.sub-q { margin-top: 22px; }
.sub-label { font-size: 18px; margin-bottom: 10px; }
@media (max-width: 360px) { .dish-grid { grid-template-columns: 1fr; } }

/* ---------- afterparty ---------- */
#afterparty .timeline time { font-size: 20px; padding-top: 3px; }
.ap-link { margin: 28px 0 0; font-size: 12px; letter-spacing: .14em; color: var(--muted); }

/* ---------- telegram ---------- */
.tg { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--line); text-align: center; }
.tg-title { margin: 0 0 16px; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.tg-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.tg-btn {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  text-align: left; text-transform: none; letter-spacing: .04em;
  border-color: var(--line);
}
.tg-btn svg { width: 26px; height: 26px; flex: none; color: #2aabee; transition: color .3s; }
.tg-btn b { display: block; font-family: var(--serif); font-size: 19px; font-weight: 500; line-height: 1.2; }
.tg-btn small { display: block; font-size: 12px; color: var(--muted); letter-spacing: .02em; line-height: 1.4; }
.tg-btn:hover svg, .tg-btn:focus-visible svg { color: var(--paper); }
.tg-btn:hover small, .tg-btn:focus-visible small { color: rgba(246, 242, 236, .7); }

/* spam honeypot — hidden from people */
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.cal-menu .cal-inapp { color: #9b3d2e; border-top: 1px solid var(--line); }
