/* ==========================================================================
   Newsletter — simple sign-up. On submit the text slides up and a football
   rolls into a 3D goal (net bulges, "GOAL!"), then success shows.
   Shopify: swap the <form> for {% form 'customer' %} with contact[email].
   ========================================================================== */

.news {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 460px;
  overflow: hidden;
  padding: 72px var(--gutter);
  background: var(--c-accent);
  color: var(--c-ink);
}

.news__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  transition: transform 0.8s var(--ease);
}

/* text swipes up and disappears while the kick plays */
.news__inner { transition: transform 0.6s var(--ease), opacity 0.45s; }
.news.is-kicking .news__inner { transform: translateY(-120px); opacity: 0; }

.news .eyebrow { color: rgba(0, 0, 0, 0.6); }
.news .display { font-size: clamp(48px, 7vw, 104px); }

.news__text {
  max-width: 44ch;
  margin: 16px auto 0;
  font-size: 17px;
  color: rgba(0, 0, 0, 0.7);
}

/* ---------- form ---------- */

.news__form {
  display: flex;
  gap: 8px;
  max-width: 520px;
  margin: 32px auto 0;
  padding: 6px;
  border-radius: 999px;
  background: var(--c-ink);
}

.news__form input {
  flex: 1;
  min-width: 0;
  height: 50px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font: 500 16px var(--font-body);
  color: #fff;
}

.news__form input::placeholder { color: rgba(255, 255, 255, 0.5); }
.news__form input:focus { outline: none; }
.news__form:focus-within { box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.25); }
.news__form .btn { height: 50px; flex: none; }
.news__form.is-invalid { animation: news-shake 0.4s; }

@keyframes news-shake {
  25% { transform: translateX(-8px); }
  50% { transform: translateX(8px); }
  75% { transform: translateX(-4px); }
}

.news__error { min-height: 20px; margin: 10px 0 0; font-size: 14px; font-weight: 600; }
.news__small { margin: 6px 0 0; font-size: 13px; color: rgba(0, 0, 0, 0.55); }

@media (max-width: 480px) {
  .news__form { flex-direction: column; border-radius: 24px; }
  /* flex: 1 has a 0 basis, which collapses the field's height once the form is a column */
  .news__form input { flex: none; width: 100%; }
  .news__form .btn { width: 100%; }
}

/* ---------- success ---------- */

.news__done { display: none; margin-top: 32px; }

.news.is-done .news__form,
.news.is-done .news__error,
.news.is-done .news__small { display: none; }

.news.is-done .news__done { display: block; animation: news-pop 0.6s var(--ease) both; }

.news__done strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
}

.news__done p { margin: 10px 0 0; font-size: 16px; color: rgba(0, 0, 0, 0.7); }

@keyframes news-pop {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: none; }
}

/* ==========================================================================
   Goal scene — camera on the pitch near the penalty spot, looking at the goal.
   Geometry (pitch, 3D goal frame, net, rolling ball) is projected in newsletter.js.
   ========================================================================== */

/* after the goal only the success message is left */
.news.is-done .news__inner > .eyebrow,
.news.is-done .news__inner > .display,
.news.is-done .news__text { display: none; }
.news.is-done .news__done { margin-top: 0; }

.news__stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s 0.2s;
}

.news.is-kicking .news__stage { opacity: 1; }
.news.is-done .news__stage { opacity: 0; transition-delay: 0s; }

/* slow push-in toward the goal while the ball rolls */
.news__cam { position: absolute; inset: 0; transform-origin: 50% 38%; }
.news.is-kicking .news__cam { animation: news-zoom 3.4s 0.5s cubic-bezier(.4,0,.2,1) both; }

@keyframes news-zoom {
  0% { transform: scale(1); }
  55% { transform: scale(1.12); }
  70% { transform: scale(1.15); }
  100% { transform: scale(1.1); }
}

.news__scene { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; overflow: visible; }

/* wireframe strokes */
.news__scene .w-main,
.news__scene .w-thin { fill: none; stroke: var(--c-ink); stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.news__scene .w-main { stroke-width: 2.2; }
.news__scene .w-soft { stroke-width: 1.6; stroke-opacity: 0.8; }
.news__scene .w-thin { stroke-width: 1; stroke-opacity: 0.4; }
.news__scene .w-dot { fill: var(--c-ink); }
.news__scene .w-shadow { fill: var(--c-ink); fill-opacity: 0.22; }

/* goal frame: white tubes */
.news__frame { fill: #fff; stroke: var(--c-ink); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }

/* ball */
.news__ballbody { fill: #fff; stroke: var(--c-ink); stroke-width: 2; vector-effect: non-scaling-stroke; }
.news__patch { fill: var(--c-ink); }
.news__seams { fill: none; stroke: var(--c-ink); stroke-width: 1; stroke-opacity: 0.55; stroke-linecap: round; vector-effect: non-scaling-stroke; }

/* GOAL! */
.news__good {
  font-family: var(--font-display);
  font-size: 96px;
  text-transform: uppercase;
  fill: var(--c-ink);
  opacity: 0;
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

.news__good.is-on { animation: news-good 1.5s var(--ease) forwards; }

@keyframes news-good {
  0% { opacity: 0; transform: scale(0.5); }
  20% { opacity: 1; transform: translateY(-8px) scale(1.12); }
  75% { opacity: 1; transform: translateY(-12px) scale(1); }
  100% { opacity: 0; transform: translateY(-24px) scale(1); }
}

@media (max-width: 600px) {
  .news { min-height: 420px; }
}

/* goal animation parked for now (see newsletter.js) */
.news__stage { display: none; }
