:root {
  --charcoal: #323232;
  --charcoal-deep: #262626;
  --ink: #1c1c1c;
  --white: #ffffff;
  --paper: #f6f5f2;
  --line: rgba(255, 255, 255, 0.78);
  --muted: rgba(255, 255, 255, 0.72);
  --error: #ffb3a6;
  --focus: #e9d8a6;
  --display: "Oranienbaum", "Bodoni 72", "Didot", Georgia, serif;
  --sans: "Montserrat", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--charcoal-deep);
  color: var(--white);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
}

.card {
  max-width: 760px;
  margin: 0 auto;
  background: var(--charcoal);
  padding: 40px 48px 56px;
}

/* ---------- Art Deco frames ---------- */

.deco { position: relative; }
.deco .c { position: absolute; width: 56px; height: 56px; color: var(--line); }
.deco .tl { top: 0; left: 0; }
.deco .tr { top: 0; right: 0; transform: scaleX(-1); }
.deco .bl { bottom: 0; left: 0; transform: scaleY(-1); }
.deco .br { bottom: 0; right: 0; transform: scale(-1, -1); }

.divider { display: flex; align-items: center; gap: 12px; margin: 36px auto; max-width: 380px; color: var(--line); }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.divider svg { width: 40px; height: 14px; }

/* ---------- Hero ---------- */

.hero { text-align: center; padding: 28px 0 4px; container-type: inline-size; }

.kicker {
  margin: 0;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.display {
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 0.95;
  margin: 0;
}

.hero h1 { font-size: min(10cqi, 70px); white-space: nowrap; margin: 8px 0 18px; }

.portrait { position: relative; margin: -7cqi auto 0; max-width: 600px; z-index: 0; }
.hero h1 { position: relative; z-index: 1; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55); }
.portrait img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 765 / 620;
  object-fit: cover;
  object-position: 50% 30%;
  /* Soft fade on every edge, like the printed invitation */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%, #000 62%, transparent 100%),
    linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, transparent 0, #000 22%, #000 62%, transparent 100%),
    linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%);
  mask-composite: intersect;
}
.portrait .on-photo {
  position: absolute; left: 0; right: 0; bottom: 6px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}

.hero .name { font-size: min(11.6cqi, 84px); white-space: nowrap; margin-top: 10px; }

.dates { margin: 10px 0 0; font-size: 16px; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; }

/* ---------- Event ---------- */

.event {
  text-align: center;
  padding: 18px 44px 30px;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 15px;
}
.event p { margin: 0 0 6px; }
.event .when { font-weight: 600; font-size: 16px; letter-spacing: 0.16em; margin-bottom: 8px; }

.map-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--white);
  border: 1px solid var(--line);
  padding: 10px 18px;
  text-decoration: none;
  letter-spacing: 0.16em;
  font-size: 13px;
  font-weight: 600;
}
.map-link:hover { background: rgba(255, 255, 255, 0.1); }

/* ---------- Form ---------- */

.intro { text-align: center; font-size: 18px; max-width: 540px; margin: 0 auto 8px; color: var(--muted); }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.section > legend { padding: 0; margin-bottom: 18px; }
h2 {
  margin: 0;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.field { margin: 0 0 24px; }
.row { display: grid; grid-template-columns: 1fr 150px; gap: 20px; }
.guests select { max-width: none; }
.hint.small { font-size: 13px; margin: 6px 0 0; }

label, .label, .choices > legend {
  display: block;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.choices > legend { line-height: 1.5; }

.req, .opt { font-weight: 400; letter-spacing: 0.06em; text-transform: none; color: var(--muted); font-size: 13px; margin-left: 6px; }

input[type="text"], input[type="email"], select, textarea {
  width: 100%;
  font: inherit;
  font-size: 17px;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--paper);
  border-radius: 2px;
  padding: 12px 14px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.12);
}
textarea { resize: vertical; min-height: 160px; line-height: 1.55; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 22px) 52%, calc(100% - 16px) 52%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; max-width: 160px; }
input::placeholder, textarea::placeholder { color: #77736c; }

[aria-invalid="true"] { border-color: var(--error) !important; }

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

.choice {
  display: flex;
  align-items: center;
  gap: 14px;
  text-transform: none;
  letter-spacing: 0.02em;
  font-weight: 500;
  font-size: 17px;
  padding: 10px 0;
  margin: 0;
  cursor: pointer;
}
.choice input {
  appearance: none;
  flex: 0 0 auto;
  width: 26px; height: 26px;
  margin: 0;
  background: var(--paper);
  border: 2px solid var(--paper);
  display: grid; place-content: center;
  cursor: pointer;
}
.choice input::before {
  content: "";
  width: 12px; height: 12px;
  background: var(--ink);
  transform: scale(0) rotate(45deg);
}
.choice input:checked::before { transform: scale(1) rotate(45deg); }

.hint { color: var(--muted); font-size: 15px; margin: 0 0 18px; }
.choices .hint { margin: 6px 0 0; }

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

.error-summary {
  border: 2px solid var(--error);
  padding: 14px 18px;
  margin-bottom: 28px;
  color: var(--white);
}
.error-summary p { margin: 0 0 6px; font-weight: 600; }
.error-summary ul { margin: 0; padding-left: 20px; }
.error-summary a { color: var(--error); }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Upload ---------- */

.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 150px;
  padding: 24px;
  text-align: center;
  background: var(--paper);
  color: var(--ink);
  border: 2px dashed #8d8a84;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  margin: 0;
}
.dropzone input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.dropzone:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.dropzone.drag { border-color: var(--ink); background: #ebe8e1; }
.dz-main { font-size: 18px; }
.dz-main u { text-underline-offset: 3px; }
.dz-sub { font-size: 14px; font-weight: 400; color: #55524c; }
.dz-touch { display: none; }

.file-list { list-style: none; margin: 12px 0 0; padding: 0; }
.file-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 15px;
}
.file-list .thumb {
  flex: 0 0 48px; width: 48px; height: 48px; object-fit: cover;
  background: #4a4a4a; display: grid; place-content: center; font-size: 11px; letter-spacing: 0.1em;
}
.file-list .meta { flex: 1; min-width: 0; }
.file-list .fname { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list .fsize { color: var(--muted); font-size: 13px; }
.file-list .remove {
  flex: 0 0 auto; font: inherit; font-size: 14px; color: var(--white);
  background: none; border: 1px solid var(--line); padding: 6px 12px; cursor: pointer;
}
.file-list .status { flex: 0 0 auto; font-size: 13px; color: var(--muted); text-align: right; min-width: 70px; }
.file-list .status.ok { color: #b9e4c2; }
.file-list .status.bad { color: var(--error); }

/* ---------- Buttons & states ---------- */

.submit {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 18px;
  font: inherit;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--white);
  border: 0;
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--charcoal), 0 0 0 2px var(--line);
}
.submit:hover { background: #ecebe7; }
.submit:disabled { opacity: 0.6; cursor: wait; }

.link-btn {
  display: block;
  margin: 16px auto 0;
  background: none;
  border: 0;
  color: var(--white);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.progress h2, .thanks h2 { text-align: center; margin-bottom: 8px; }
.progress > p { text-align: center; color: var(--muted); margin: 0 0 16px; }
.bar { height: 10px; background: rgba(255, 255, 255, 0.15); overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--white); transition: width 0.3s ease; }
.progress .bar-text { text-align: center; color: var(--white); margin: 10px 0 0; font-size: 15px; }
.retry { margin-top: 24px; border: 2px solid var(--error); padding: 16px 18px; }
.retry p { margin: 0 0 4px; }

.thanks { text-align: center; padding: 12px 0 8px; outline: none; }
.thanks .display { font-size: clamp(44px, 10vw, 72px); margin-bottom: 18px; letter-spacing: 0.02em; }
.thanks p { max-width: 520px; margin: 0 auto 14px; font-size: 18px; }
.thanks .hint { font-size: 15px; }

/* ---------- Small screens ---------- */

@media (max-width: 600px) {
  .row { grid-template-columns: 1fr 110px; gap: 12px; }
  body { background: var(--charcoal); }
  .card { padding: 24px 16px 40px; }
  .deco .c { width: 36px; height: 36px; }
  .hero { padding-top: 20px; }
  .kicker { font-size: 13px; letter-spacing: 0.22em; }
  .dates { font-size: 13px; letter-spacing: 0.14em; }
  .event { padding: 14px 18px 24px; font-size: 13px; letter-spacing: 0.05em; }
  .event .when { font-size: 14px; letter-spacing: 0.1em; }
  .event .sep { display: none; }
  .event .time { display: block; }
  .divider { margin: 28px auto; }
  .dz-desktop { display: none; }
  .dz-touch { display: inline; }
}

@media (hover: none) { .dz-desktop { display: none; } .dz-touch { display: inline; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
