/* v1 — playground */

html { scroll-behavior: smooth; overflow-x: clip; }
[hidden] { display: none !important; }
body { overflow-x: clip; }

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

.skip {
  position: fixed; top: 10px; left: 10px; z-index: 100;
  padding: 10px 14px; border-radius: 8px;
  background: var(--choc); color: var(--beige);
  transform: translateY(-150%);
}
.skip:focus { transform: none; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.55em;
  font-weight: 700; font-size: 0.8rem;
  letter-spacing: 0.14em; text-transform: uppercase;
}
.eyebrow .dot {
  width: 0.6em; height: 0.6em; border-radius: 50%;
  background: var(--cherry);
  box-shadow: 0 0 0 0 rgb(238 47 53 / 0.5);
  animation: ping 2s var(--ease-out) infinite;
}
@keyframes ping { 70%, 100% { box-shadow: 0 0 0 0.7em rgb(238 47 53 / 0); } }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.6em;
  padding: 0.95em 1.4em;
  border: 0; border-radius: 999px;
  background: var(--red); color: var(--beige);
  font-family: var(--font-head); font-weight: 600; font-size: 1.05rem;
  text-decoration: none; cursor: pointer;
  box-shadow: 0 4px 0 var(--choc);
  transition: transform 0.25s var(--ease-bounce), box-shadow 0.25s var(--ease-bounce), background 0.2s;
}
.btn .icon { width: 1.1em; height: 1.1em; transition: transform 0.6s var(--ease-bounce); }
.btn:hover { transform: translateY(-3px); box-shadow: 0 7px 0 var(--choc); }
.btn:hover .icon { transform: rotate(180deg) scale(1.15); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--choc); }

.pill {
  display: inline-flex; align-items: center; gap: 0.5em;
  padding: 0.55em 1em;
  border-radius: 999px;
  font-weight: 700; font-size: 0.85rem; text-decoration: none;
  transition: transform 0.25s var(--ease-bounce), background 0.2s, color 0.2s;
}
.pill:hover { transform: translateY(-2px); }
.pill--ghost { background: rgb(241 234 207 / 0.85); border: 2px solid var(--choc); backdrop-filter: blur(6px); }
.pill--ghost:hover { background: var(--choc); color: var(--beige); }
.pill--solid { background: var(--red); color: var(--beige); border: 2px solid var(--red); box-shadow: 0 0 0 2px var(--beige); }
.pill--solid:hover { background: var(--choc); border-color: var(--choc); }

/* header */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: clamp(12px, 2vw, 22px) clamp(14px, 3vw, 36px);
  pointer-events: none;
}
.site-header > * { pointer-events: auto; }
.site-header__brand {
  flex: 1 1 auto; min-width: 0;
  color: var(--choc); text-decoration: none;
}
.site-header__mark {
  display: block;
  width: clamp(134px, 13.8vw, 165px); /* same footprint as the old text tag */
  max-width: none;
  height: auto;
  aspect-ratio: 338.18 / 61.28;
  fill: #000; /* toolkit draws the boxed lockup in pure black and white */
}
.site-header__mark use { fill: #fff; }
.site-header__nav { display: flex; flex: none; gap: 8px; }

/* HERO */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid; place-items: center;
  padding: 110px 20px 120px;
  overflow: hidden;
  isolation: isolate;
}
.hero__inner {
  position: relative; z-index: 1;
  display: grid; justify-items: center; gap: clamp(16px, 2.4vw, 28px);
  text-align: center;
  max-width: 1100px;
}
.hero__title {
  font-size: clamp(5rem, 17vw, 15.5rem);
  line-height: 0.82;
  letter-spacing: -0.055em;
  color: var(--choc);
}
.hero__title .line { display: block; }
.hero__title .char { display: inline-block; will-change: transform; }
.hero__dot { color: var(--red); }
.hero__lede {
  max-width: 34ch;
  font-size: clamp(1.02rem, 1.45vw, 1.25rem);
  line-height: 1.45;
}

.hero__coins { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.drag {
  position: absolute;
  left: var(--x); top: var(--y);
  width: clamp(3.4rem, calc(var(--s) * 1vw), 11.5rem);
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
}
.drag:active { cursor: grabbing; }
.drag .coin {
  width: 100%;
  box-shadow: 0 10px 0 -2px rgb(71 31 11 / 0.14);
  transition: box-shadow 0.3s;
}
.drag.is-dragging .coin { box-shadow: 0 22px 18px -6px rgb(71 31 11 / 0.28); }
.hero__hint {
  position: absolute; right: 7%; top: calc(13% + clamp(3.4rem, 11vw, 11.5rem) + 10px);
  font-family: var(--font-head); font-weight: 600; font-size: 0.95rem; line-height: 1.15;
  text-align: right;
  transform: rotate(-4deg);
  color: var(--cobalt);
}

/* badge */
.badge {
  position: absolute; z-index: 3;
  right: clamp(14px, 4vw, 56px); bottom: clamp(14px, 4vw, 48px);
  width: clamp(96px, 10vw, 140px); aspect-ratio: 1;
  display: grid; place-items: center;
  color: var(--beige);
}
.badge > svg { grid-area: 1 / 1; }
.badge__spin { width: 100%; height: 100%; overflow: visible; }
.badge__spin text {
  fill: var(--beige);
  font-family: var(--font-head); font-weight: 600; font-size: 10.5px; letter-spacing: 0.02em;
}
.badge__arrow { width: 28%; height: 28%; }

/* RIBBONS */
.ribbons {
  position: relative; z-index: 4;
  height: clamp(130px, 14vw, 210px);
  margin-top: clamp(-80px, -5vw, -40px);
  overflow-x: clip;
  pointer-events: none;
}
.ribbon {
  position: absolute; left: -5%; right: -5%; top: 50%;
  overflow: hidden;
  padding: 0.55em 0;
  font-family: var(--font-head); font-weight: 600;
  font-size: clamp(1.4rem, 3.2vw, 2.6rem);
  letter-spacing: -0.03em;
  white-space: nowrap;
}
.ribbon--front { background: var(--red); color: var(--beige); transform: translateY(-50%) rotate(-3deg); }
.ribbon--back { background: var(--choc); color: var(--beige); transform: translateY(-50%) rotate(2.2deg); }
.ribbon__track { display: flex; width: max-content; }
.ribbon__set { display: flex; align-items: center; }
.ribbon__item { display: inline-flex; align-items: center; gap: 0.6em; padding-right: 0.6em; }
.ribbon__item .coin { width: 1.15em; }

/* PRODUCTS */
.products {
  --card-w: clamp(260px, 74vw, 320px);
  position: relative;
  padding: clamp(60px, 8vw, 110px) 0 clamp(40px, 5vw, 70px);
}
.products__head {
  padding: 0 clamp(20px, 6vw, 88px);
  display: grid; gap: 14px;
  max-width: 900px;
}
.products__head h2 { font-size: clamp(2.6rem, 6.4vw, 5.8rem); }
.products__note { font-size: 1.05rem; max-width: 40ch; }
.desk-only { display: none; }

.products__viewport {
  margin-top: clamp(28px, 4vw, 48px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.products__viewport::-webkit-scrollbar { display: none; }
.products__track {
  display: flex; gap: clamp(16px, 2.2vw, 30px);
  width: max-content;
  padding: 16px clamp(20px, 6vw, 88px) 36px;
}
/* swipe mode: pad so the first and last cards can snap to dead centre */
.products:not(.is-deck) .products__track { padding-inline: max(20px, calc((100vw - var(--card-w)) / 2)); }

.easel {
  --c: var(--red);
  --w: var(--card-w);
  --img: 47%; /* photo share of the card height; the price sticker sits on its edge */
  flex: none;
  width: var(--w);
  aspect-ratio: 12 / 21;
  display: flex; flex-direction: column;
  border-radius: 10px;
  background: var(--beige);
  box-shadow: 0 1px 0 rgb(71 31 11 / 0.08), 0 18px 40px -18px rgb(71 31 11 / 0.35);
  overflow: hidden;
  scroll-snap-align: center;
  transform-origin: 50% 90%;
  transition: box-shadow 0.4s;
}
.easel:hover { box-shadow: 0 1px 0 rgb(71 31 11 / 0.08), 0 30px 50px -18px rgb(71 31 11 / 0.45); }
.easel__img { flex: 0 0 var(--img); overflow: hidden; background: var(--c); }
.easel__img img {
  width: 100%; height: 100%; object-fit: cover;
  object-position: var(--pos, 50% 50%);
  transition: transform 0.9s var(--ease-out);
}
.easel:hover .easel__img img { transform: scale(1.06); }
.easel__body {
  flex: 1;
  display: flex; flex-direction: column;
  padding: 7% 8% 7%;
  background: #f3ecd2;
}
.easel__title {
  color: var(--c);
  font-size: calc(var(--w) * 0.098);
  line-height: 0.9;
  letter-spacing: -0.04em;
}
.easel__kind {
  margin-top: 0.6em;
  font-weight: 600; font-size: calc(var(--w) * 0.042);
  letter-spacing: 0.01em; text-transform: uppercase;
  color: var(--k, var(--choc));
}
.easel__desc {
  margin: 0.6em 0 0;
  font-size: calc(var(--w) * 0.037); line-height: 1.35;
}
.easel__points {
  margin: auto 0 0; padding: 0; list-style: none;
  display: grid; grid-template-columns: auto 1fr; gap: 0.9em 5%;
  font-size: calc(var(--w) * 0.034); line-height: 1.2;
}
.easel__points li { display: flex; align-items: center; gap: 0.6em; }
.easel__points .coin { --bg: var(--c); --fg: var(--beige); width: 2.4em; }
/* the catalog's flower is wider than the usual 58% icon box; overflow: visible also lifts
   the grid min-size floor, so reset it or the coin grows tall */
.easel__points .icon { overflow: visible; min-width: 0; min-height: 0; }

/* festive price: a scalloped sticker slapped across the photo's bottom edge */
.easel { position: relative; }
.price {
  position: absolute; z-index: 1;
  top: var(--img); right: 6%;
  width: calc(var(--w) * 0.36); aspect-ratio: 1;
  margin: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--beige); text-align: center;
  transform: translateY(-82%) rotate(-9deg);
  transition: transform 0.5s var(--ease-bounce);
}
.easel:hover .price { transform: translateY(-82%) rotate(4deg) scale(1.08); }
.price__bg {
  position: absolute; inset: 0; z-index: -1;
  width: 100%; height: 100%;
  fill: var(--k, var(--c));
  stroke: var(--beige); stroke-width: 4px; paint-order: stroke;
  filter: drop-shadow(0 4px 6px rgb(71 31 11 / 0.3));
}
.price__label {
  font-weight: 800; font-size: calc(var(--w) * 0.03);
  letter-spacing: 0.06em; text-transform: uppercase;
  opacity: 0.9;
}
.price__amt {
  font-family: var(--font-head); font-weight: 700;
  font-size: calc(var(--w) * 0.075);
  letter-spacing: -0.03em; line-height: 1.05;
}

.products__progress {
  display: none;
  margin: 0 clamp(20px, 6vw, 88px);
  height: 4px; border-radius: 4px;
  background: rgb(71 31 11 / 0.12);
  overflow: hidden;
}
.products__progress span {
  display: block; height: 100%; width: 100%;
  background: var(--red);
  transform: scaleX(0); transform-origin: left;
}

/* pinned deck mode — set by main.js on desktop when motion is allowed */
.products.is-deck { height: 100vh; padding: 84px 0 28px; display: flex; flex-direction: column; justify-content: center; }
.products.is-deck .products__head {
  max-width: none;
  grid-template-columns: auto 1fr; align-items: end; column-gap: 48px; row-gap: 10px;
}
.products.is-deck .products__head .eyebrow { grid-column: 1 / -1; }
.products.is-deck .products__head h2 { font-size: clamp(2.4rem, 4.4vw, 4.2rem); }
.products.is-deck .products__note { justify-self: end; text-align: right; max-width: 30ch; }
.products.is-deck .products__viewport { margin-top: 24px; }
.products.is-deck .products__viewport { overflow: visible; scroll-snap-type: none; }
.products.is-deck .easel { --w: min(300px, calc((100vh - 380px) * 0.5714)); }
.products.is-deck .products__progress { display: block; }
.products.is-deck .desk-only { display: inline; }
.products.is-deck .mob-only { display: none; }

/* MANIFESTO */
.manifesto {
  padding: clamp(80px, 12vw, 180px) clamp(20px, 6vw, 88px);
  display: grid; gap: 28px;
  max-width: 1320px;
}
.manifesto__text {
  font-family: var(--font-head); font-weight: 600;
  font-size: clamp(2rem, 5.4vw, 4.9rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}
.manifesto__text em { font-style: normal; color: var(--red); }
.m-coin {
  display: inline-grid;
  width: 0.9em;
  vertical-align: -0.1em;
  margin: 0 0.05em;
}
.manifesto__sub { max-width: 46ch; font-size: clamp(1.02rem, 1.4vw, 1.2rem); line-height: 1.5; }

/* SIGNUP */
.signup {
  --a: var(--choc); --b: var(--red); --w: clamp(90px, 11vw, 150px);
  position: relative;
  display: grid; place-items: center;
  /* minmax(0, …) so the card's 100% width is the column, not its own text width */
  grid-template-columns: minmax(0, 1fr);
  padding: clamp(70px, 10vw, 140px) 16px;
  overflow: hidden;
}
.signup__card {
  --s: 34px;
  position: relative;
  width: min(640px, 100%);
  padding: clamp(32px, 5vw, 56px) clamp(22px, 5vw, 56px) calc(clamp(40px, 5vw, 60px) + 17px);
  background: var(--beige);
  border-radius: 14px 14px 0 0;
  text-align: center;
}
.signup__content, .signup__done { display: grid; justify-items: center; gap: 18px; }
.signup__tag { font-size: 0.85rem; background: var(--red); }
.signup h2 { font-size: clamp(3.2rem, 9vw, 5.8rem); }
.signup p { max-width: 38ch; line-height: 1.5; }
.signup__form {
  display: flex; gap: 8px;
  width: 100%;
  margin-top: 6px;
  padding: 6px;
  border-radius: 999px;
  background: #fff8e8;
  border: 2px solid var(--choc);
}
.signup__form:focus-within { border-color: var(--red); }
.signup__form input {
  flex: 1; min-width: 0;
  padding: 0.8em 1em;
  border: 0; background: transparent;
  font-size: 1.05rem;
}
.signup__form input:focus { outline: none; }
.signup__form input::placeholder { color: rgb(71 31 11 / 0.45); }
.signup__form .btn { box-shadow: none; padding: 0.85em 1.3em; }
.signup__form .btn:hover { transform: none; background: var(--choc); }
.signup__form .btn[aria-busy="true"] { opacity: 0.7; pointer-events: none; }
.signup__msg { min-height: 1.4em; font-weight: 700; font-size: 0.95rem; color: var(--red); }
.signup__done-coin { width: 96px; }
.signup__qr { text-align: left; padding-top: 18px; border-top: 1.5px dashed rgb(71 31 11 / 0.25); }
.signup__qr a { color: inherit; }
.signup__qr .qr { --qr-size: 96px; }
.signup__done h2 { outline: none; }
.signup__burst { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.signup__burst .coin { position: absolute; left: 50%; top: 40%; width: 44px; margin: -22px 0 0 -22px; }

/* FOOTER */
.site-footer {
  background: var(--choc); color: var(--beige);
  padding: clamp(50px, 7vw, 90px) clamp(20px, 5vw, 64px) 28px;
  overflow: hidden;
}
.site-footer__top {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px;
}
.site-footer__line {
  font-family: var(--font-head); font-weight: 600;
  font-size: clamp(2rem, 4.5vw, 3.6rem); line-height: 0.95; letter-spacing: -0.035em;
}
.site-footer__links { display: flex; flex-wrap: wrap; gap: clamp(28px, 5vw, 72px); }
.site-footer .label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.6; margin-bottom: 6px; }
.site-footer__links a { font-family: var(--font-head); font-weight: 600; font-size: clamp(1.15rem, 1.7vw, 1.45rem); text-decoration: none; background: linear-gradient(currentColor 0 0) 0 100% / 0 2px no-repeat; transition: background-size 0.35s var(--ease-out); }
.site-footer__links a:hover { background-size: 100% 2px; }
/* the underline rule above sets `background`, which would erase the QR tile */
.site-footer__links .qr, .site-footer__links .qr:hover { --qr-size: 112px; background: var(--beige); }
.site-footer__mark {
  display: block;
  width: 100%; height: auto;
  margin: clamp(40px, 6vw, 80px) 0 clamp(18px, 2vw, 28px);
  overflow: visible;
  fill: var(--beige);
}
/* each letter tumbles in from its own baseline */
.site-footer__mark path { transform-box: fill-box; transform-origin: 50% 100%; }
.site-footer__bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px;
  padding-top: 20px;
  border-top: 1px solid rgb(241 234 207 / 0.2);
  font-size: 0.9rem;
}
.site-footer__bottom a { text-decoration: none; }
.made { display: inline-flex; align-items: center; gap: 0.6em; font-weight: 700; }
.made .coin { width: 1.8em; }

/* small screens */
@media (max-width: 640px) {
  /* frosted bar once scrolled, so the header doesn't sit on top of body text (class set in main.js) */
  html { scroll-padding-top: 64px; }
  .site-header { transition: background 0.3s, box-shadow 0.3s; }
  .site-header.is-scrolled {
    background: rgb(241 234 207 / 0.88);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 1px 0 rgb(71 31 11 / 0.1);
  }
  .site-header__nav .pill--ghost span { display: none; }
  .site-header__nav .pill--ghost { padding: 0; width: 2.6rem; justify-content: center; }
  .site-header__nav .pill--ghost .icon { width: 1.15em; height: 1.15em; }
  .site-header__nav .pill { min-height: 2.6rem; }

  .hero { padding-bottom: 150px; }
  .hero__title { font-size: 25vw; }
  .drag--wide { display: none; }
  /* left/top, not --x/--y: the inline custom properties would win over these */
  .drag:nth-child(3) { left: 3%; }
  .drag:nth-child(6) { left: 74%; top: 80%; }
  .drag:nth-child(9) { left: 8%; top: 82%; }
  .hero__hint { display: none; }
  .badge { right: auto; left: calc(50% - 48px); width: 96px; bottom: 22px; }

  .products__head, .manifesto { text-align: center; justify-items: center; }
  .products__head .eyebrow, .manifesto .eyebrow { justify-content: center; }

  .signup__form { flex-direction: column; border-radius: 22px; }
  .signup__form .btn { justify-content: center; }
  .signup__form input { text-align: center; }

  .site-footer { text-align: center; }
  .site-footer__top, .site-footer__links { justify-content: center; }
  .site-footer__top { flex-direction: column; align-items: center; }
  .site-footer__bottom { flex-direction: column; justify-content: center; }
}
@media (max-width: 699px) {
  /* the QR is hidden here, so centre the follow line with the rest of the card */
  .signup__qr { justify-content: center; text-align: center; }
  .signup__qr .qr-follow__text { justify-items: center; }
}
@media (max-width: 360px) {
  .site-header__nav { gap: 6px; }
  .site-header__nav .pill { min-height: 2.35rem; }
  .site-header__nav .pill--ghost { width: 2.35rem; }
  .site-header__nav .pill--solid { padding-inline: 0.75em; font-size: 0.76rem; }
}
@media (max-width: 360px), (max-width: 640px) and (max-height: 700px) {
  /* no room for coins beside the title and CTA: smaller coins, a row up top, two in the bottom corners */
  .drag { width: 2.9rem; }
  .drag:nth-child(1) { left: 5%; top: 12%; }
  .drag:nth-child(2) { left: 79%; top: 11%; }
  .drag:nth-child(5) { left: 40%; top: 10%; }
  .drag:nth-child(3) { left: 5%; top: 83%; }
  .drag:nth-child(4) { left: 80%; top: 82%; }
  .drag:nth-child(6), .drag:nth-child(9) { display: none; }
}

/* local override of .scallop-bottom: overlap the two mask layers by 1px to hide the seam */
.signup__card.scallop-bottom {
  -webkit-mask:
    linear-gradient(#000 0 0) top / 100% calc(100% - var(--s) / 2 + 1px) no-repeat,
    radial-gradient(circle at 50% 0, #000 calc(var(--s) / 2 - 0.5px), #0000 calc(var(--s) / 2)) bottom / var(--s) calc(var(--s) / 2) repeat-x;
  mask:
    linear-gradient(#000 0 0) top / 100% calc(100% - var(--s) / 2 + 1px) no-repeat,
    radial-gradient(circle at 50% 0, #000 calc(var(--s) / 2 - 0.5px), #0000 calc(var(--s) / 2)) bottom / var(--s) calc(var(--s) / 2) repeat-x;
}
