@font-face {
  font-family: "Titan One";
  src: url("/fonts/titan-one-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Barlow Condensed";
  src: url("/fonts/barlow-condensed-600.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Barlow Condensed";
  src: url("/fonts/barlow-condensed-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Barlow Condensed";
  src: url("/fonts/barlow-condensed-800.woff2") format("woff2");
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

:root {
  --sky: #3aa9e2;
  --sky-dark: #248fc8;
  --yellow: #ffc72e;
  --yellow-dark: #edae00;
  --ink: #171717;
  --paper: #f6eee1;
  --paper-bright: #fffaf2;
  --dirt: #864a31;
  --dirt-dark: #6f3927;
  --gray: #51565e;
  --red: #b83b2f;
  --green: #1d7c4d;
  --radius: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  font-size: 1.08rem;
  font-weight: 600;
  background:
    radial-gradient(circle at 12% 20%, rgba(255,255,255,.12) 0 1px, transparent 2px),
    radial-gradient(circle at 70% 35%, rgba(0,0,0,.05) 0 1px, transparent 2px),
    var(--sky);
  background-size: 28px 28px, 34px 34px, auto;
  overflow-x: hidden;
}

body::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 16vh;
  z-index: -1;
  background:
    radial-gradient(70px 26px at 4% 15%, var(--dirt-dark) 99%, transparent 100%),
    radial-gradient(90px 34px at 21% 12%, var(--dirt) 99%, transparent 100%),
    radial-gradient(120px 38px at 43% 22%, var(--dirt-dark) 99%, transparent 100%),
    radial-gradient(100px 30px at 68% 8%, var(--dirt) 99%, transparent 100%),
    radial-gradient(90px 34px at 92% 18%, var(--dirt-dark) 99%, transparent 100%),
    var(--dirt);
  box-shadow: 0 -6px 0 rgba(67, 31, 20, .12);
}

.sky-texture {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  opacity: .18;
  background-image:
    repeating-linear-gradient(13deg, rgba(255,255,255,.22) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(103deg, rgba(0,0,0,.06) 0 1px, transparent 1px 9px);
  mix-blend-mode: soft-light;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 72px;
}

.site-header {
  text-align: center;
  margin: 0 auto 30px;
  max-width: 960px;
  position: relative;
}

.paper-label {
  position: relative;
  display: inline-block;
  padding: 18px 28px 20px;
  transform: rotate(-.8deg);
  filter: drop-shadow(0 8px 3px rgba(0,0,0,.16));
  clip-path: polygon(1% 9%, 7% 5%, 15% 7%, 24% 3%, 34% 6%, 45% 2%, 55% 5%, 64% 3%, 76% 6%, 89% 2%, 99% 8%, 97% 25%, 100% 42%, 98% 59%, 100% 77%, 96% 94%, 83% 97%, 70% 94%, 59% 98%, 47% 95%, 34% 99%, 22% 95%, 10% 98%, 2% 91%, 4% 73%, 1% 58%, 3% 40%, 0% 24%);
}

.paper-label::after,
.rsvp-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .13;
  background-image:
    repeating-linear-gradient(18deg, transparent 0 6px, rgba(0,0,0,.18) 7px, transparent 8px 14px),
    repeating-linear-gradient(97deg, transparent 0 8px, rgba(255,255,255,.35) 9px, transparent 10px 18px);
  mix-blend-mode: multiply;
}

.paper-label--yellow { background: var(--yellow); }
.paper-label--white { background: var(--paper-bright); }

.site-header h1 {
  font-family: "Titan One", "Arial Black", sans-serif;
  font-weight: 400;
  font-size: clamp(2.65rem, 6.5vw, 5rem);
  line-height: .96;
  margin: 0;
  letter-spacing: -.035em;
  white-space: nowrap;
  text-shadow: 1px 2px 0 rgba(255,255,255,.13);
}

.eyebrow {
  display: block;
  font-family: "Titan One", "Arial Black", sans-serif;
  font-size: clamp(1.8rem, 4.4vw, 3.2rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.02em;
  margin-bottom: 11px;
}

.intro {
  margin: 18px auto 0;
  font-size: 1.28rem;
  font-weight: 800;
  color: #0d3043;
  background: rgba(255,255,255,.78);
  width: fit-content;
  max-width: 90%;
  padding: 9px 15px;
  transform: rotate(.5deg);
  box-shadow: 0 4px 0 rgba(13,48,67,.13);
}

.party-grid {
  display: grid;
  grid-template-columns: minmax(0, .88fr) minmax(420px, 1.12fr);
  gap: 34px;
  align-items: start;
}

.paper-shadow { filter: drop-shadow(0 14px 9px rgba(0, 0, 0, .22)); }

.invite-wrap {
  margin: 0;
  background: #fff;
  padding: 10px;
  transform: rotate(-1.4deg);
  clip-path: polygon(1% 1%, 10% 0, 18% 1%, 28% 0, 39% 1%, 49% 0, 61% 1%, 72% 0, 84% 1%, 99% 0, 100% 10%, 99% 20%, 100% 32%, 99% 44%, 100% 56%, 99% 68%, 100% 80%, 99% 91%, 100% 100%, 88% 99%, 76% 100%, 64% 99%, 51% 100%, 40% 99%, 27% 100%, 14% 99%, 0 100%, 1% 88%, 0 77%, 1% 66%, 0 54%, 1% 42%, 0 29%, 1% 16%);
  animation: paperFloat 7s ease-in-out infinite;
}

.invite-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
}

.rsvp-card {
  position: sticky;
  top: 22px;
  isolation: isolate;
  padding: 210px 34px 38px;
  background: var(--paper);
  clip-path: polygon(0 2%, 8% 1%, 17% 2%, 26% 0, 38% 1%, 49% 0, 60% 2%, 71% 1%, 82% 2%, 92% 0, 100% 2%, 99% 14%, 100% 29%, 99% 42%, 100% 56%, 99% 72%, 100% 86%, 98% 100%, 88% 99%, 77% 100%, 66% 99%, 55% 100%, 43% 99%, 31% 100%, 19% 99%, 8% 100%, 1% 98%, 2% 83%, 0 70%, 1% 56%, 0 42%, 1% 28%, 0 14%);
}

.rsvp-card > * { position: relative; z-index: 1; }

.compact-label {
  display: block;
  transform: rotate(.65deg);
  margin: 0 0 24px;
  padding: 18px 22px;
  text-align: center;
}

.compact-label h2 {
  font-family: "Titan One", "Arial Black", sans-serif;
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.35rem);
  margin: 2px 0 8px;
  line-height: 1;
}

.compact-label p { margin: 0; line-height: 1.45; }
.kicker { font-size: 1rem; text-transform: uppercase; letter-spacing: .055em; font-weight: 800; }

.field-group { margin: 0 0 23px; }

label,
legend {
  font-weight: 800;
  font-size: 1.18rem;
}

input[type="text"],
input[type="number"],
textarea {
  width: 100%;
  margin-top: 8px;
  border: 3px solid var(--ink);
  border-radius: 7px 11px 6px 10px;
  background: #fffdfa;
  color: var(--ink);
  font: inherit;
  font-size: 1.08rem;
  font-weight: 600;
  padding: 13px 14px;
  outline: none;
  box-shadow: 4px 5px 0 rgba(23,23,23,.16);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

textarea { resize: vertical; min-height: 92px; }
input:focus, textarea:focus {
  border-color: var(--sky-dark);
  transform: translateY(-1px);
  box-shadow: 5px 6px 0 rgba(36,143,200,.18);
}

.rsvp-choice {
  border: 0;
  padding: 0;
  margin: 0 0 23px;
}

.rsvp-choice legend { margin-bottom: 10px; }

.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.choice-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 78px;
  padding: 12px;
  cursor: pointer;
  background: #fffdf7;
  border: 3px solid var(--ink);
  border-radius: 8px 13px 8px 12px;
  box-shadow: 4px 5px 0 rgba(23,23,23,.16);
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.choice-card:hover { transform: translateY(-2px) rotate(-.35deg); }
.choice-card:has(input:checked) {
  background: var(--yellow);
  box-shadow: 6px 7px 0 rgba(23,23,23,.2);
  transform: translateY(-2px);
}

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

.choice-card:has(input:focus-visible) { outline: 4px solid rgba(36,143,200,.45); outline-offset: 3px; }

.choice-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--yellow);
  font-size: 1.7rem;
  line-height: 1;
}

.choice-card strong, .choice-card small { display: block; }
.choice-card strong { font-size: 1.22rem; line-height: 1; }
.choice-card small { font-weight: 600; margin-top: 4px; font-size: .92rem; line-height: 1.15; }

.attending-fields {
  padding: 17px 17px 1px;
  margin-bottom: 22px;
  border-left: 6px solid var(--yellow-dark);
  background: rgba(255,255,255,.48);
  animation: digIn .25s ease-out both;
}

.field-help {
  margin: 6px 0 0;
  color: #5a5149;
  font-size: .92rem;
  font-weight: 700;
}

.number-control {
  display: grid;
  grid-template-columns: 54px minmax(70px, 1fr) 54px;
  max-width: 240px;
  align-items: stretch;
  margin-top: 8px;
}

.number-control input {
  margin: 0;
  text-align: center;
  border-radius: 0;
  box-shadow: none;
  appearance: textfield;
  -moz-appearance: textfield;
}
.number-control input::-webkit-outer-spin-button,
.number-control input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.count-button {
  border: 3px solid var(--ink);
  background: var(--yellow);
  color: var(--ink);
  font: 900 1.8rem/1 inherit;
  cursor: pointer;
  min-height: 50px;
}
.count-button:first-child { border-radius: 9px 0 0 9px; border-right: 0; }
.count-button:last-child { border-radius: 0 9px 9px 0; border-left: 0; }
.count-button:active { transform: translateY(2px); }

.submit-button {
  width: 100%;
  min-height: 74px;
  border: 4px solid var(--ink);
  border-radius: 8px 13px 8px 12px;
  background: var(--yellow);
  color: var(--ink);
  font-family: "Titan One", "Arial Black", sans-serif;
  font-size: clamp(1.55rem, 4vw, 2rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: .01em;
  cursor: pointer;
  box-shadow: 7px 8px 0 var(--ink);
  transform: rotate(-.25deg);
  transition: transform .14s ease, box-shadow .14s ease;
}
.submit-button:hover { transform: translateY(-2px) rotate(.15deg); box-shadow: 8px 10px 0 var(--ink); }
.submit-button:active { transform: translate(4px, 5px); box-shadow: 3px 3px 0 var(--ink); }
.submit-button:disabled { opacity: .65; cursor: wait; }

.button-loader {
  display: none;
  width: 19px;
  height: 19px;
  margin-left: 9px;
  vertical-align: middle;
  border: 3px solid rgba(23,23,23,.3);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}
.submit-button.is-loading .button-loader { display: inline-block; }

.field-error {
  min-height: 1.05em;
  margin: 6px 0 0;
  color: var(--red);
  font-size: .92rem;
  font-weight: 900;
}

.form-status {
  min-height: 0;
  margin-top: 18px;
  font-weight: 900;
  line-height: 1.45;
}
.form-status.success,
.form-status.error { padding: 13px 14px; border: 3px solid var(--ink); background: #fff; box-shadow: 4px 5px 0 rgba(23,23,23,.16); }
.form-status.success { border-left: 8px solid var(--green); }
.form-status.error { border-left: 8px solid var(--red); }

.honeypot {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

footer {
  margin-top: 34px;
  text-align: center;
  color: #fff;
  font-weight: 900;
  text-shadow: 0 2px 0 rgba(0,0,0,.18);
}

.sun {
  position: fixed;
  top: 34px;
  right: 4vw;
  width: 104px;
  height: 104px;
  z-index: -1;
  animation: sunDrift 12s ease-in-out infinite;
}
.sun i {
  position: absolute;
  inset: 21px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 4px 7px rgba(0,0,0,.14);
}
.sun span {
  position: absolute;
  left: 48px;
  top: -8px;
  width: 10px;
  height: 26px;
  background: var(--yellow);
  transform-origin: 5px 60px;
}
.sun span:nth-child(2){ transform: rotate(45deg); }
.sun span:nth-child(3){ transform: rotate(90deg); }
.sun span:nth-child(4){ transform: rotate(135deg); }
.sun span:nth-child(5){ transform: rotate(180deg); }
.sun span:nth-child(6){ transform: rotate(225deg); }
.sun span:nth-child(7){ transform: rotate(270deg); }
.sun span:nth-child(8){ transform: rotate(315deg); }

.excavator-stage {
  position: absolute;
  top: 12px;
  left: 50%;
  width: min(430px, 84%);
  height: 190px;
  transform: translateX(-50%);
  overflow: hidden;
}

.paper-excavator {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 7px 3px rgba(23, 23, 23, .24));
  opacity: 0;
}

.paper-excavator--lift {
  animation: excavatorLiftFrame 4.8s steps(1, end) infinite;
}

.paper-excavator--dig {
  animation: excavatorDigFrame 4.8s steps(1, end) infinite;
}

.paper-excavator--scoop {
  animation: excavatorScoopFrame 4.8s steps(1, end) infinite;
}

.celebration {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  overflow: hidden;
}
.confetti {
  position: absolute;
  top: -30px;
  width: 14px;
  height: 18px;
  background: var(--yellow);
  border: 2px solid rgba(23,23,23,.5);
  animation: confettiFall 1.6s cubic-bezier(.21,.78,.31,.98) forwards;
}
.confetti:nth-child(3n) { background: var(--ink); }
.confetti:nth-child(4n) { background: #fff; }
.confetti:nth-child(5n) { background: var(--dirt); }

@keyframes paperFloat {
  0%, 100% { transform: rotate(-1.4deg) translateY(0); }
  50% { transform: rotate(-.7deg) translateY(-7px); }
}
@keyframes digIn { from { opacity: 0; transform: translateY(-7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes sunDrift { 0%,100% { transform: rotate(-4deg) translateY(0); } 50% { transform: rotate(4deg) translateY(9px); } }
@keyframes excavatorLiftFrame {
  0%, 18%, 78%, 100% { opacity: 1; }
  19%, 77% { opacity: 0; }
}
@keyframes excavatorDigFrame {
  0%, 18%, 47%, 100% { opacity: 0; }
  19%, 46% { opacity: 1; }
}
@keyframes excavatorScoopFrame {
  0%, 46%, 78%, 100% { opacity: 0; }
  47%, 77% { opacity: 1; }
}
@keyframes confettiFall { to { transform: translate(var(--drift), 110vh) rotate(var(--spin)); opacity: .94; } }

@media (max-width: 900px) {
  .page-shell { width: min(720px, calc(100% - 22px)); padding-top: 24px; }
  .party-grid { grid-template-columns: 1fr; gap: 28px; }
  .invite-wrap { width: min(100%, 560px); justify-self: center; }
  .rsvp-card { position: relative; top: 0; width: min(100%, 620px); justify-self: center; }
  .sun { width: 78px; height: 78px; right: -8px; top: 12px; opacity: .78; }
  .sun i { inset: 17px; }
  .sun span { left: 35px; top: -6px; width: 8px; height: 20px; transform-origin: 4px 45px; }
}

@media (max-width: 560px) {
  .page-shell { width: min(100% - 14px, 480px); padding-bottom: 58px; }
  .site-header { margin-bottom: 22px; }
  .paper-label { padding: 15px 18px 17px; }
  .site-header h1 { font-size: clamp(2.5rem, 14vw, 4rem); white-space: normal; }
  .intro { font-size: .94rem; max-width: 96%; }
  .invite-wrap { padding: 6px; }
  .rsvp-card { padding: 174px 19px 28px; }
  .compact-label { padding: 15px; }
  .choice-grid { grid-template-columns: 1fr; }
  .choice-card { min-height: 68px; }
  .excavator-stage { top: 9px; width: 94%; height: 155px; }
  .attending-fields { padding: 14px 13px 1px; }
  .number-control { max-width: none; grid-template-columns: 56px 1fr 56px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
