:root {
  --virtius-blue: #1E8FFF;
  --virtius-blue-dark: #0B72D9;
  --ink: #111418;
  --muted: #5a6370;
  --panel-bg: rgba(255, 255, 255, 0.86);
  --panel-radius: 14px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--ink);
  background: #e9ecef;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-color: #c9ced4;
  background-image: url("assets/bg.jpeg");
  background-image: image-set(
    url("assets/bg.webp") type("image/webp"),
    url("assets/bg.jpeg") type("image/jpeg")
  );
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* ------------------------------------------------------------------ */
/* Brand header — Pop-Up Shop wordmark over Virtius wordmark + tagline */
/* ------------------------------------------------------------------ */
.brand-header {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 40px 20px 0;
}
.logo-mark {
  position: relative;
  width: min(360px, 70%);
  margin: 90px auto 0;
}
.logo-mark .virtius-wordmark {
  width: 100%;
  height: auto;
  display: block;
}
.logo-mark .popup-wordmark {
  position: absolute;
  left: 0;
  bottom: 92%;
  width: 70%;
  height: auto;
  display: block;
  transform: translateX(-12.2%);
  z-index: 2;
}
.brand-subtitle {
  margin: 18px 0 0;
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ------------------------------------------------------------------ */
/* Page container                                                     */
/* ------------------------------------------------------------------ */
.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.panel {
  background: var(--panel-bg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: var(--panel-radius);
  padding: 36px 40px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

/* Stack the hero (and its open combobox dropdown) above the sample
   video below. .panel uses backdrop-filter, which creates its own
   stacking context, so the combobox z-index alone can't escape it. */
.hero { position: relative; z-index: 2; }
.sample-section { position: relative; z-index: 1; }

/* ------------------------------------------------------------------ */
/* Hero panel                                                         */
/* ------------------------------------------------------------------ */
.hero h1 {
  font-size: 32px;
  text-align: center;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
  line-height: 1.15;
  /* Avoid widows like "...on" / "video." — balance distributes lines
     evenly so the break lands at the natural comma instead. */
  text-wrap: balance;
}
.hero-sub {
  text-align: center;
  color: var(--muted);
  margin: 0 0 8px;
  font-size: 15px;
}
.hero-price {
  text-align: center;
  margin: 0 0 24px;
  font-size: 17px;
  color: var(--ink);
}
.hero-price strong {
  color: var(--virtius-blue);
  font-weight: 700;
}

.picker-block {
  margin-top: 4px;
  text-align: center;
}
.picker-label {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 4px;
}
.picker-block .muted {
  margin: 0 0 4px;
  font-size: 13px;
}
.picker-block .combobox-input {
  text-align: center;
}
.picker-block .combobox-input::placeholder {
  text-align: center;
}

/* ------------------------------------------------------------------ */
/* Personalized hero — swaps in when an athlete is selected.          */
/* Scoreboard-style: big uppercase name, blue underline, bib + team.  */
/* ------------------------------------------------------------------ */
.hero-personalized { display: none; }
.hero[data-athlete-selected] .hero-default { display: none; }
.hero[data-athlete-selected] .hero-personalized {
  display: grid;
  /* 36px back-icon column / centered name+subtitle / 36px gutter.
     Matching gutters keep the centered name visually centered, while
     reserving space so long names don't collide with the back icon. */
  grid-template-columns: 36px 1fr 36px;
  grid-template-areas:
    "back name ."
    ". subtitle .";
  align-items: start;
  text-align: center;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--virtius-blue);
}
.hero[data-athlete-selected] #hero-athlete-name { grid-area: name; }
.hero[data-athlete-selected] .hero-athlete-subtitle { grid-area: subtitle; }
.hero[data-athlete-selected] .change-athlete { grid-area: back; }
.hero[data-athlete-selected] .picker-block,
.hero[data-athlete-selected] .picker-label,
.hero[data-athlete-selected] .picker-block > .muted,
.hero[data-athlete-selected] .combobox {
  display: none;
}

/* "Start over" — refresh icon in the right column of the personalized
   header grid. Quiet by default, blue on hover. */
.change-athlete {
  display: none;  /* shown by .hero[data-athlete-selected] selector */
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  color: rgba(90, 99, 112, 0.55);
  justify-self: start;
  align-self: start;
  transition: color 0.15s ease, background 0.15s ease;
}
.hero[data-athlete-selected] .change-athlete { display: inline-flex; align-items: center; justify-content: center; }
.change-athlete svg { width: 18px; height: 18px; display: block; }
.change-athlete:hover,
.change-athlete:focus-visible {
  color: var(--virtius-blue-dark);
  background: rgba(30, 143, 255, 0.08);
  outline: none;
}
#hero-athlete-name {
  font-size: 36px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 6px;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  line-height: 1;
  /* Names like "Patricio Guillaumin Perez" (25 chars) need to wrap on
     narrow widths instead of overflowing the grid cell. text-wrap:
     balance keeps multi-line names visually even. */
  overflow-wrap: break-word;
  text-wrap: balance;
}
.hero-athlete-subtitle {
  font-size: 13px;
  color: var(--virtius-blue-dark);
  margin: 0;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}

/* Reveal block — athlete details + package picker + checkout, shown after pick */
.reveal-block {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid #e3e7ec;
  animation: revealFadeIn 0.35s ease-out;
}
.reveal-block[hidden] { display: none; }
@keyframes revealFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.package-heading {
  font-size: 20px;
  margin: 28px 0 4px;
  line-height: 1.25;
}
#package-athlete-name {
  color: var(--virtius-blue-dark);
  font-weight: 700;
}

/* ------------------------------------------------------------------ */
/* Buttons                                                            */
/* ------------------------------------------------------------------ */
.btn-primary {
  background: var(--virtius-blue);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 16px;
  padding: 12px 22px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}
.btn-primary:hover { background: var(--virtius-blue-dark); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.checkout-btn {
  display: block;
  width: 100%;
  margin-top: 20px;
  font-size: 17px;
  padding: 16px 22px;
  border-radius: 8px;
}

.error {
  color: #c0392b;
  font-size: 14px;
  margin-top: 10px;
}

p { margin: 6px 0; line-height: 1.5; }
.muted { color: var(--muted); }

/* ------------------------------------------------------------------ */
/* Sample video section — wrapped in a panel to match the hero + FAQ  */
/* card treatment, so the page reads as a consistent stack of panels. */
/* ------------------------------------------------------------------ */
.sample-section {
  position: relative;
  z-index: 1;
  background: var(--panel-bg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: var(--panel-radius);
  padding: 28px 28px 24px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  text-align: center;
}
.sample-section h2 {
  font-size: 22px;
  margin: 0 0 6px;
  color: var(--ink);
}
.sample-section .muted {
  margin: 0 0 14px;
  font-size: 14px;
}

.video-facade {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 10px;
  margin: 0;
  background: #000 center / cover no-repeat;
  cursor: pointer;
  overflow: hidden;
  padding: 0;
  transition: filter 0.15s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}
.video-facade:hover { filter: brightness(1.08); }
.video-facade iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-facade .play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 68px;
  height: 48px;
  transform: translate(-50%, -50%);
  transition: transform 0.15s ease, opacity 0.15s ease;
  opacity: 0.92;
  pointer-events: none;
}
.video-facade:hover .play-btn { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
.video-facade .play-btn svg { width: 100%; height: 100%; display: block; }

/* ------------------------------------------------------------------ */
/* FAQ — single collapsed accordion at the bottom of the page.        */
/* Wrapped in a panel so it has the same translucent-white card       */
/* treatment as the hero, instead of floating naked on the backdrop.  */
/* ------------------------------------------------------------------ */
.faq-section {
  position: relative;
  z-index: 1;
  background: var(--panel-bg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: var(--panel-radius);
  padding: 4px 28px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}
.faq > summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 0;
  /* Grid: empty gutter / centered heading / + icon — keeps the FAQ
     heading visually centered to match the other section headings,
     without losing the right-anchored toggle indicator. */
  display: grid;
  grid-template-columns: 26px 1fr 26px;
  align-items: center;
  gap: 8px;
}
.faq[open] > summary {
  border-bottom: 1px solid #e3e7ec;
}
.faq > summary::-webkit-details-marker { display: none; }
.faq > summary h2 {
  grid-column: 2;
  margin: 0;
  font-size: 22px;
  color: var(--ink);
  font-weight: 700;
  text-align: center;
}
.faq > summary::after {
  content: "+";
  grid-column: 3;
  justify-self: end;
  font-size: 26px;
  font-weight: 400;
  color: var(--virtius-blue);
  line-height: 1;
}
.faq[open] > summary::after { content: "−"; }
.faq-content {
  padding: 6px 0 20px;
}
.faq-item {
  margin: 18px 0;
}
.faq-item:first-child { margin-top: 8px; }
.faq-q {
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 4px;
  font-size: 15px;
}
.faq-a {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
}
.faq-a a {
  color: var(--virtius-blue-dark);
  text-decoration: none;
}
.faq-a a:hover { text-decoration: underline; }
/* ------------------------------------------------------------------ */
/* About Virtius — promoted out of the FAQ footnote into its own      */
/* panel. This is the company-credibility beat (NCAA, 1000+ comps,    */
/* since 2020) and earns full panel weight.                           */
/* ------------------------------------------------------------------ */
.about-section {
  position: relative;
  z-index: 1;
  background: var(--panel-bg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: var(--panel-radius);
  padding: 28px 32px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}
.about-section h2 {
  font-size: 22px;
  margin: 0 0 12px;
  color: var(--ink);
  font-weight: 700;
  text-align: center;
}
.about-section p {
  font-size: 15px;
  color: var(--ink);
  line-height: 1.55;
  margin: 0;
  text-align: left;
}
.about-section p strong {
  color: var(--virtius-blue-dark);
  font-weight: 700;
}
.about-links {
  margin-top: 14px !important;
  font-size: 14px;
  color: var(--muted);
  text-align: center !important;
}
.about-links a {
  color: var(--virtius-blue-dark);
  text-decoration: none;
  font-weight: 500;
}
.about-links a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ */
/* Trust footer — championship + venue logos + contact                */
/* ------------------------------------------------------------------ */
.trust-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 24px 20px 40px;
}
.event-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  margin-top: 8px;
}
.event-logos img {
  height: 140px;
  width: auto;
  object-fit: contain;
  display: block;
}
.event-logos .venue-logo {
  height: 95px;
}
.contact-line {
  margin: 24px 0 0;
  font-size: 14px;
  color: var(--muted);
}
.contact-line a {
  color: var(--virtius-blue-dark);
  text-decoration: none;
}
.contact-line a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ */
/* Gymnast picker (combobox)                                          */
/* ------------------------------------------------------------------ */
.required { color: var(--virtius-blue); }
.combobox { position: relative; margin-top: 6px; }
.combobox-input {
  width: 100%;
  font: inherit;
  font-size: 20px;
  padding: 10px 0;
  border: none;
  border-bottom: 2px solid var(--virtius-blue);
  background: transparent;
  outline: none;
  color: var(--ink);
  font-weight: 300;
}
.combobox-input::placeholder {
  color: #a3a9b2;
  font-weight: 300;
}
.combobox-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border: 1px solid #e3e7ec;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(20,28,42,0.10);
  max-height: 280px;
  overflow-y: auto;
  z-index: 10;
}
.combobox-list li {
  padding: 10px 14px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--virtius-blue-dark);
  background: #eef3fb;
  margin: 3px 0;
  font-size: 16px;
}
.combobox-list li[aria-selected="true"],
.combobox-list li:hover {
  background: var(--virtius-blue);
  color: #fff;
}
.combobox-status {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.athlete-details {
  margin: 0;
  padding: 14px 16px;
  background: #f5f8fc;
  border: 1px solid #e3e7ec;
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px 18px;
  font-size: 14px;
}
.athlete-details > div { display: flex; flex-direction: column; gap: 2px; }
.athlete-details > div[hidden] { display: none; }
.athlete-details dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
}
.athlete-details dd {
  margin: 0;
  color: var(--ink);
  font-weight: 500;
}

/* ------------------------------------------------------------------ */
/* Package picker                                                     */
/* ------------------------------------------------------------------ */
.package-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 14px 0 4px;
}
.package-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 18px 20px;
  background: #f5f8fc;
  border: 2px solid #e3e7ec;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font: inherit;
  color: var(--ink);
}
.package-card:hover { border-color: var(--virtius-blue); }
.package-card[aria-pressed="true"] {
  border-color: var(--virtius-blue);
  background: #e7f0fb;
}
.package-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--virtius-blue-dark);
}
.package-desc {
  margin-top: 6px;
  font-size: 14px;
  color: var(--muted);
}
.package-price {
  margin-top: 12px;
  font-size: 22px;
  font-weight: 700;
  color: var(--virtius-blue);
}

/* ------------------------------------------------------------------ */
/* Mobile                                                             */
/* ------------------------------------------------------------------ */
@media (max-width: 640px) {
  .brand-header { padding: 20px 16px 0; }
  .logo-mark { width: 78%; margin-top: 60px; }
  .brand-subtitle { font-size: 12px; }

  .page { padding: 24px 12px 4px; gap: 24px; }
  .panel { padding: 28px 22px; }

  .hero h1 { font-size: 26px; }
  .hero-sub { font-size: 14px; }
  .hero-price { font-size: 16px; margin-bottom: 18px; }

  #hero-athlete-name { font-size: 24px; }
  .hero-athlete-subtitle { font-size: 12px; }

  .package-heading { font-size: 18px; }

  .sample-section { padding: 22px 18px 18px; }
  .sample-section h2 { font-size: 20px; }

  .faq-section { padding: 0 18px; }
  .faq > summary { padding: 16px 0; }
  .faq > summary h2 { font-size: 20px; }
  .faq-q { font-size: 14px; }
  .faq-a { font-size: 13.5px; }

  .about-section { padding: 22px 22px; }
  .about-section h2 { font-size: 20px; }
  .about-section p { font-size: 14px; }

  .trust-footer { padding: 16px 12px 32px; }
  .event-logos { gap: 24px; }
  .event-logos img { height: 110px; }
  .event-logos .venue-logo { height: 75px; }
}

/* ------------------------------------------------------------------ */
/* Share — top-right icon + modal with QR and link.                   */
/* ------------------------------------------------------------------ */
.share-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 20;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--virtius-blue-dark);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.10);
  transition: transform 0.1s ease, background 0.15s ease;
}
.share-btn:hover { background: #fff; }
.share-btn:active { transform: scale(0.96); }
.share-btn svg { width: 18px; height: 18px; }
.share-btn-label { line-height: 1; }

.share-modal {
  border: none;
  border-radius: var(--panel-radius);
  padding: 0;
  max-width: 420px;
  width: calc(100% - 32px);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
}
.share-modal::backdrop {
  background: rgba(20, 28, 42, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.share-modal-inner {
  margin: 0;
  padding: 28px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
}
.share-modal-inner h2 {
  margin: 0;
  font-size: 20px;
  text-align: center;
  color: var(--ink);
}
.share-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.share-modal-close:hover { background: #f0f3f7; color: var(--ink); }
.share-modal-close svg { width: 18px; height: 18px; }

.share-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.share-qr {
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #eef0f3;
  border-radius: 10px;
  padding: 10px;
}
.share-qr canvas, .share-qr svg, .share-qr img { width: 100%; height: 100%; display: block; }
.share-caption {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}
.share-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.share-divider::before, .share-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e3e7ec;
}
.share-link-row {
  align-items: stretch;
  gap: 10px;
}
.share-link-input {
  width: 100%;
  min-width: 0;
  font: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid #d8dde4;
  border-radius: 6px;
  background: #f7f9fc;
  color: var(--ink);
}
.share-link-input:focus { outline: 2px solid var(--virtius-blue); outline-offset: 0; }
.share-link-actions {
  display: flex;
  width: 100%;
  gap: 8px;
}
.share-link-actions .share-action-btn { flex: 1; }
.share-action-btn {
  font-size: 14px;
  padding: 10px 16px;
}
.share-toast {
  margin: 0;
  font-size: 13px;
  text-align: center;
  color: var(--virtius-blue-dark);
  font-weight: 600;
}
