/* ============================================================
   XPENG Club — Landing + Thank-You pages
   Plain HTML / CSS / JS. Mobile-first, single centered column.
   ============================================================ */

:root {
  --lime: #b3cd3c;          /* brand lime / green (headline accents, divider) */
  --lime-strong: #bcd63a;   /* CTA button */
  --white: #ffffff;
  --black: #0a0b0a;         /* page background */
  --muted: rgba(255, 255, 255, 0.72);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--black);
  color: var(--white);
  font-family: "Assistant", "Heebo", -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.4;
}

/* Centered single column on every viewport (matches the mockup) */
.page {
  max-width: 480px;
  margin: 0 auto;
  background: var(--black);
  overflow: hidden;
}

.wrap { max-width: 500px; margin: 0 auto; }

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

/* The XPENG ✕ emblem reused inline in several places */
.xmark { height: 0.72em; width: auto; display: inline-block; vertical-align: middle; }
.exp { white-space: nowrap; }         /* keep "e✕perience" on one line */
.xmark--sm { height: 0.62em; margin: 0 0.04em; transform: translateY(-0.04em); }
.xmark--foot { height: 22px; margin: 14px auto 0; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  background: url("../images/hero.png") center / cover no-repeat;
  display: flex;
  flex-direction: column;
  padding: 30px 26px 54px;
  overflow: hidden;
  text-align: center;
}

.hero__overlay { position: absolute; left: 0; right: 0; pointer-events: none; z-index: 1; }
.hero__overlay--top {
  top: 0; height: 48%;
  background: linear-gradient(180deg, rgba(6, 10, 8, 0.78) 0%, rgba(6, 10, 8, 0.28) 55%, rgba(6, 10, 8, 0) 100%);
}
.hero__overlay--bottom {
  bottom: 0; height: 40%;
  background: linear-gradient(0deg, rgba(6, 10, 8, 0.9) 0%, rgba(6, 10, 8, 0.3) 55%, rgba(6, 10, 8, 0) 100%);
}

.hero__top, .hero__foot { position: relative; z-index: 2; }

.hero__top { display: flex; flex-direction: column; align-items: center; }

.brandmark-link { display: block; width: min(58%, 220px); }
.brandmark { width: 100%; height: auto; }

.eyebrow {
  margin-top: 22px;
  font-size: 22px;
  font-weight: 700;
  color: var(--white);
}

.experience {
  width: min(84%, 320px);
  height: auto;
  margin-top: 10px;
}

/* YOU ✕ CLUB outlined pill */
.youclub {
  display: inline-flex;
  direction: ltr;               /* keep YOU ✕ CLUB reading order */
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 9px 22px;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  font-size: clamp(17px, 4.6vw, 21px);
  letter-spacing: 0.02em;
  color: var(--white);
}
.youclub .xmark { height: 0.9em; }

/* Hero foot: invite text (centered) + arrow below on the left */
.hero__foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.invite {
  font-size: clamp(16px, 4.6vw, 21px);
  line-height: 1.34;
}
.invite span { display: block; }
.invite__light { font-weight: 400; color: rgba(255, 255, 255, 0.92); }
.invite__strong { font-weight: 700; color: var(--white); margin-top: 12px; direction: rtl; }
.invite__strong .xmark--sm { filter: none; }

.arrow {
  align-self: flex-end;         /* left edge in RTL */
  flex: none;
  width: clamp(48px, 13vw, 56px);
  height: clamp(48px, 13vw, 56px);
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  background: transparent;
  color: var(--white);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease;
}
.arrow svg { width: 44%; height: 44%; }
.arrow:hover { background: rgba(255, 255, 255, 0.14); }
.arrow:active { transform: scale(0.94); }

/* ============================================================
   REGISTER FORM
   ============================================================ */
.register {
  background: var(--black);
  padding: 40px 30px 8px;
}

.reg__title {
  text-align: center;
  font-weight: 700;
  font-size: clamp(23px, 6.4vw, 30px);
  margin-bottom: 30px;
}

.rform { display: block; }

.field { margin-bottom: 26px; }
.field input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--lime);
  color: var(--white);
  font-family: inherit;
  font-size: clamp(16px, 4.4vw, 19px);
  font-weight: 400;
  text-align: right;
  padding: 6px 2px 10px;
  outline: none;
}
.field input::placeholder { color: rgba(255, 255, 255, 0.9); opacity: 1; }
.field input:focus { border-bottom-color: #c8e04a; }

.check {
  display: flex;
  flex-direction: row;   /* RTL: box on the right, label flows to its left */
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-top: 18px;
  cursor: pointer;
}
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check__box {
  flex: none;
  width: 20px;
  height: 20px;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  border-radius: 5px;
  display: grid;
  place-items: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.check__box::after {
  content: "";
  width: 10px;
  height: 5px;
  border-left: 2px solid #10130a;
  border-bottom: 2px solid #10130a;
  transform: rotate(-45deg) translateY(-1px);
  opacity: 0;
}
.check input:checked + .check__box { background: var(--lime); border-color: var(--lime); }
.check input:checked + .check__box::after { opacity: 1; }
.check input:focus-visible + .check__box { outline: 2px solid var(--lime); outline-offset: 2px; }
.check__label {
  font-size: clamp(12px, 3.4vw, 14px);
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.4;
}

/* Lime pill button (shared by form + any CTA) */
.btn {
  display: flex;
  direction: ltr;               /* chevron on the left, text to its right */
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 30px;
  padding: 18px 24px;
  background: var(--lime-strong);
  color: #10130a;
  font-family: "Assistant", sans-serif;
  font-weight: 700;
  font-size: clamp(17px, 4.6vw, 20px);
  letter-spacing: 0.01em;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}
.btn svg { width: 20px; height: 20px; }
.btn:hover { background: #c8e04a; }
.btn:active { transform: scale(0.98); }

/* Full-capacity state */
.state { text-align: center; padding: 24px 8px 8px; }
.state[hidden] { display: none; }
.state h2 { font-weight: 800; font-size: clamp(22px, 6vw, 28px); margin-bottom: 12px; }
.state p { font-size: clamp(15px, 4.2vw, 18px); color: rgba(255, 255, 255, 0.85); line-height: 1.5; }

/* ============================================================
   EVENT-CLOSED page (event-closed.html)
   Figma frame "Event Closed". Same court backdrop, brandmark and overlays as
   the landing hero — only the copy changes: the closed message where the
   invite used to be, and a "see you at the next events" sign-off at the foot.
   One full screen, no form.
   ============================================================ */
/* Figma leaves noticeably more room under the sign-off than the landing hero */
.hero--closed { padding-bottom: clamp(60px, 12vh, 104px); }

/* The sign-off sits over the brightest part of the court (the ball and the
   painted lines), so this page darkens the foot further than the landing hero
   does — matching Figma and keeping the white type legible. */
.hero--closed .hero__overlay--bottom {
  height: 52%;
  background: linear-gradient(0deg, rgba(6, 10, 8, 0.94) 0%, rgba(6, 10, 8, 0.55) 45%, rgba(6, 10, 8, 0) 100%);
}

.closed__title {
  margin-top: 36px;
  font-weight: 700;
  font-size: clamp(30px, 10vw, 42px);
  line-height: 1.28;
}

/* The landing hero's arrow hugs the left edge; this one is centred under the
   message, and points straight down (it scrolls rather than jumps to a form). */
.arrow--down {
  align-self: center;
  margin-top: 30px;
  text-decoration: none;
}
.arrow--down svg { width: 40%; height: 40%; }

/* Four stacked lines, so the hero's 22px flex gap is too loose here */
.hero--closed .hero__foot { gap: 0; }

.closed__lead,
.closed__of {
  font-size: clamp(16px, 4.6vw, 19px);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.92);
}
.closed__next {
  margin-top: 2px;
  font-weight: 700;
  font-size: clamp(30px, 10vw, 42px);
  line-height: 1.2;
}
.closed__of { margin-top: 4px; }

.hero--closed .youclub { margin-top: 16px; }
.youclub--lg {
  gap: 13px;
  padding: 12px 30px;
  font-size: clamp(19px, 5.8vw, 24px);
}

/* ============================================================
   THANK-YOU middle block
   ============================================================ */
.thanks {
  background: var(--black);
  padding: 34px 30px 8px;
  text-align: center;
}
.thanks__title {
  color: var(--lime);
  font-weight: 800;
  font-size: clamp(28px, 8vw, 38px);
  margin-bottom: 22px;
}
.thanks__lead {
  font-size: clamp(16px, 4.4vw, 19px);
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 16px;
}
.youclub--dark { border-color: rgba(255, 255, 255, 0.85); }
.thanks__text {
  margin-top: 22px;
  font-size: clamp(16px, 4.4vw, 19px);
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
}
.thanks .date { margin-top: 30px; }

/* ============================================================
   DETAILS + PRODUCT (shared bottom of both pages)
   On mobile these two sit flush and read as one continuous block
   (the original Figma order); on desktop they split apart — see the
   desktop media query below.
   ============================================================ */
.details {
  background: var(--black);
  padding: 32px 30px 0;
  text-align: center;
}
.product {
  background: var(--black);
  padding: 0 0 0px;
  text-align: center;
}

/* Two copies of the product slider: --flow sits in the mobile reading
   order (between the two texts); --feature is the desktop product shot.
   Each is shown only at its breakpoint. */
.slider--feature { display: none; }

.story__text {
  font-size: clamp(17px, 4.8vw, 21px);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.55;
}

/* ---- Product slider ----------------------------------------------------
   Full-bleed banner: the starburst SVG is the static backdrop, and the three
   product shots slide across it right-to-left on an endless loop.
   The track holds 4 frames (slides 1-2-3 + a clone of 1) so the loop
   restarts seamlessly. Pure CSS — no JS.
   ------------------------------------------------------------------------ */
.slider {
  position: relative;
  direction: ltr;               /* the page is RTL; keep the track's overflow
                                   and slide order left-to-right */
  width: calc(100% + 60px);     /* cancel the .details 30px side padding */
  max-width: none;
  margin: 26px -30px;
  height: 300px;
  overflow: hidden;
  background: url("../images/slider-bg.svg") center / cover no-repeat;
}

.slider__track {
  display: flex;
  width: 400%;                  /* 4 frames */
  height: 100%;
  animation: slider-loop 5s infinite;
}

.slider__img {
  width: 25%;                   /* one frame */
  height: 100%;
  object-fit: contain;
  padding: 22px 0;
}

/* Hold each slide, then glide to the next. The 4th frame is a clone of the
   first, so when the animation restarts at 0 nothing visibly jumps. */
@keyframes slider-loop {
  0%,   28%  { transform: translateX(0); }
  33%,  61%  { transform: translateX(-25%); }
  66%,  94%  { transform: translateX(-50%); }
  100%       { transform: translateX(-75%); }
}

@media (prefers-reduced-motion: reduce) {
  .slider__track { animation: none; }
}

.divider {
  display: block;
  width: 46px;
  height: 2px;
  background: var(--lime);
  margin: 30px auto;
}

.date {
  font-weight: 400;
  font-size: clamp(40px, 11vw, 52px);
  line-height: 1;
  letter-spacing: 0.01em;
}
.place {
  margin-top: 12px;
  font-size: clamp(16px, 4.4vw, 19px);
  color: var(--muted);
}

/* Keychain "stage": the product photo is the backdrop; the date sits over
   its (dark) top and the sign-off over its (dark) bottom — matching Figma. */
.stage { position: relative; }
.keychain {
  width: 100%;
  aspect-ratio: 722 / 900;      /* keep dark room top & bottom for the overlays */
  height: auto;
  object-fit: cover;
  object-position: center 100%;
  margin: 0;
}
.stage__over {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
  text-align: center;
  pointer-events: none;
}
.stage__over--top { top: 0; padding-top: 20px; }
.stage__over--bottom { bottom: 0; padding-bottom: 30px; }

.signoff {
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-size: clamp(16px, 4.4vw, 19px);
  color: var(--white);
}

/* ============================================================
   DESKTOP — the mobile design, kept intact, in the LEFT column,
   with the hero pinned full-height on the RIGHT (client's request:
   "sync the desktop so it will be like the mobile … in the left side").
   Only placement changes here — every section keeps its mobile styling,
   so the Figma design stays pixel-identical, just narrower than the screen.
   ============================================================ */
@media (min-width: 900px) {
  .page {
    max-width: none;
    margin: 0;
    overflow: visible;          /* must not clip: the hero below is sticky */
    display: grid;
    /* The content column keeps the phone's width. Widening it would stretch
       the portrait product shots into huge, over-cropped images — this way
       every section fills its column edge to edge at its natural size. */
    /* RTL: column 1 is the RIGHT-hand side. Content sits on the right at
       .wrap's width (so nothing insets), the hero fills the left. */
    grid-template-columns: 500px 1fr;
    align-items: start;
  }

  /* Left column: the hero stays in view while the right column scrolls. */
  .hero {
    grid-column: 2;
    /* span every content row. NOT `1 / -1`: with no explicit rows that
       resolves to row 1 only, which stretches row 1 to 100vh and leaves a
       huge hole under the form. */
    grid-row: 1 / span 3;
    position: sticky;
    top: 0;
    height: 100vh;
    min-height: 0;
    padding: 48px 56px 60px;
  }
  .brandmark-link { width: min(50%, 240px); }
  .experience { width: min(78%, 360px); }

  /* Right column (grid column 1 in RTL): everything else, stacked as on mobile */
  .register,
  .thanks,
  .details,
  .product {
    grid-column: 1;
  }

  /* Nothing else is restyled: at this column width the mobile rules already
     make the slider and the keychain span edge to edge at their natural size. */

  /* First section in the content column needs a little breathing room on top */
  .register { padding-top: 64px; }

  /* Drop the date a little so it isn't tight against the photo's top edge */
  .stage__over--top { padding-top: 40px; }
  .page--thanks .thanks { padding-top: 64px; }

  /* The closed page is one screen with no content column to pin the hero
     beside, so it opts out of the two-column grid. It keeps the phone's width
     and centres: stretching it full-bleed makes `cover` crop the portrait
     court shot so hard that the racket swallows the frame and the copy lands
     on top of the ball. Same principle as the content column above. */
  .page--closed {
    display: block;
    max-width: 520px;
    margin: 0 auto;
  }
  .page--closed .hero {
    grid-column: auto;
    grid-row: auto;
    position: relative;
    height: 100svh;
    padding: 40px 40px clamp(60px, 12vh, 104px);
  }
}
