/* Valley Foods Giveaway — one screen: the prize card and the three steps that
   stamp it (follow, optional review, your details). Mobile-first. */

:root {
  color-scheme: light;
  --ink: #15160e;
  --ink-2: #1f2015;
  --olive: #86840d;
  --olive-deep: #5c5b0a;
  --lime: #bccb24;
  --lime-hi: #cddb3c;
  --cream: #f5f0e3;
  --paper: #fffdf8;
  --text: #1b1c12;
  --muted: #5d5b4c;
  --line: rgba(27, 28, 18, 0.12);
  --on-dark: #f5f0e3;
  --on-dark-muted: rgba(245, 240, 227, 0.72);
  --error: #b3261e;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --gutter: 16px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--text);
  font: 400 1rem/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

/* The giveaway page is dark edge to edge (also behind the phone's status bar). */
body[data-phase] {
  background: var(--ink);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

[hidden] {
  display: none !important;
}

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

.panel :focus-visible,
.doc :focus-visible {
  outline-color: var(--olive);
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--lime);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

/* Phase-dependent content (upcoming / live / closed) */
[data-phase='live'] .when-upcoming,
[data-phase='live'] .when-closed,
[data-phase='upcoming'] .when-live,
[data-phase='upcoming'] .when-closed,
[data-phase='closed'] .when-live,
[data-phase='closed'] .when-upcoming {
  display: none !important;
}

.wrap {
  width: min(1160px, 100% - var(--gutter) * 2);
  margin-inline: auto;
}

/* ------------------------------------------------------------------------ */
/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 24px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font: 600 1rem/1.15 var(--font-body);
  letter-spacing: 0.01em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary {
  background: var(--lime);
  color: var(--ink);
  box-shadow: 0 12px 32px -12px rgba(188, 203, 36, 0.6);
}

.btn--primary:hover {
  background: var(--lime-hi);
}

.btn--dark {
  background: var(--ink);
  color: var(--cream);
}

.btn--dark:hover {
  background: #2b2c1e;
}

/* Instagram's own colors: the one button people already know. */
.btn--ig {
  background: linear-gradient(45deg, #f9a13a 0%, #e1306c 52%, #8a3ab9 100%);
  color: #fff;
  box-shadow: 0 14px 30px -14px rgba(225, 48, 108, 0.75);
}

.btn--ig:hover {
  filter: brightness(1.06);
}

.btn--ig .icon {
  width: 22px;
  height: 22px;
}

.btn--outline {
  background: transparent;
  color: var(--ink);
  border-color: rgba(21, 22, 14, 0.22);
}

.btn--outline:hover {
  border-color: var(--ink);
}

.btn--lg {
  min-height: 58px;
  font-size: 1.06rem;
}

.btn--block {
  width: 100%;
}

.btn--sm {
  min-height: 42px;
  padding: 0 18px;
  font-size: 0.92rem;
}

.btn__spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(21, 22, 14, 0.25);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn.is-loading {
  pointer-events: none;
}

.btn.is-loading .btn__spinner {
  display: inline-block;
}

.btn.is-loading .btn__label {
  opacity: 0.75;
}

.btn.nudge {
  animation: nudge 1.4s ease-in-out 2;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes nudge {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(134, 132, 13, 0);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(134, 132, 13, 0.22);
  }
}

/* ------------------------------------------------------------------------ */
/* Stage: the whole giveaway on one screen */

.stage {
  /* Card width; everything on the card is sized from it. */
  --cw: min(84vw, 340px);
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  padding: 0 var(--gutter) 18px;
  background: var(--ink);
  color: var(--on-dark);
  overflow: hidden;
}

.stage__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.stage__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 24%;
  opacity: 0.5;
}

/* Darkens the photo towards the bottom, where the steps sit. (z-index: the
   shade and the rings are painted over the photo, not under it.) */
.stage__bg::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(90% 46% at 50% 30%, rgba(188, 203, 36, 0.12), transparent 70%),
    linear-gradient(180deg, rgba(21, 22, 14, 0.58) 0%, rgba(21, 22, 14, 0.3) 24%, rgba(21, 22, 14, 0.62) 56%, rgba(21, 22, 14, 0.9) 82%, var(--ink) 100%);
}

/* The brand's rings, centred behind the card. */
.stage__bg::after {
  content: '';
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 36%;
  width: 980px;
  height: 980px;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 46px, rgba(188, 203, 36, 0.075) 46px 48px);
  transform: translate(-50%, -50%);
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 68%);
  mask: radial-gradient(circle, #000 20%, transparent 68%);
}

.stage__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: max(14px, env(safe-area-inset-top));
}

.stage__brand img {
  width: auto;
  height: 32px;
}

.clock {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--on-dark-muted);
  font: 600 0.68rem/1 var(--font-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.clock__label {
  display: none;
}

.clock--closed {
  padding: 9px 13px;
  border: 1px solid rgba(245, 240, 227, 0.2);
  border-radius: 999px;
}

.countdown {
  display: flex;
  gap: 4px;
}

.cd {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 34px;
  padding: 6px 3px 5px;
  border: 1px solid rgba(245, 240, 227, 0.14);
  border-radius: 9px;
  background: rgba(21, 22, 14, 0.55);
}

.cd b {
  color: var(--cream);
  font: 600 0.94rem/1 var(--font-body);
  font-variant-numeric: tabular-nums;
}

.cd i {
  margin-top: 3px;
  color: var(--on-dark-muted);
  font: 500 0.5rem/1 var(--font-body);
  font-style: normal;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stage__grid {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding-top: 20px;
}

/* The one legal line, small and quiet at the bottom of the screen. */
.stage__legal {
  max-width: 62ch;
  margin: 22px auto 0;
  padding-bottom: env(safe-area-inset-bottom);
  color: rgba(245, 240, 227, 0.66);
  font-size: 0.7rem;
  line-height: 1.55;
  text-align: center;
}

.stage__legal a {
  color: rgba(245, 240, 227, 0.9);
  text-underline-offset: 2px;
  white-space: nowrap;
}

/* ------------------------------------------------------------------------ */
/* Pitch: what you can win */

.pitch {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  text-align: center;
}

.pitch__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 12px;
  color: var(--lime);
  font: 600 0.7rem/1.3 var(--font-body);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.pulse {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
  animation: pulse 2.2s ease-out infinite;
}

[data-phase='closed'] .pulse,
[data-phase='upcoming'] .pulse {
  background: #d9a05b;
  animation: none;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(188, 203, 36, 0.55);
  }
  70%,
  100% {
    box-shadow: 0 0 0 10px rgba(188, 203, 36, 0);
  }
}

.pitch__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-variation-settings: 'opsz' 144;
  letter-spacing: -0.025em;
  line-height: 0.94;
}

.pitch__win {
  display: block;
  font-size: clamp(3.3rem, 17.5vw, 5.4rem);
}

.pitch__amount {
  color: var(--lime);
}

.pitch__line {
  display: block;
  margin-top: 6px;
  font-size: clamp(1.3rem, 5.8vw, 1.8rem);
  font-weight: 500;
  letter-spacing: -0.012em;
  line-height: 1.08;
}

.pitch__sub {
  margin: 12px 0 0;
  color: var(--on-dark-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.pitch__sub strong {
  color: var(--cream);
  font-weight: 600;
}

.pitch__proof {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 0;
  color: var(--on-dark-muted);
  font-size: 0.9rem;
}

.pitch__proof strong {
  color: var(--cream);
  font-weight: 600;
}

/* ------------------------------------------------------------------------ */
/* The gift card. Each finished step stamps it; the last one flips it over
   into the entry ticket. All sizes are in em, from the card's width. */

.cardwrap {
  width: var(--cw);
  height: calc(var(--cw) / 1.586 * var(--s, 1));
  margin-top: 22px;
  transition: height 0.45s var(--ease);
}

.card3d {
  width: var(--cw);
  height: calc(var(--cw) / 1.586);
  font-size: calc(var(--cw) / 20);
  perspective: 1100px;
  transform: scale(var(--s, 1));
  transform-origin: 50% 0;
  transition: transform 0.45s var(--ease);
}

/* Leans towards the pointer (set from JS) and floats gently. */
.card3d__tilt {
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.25s ease-out;
  animation: card-float 6s ease-in-out infinite;
}

.card3d__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.95s cubic-bezier(0.3, 1.25, 0.4, 1);
}

.card3d.is-flipped .card3d__inner {
  transform: rotateY(180deg);
}

/* The little jolt when a stamp lands. */
.card3d.is-hit .card3d__inner {
  animation: card-hit 0.4s ease-out;
}

/* Restoring saved progress: show the result without replaying the motion. */
.card3d.is-quiet .card3d__inner {
  transition: none;
}

.card3d__face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 1em;
  /* An explicit transform on the front face too: Safari and Firefox need it
     to hide a face that is turned away. */
  transform: rotateY(0deg);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  /* A lit lime edge and a soft glow lift the card off the dark background. */
  box-shadow:
    0 0 0 1px rgba(188, 203, 36, 0.5),
    0 0 3.2em -0.6em rgba(188, 203, 36, 0.45),
    0 1.9em 3.4em -1.3em rgba(0, 0, 0, 0.9);
}

.card3d__back {
  transform: rotateY(180deg);
}

/* Safety net for browsers that get backface-visibility wrong (the page is
   mostly opened inside Instagram, on Safari's engine): the face that is turned
   away is also hidden outright, switching when the card is edge-on. */
.card3d__back,
.card3d.is-flipped .giftcard {
  visibility: hidden;
  transition: visibility 0s 0.28s;
}

.card3d.is-flipped .card3d__back {
  visibility: visible;
}

.card3d.is-quiet .card3d__face {
  transition: none;
}

@keyframes card-float {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -7px;
  }
}

@keyframes card-hit {
  0% {
    scale: 1;
  }
  35% {
    scale: 0.955;
  }
  100% {
    scale: 1;
  }
}

/* Front */

.giftcard {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.15em 1.25em 0.95em;
  background: radial-gradient(130% 140% at 100% 0%, #4a4b2e 0%, #23241a 55%, #17180f 100%);
  color: var(--cream);
}

.giftcard::before {
  content: '';
  position: absolute;
  right: -34%;
  top: -66%;
  width: 96%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 0.7em, rgba(188, 203, 36, 0.16) 0.7em 0.8em);
}

/* A slow sweep of light across the card. */
.giftcard::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(110deg, transparent 42%, rgba(255, 255, 255, 0.14) 50%, transparent 58%) no-repeat;
  background-size: 250% 100%;
  box-shadow: inset 0 0 0 1px rgba(245, 240, 227, 0.14);
  animation: sheen 5.5s ease-in-out infinite;
  pointer-events: none;
}

/* The band of light starts off the card's left edge and leaves on the right. */
@keyframes sheen {
  0% {
    background-position: 100% 0;
  }
  60%,
  100% {
    background-position: 0% 0;
  }
}

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

.giftcard__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6em;
}

.giftcard__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font: 600 1.08em/1 var(--font-display);
  letter-spacing: -0.01em;
}

.giftcard__emblem {
  flex: none;
  width: 1.95em;
  height: 1.95em;
  background: var(--lime);
  -webkit-mask: url('/img/emblem.png') center / contain no-repeat;
  mask: url('/img/emblem.png') center / contain no-repeat;
}

.giftcard__value {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.giftcard__value small {
  color: var(--on-dark-muted);
  font: 600 0.52em/1 var(--font-body);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.giftcard__value b {
  margin-top: 0.12em;
  color: var(--lime);
  font: 600 2.75em/1 var(--font-display);
}

.giftcard__note {
  margin: 0;
  color: var(--on-dark-muted);
  font: 600 0.6em/1.2 var(--font-body);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* Stamps */

/* Three slots in a row, joined by a dashed line, each named underneath: a
   loyalty card. (Names go under the slots so "Followed" has room.) */
.stamps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
}

.stamps::before {
  content: '';
  position: absolute;
  top: 1.17em;
  left: 16.67%;
  right: 16.67%;
  border-top: 0.09em dashed rgba(245, 240, 227, 0.28);
}

.stamp {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.42em;
  min-width: 0;
}

.stamp__slot {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 2.35em;
  height: 2.35em;
  border: 0.09em dashed rgba(245, 240, 227, 0.42);
  border-radius: 50%;
  /* Covers the joining line where it passes behind the slot. */
  background: #1d1e14;
}

.stamp__num {
  color: rgba(245, 240, 227, 0.6);
  font: 600 0.82em/1 var(--font-body);
}

/* The ink: lands big and crooked, like a real stamp. */
.stamp__ink {
  position: absolute;
  inset: -0.14em;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--lime);
  color: var(--ink);
  box-shadow: inset 0 0 0 0.13em rgba(21, 22, 14, 0.22), 0 0.3em 0.9em -0.2em rgba(188, 203, 36, 0.75);
  opacity: 0;
  transform: scale(0) rotate(-30deg);
}

.stamp__ink .icon {
  width: 1.25em;
  height: 1.25em;
}

.stamp.is-stamped .stamp__ink {
  animation: stamp-in 0.55s cubic-bezier(0.2, 1.4, 0.4, 1) forwards;
}

.stamp.is-stamped .stamp__slot::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 0.12em solid var(--lime);
  border-radius: 50%;
  animation: stamp-ring 0.7s ease-out 0.18s both;
}

.stamp.is-stamped.is-quiet .stamp__ink {
  animation: none;
  opacity: 1;
  transform: rotate(-12deg);
}

.stamp.is-stamped.is-quiet .stamp__slot::after {
  display: none;
}

.stamp__label {
  min-width: 0;
  color: rgba(245, 240, 227, 0.72);
  font: 600 0.56em/1.15 var(--font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.stamp.is-stamped .stamp__label {
  color: var(--lime);
}

@keyframes stamp-in {
  0% {
    opacity: 0;
    transform: scale(2.8) rotate(-38deg);
  }
  55% {
    opacity: 1;
    transform: scale(0.88) rotate(-9deg);
  }
  78% {
    transform: scale(1.06) rotate(-13deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(-12deg);
  }
}

@keyframes stamp-ring {
  0% {
    opacity: 0.9;
    transform: scale(0.7);
  }
  100% {
    opacity: 0;
    transform: scale(2.5);
  }
}

/* Back: the entry ticket */

.ticketface {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 1em 1.6em;
  background: linear-gradient(140deg, #d6e44a 0%, #bccb24 48%, #a3b119 100%);
  color: var(--ink);
  text-align: center;
}

/* Ticket notches and a perforation line. */
.ticketface::before,
.ticketface::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 1.5em;
  height: 1.5em;
  border-radius: 50%;
  background: var(--ink);
  transform: translateY(-50%);
}

.ticketface::before {
  left: -0.75em;
}

.ticketface::after {
  right: -0.75em;
}

.ticketface__label {
  font: 700 0.6em/1.2 var(--font-body);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.ticketface__ref {
  padding: 0.12em 0.5em;
  border: 0.06em dashed rgba(21, 22, 14, 0.45);
  border-radius: 0.3em;
  font: 700 2.05em/1.1 ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.ticketface__sub {
  font: 600 0.58em/1.3 var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.8;
}

/* ------------------------------------------------------------------------ */
/* Panel: the current step */

.panel {
  width: min(100%, 440px);
  padding: 24px 20px 20px;
  border-radius: 26px;
  background: var(--paper);
  color: var(--text);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.85);
}

.step {
  animation: step-in 0.42s var(--ease);
}

@keyframes step-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

.step__kicker {
  margin: 0 0 8px;
  color: var(--olive-deep);
  font: 600 0.72rem/1.3 var(--font-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.step__title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 6.6vw, 1.95rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.016em;
}

.step__title:focus {
  outline: none;
}

.step__text {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 1.02rem;
}

.step__text strong {
  color: var(--text);
  font-weight: 600;
}

.step__actions {
  display: grid;
  gap: 10px;
}

.link-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: 500 0.95rem/1.3 var(--font-body);
  cursor: pointer;
}

.link-back:hover {
  color: var(--ink);
}

.link-back .icon {
  width: 18px;
  height: 18px;
}

.link-back--center {
  display: flex;
  justify-content: center;
  width: 100%;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Form */

.form {
  display: grid;
  gap: 14px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font: 600 0.9rem/1.2 var(--font-body);
}

.field__hint {
  color: var(--muted);
  font-weight: 400;
}

.field input {
  /* When an error moves focus here, keep the field's label in view above it. */
  scroll-margin-top: 96px;
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1.5px solid rgba(21, 22, 14, 0.18);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  font-size: 1.0625rem; /* ≥16px so iOS doesn't zoom in */
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input::placeholder {
  color: rgba(93, 91, 76, 0.55);
}

.field input:focus {
  outline: none;
  border-color: var(--olive);
  box-shadow: 0 0 0 4px rgba(134, 132, 13, 0.18);
}

.field input[aria-invalid='true'] {
  border-color: var(--error);
}

.field input[aria-invalid='true']:focus {
  box-shadow: 0 0 0 4px rgba(179, 38, 30, 0.15);
}

.field__error {
  margin: 6px 0 0;
  color: var(--error);
  font-size: 0.88rem;
  line-height: 1.35;
}

.field__affix {
  position: relative;
}

.field__affix span {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-52%);
  color: var(--muted);
  font-size: 1.0625rem;
  pointer-events: none;
}

.field__affix input {
  padding-left: 33px;
}

/* Phone number with its country: flag and dialling code on the left (the
   native picker sits invisibly on top of them), the number on the right. */
.phonefield {
  display: flex;
}

.phonefield__country {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px 0 13px;
  border: 1.5px solid rgba(21, 22, 14, 0.18);
  border-right: 0;
  border-radius: 14px 0 0 14px;
  background: var(--cream);
  color: var(--text);
  font-size: 1.0625rem;
  font-weight: 600;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.phonefield__flag {
  font-size: 1.3rem;
  line-height: 1;
}

/* Where the device can't draw flags (see fonts.css), a flag font fills in,
   for the picker's label and for its list of countries. */
.no-flag-emoji .phonefield__flag,
.no-flag-emoji .phonefield__country select {
  font-family: 'Twemoji Country Flags', var(--font-body);
}

.phonefield__chevron {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.phonefield__country select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  opacity: 0;
  font-size: 1rem; /* ≥16px so iOS doesn't zoom in */
  cursor: pointer;
}

.phonefield__country:focus-within {
  border-color: var(--olive);
  box-shadow: 0 0 0 4px rgba(134, 132, 13, 0.18);
}

.phonefield input {
  flex: 1;
  min-width: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

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

/* One-line optional opt-in, so it doesn't compete with the entry itself. */
.check {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  align-items: center;
}

.check input {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin: 0;
  border: 1.5px solid rgba(21, 22, 14, 0.32);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.check input::after {
  content: '';
  width: 12px;
  height: 7px;
  border: 2.5px solid #fff;
  border-top: 0;
  border-right: 0;
  transform: rotate(-45deg) translate(1px, -1px) scale(0);
  transition: transform 0.15s;
}

.check input:checked {
  border-color: var(--olive);
  background: var(--olive);
}

.check input:checked::after {
  transform: rotate(-45deg) translate(1px, -1px) scale(1);
}

.check label {
  font-size: 0.93rem;
  line-height: 1.45;
  cursor: pointer;
}

.check__hint {
  color: var(--muted);
  font-size: 0.85rem;
}

.turnstile:empty {
  display: none;
}

.form__alert {
  padding: 12px 14px;
  border-radius: 12px;
  background: #fbeae8;
  color: #7f1d1d;
  font-size: 0.95rem;
  line-height: 1.4;
}

/* Consent, stated right under the button that gives it. */
.form__consent {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
  text-align: center;
}

.form__consent a {
  color: var(--olive-deep);
  font-weight: 600;
  text-underline-offset: 2px;
}

/* The entry button: an arrow that leans forward, and a sweep of light once
   every field is filled in correctly. */
.btn--enter {
  position: relative;
  overflow: hidden;
  font-weight: 700;
}

.btn--enter .btn__arrow {
  transition: transform 0.2s;
}

.btn--enter:hover .btn__arrow,
.btn--enter.is-ready .btn__arrow {
  transform: translateX(4px);
}

.btn--enter.is-loading .btn__arrow {
  display: none;
}

.btn--enter.is-ready {
  background: var(--lime-hi);
  box-shadow: 0 14px 36px -10px rgba(188, 203, 36, 0.85);
}

.btn--enter.is-ready::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: shine 2.4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes shine {
  60%,
  100% {
    transform: translateX(100%);
  }
}

/* Success */

.step--done {
  text-align: center;
}

.done__title {
  margin: 4px 0 8px;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 12.5vw, 3.4rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.done__title:focus {
  outline: none;
}

.done__lead {
  margin: 0 0 10px;
  font-size: 1.08rem;
  font-weight: 600;
}

.done__ref {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.done__text {
  max-width: 40ch;
  margin: 0 auto;
  color: var(--muted);
}

.done__luck {
  margin: 14px 0 18px;
  color: var(--olive-deep);
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-style: italic;
  font-weight: 500;
}

.confetti {
  position: fixed;
  inset: 0;
  z-index: 300;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Closed / upcoming */

.status {
  text-align: center;
}

.status__pill {
  display: inline-block;
  margin: 0 0 16px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--cream);
  color: var(--olive-deep);
  font: 600 0.74rem/1 var(--font-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.status__winners {
  margin: 0 0 14px;
  padding: 12px 16px;
  border: 1px solid rgba(134, 132, 13, 0.35);
  border-radius: 14px;
  background: rgba(188, 203, 36, 0.16);
  font-size: 1.02rem;
}

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

.footer {
  padding: 30px 0 calc(34px + env(safe-area-inset-bottom));
  background: var(--ink);
  color: var(--on-dark-muted);
  font-size: 0.92rem;
}

.footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 22px;
}

.footer__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--cream);
  font-weight: 500;
  text-decoration: none;
}

.footer__nav a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.footer__address {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 0 0 6px;
  font-style: normal;
}

.footer__address a {
  color: var(--on-dark-muted);
  text-underline-offset: 3px;
}

.footer__copy {
  margin: 6px 0 0;
  font-size: 0.8rem;
}

/* ------------------------------------------------------------------------ */
/* Legal pages */

.doc-header {
  padding: max(16px, env(safe-area-inset-top)) 0 16px;
  background: var(--ink);
}

.doc-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.doc-header img {
  width: auto;
  height: 38px;
}

.doc-main {
  padding: 48px 0 72px;
}

.doc-body {
  max-width: 720px;
  margin: 0 auto;
  font-size: 1.02rem;
  line-height: 1.7;
}

.doc-body h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 9vw, 3.2rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.doc-body .doc-meta {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 0.92rem;
}

.doc-body h2 {
  margin: 36px 0 8px;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.doc-body p,
.doc-body li {
  color: #34352a;
}

.doc-body ul {
  padding-left: 1.25em;
}

.doc-body li + li {
  margin-top: 6px;
}

.doc-body a {
  color: var(--olive-deep);
  font-weight: 500;
}

.doc-summary {
  margin: 0 0 12px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
}

.doc-summary dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 18px;
  margin: 0;
}

.doc-summary dt {
  color: var(--muted);
  font-weight: 500;
}

.doc-summary dd {
  margin: 0;
  font-weight: 600;
}

.notfound {
  display: grid;
  place-items: center;
  min-height: 60vh;
  text-align: center;
}

.notfound h1 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 10vw, 3.6rem);
  font-weight: 600;
}

.notfound p {
  margin: 0 0 24px;
  color: var(--muted);
}

/* ------------------------------------------------------------------------ */
/* Small phones */

@media (max-width: 359px) {
  /* Four countdown cells don't fit next to the logo: drop the seconds. */
  .cd:last-child {
    display: none;
  }

  /* Keeps "… giveaway · Now open" on one line. */
  .pitch__eyebrow {
    font-size: 0.62rem;
    letter-spacing: 0.11em;
  }
}

/* Short screens. Most visitors arrive inside Instagram's own browser, whose
   bars leave about 660px of height on a current phone (and under 600px on a
   small one). The headline, the card and the spacing all give way, so both
   buttons of a step stay on screen without scrolling. */
@media (max-width: 959px) and (max-height: 760px) {
  .stage {
    --cw: min(84vw, 340px, 36vh);
    --cw: min(84vw, 340px, 36svh);
  }

  .stage__grid {
    gap: 14px;
    padding-top: 10px;
  }

  .pitch__eyebrow {
    margin-bottom: 8px;
  }

  .pitch__win {
    font-size: min(17.5vw, 9.4vh);
  }

  .pitch__line {
    margin-top: 4px;
    font-size: min(5.8vw, 3.3vh);
  }

  .pitch__sub {
    margin-top: 8px;
    font-size: 0.86rem;
  }

  .cardwrap {
    margin-top: 12px;
  }

  .pitch__proof {
    margin-top: 10px;
  }

  .panel {
    padding: 18px 18px 14px;
  }

  .panel .btn {
    min-height: 50px;
  }

  .step__kicker {
    margin-bottom: 5px;
  }

  .step__title {
    margin-bottom: 6px;
    font-size: 1.5rem;
  }

  .step__text {
    margin-bottom: 14px;
    font-size: 0.96rem;
  }

  .link-back {
    min-height: 40px;
    margin-top: 6px;
  }

  .stage__legal {
    margin-top: 14px;
  }
}

@media (max-width: 959px) and (max-height: 600px) {
  .stage {
    --cw: min(78vw, 300px, 31vh);
    --cw: min(78vw, 300px, 31svh);
  }

  .pitch__eyebrow {
    display: none;
  }

  .pitch__win {
    font-size: min(15vw, 8.6vh);
  }
}

/* A phone held sideways: the prize on the left, the step on the right. */
@media (min-width: 600px) and (max-width: 959px) and (max-height: 520px) {
  .stage {
    --cw: min(34vw, 250px);
  }

  .stage__grid {
    flex-direction: row;
    align-items: center;
    gap: 24px;
    padding-top: 6px;
  }

  .pitch {
    flex: 1 1 0;
  }

  .pitch__eyebrow,
  .pitch__proof {
    display: none;
  }

  .pitch__win {
    font-size: min(8.4vw, 15vh);
  }

  .pitch__line {
    font-size: min(3vw, 6vh);
  }

  .panel {
    flex: 1 1 0;
    width: auto;
    max-width: 400px;
  }
}

/* Phones, on the form: the headline steps aside and the card shrinks, so the
   fields get the screen (the keyboard takes half of it). */
@media (max-width: 959px) {
  .stage[data-step='3'] {
    --s: 0.56;
  }

  .stage[data-step='3'] .pitch__head,
  .stage[data-step='3'] .pitch__proof {
    display: none;
  }

  .stage[data-step='3'] .cardwrap {
    margin-top: 0;
  }
}

/* ------------------------------------------------------------------------ */
/* Larger screens */

@media (min-width: 480px) {
  .clock__label {
    display: inline;
  }

  .stage__brand img {
    height: 38px;
  }

  .panel {
    padding: 30px 30px 26px;
  }
}

@media (min-width: 640px) {
  :root {
    --gutter: 28px;
  }
}

/* Desktop: the prize on the left, the steps on the right. */
@media (min-width: 960px) {
  :root {
    --gutter: 48px;
  }

  /* The card and headline also follow the window's height, so a short laptop
     window still shows the whole card (the stamps are at its bottom). */
  .stage {
    --cw: min(36vw, 430px, 44vh);
    padding-bottom: 24px;
  }

  .stage__legal {
    max-width: none;
    margin-top: 30px;
    font-size: 0.74rem;
  }

  .stage__bg img {
    opacity: 0.55;
    object-position: 50% 40%;
  }

  .stage__bg::before {
    background:
      radial-gradient(50% 60% at 28% 55%, rgba(188, 203, 36, 0.1), transparent 70%),
      linear-gradient(180deg, rgba(21, 22, 14, 0.5) 0%, rgba(21, 22, 14, 0) 30%, rgba(21, 22, 14, 0) 62%, var(--ink) 100%),
      linear-gradient(90deg, rgba(21, 22, 14, 0.5) 0%, rgba(21, 22, 14, 0.4) 50%, rgba(21, 22, 14, 0.62) 100%);
  }

  .stage__bg::after {
    left: 30%;
    top: 56%;
    width: 1200px;
    height: 1200px;
  }

  .stage__top,
  .stage__grid {
    width: min(1160px, 100%);
    margin-inline: auto;
  }

  .stage__top {
    padding-top: 28px;
  }

  .stage__brand img {
    height: 50px;
  }

  .cd {
    min-width: 46px;
    padding: 8px 5px 7px;
    border-radius: 11px;
  }

  .cd b {
    font-size: 1.15rem;
  }

  .cd i {
    margin-top: 4px;
    font-size: 0.56rem;
  }

  .stage__grid {
    flex-direction: row;
    gap: clamp(40px, 6vw, 96px);
    padding-top: 28px;
  }

  .pitch {
    flex: 1 1 0;
    align-items: flex-start;
    text-align: left;
  }

  .pitch__win {
    font-size: clamp(3.4rem, min(8.6vw, 14vh), 7.4rem);
  }

  .pitch__line {
    font-size: clamp(1.4rem, min(2.9vw, 4.6vh), 2.5rem);
  }

  .pitch__sub {
    margin-top: 16px;
    font-size: 1rem;
  }

  .cardwrap {
    margin-top: 34px;
  }

  .panel {
    flex: none;
    width: 440px;
    padding: 36px 36px 30px;
    border-radius: 30px;
  }

  .footer {
    padding-top: 36px;
  }
}

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