/* =====================================================================
   Denis is Turning 6 — off-road evite
   Palette sampled from the invite artwork. No frameworks, no build step.
   ===================================================================== */

:root {
  --mud-950: #1a1006;
  --mud-900: #241408;
  --mud-800: #3b2412;
  --mud-700: #4d301a;
  --mud-600: #6b4423;
  --mud-500: #8a5a2b;
  --olive:   #5f6b2a;
  --sky:     #5fb6e6;
  --sky-deep:#2b8fc9;
  --gold:    #fdd23f;
  --orange:  #f7941d;
  --blue:    #1e7fd4;
  --bone:    #f6efe2;
  --bone-dim:#c9b7a1;

  --display: 'Bungee', 'Arial Black', system-ui, sans-serif;
  --body: 'Nunito', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;

  --edge: 4px solid var(--mud-950);
  --pop: 0 6px 0 var(--mud-950), 0 14px 28px rgba(0, 0, 0, .45);
  --wrap: 620px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--bone);
  background: var(--mud-900);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* height:auto is required: the width/height attributes on the hero image are
   there to reserve space, but without this they also fix the used height. */
img { max-width: 100%; height: auto; display: block; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--gold); color: var(--mud-950);
  padding: 12px 20px; border-radius: 0 0 12px 0; font-weight: 800;
}
.skip:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------------------------------------------------------------- *
   Terrain — fixed background: sky fading into mud, tire tread, ridge
 * ---------------------------------------------------------------- */

.terrain { position: fixed; inset: 0; z-index: -1; pointer-events: none; }

.terrain__sky {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(147, 214, 247, .55) 0%, rgba(95, 182, 230, 0) 55%),
    linear-gradient(180deg, #2f7fb0 0%, #4a3520 34%, var(--mud-800) 62%, var(--mud-900) 100%);
}

/* Tire tread, drawn once as an inline SVG and tiled at low opacity. */
.terrain__tread {
  position: absolute; inset: 0;
  opacity: .16;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='90' viewBox='0 0 120 90'%3E%3Cg fill='%23140c05'%3E%3Cpath d='M8 6h26l-6 16H2zM44 6h26l-6 16H38zM80 6h26l-6 16H74z'/%3E%3Cpath d='M0 34h30l-5 14H-5zM38 34h30l-5 14H33zM76 34h30l-5 14H71z'/%3E%3Cpath d='M10 60h24l-6 18H4zM48 60h24l-6 18H42zM86 60h24l-6 18H80z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 150px 112px;
}

/* Rocky ridge sitting along the bottom of the viewport. */
.terrain__ridge {
  position: absolute; left: 0; right: 0; bottom: 0; height: 34vh;
  background:
    linear-gradient(180deg, rgba(26, 16, 6, 0) 0%, rgba(26, 16, 6, .85) 70%, var(--mud-950) 100%);
}

/* ---------------------------------------------------------------- *
   Shared type + section furniture
 * ---------------------------------------------------------------- */

main { position: relative; }

section, .hero {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 52px 20px;
}

.section-title {
  font-family: var(--display);
  font-size: clamp(1.85rem, 7.5vw, 2.85rem);
  line-height: 1.05;
  text-align: center;
  margin: 0 0 8px;
  color: var(--gold);
  -webkit-text-stroke: 7px var(--mud-950);
  paint-order: stroke fill;
  text-shadow: 0 5px 0 rgba(0, 0, 0, .5);
  transform: rotate(-1.4deg);
}

.section-sub {
  text-align: center;
  color: var(--bone-dim);
  margin: 0 auto 26px;
  max-width: 30ch;
}

/* Reveal-on-scroll. Hidden only when JS is present, so a no-JS visitor still
   gets the whole page. Neutralised under reduced motion (see bottom). */
.js .reveal { opacity: 0; transform: translateY(26px); }
.js .reveal.in {
  opacity: 1; transform: none;
  transition: opacity .7s ease-out, transform .7s cubic-bezier(.2, .8, .3, 1);
}

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

.hero { padding-top: 34px; text-align: center; }

.hero__kicker {
  font-family: var(--display);
  font-size: .82rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--bone);
  margin: 0 0 18px;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .5);
}
.hero__kicker span { color: var(--gold); }

.hero__frame {
  position: relative;
  max-width: 460px;
  margin: 0 auto;
  border: 10px solid var(--mud-950);
  border-radius: 20px;
  background: var(--mud-950);
  box-shadow:
    0 0 0 4px var(--mud-600),
    0 24px 44px rgba(0, 0, 0, .55);
  overflow: hidden;
  transform: rotate(-1deg);
}
.hero__frame img { border-radius: 11px; }

/* Rivet heads around the frame. */
.hero__rivets {
  position: absolute; inset: 6px; border-radius: 12px; z-index: 2;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255, 233, 180, .85) 0 1.6px, rgba(0, 0, 0, .45) 2px, transparent 2.6px);
  background-size: 44px 44px;
  background-position: 6px 6px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  padding: 9px;
}

.hero__tagline {
  font-family: var(--display);
  font-size: clamp(.95rem, 3.6vw, 1.15rem);
  color: var(--bone);
  margin: 22px auto 0;
  max-width: 22ch;
  line-height: 1.5;
  text-shadow: 0 3px 0 rgba(0, 0, 0, .5);
}

/* ---------------------------------------------------------------- *
   Countdown gauges
 * ---------------------------------------------------------------- */

.countdown { padding-top: 20px; text-align: center; }

.plate__label {
  font-family: var(--display);
  font-size: .78rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 14px;
}

.gauges {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-width: 440px;
  margin: 0 auto;
}

.gauge {
  background: linear-gradient(180deg, var(--mud-700), var(--mud-900));
  border: var(--edge);
  border-radius: 14px;
  padding: 12px 4px 9px;
  box-shadow: inset 0 2px 0 rgba(255, 220, 160, .18), 0 5px 0 var(--mud-950);
}
.gauge b {
  display: block;
  font-family: var(--display);
  font-size: clamp(1.5rem, 6.5vw, 2.1rem);
  line-height: 1;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 3px 0 rgba(0, 0, 0, .55);
}
.gauge span {
  display: block;
  font-size: .64rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--bone-dim);
  margin-top: 5px;
}

.countdown__msg {
  font-family: var(--display);
  color: var(--gold);
  font-size: 1.15rem;
  margin: 16px 0 0;
  text-shadow: 0 3px 0 rgba(0, 0, 0, .5);
}

/* ---------------------------------------------------------------- *
   Mission brief cards
 * ---------------------------------------------------------------- */

.cards { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 14px; }

.card {
  position: relative;
  background: linear-gradient(180deg, rgba(107, 68, 35, .96), rgba(36, 20, 8, .96));
  border: var(--edge);
  border-radius: 18px;
  padding: 18px 20px 18px 68px;
  box-shadow: var(--pop);
}
.card:nth-child(odd)  { transform: rotate(-.7deg); }
.card:nth-child(even) { transform: rotate(.7deg); }

.card__icon {
  position: absolute; left: 18px; top: 20px;
  width: 34px; height: 34px;
  fill: none; stroke: var(--gold); stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

.card__label {
  font-family: var(--display);
  font-size: .68rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--orange);
  margin: 0 0 2px;
}
.card__value {
  font-family: var(--display);
  font-size: clamp(1.15rem, 4.6vw, 1.4rem);
  line-height: 1.15;
  margin: 0;
  color: var(--bone);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .45);
}
.card__sub { margin: 3px 0 0; color: var(--bone-dim); font-size: .92rem; line-height: 1.45; }

.brief__actions { display: grid; gap: 12px; }

.brief__hint {
  text-align: center; font-size: .86rem; color: var(--bone-dim); margin: 16px 0 0;
}
.brief__hint a { color: var(--gold); }

/* ---------------------------------------------------------------- *
   Buttons — chunky, extruded, pressable
 * ---------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--display);
  font-size: 1rem;
  text-decoration: none;
  text-align: center;
  padding: 15px 24px;
  border: var(--edge);
  border-radius: 999px;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease, filter .15s ease;
}
.btn svg {
  width: 21px; height: 21px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

.btn--gold {
  background: linear-gradient(180deg, var(--gold), var(--orange));
  color: var(--mud-950);
  box-shadow: 0 6px 0 #a8560c, 0 12px 20px rgba(0, 0, 0, .4);
}
.btn--mud {
  background: linear-gradient(180deg, var(--mud-600), var(--mud-800));
  color: var(--bone);
  box-shadow: 0 6px 0 var(--mud-950), 0 12px 20px rgba(0, 0, 0, .4);
}
.btn--ghost {
  background: transparent;
  color: var(--bone);
  border-color: var(--mud-500);
  box-shadow: none;
  font-size: .88rem;
  padding: 12px 20px;
}
.btn--ghost:hover { background: rgba(255, 255, 255, .07); }

.btn--big { width: 100%; font-size: 1.15rem; padding: 18px 24px; margin-top: 6px; }

.btn--gold:hover, .btn--mud:hover { filter: brightness(1.06); }
.btn--gold:active, .btn--mud:active {
  transform: translateY(5px);
  box-shadow: 0 1px 0 #a8560c, 0 4px 10px rgba(0, 0, 0, .4);
}
.btn--mud:active { box-shadow: 0 1px 0 var(--mud-950), 0 4px 10px rgba(0, 0, 0, .4); }

.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------------------------------------------------------------- *
   Panels + form
 * ---------------------------------------------------------------- */

.panel {
  background: linear-gradient(180deg, rgba(59, 36, 18, .97), rgba(26, 16, 6, .97));
  border: var(--edge);
  border-radius: 22px;
  padding: 24px 20px;
  box-shadow: var(--pop);
}

.field { margin-bottom: 20px; border: 0; padding: 0; }

.field > label, .field > legend {
  display: block;
  font-family: var(--display);
  font-size: .78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
  padding: 0;
}
.req { color: var(--orange); }
.opt {
  color: var(--bone-dim);
  font-family: var(--body);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  font-size: .8rem;
}

input[type="text"], input[type="number"], textarea {
  width: 100%;
  font-family: var(--body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--mud-950);
  background: var(--bone);
  border: 3px solid var(--mud-950);
  border-radius: 12px;
  padding: 13px 14px;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .22);
}
textarea { resize: vertical; min-height: 84px; }
::placeholder { color: #9c8a76; font-weight: 600; }

.help { font-size: .8rem; color: var(--bone-dim); margin: 7px 0 0; }

/* Honeypot: off-screen rather than display:none, which bots skip. */
.hp { position: absolute; left: -6000px; width: 1px; height: 1px; overflow: hidden; }

/* Coming / not coming toggle */
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg {
  font-family: var(--display);
  font-size: clamp(.78rem, 3.4vw, .92rem);
  line-height: 1.25;
  padding: 15px 8px;
  border: var(--edge);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--mud-600), var(--mud-800));
  color: var(--bone-dim);
  cursor: pointer;
  box-shadow: 0 4px 0 var(--mud-950);
  transition: transform .1s ease, box-shadow .1s ease;
}
.seg.is-on {
  background: linear-gradient(180deg, var(--gold), var(--orange));
  color: var(--mud-950);
  box-shadow: 0 4px 0 #a8560c;
  transform: translateY(-1px);
}

/* Steppers */
.counts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }

.stepper__label {
  display: block;
  font-family: var(--display);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
  text-align: center;
}
.stepper__row { display: flex; align-items: center; gap: 7px; }
.stepper__row input {
  text-align: center;
  font-family: var(--display);
  font-size: 1.25rem;
  padding: 11px 2px;
  -moz-appearance: textfield;
  appearance: textfield;
}
.stepper__row input::-webkit-outer-spin-button,
.stepper__row input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.round {
  flex: none;
  width: 44px; height: 44px;
  border: var(--edge);
  border-radius: 50%;
  background: linear-gradient(180deg, var(--mud-500), var(--mud-700));
  color: var(--bone);
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--mud-950);
}
.round:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--mud-950); }

.kid-names { display: grid; gap: 9px; }

.form-error {
  background: #7a2412;
  border: 3px solid var(--mud-950);
  border-radius: 12px;
  padding: 11px 14px;
  margin: 0 0 16px;
  font-weight: 700;
  font-size: .93rem;
}

/* ---------------------------------------------------------------- *
   Thank-you panel
 * ---------------------------------------------------------------- */

.panel--win { position: relative; overflow: hidden; text-align: center; }

.burst {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 3;
}

.flag {
  height: 22px;
  margin: -24px -20px 18px;
  background-image:
    conic-gradient(var(--bone) 90deg, var(--mud-950) 90deg 180deg, var(--bone) 180deg 270deg, var(--mud-950) 270deg);
  background-size: 22px 22px;
}

.panel--win h3 {
  font-family: var(--display);
  font-size: clamp(1.4rem, 6vw, 1.9rem);
  line-height: 1.15;
  color: var(--gold);
  margin: 0 0 10px;
  -webkit-text-stroke: 5px var(--mud-950);
  paint-order: stroke fill;
}
.panel--win p { color: var(--bone); margin: 0 auto 20px; max-width: 34ch; }

.thanks__actions { display: grid; gap: 10px; justify-items: stretch; }

/* ---------------------------------------------------------------- *
   Crew list
 * ---------------------------------------------------------------- */

.crew__totals {
  text-align: center;
  font-family: var(--display);
  color: var(--gold);
  font-size: 1.05rem;
  margin: 0 0 20px;
  text-shadow: 0 3px 0 rgba(0, 0, 0, .5);
}

.badges { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
@media (min-width: 480px) { .badges { grid-template-columns: 1fr 1fr; } }

.badge {
  background: linear-gradient(180deg, rgba(107, 68, 35, .9), rgba(36, 20, 8, .9));
  border: 3px solid var(--mud-950);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 4px 0 var(--mud-950);
  opacity: 0;
  animation: rollIn .45s cubic-bezier(.2, .8, .3, 1) forwards;
}
@keyframes rollIn {
  from { opacity: 0; transform: translateX(-16px) rotate(-3deg); }
  to   { opacity: 1; transform: none; }
}

/* Family name stays the heading, but sits back a little so the kids'
   names carry the row — parents scan for their child's friends. */
.badge__name {
  font-family: var(--display);
  font-size: .82rem;
  letter-spacing: .04em;
  color: var(--bone-dim);
  margin: 0;
  line-height: 1.25;
}

.kids {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 7px 0 0;
  padding: 0;
}
.kid {
  font-family: var(--display);
  font-size: 1.02rem;
  line-height: 1.15;
  color: var(--gold);
  background: rgba(0, 0, 0, .34);
  border: 2px solid var(--mud-950);
  border-radius: 999px;
  padding: 5px 13px 6px;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .5);
}

.badge__meta { margin: 8px 0 0; font-size: .8rem; color: var(--bone-dim); font-weight: 700; }

/* ---------------------------------------------------------------- *
   Footer
 * ---------------------------------------------------------------- */

.footer {
  text-align: center;
  padding: 40px 20px calc(46px + env(safe-area-inset-bottom));
  background: var(--mud-950);
  border-top: 5px solid #0d0803;
}
.footer__names {
  font-family: var(--display);
  color: var(--gold);
  margin: 0 0 6px;
  font-size: 1rem;
}
.footer__small { color: var(--bone-dim); font-size: .88rem; margin: 0; }

/* ---------------------------------------------------------------- *
   Wider screens
 * ---------------------------------------------------------------- */

@media (min-width: 620px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .cards > li:last-child { grid-column: 1 / -1; }
  .brief__actions { grid-template-columns: 1fr 1fr; }
  .thanks__actions { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .hero { padding-left: 0; padding-right: 0; }
  .hero__kicker, .hero__tagline { padding: 0 20px; }
  .hero__frame {
    border-radius: 0;
    border-left: 0; border-right: 0;
    transform: none;
    box-shadow: 0 16px 34px rgba(0, 0, 0, .5);
  }
  .hero__frame img { border-radius: 0; }
}

/* ---------------------------------------------------------------- *
   Motion off
 * ---------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .badge { opacity: 1; animation: none; }
  .btn, .seg, .round { transition: none; }
  .card, .hero__frame, .section-title { transform: none; }
}

/* ---------------------------------------------------------------- *
   Floating jump-to-RSVP button
 * ---------------------------------------------------------------- */

.jump {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 60;

  display: inline-flex;
  align-items: center;
  gap: 9px;

  font-family: var(--display);
  font-size: .95rem;
  text-decoration: none;
  color: var(--mud-950);
  background: linear-gradient(180deg, var(--gold), var(--orange));
  border: var(--edge);
  border-radius: 999px;
  padding: 13px 20px;
  box-shadow: 0 5px 0 #a8560c, 0 12px 24px rgba(0, 0, 0, .5);

  opacity: 0;
  transform: translateY(14px) scale(.94);
  transition: opacity .28s ease, transform .28s cubic-bezier(.2, .8, .3, 1);
}
.jump.is-shown { opacity: 1; transform: none; }

.jump svg {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2.6;
  stroke-linecap: round; stroke-linejoin: round;
  transform: rotate(90deg);
}
.jump.points-up svg { transform: rotate(-90deg); }

.jump:active { transform: translateY(4px); box-shadow: 0 1px 0 #a8560c, 0 4px 10px rgba(0, 0, 0, .5); }

/* Keep it clear of the footer text on very small screens. */
@media (max-width: 380px) {
  .jump { font-size: .85rem; padding: 11px 16px; }
}

/* ---------------------------------------------------------------- *
   Text button used for the "show me the list anyway" escape hatch
 * ---------------------------------------------------------------- */

.linkish {
  display: inline-block;
  margin-top: 14px;
  background: none;
  border: 0;
  padding: 6px 4px;
  font-family: var(--body);
  font-size: .88rem;
  font-weight: 700;
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.linkish:hover { color: var(--orange); }

.card__sub em { color: var(--bone-dim); font-style: normal; opacity: .85; }

@media (prefers-reduced-motion: reduce) {
  .jump { transition: none; }
}

/* ---------------------------------------------------------------- *
   Personal edit link on the confirmation panel
 * ---------------------------------------------------------------- */

.mylink {
  margin: 0 0 20px;
  padding: 14px;
  background: rgba(0, 0, 0, .3);
  border: 3px dashed var(--mud-500);
  border-radius: 14px;
  text-align: left;
}

.mylink__label {
  font-family: var(--display);
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 8px !important;
}

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

.mylink__row input {
  flex: 1 1 auto;
  min-width: 0;
  font-size: .8rem;
  font-weight: 600;
  padding: 10px 11px;
  border-width: 2px;
  border-radius: 10px;
}

.mylink__row button {
  flex: none;
  font-family: var(--display);
  font-size: .8rem;
  padding: 0 16px;
  color: var(--mud-950);
  background: linear-gradient(180deg, var(--gold), var(--orange));
  border: 3px solid var(--mud-950);
  border-radius: 10px;
  cursor: pointer;
}
.mylink__row button:active { transform: translateY(2px); }

.mylink__help {
  font-size: .78rem !important;
  color: var(--bone-dim);
  margin: 8px 0 0 !important;
  max-width: none !important;
}

/* ---------------------------------------------------------------- *
   Turnstile widget
 * ---------------------------------------------------------------- */

.turnstile {
  margin: 0 0 18px;
  min-height: 66px;          /* reserve space so the button does not jump */
  display: flex;
  justify-content: center;
}
.turnstile iframe { max-width: 100%; }
