:root {
  color-scheme: light;
  --ink: #293b3b;
  --muted: #687675;
  --accent: #b36c4b;
  --accent-deep: #86513d;
  --paper: #fffefa;
  --canvas: #f7f4ed;
  --line: #e8e1d5;
  --sage: #dfe6dc;
  --gold: #e4bd72;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; min-height: 100vh; color: var(--ink); font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--canvas); }
a { color: inherit; }
.page-shell { min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 18px 26px; position: relative; overflow: hidden; }
.page-shell::before, .page-shell::after { content: ''; position: fixed; width: 320px; height: 320px; border: 1px solid #e9e1d4; border-radius: 50%; pointer-events: none; }
.page-shell::before { top: -220px; left: -175px; box-shadow: 0 0 0 18px var(--canvas), 0 0 0 19px #e9e1d4, 0 0 0 38px var(--canvas), 0 0 0 39px #e9e1d4; }
.page-shell::after { right: -210px; bottom: -230px; box-shadow: 0 0 0 18px var(--canvas), 0 0 0 19px #e9e1d4, 0 0 0 38px var(--canvas), 0 0 0 39px #e9e1d4; }
.card { width: min(100%, 560px); background: var(--paper); position: relative; z-index: 1; border: 1px solid #ece5db; border-radius: 7px; box-shadow: 0 22px 64px #473b2b12; overflow: hidden; animation: card-arrive 1.5s cubic-bezier(.2,.75,.25,1) both; }
.invite-hero { padding: 0 34px 25px; text-align: center; }
.road-art { height: 177px; margin: 0 -34px 22px; position: relative; overflow: hidden; background: linear-gradient(180deg, #f4ead5 0%, #f7f0e4 74%, #e9e3d6 74%, #e9e3d6 100%); }
.road-sun { position: absolute; width: 64px; height: 64px; border-radius: 50%; background: #ead7ae; top: 22px; right: calc(50% - 115px); animation: sun-glow 8s ease-in-out infinite; }
.road-cloud { position: absolute; height: 11px; width: 38px; border-radius: 20px; background: #fffaf0; opacity: .92; animation: cloud-drift 12s ease-in-out infinite alternate; }
.road-cloud::before, .road-cloud::after { content: ''; position: absolute; bottom: 3px; border-radius: 50%; background: inherit; }
.road-cloud::before { left: 7px; width: 16px; height: 16px; }
.road-cloud::after { left: 18px; width: 12px; height: 12px; }
.cloud-one { top: 50px; left: calc(50% - 142px); }
.cloud-two { top: 33px; right: calc(50% - 158px); transform: scale(.72); animation-delay: -3.5s; animation-duration: 9s; }
.hero-sparkle { position: absolute; z-index: 1; color: #a17b4f; line-height: 1; animation: sparkle 4.2s ease-in-out infinite; }
.sparkle-one { top: 32px; left: calc(50% - 102px); font-size: 16px; }
.sparkle-two { top: 73px; right: calc(50% - 134px); color: #879581; font-size: 13px; animation-delay: .9s; }
.sparkle-three { top: 92px; left: calc(50% - 144px); color: #c28a68; font-size: 10px; animation-delay: 1.5s; }
.birthday-car { position: absolute; z-index: 1; width: min(220px, 66vw); height: auto; left: 50%; bottom: 13px; transform: translateX(-50%); overflow: visible; animation: car-drive-in 2.8s cubic-bezier(.15,.76,.28,1) .2s both; }
.car-shadow { fill: none; stroke: #c4b8a4; stroke-width: 3; stroke-linecap: round; }
.car-body { fill: #bd7652; stroke: #925c43; stroke-width: 2; stroke-linejoin: round; }
.car-window { fill: #f5e8ce; stroke: #925c43; stroke-width: 2; stroke-linejoin: round; }
.car-trim, .car-lamp { fill: none; stroke: #f6e2b8; stroke-width: 3; stroke-linecap: round; }
.wheel { fill: #354243; stroke: #fffefa; stroke-width: 3; }
.wheel-center { fill: #d9c7a7; }
.wheel-spin { transform-box: fill-box; transform-origin: center; animation: wheel-roll 2.8s cubic-bezier(.15,.76,.28,1) .2s both; }
.wheel-spoke { fill: none; stroke: #d9c7a7; stroke-width: 1.4; stroke-linecap: round; }
.car-bunting { fill: #788a78; stroke: #788a78; stroke-width: 1; stroke-linejoin: round; transform-box: fill-box; transform-origin: center top; animation: bunting-wave 4.8s ease-in-out infinite alternate; }
.road-line { position: absolute; width: 42px; left: calc(50% - 21px); bottom: 8px; border-top: 2px dashed #b8aa91; }
.eyebrow { color: var(--accent-deep); font-size: 10px; font-weight: 700; letter-spacing: .2em; margin: 0 0 11px; }
.invitee-pill { display: table; max-width: 100%; margin: -5px auto 10px; padding: 7px 17px; border: 1px solid #eadfce; border-radius: 999px; background: #fbf7ee; color: var(--accent-deep); font-size: clamp(15px, 2.8vw, 17px); font-weight: 700; letter-spacing: .035em; line-height: 1.25; animation: text-arrive 1.5s cubic-bezier(.2,.75,.25,1) .45s both; }
h1 { max-width: 460px; margin: 0 auto 13px; font: 600 clamp(34px, 8vw, 46px)/1.12 'Playfair Display', Georgia, serif; letter-spacing: -.035em; animation: text-arrive 1.35s cubic-bezier(.2,.75,.25,1) .85s both; }
h1 span { display: inline-block; color: var(--accent); white-space: nowrap; animation: word-pop 1.35s cubic-bezier(.2,.75,.25,1) 1.45s both; }
.hero-copy { max-width: 370px; margin: 0 auto; color: var(--muted); font-size: 14px; line-height: 1.7; animation: text-arrive 1.3s cubic-bezier(.2,.75,.25,1) 1.2s both; }
.event-details { margin: 0 34px; padding: 18px 0; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); gap: 18px; }
.detail-row { min-width: 0; display: flex; align-items: flex-start; gap: 11px; text-align: left; }
.detail-icon { flex: 0 0 31px; width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; color: var(--accent-deep); background: #f3ece0; font-size: 17px; transition: transform .25s ease, background .25s ease; }
.detail-row:hover .detail-icon { transform: rotate(-10deg) scale(1.08); background: #efe3d0; }
.pin-icon { font-size: 23px; line-height: 1; }
.detail-row > div { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.detail-label { color: var(--accent-deep); font-size: 9px; font-weight: 700; letter-spacing: .16em; }
.detail-row strong { font-size: 12px; line-height: 1.45; font-weight: 700; }
.detail-sub { color: var(--muted); font-size: 11px; line-height: 1.5; }
.map-link { display: inline-flex; align-items: center; gap: 5px; width: fit-content; margin-top: 2px; color: var(--accent-deep); font-size: 11px; font-weight: 700; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.map-link:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 2px; }
.personal-note { margin: 12px 28px 10px; color: var(--muted); text-align: center; font-size: 13px; line-height: 1.6; }
.personal-note strong { color: var(--ink); }
.rsvp-panel { margin: 0 34px 18px; padding: 14px 20px 15px; border: 1px solid #eee7dc; border-radius: 5px; background: #f8f6f0; animation: content-arrive 1.3s ease-out .65s both; }
.rsvp-kicker { margin-bottom: 7px; color: var(--accent-deep); font-size: 9px; font-weight: 700; letter-spacing: .18em; text-align: center; }
.rsvp-kicker span { display: inline-block; margin-right: 3px; animation: sparkle 4.2s ease-in-out infinite; }
.invite-limit { display: flex; align-items: baseline; justify-content: center; gap: 7px; margin-bottom: 10px; }
.limit-number { color: var(--accent); font: 600 28px/1 'Playfair Display', Georgia, serif; }
.limit-label { color: var(--muted); font-size: 11px; }
.rsvp-copy { max-width: 330px; margin: 0 auto 10px; color: var(--muted); text-align: center; font-size: 11px; line-height: 1.45; animation: text-arrive 1.15s ease-out .95s both; }
.rsvp-form { text-align: left; }
.rsvp-form label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 700; }
.select-wrap { position: relative; }
select { appearance: none; width: 100%; min-height: 50px; border: 1px solid #d7d2c8; border-radius: 4px; padding: 12px 44px 12px 14px; background: var(--paper); color: var(--ink); font: 500 15px 'DM Sans', sans-serif; outline-color: var(--accent); }
.select-wrap > span { position: absolute; right: 15px; top: 50%; transform: translateY(-55%); pointer-events: none; color: var(--muted); font-size: 22px; }
.crew-preview { display: flex; align-items: center; gap: 9px; min-height: 34px; margin-top: 8px; padding: 5px 9px; border-radius: 4px; background: #f1ede4; }
.mini-convoy { position: relative; display: flex; flex: 0 0 92px; align-items: center; gap: 3px; min-height: 20px; overflow: hidden; }
.mini-convoy::after { content: ''; position: absolute; right: 0; bottom: 1px; left: 0; z-index: 0; border-bottom: 1px dashed #c9bca8; }
.mini-car { position: relative; z-index: 1; flex: 0 0 18px; width: 18px; height: 8px; border-radius: 5px 7px 2px 2px; background: var(--accent); animation: mini-car-roll 1s cubic-bezier(.2,.75,.25,1) both; }
.mini-car:nth-child(even) { background: #82907c; }
.mini-car::before { content: ''; position: absolute; top: -4px; left: 5px; width: 8px; height: 5px; border-radius: 4px 4px 0 0; background: #e5d5b8; }
.mini-car::after { content: ''; position: absolute; bottom: -3px; left: 2px; width: 15px; height: 4px; background: radial-gradient(circle at 2px 2px, #354243 0 2px, transparent 2.5px), radial-gradient(circle at 13px 2px, #354243 0 2px, transparent 2.5px); }
.mini-convoy.is-u-turn .mini-car { animation: tiny-u-turn 1.8s cubic-bezier(.2,.75,.25,1) both; }
.convoy-extra { position: relative; z-index: 1; color: var(--muted); font-size: 9px; font-weight: 700; }
.crew-feedback { flex: 1; min-width: 0; margin: 0; color: #586564; font-size: 10px; line-height: 1.35; }
button { display: block; width: 100%; min-height: 50px; margin-top: 9px; padding: 13px 16px; border: 0; border-radius: 4px; color: #fffefa; background: var(--ink); font: 700 14px 'DM Sans', sans-serif; letter-spacing: .01em; cursor: pointer; transition: background .18s ease, transform .18s ease; }
button:hover { background: var(--accent-deep); }
button:active { transform: translateY(1px); }
button span { display: inline-block; transition: transform .2s ease; }
button:hover span { transform: translateX(4px); }
button:focus-visible, select:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
button span { padding-left: 7px; }
.edit-note { max-width: 340px; margin: 10px auto 0; color: #7d8580; font-size: 11px; line-height: 1.55; text-align: center; }
.notice { margin: 18px 24px 0; padding: 12px 14px; border-radius: 4px; font-size: 13px; line-height: 1.5; text-align: center; }
.notice.success { color: #315d49; background: #edf4ec; }
.notice.error { color: #824935; background: #f8eee8; }
footer { position: relative; z-index: 1; margin-top: 17px; color: #85867d; font: 12px 'Playfair Display', Georgia, serif; letter-spacing: .04em; text-align: center; }
.dad-signoff { display: flex; align-items: center; justify-content: center; gap: 9px; flex-wrap: wrap; font-size: 11px; }
.signoff-rule { width: 22px; height: 1px; background: #d9cdbb; }
.signoff-dot { color: var(--accent); font-size: 10px; animation: sparkle 4.2s ease-in-out infinite; }

@keyframes card-arrive {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes content-arrive {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes text-arrive {
  0% { opacity: 0; transform: translateY(14px); filter: blur(3px); }
  70% { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: translateY(0); filter: blur(0); }
}
@keyframes word-pop {
  0% { opacity: 0; transform: translateY(10px) scale(.78) rotate(-8deg); }
  72% { opacity: 1; transform: translateY(-2px) scale(1.08) rotate(2deg); }
  100% { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}
@keyframes car-drive-in {
  /* The car's nose points left, so it enters from the right and rolls forward. */
  0% { opacity: .25; transform: translate(calc(-50% + 140px), 10px) scale(.82); }
  62% { opacity: 1; transform: translate(-52%, -3px) scale(1.04); }
  82% { transform: translate(-49%, 1px) scale(.99); }
  100% { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
@keyframes wheel-roll {
  from { transform: rotate(540deg); }
  to { transform: rotate(0); }
}
@keyframes cloud-drift {
  from { translate: -4px 0; }
  to { translate: 11px 2px; }
}
@keyframes sun-glow {
  0%, 100% { opacity: .85; scale: 1; }
  50% { opacity: 1; scale: 1.06; }
}
@keyframes sparkle {
  0%, 100% { opacity: .45; transform: scale(.78) rotate(-12deg); }
  50% { opacity: 1; transform: scale(1.12) rotate(12deg); }
}
@keyframes bunting-wave {
  from { rotate: -2deg; }
  to { rotate: 3deg; }
}
@keyframes mini-car-roll {
  from { opacity: 0; transform: translateX(-18px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes tiny-u-turn {
  0% { opacity: 0; transform: translate(20px, 0) scaleX(1); }
  45% { opacity: 1; transform: translate(0, 0) scaleX(1); }
  64% { transform: translate(0, -4px) scaleX(.82); }
  78% { transform: translate(0, -2px) scaleX(-1); }
  100% { opacity: 1; transform: translate(-3px, 0) scaleX(-1); }
}

@media (max-width: 520px) {
  .page-shell { justify-content: flex-start; padding: max(14px, env(safe-area-inset-top)) 12px max(20px, env(safe-area-inset-bottom)); }
  .card { border-radius: 7px; }
  .invite-hero { padding: 0 21px 12px; }
  .road-art { height: 96px; margin-right: -21px; margin-left: -21px; margin-bottom: 11px; }
  .road-sun { top: 14px; width: 45px; height: 45px; }
  .cloud-one { top: 38px; }
  .cloud-two { top: 19px; }
  .hero-sparkle.sparkle-one { top: 20px; }
  .hero-sparkle.sparkle-two { top: 55px; }
  .hero-sparkle.sparkle-three { top: 65px; }
  .birthday-car { width: min(174px, 55vw); bottom: 3px; }
  .eyebrow { margin-bottom: 7px; font-size: 9px; }
  .invitee-pill { margin-top: -3px; margin-bottom: 7px; padding: 5px 12px; font-size: clamp(14px, 4vw, 16px); }
  h1 { margin-bottom: 7px; font-size: clamp(30px, 8.5vw, 38px); }
  .hero-copy { max-width: 330px; font-size: 12px; line-height: 1.5; }
  .event-details { margin: 0 18px; grid-template-columns: 1fr; gap: 14px; padding: 16px 2px; }
  .detail-row { gap: 10px; }
  .detail-row strong { font-size: 13px; }
  .detail-sub { font-size: 12px; }
  .personal-note { margin: 8px 19px 8px; font-size: 12px; }
  .rsvp-panel { margin: 0 14px 15px; padding: 11px 13px 12px; }
  .rsvp-kicker { margin-bottom: 4px; }
  .invite-limit { margin-bottom: 7px; }
  .rsvp-copy { margin-bottom: 7px; font-size: 10px; }
  .rsvp-form label { margin-bottom: 6px; font-size: 12px; }
  select, button { min-height: 48px; }
  .crew-preview { gap: 7px; min-height: 31px; margin-top: 6px; padding: 4px 7px; }
  .mini-convoy { flex-basis: 80px; }
  .crew-feedback { font-size: 9px; }
  button { margin-top: 7px; padding: 12px 14px; }
  .edit-note { margin-top: 8px; font-size: 10px; }
  .event-details { padding-top: 14px; }
  .notice { margin-right: 14px; margin-left: 14px; }
  footer { margin-top: 13px; }
  .dad-signoff { gap: 6px; font-size: 10px; }
  .signoff-rule { width: 13px; }
}

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