/* Afterparty marketing site. One stylesheet.
   Without JavaScript, or when the visitor asks for reduced motion, the page is a plain
   scrolling document with the checkout example shown in its finished state. js/site.js adds
   .anim to <html> to pin the example and drive it from the scroll position. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-style: normal;
  font-display: swap;
}

:root {
  --night: #12072a;
  --plum: #1e0d45;
  --violet: #7c3aed;
  --orchid: #b79cff;
  --mirror: #f4efff;
  --gold: #ffd27a;
  --ink: #1c1b22;
  --ink-soft: #6b6976;
  --line: #e4e2ea;

  --gutter: clamp(20px, 5vw, 72px);
  --display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  --t-small: clamp(0.84rem, 0.8rem + 0.15vw, 0.95rem);
  --t-body: clamp(1.02rem, 0.96rem + 0.3vw, 1.22rem);
  --t-h3: clamp(1.2rem, 1.08rem + 0.55vw, 1.55rem);
  --t-h2: clamp(2rem, 1.3rem + 3vw, 4.1rem);
  --t-h1: clamp(3.2rem, min(1rem + 10.4vw, 19vh), 10rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--mirror);
  font-family: var(--display);
  font-size: var(--t-body);
  font-stretch: 100%;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
h1, h2, h3, p, ol, ul, dl, dd { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

h1, h2 {
  font-weight: 800;
  font-stretch: 75%;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h1 { font-size: var(--t-h1); line-height: 0.9; }
h2 { font-size: var(--t-h2); line-height: 0.98; }
h3 { font-size: var(--t-h3); font-weight: 700; font-stretch: 87%; line-height: 1.15; }

.fine { font-size: var(--t-small); color: var(--orchid); }

/* ---------- canvas ---------- */
#fx {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  height: 100lvh;
  pointer-events: none;
  z-index: 4;
}
html:not(.js) #fx { display: none; }

/* ---------- nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px var(--gutter);
  pointer-events: none;
}
.nav > * { pointer-events: auto; position: relative; }
/* keeps the wordmark readable when page text scrolls beneath it */
.nav::before {
  content: "";
  position: absolute;
  inset: 0 0 -14px 0;
  background: linear-gradient(180deg, rgba(18, 7, 42, 0.94) 40%, rgba(18, 7, 42, 0));
  pointer-events: none;
}
.mark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-stretch: 80%;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.mark svg { display: block; }

.btn {
  display: inline-block;
  padding: 0.95em 1.5em;
  border-radius: 14px;
  background: var(--mirror);
  color: var(--night);
  font-weight: 700;
  font-stretch: 90%;
  font-size: var(--t-body);
  line-height: 1.1;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, background-color 0.18s ease;
}
/* a mirror facet catching the light as the pointer crosses */
.btn::after {
  content: "";
  position: absolute;
  inset: -40% auto -40% -30%;
  width: 28%;
  background: linear-gradient(90deg, transparent, rgba(124, 58, 237, 0.35), transparent);
  transform: skewX(-20deg) translateX(-120%);
}
.btn:hover { background: #fff; transform: translateY(-1px); }
.btn:hover::after { transform: skewX(-20deg) translateX(620%); transition: transform 0.6s ease; }
.btn:active { transform: translateY(1px); }
.btn-small { padding: 0.7em 1.1em; font-size: 0.98rem; border-radius: 11px; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  align-items: center;
  gap: clamp(16px, 3vw, 48px);
  padding: 96px var(--gutter) 88px;
  background:
    radial-gradient(60vw 60vw at 76% 44%, rgba(124, 58, 237, 0.34), transparent 62%),
    radial-gradient(40vw 40vw at 8% 100%, rgba(183, 156, 255, 0.10), transparent 70%);
}
.hero-copy { position: relative; z-index: 5; display: grid; gap: clamp(18px, 2.4vw, 30px); justify-items: start; }
.hero h1 { max-width: 7em; }
.lede { max-width: 34em; color: #e3d9ff; }
.cta-row { display: grid; gap: 12px; justify-items: start; }

.ball-spot { pointer-events: none; }
.hero .ball-spot {
  justify-self: center;
  width: min(36vw, 60vh);
  aspect-ratio: 1;
  margin-top: 4vh;
}
.cue {
  position: absolute;
  left: var(--gutter);
  bottom: 28px;
  font-size: var(--t-small);
  color: var(--orchid);
  padding-left: 26px;
}
.cue::before {
  content: "";
  position: absolute;
  left: 4px; top: 0.1em;
  width: 2px; height: 1.2em;
  background: var(--orchid);
  transform-origin: top;
  animation: cue 1.8s ease-in-out infinite;
}
@keyframes cue { 0% { transform: scaleY(0); } 55% { transform: scaleY(1); } 100% { transform: scaleY(1) translateY(1.2em) scaleY(0); } }
html:not(.anim) .cue { display: none; }

/* ---------- the checkout story ---------- */
.stage { position: relative; background: linear-gradient(180deg, var(--night), var(--plum) 18%, var(--plum) 82%, var(--night)); }
.stage-pin {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(20px, 5vw, 80px);
  align-items: center;
  padding: clamp(56px, 9vw, 120px) var(--gutter);
}
.ball-spot-stage { display: none; }

.story { display: grid; gap: clamp(22px, 3vw, 40px); align-content: center; }
.beats { display: grid; gap: clamp(28px, 4vw, 48px); }
.beat { display: grid; gap: 14px; max-width: 30em; }
.beat p { color: #e3d9ff; }

.tally { display: none; }
.ticks { display: none; }

/* the checkout card */
.co-window { display: grid; justify-items: center; }
.co { width: min(420px, 100%); font-family: var(--ui); font-size: 14px; line-height: 1.35; color: var(--ink); }
.co-flip { display: grid; gap: 22px; }
.co-face {
  background: #fff;
  border-radius: 18px;
  padding: 18px 18px 20px;
  box-shadow: 0 30px 70px -20px rgba(8, 2, 28, 0.75), 0 2px 0 rgba(255, 255, 255, 0.5) inset;
}
.co-head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.co-head b { font-size: 16px; }
.co-head span { color: var(--ink-soft); font-size: 12.5px; }

.co-line, .co-added-in, .blk-row, .blk-check { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; }
.co-line { padding: 10px 0; }
.co-added { display: block; padding: 0; overflow: hidden; }
.co-added-in { padding: 10px 0; }
.nm { font-weight: 600; }
.nm small { display: block; font-weight: 400; font-size: 12.5px; color: var(--ink-soft); }
.pr { font-variant-numeric: tabular-nums; }

.thumb { width: 44px; height: 44px; border-radius: 9px; border: 1px solid var(--line); background: #f3f1f7 center / 26px 26px no-repeat; }
.thumb-shirt { background-color: #efe7d8; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 3 3 6l2 4 2-1v11h10V9l2 1 2-4-5-3c-.6 1.6-2 2.5-4 2.5S8.600 4.600 8 3Z' fill='%23c9b48e'/%3E%3C/svg%3E"); }
.thumb-socks { background-color: #e7e0fb; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 3h6v9.500l-3.800 5.200A3.300 3.300 0 0 1 5.900 13.800L9 10.500V3Z' fill='%237c3aed'/%3E%3Cpath d='M9 6h6' stroke='%23e7e0fb' stroke-width='1.600'/%3E%3C/svg%3E"); }
.thumb-wrap { background-color: #fff1d6; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='4' y='9' width='16' height='11' rx='1.500' fill='%23e0a43a'/%3E%3Crect x='3' y='6' width='18' height='4' rx='1' fill='%23c98a1f'/%3E%3Cpath d='M12 6v14' stroke='%23fff1d6' stroke-width='2'/%3E%3C/svg%3E"); }

.slot { overflow: hidden; }
.slot-in { padding: 6px 0; position: relative; }
.blk { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 10px; background: #fff; }
.blk-title { font-weight: 600; }
.blk-p { color: var(--ink-soft); font-size: 13px; }
.blk-btn { justify-self: end; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--ink); font-weight: 600; font-size: 13px; }
.blk-btn.is-done { background: var(--ink); color: #fff; }
.blk-btn-wide { justify-self: stretch; text-align: center; background: var(--ink); color: #fff; }
.blk-check { grid-template-columns: 22px 1fr; }
.box { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid #9a98a6; display: block; position: relative; }
.box.is-on { background: var(--violet); border-color: var(--violet); }
.box.is-on::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(42deg); }

.meter { height: 8px; border-radius: 99px; background: #ece9f4; overflow: hidden; }
.meter i { display: block; height: 100%; width: 100%; border-radius: inherit; background: var(--violet); transform-origin: left; }

.co-sum { padding: 10px 0 4px; display: grid; gap: 6px; border-top: 1px solid var(--line); margin-top: 6px; }
.co-sum > div { display: flex; justify-content: space-between; color: var(--ink-soft); }
.co-sum dd { font-variant-numeric: tabular-nums; }
.co-sum .co-total { color: var(--ink); font-weight: 700; font-size: 17px; padding-top: 4px; }
.co-pay { margin-top: 12px; padding: 14px; border-radius: 11px; background: var(--ink); color: #fff; font-weight: 600; text-align: center; font-size: 15px; }

.ty { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; padding: 16px 0 10px; }
.ty-check { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--violet); position: relative; }
.ty-check::after { content: ""; position: absolute; left: 13px; top: 7px; width: 8px; height: 16px; border: solid var(--violet); border-width: 0 2.5px 2.5px 0; transform: rotate(42deg); }
.ty-h { font-size: 18px; font-weight: 700; }
.ty-p { color: var(--ink-soft); font-size: 13px; }

/* ---------- pinned, scroll-driven version ---------- */
.anim .stage { height: 540vh; }
.anim .stage-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  padding: 84px var(--gutter) 28px;
  z-index: 1;
  overflow: clip;
}
.anim .ball-spot-stage {
  display: block;
  position: absolute;
  top: 92px;
  right: calc(var(--gutter) - 14px);
  width: clamp(96px, 9vw, 132px);
  aspect-ratio: 1;
}
.anim .beats { gap: 0; }
.anim .beat { grid-area: 1 / 1; opacity: 0; will-change: opacity, transform; }
.anim .tally { display: grid; gap: 2px; }
.tally-label { font-size: var(--t-small); color: var(--orchid); }
.tally-num {
  font-weight: 800;
  font-stretch: 75%;
  font-size: clamp(3rem, 1.5rem + 6vw, 6.4rem);
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
  letter-spacing: -0.01em;
}
.anim .ticks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; max-width: 260px; }
.tick { height: 4px; border-radius: 99px; background: rgba(183, 156, 255, 0.22); overflow: hidden; }
.tick i { display: block; height: 100%; background: var(--orchid); transform: scaleX(0); transform-origin: left; }

.anim .co-window {
  align-self: stretch;
  height: 100%;
  min-height: 0;
  display: block;
  position: relative;
  contain: layout;
  /* clip above and below only, so the card's shadow and its turn keep their width */
  clip-path: inset(0 -50vw);
}
.anim .co {
  position: absolute;
  left: calc(50% - 56px);
  top: 0;
  margin-left: calc(min(420px, 100%) / -2);
  perspective: 1500px;
  will-change: transform;
}
.anim .co-flip { display: block; position: relative; transform-style: preserve-3d; will-change: transform; }
.anim .co-face { position: absolute; left: 0; right: 0; top: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.anim .co-back { transform: rotateY(180deg); }
/* the empty place a block will land in, as the checkout editor shows it */
.anim .slot-in::before {
  content: "";
  position: absolute;
  inset: 6px 0;
  border: 1.5px dashed var(--violet);
  border-radius: 12px;
  background: rgba(124, 58, 237, 0.06);
  opacity: var(--ghost, 0);
  pointer-events: none;
}
.anim .slot .blk { opacity: var(--show, 1); }

/* ---------- how it works ---------- */
.how {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: clamp(20px, 5vw, 80px);
  align-items: center;
  padding: clamp(88px, 13vw, 190px) var(--gutter);
  overflow-x: clip; /* the ball's place hangs off the right edge; this keeps the page from scrolling sideways */
}
.how-copy { position: relative; z-index: 5; display: grid; gap: clamp(30px, 4vw, 56px); }
.steps { counter-reset: step; display: grid; gap: clamp(22px, 2.6vw, 34px); max-width: 36em; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2.6em 1fr; column-gap: 6px; row-gap: 6px; }
.steps li::before {
  content: counter(step);
  grid-row: span 2;
  font-weight: 800;
  font-stretch: 75%;
  font-size: var(--t-h3);
  line-height: 1.15;
  color: var(--orchid);
}
.steps p { color: #e3d9ff; grid-column: 2; }
.ball-spot-how { justify-self: end; width: min(30vw, 46vh); aspect-ratio: 1; margin-right: calc(var(--gutter) * -1 - 6vw); }

/* ---------- finale ---------- */
.finale {
  position: relative;
  display: grid;
  justify-items: center;
  gap: clamp(20px, 3vw, 40px);
  padding: clamp(40px, 6vw, 80px) var(--gutter) clamp(72px, 9vw, 120px);
  text-align: center;
  background: radial-gradient(70vw 50vw at 50% 26%, rgba(124, 58, 237, 0.4), transparent 66%);
}
.ball-spot-finale { width: min(44vw, 36vh); aspect-ratio: 1; }
.finale-copy { position: relative; z-index: 5; display: grid; gap: clamp(18px, 2.4vw, 30px); justify-items: center; }
.finale h2 { max-width: 13em; font-size: clamp(2.3rem, 1.2rem + 5vw, 5.6rem); }

.lost { min-height: 100vh; align-content: center; }
.lost h1 { font-size: var(--t-h2); line-height: 0.98; }

/* ---------- footer ---------- */
.foot {
  position: relative;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  justify-content: space-between;
  padding: 26px var(--gutter) 34px;
  border-top: 1px solid rgba(183, 156, 255, 0.2);
  font-size: var(--t-small);
  color: var(--orchid);
}

/* ---------- narrow screens ---------- */
@media (max-width: 1099px) {
  .stage-pin { grid-template-columns: 1fr; }
  .anim .stage-pin { grid-template-rows: auto minmax(0, 1fr); gap: 16px; padding: 94px var(--gutter) 14px; align-items: start; }
  .anim .story { gap: 10px; padding-right: 96px; min-height: 9.2em; align-content: start; }
  .anim .beat { gap: 6px; max-width: 34em; }
  .anim .beat h2 { font-size: clamp(1.7rem, 1rem + 3.2vw, 2.6rem); }
  .anim .beat p { font-size: clamp(0.95rem, 0.8rem + 0.6vw, 1.1rem); line-height: 1.38; }
  .anim .tally { display: none; }
  .anim .ticks { max-width: 150px; }
  .anim .ball-spot-stage { top: 88px; right: 14px; width: 78px; }
  .anim .co { left: 50%; }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; align-content: end; padding-top: 76px; padding-bottom: 76px; gap: 8px;
    background: radial-gradient(120vw 120vw at 70% 22%, rgba(124, 58, 237, 0.36), transparent 60%); }
  .hero .ball-spot { order: -1; justify-self: end; width: min(62vw, 36vh); margin: 0 -4vw 0 0; }
  .how { grid-template-columns: 1fr; }
  .ball-spot-how { display: none; }
}
@media (max-width: 860px) and (max-height: 700px) {
  .anim .beat p { font-size: 0.88rem; }
  .anim .beat h2 { font-size: 1.45rem; }
}

@media (max-height: 760px) and (min-width: 861px) {
  .hero { padding-top: 80px; padding-bottom: 60px; }
  .hero-copy { gap: 16px; }
  .cue { bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
  .btn::after { display: none; }
  .cue::before { animation: none; }
}
