/* Tokens — exact reference (DESIGN.md / wuldi theme.css) */
:root {
  --bg-primary: #000000;
  --bg-secondary: #090909;
  --bg-surface: #000000;
  --bg-primary-10: color-mix(in srgb, var(--bg-primary) 10%, transparent);

  --border-primary: #1C1C1C;
  --border-secondary: #FFFFFF;
  --border-secondary-10: color-mix(in srgb, var(--border-secondary) 10%, transparent);
  --border-secondary-20: color-mix(in srgb, var(--border-secondary) 20%, transparent);

  --color-primary: #D50007;
  --color-secondary: #FF7E02;
  --color-surface: #FD0A53;

  --gradient-primary: linear-gradient(
    90deg,
    #D50007 0%,
    #FD0A53 23.5%,
    #E93D05 53.5%,
    #FD0A53 75%,
    #FF7E02 100%
  );

  --text-primary: #FFFBF9;
  --text-secondary: #878787;

  --font-heading: "Onest", sans-serif;
  --font-body: "Inter", sans-serif;

  --c-light: rgba(255, 255, 255, 0.25);
  --c-dark: #000;
  --glass-reflex-dark: 1;
  --glass-reflex-light: 1;
  --glass-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--c-light) calc(var(--glass-reflex-light) * 10%), transparent),
    inset 1.8px 3px 0px -2px color-mix(in srgb, var(--c-light) calc(var(--glass-reflex-light) * 90%), transparent),
    inset -2px -2px 0px -2px color-mix(in srgb, var(--c-light) calc(var(--glass-reflex-light) * 80%), transparent),
    inset -3px -8px 1px -6px color-mix(in srgb, var(--c-light) calc(var(--glass-reflex-light) * 60%), transparent),
    inset -0.3px -1px 4px 0px color-mix(in srgb, var(--c-dark) calc(var(--glass-reflex-dark) * 12%), transparent),
    inset -1.5px 2.5px 0px -2px color-mix(in srgb, var(--c-dark) calc(var(--glass-reflex-dark) * 20%), transparent),
    inset 0px 3px 4px -2px color-mix(in srgb, var(--c-dark) calc(var(--glass-reflex-dark) * 20%), transparent),
    inset 2px -6.5px 1px -4px color-mix(in srgb, var(--c-dark) calc(var(--glass-reflex-dark) * 10%), transparent),
    0px 1px 5px 0px color-mix(in srgb, var(--c-dark) calc(var(--glass-reflex-dark) * 10%), transparent),
    0px 6px 16px 0px color-mix(in srgb, var(--c-dark) calc(var(--glass-reflex-dark) * 8%), transparent);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --angle: 210deg;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html {
  font-size: 16px;
  touch-action: manipulation;
  -ms-touch-action: manipulation;
}

body {
  min-height: 100dvh;
  background-color: var(--bg-primary);
  background-image: url("assets/bg.jpg");
  background-size: 100%;
  background-position: top center;
  background-repeat: no-repeat;
  font-family: var(--font-body);
  color: var(--text-primary);
  overflow-x: hidden;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

button,
a,
.tab,
.seg__btn,
.stepper__btn,
.btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

/* Stars overlay from reference */
.stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.2;
  overflow: hidden;
}

/* ========== TOPBAR (glass pill — navbar.css .nav-bg) ========== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: calc(0.75rem + var(--safe-top)) 0.875rem 0.5rem;
}

.topbar__glass {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 14px 18px;
  border-radius: 100px;
  background: var(--bg-primary-10);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
  min-width: 0;
}

.brand__mark {
  display: block;
  height: 36px;
  width: auto;
  max-width: 48px;
  object-fit: contain;
  object-position: center;
  flex-shrink: 0;
  overflow: visible;
}

.brand__name {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.userchip {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
}

.userchip__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  min-width: 0;
}

.userchip__handle {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 42vw;
}

.userchip__plan {
  font-size: 12px;
  font-weight: 600;
  color: #FF5C7A;
  border: 1px solid color-mix(in srgb, #FD0A53 45%, transparent);
  border-radius: 65px;
  padding: 0.1rem 0.5rem;
}

.userchip__avatar,
.userchip__avatar--fallback {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-primary);
  object-fit: cover;
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.userchip__avatar--fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ========== STAGE / HERO (comps.css .section__title) ========== */
.stage {
  position: relative;
  z-index: 1;
  min-height: calc(100dvh - 120px);
  padding: 0.35rem 1rem calc(7rem + var(--safe-bottom));
  overflow: hidden;
}

.view {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  opacity: 0;
  transform: translate3d(22px, 0, 0);
  pointer-events: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 1rem;
  padding: 0 1rem;
  visibility: hidden;
  transition:
    opacity 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.34s;
}

.view[hidden] { display: block !important; }

.view.view--active {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  pointer-events: auto;
  position: relative;
  top: auto;
  visibility: visible;
  z-index: 2;
}

.view.view--exit-left {
  transform: translate3d(-22px, 0, 0);
  opacity: 0;
  visibility: hidden;
}

.view.view--exit-right {
  transform: translate3d(22px, 0, 0);
  opacity: 0;
  visibility: hidden;
}

.view.view--enter-left {
  transform: translate3d(-22px, 0, 0);
}

.view.view--enter-right {
  transform: translate3d(22px, 0, 0);
}

#view-home.view--active {
  min-height: calc(100dvh - 200px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 1.25rem;
}

.section__title--home {
  gap: 0.85rem;
  padding-top: 0.25rem;
}

.home-cta {
  margin-top: 0.35rem;
  min-width: 210px;
}

.page {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
}

/* Catalogue — une seule card compacte */
.page--catalog {
  gap: 0;
}

.card--sheet {
  padding: 1rem 1rem 0.9rem;
  border-radius: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cfg__top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
}

.catalog-sub {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.3;
}

.cfg__block {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.cfg__label {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.seg {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
  padding: 4px;
  border-radius: 100px;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
}

.seg--3 { grid-template-columns: repeat(3, 1fr); }

.seg__pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 50%;
  border-radius: 100px;
  background-image: var(--gradient-primary);
  box-shadow: var(--glass-shadow);
  transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1), width 0.36s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 0;
  pointer-events: none;
  will-change: transform, width;
}

.seg__btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  min-height: 38px;
  border-radius: 100px;
  cursor: pointer;
  transition: color 0.28s ease;
  position: relative;
  z-index: 1;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.seg__btn.active {
  color: var(--text-primary);
}

.addon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.addon:last-child { border-bottom: 0; padding-bottom: 0; }
.addon:first-of-type { padding-top: 0; }

.addon__info {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.addon__titlebtn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.help-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid color-mix(in srgb, #FD0A53 45%, transparent);
  color: #FF5C7A;
  flex-shrink: 0;
  transition: transform 0.18s ease, background 0.18s ease;
}

.addon__price {
  font-size: 12px;
  color: #FF5C7A;
  font-weight: 600;
}

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 65px;
  padding: 2px;
}

.stepper__btn {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
  transition: transform 0.18s ease, background 0.2s ease;
}

.stepper__btn:active { background: color-mix(in srgb, var(--bg-secondary) 70%, #FD0A53); }

.stepper__val {
  min-width: 1.1rem;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.18s ease;
}

.pricebar--inline {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.15rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.pricebar__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.pricebar__sum {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.3;
}

.pricebar__total {
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
  background: var(--gradient-primary);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.btn--block { width: 100%; }

/* Help sheet */
.help {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.help[hidden] { display: none !important; }

.help__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

.help__panel {
  position: relative;
  z-index: 1;
  width: min(560px, calc(100% - 1.5rem));
  margin-bottom: calc(5.5rem + var(--safe-bottom));
  padding: 1.15rem 1.15rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  animation: helpIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes helpIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.help__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.help__head h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 500;
}

.help__x {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 1.25rem;
  cursor: pointer;
}

.help__body {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-line;
}

.addon__titlebtn:active .help-dot {
  background: color-mix(in srgb, #FD0A53 18%, transparent);
}

@media (max-height: 700px) {
  .card--sheet { gap: 0.55rem; padding: 0.85rem; }
  .seg__btn { min-height: 34px; font-size: 12px; }
  .pricebar__total { font-size: 22px; }
  .stage { padding-top: 0.65rem; }
}

.section__title--page {
  align-items: flex-start;
  text-align: left;
  margin: 0;
}

.section__title--page .section__eyebrow {
  margin-left: 0;
  margin-right: 0;
}

.section__title h2 {
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: 1.875rem;
  font-weight: 500;
  line-height: 1.2;
}

.section__title--page .section__lead {
  text-align: left;
  font-size: 16px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 1.5rem;
  padding: 1.5rem;
}

.empty-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 1.5rem;
  padding: 2rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.empty-card__title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-primary);
}

.empty-card__text {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.5;
  max-width: 280px;
}

.order-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.order-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.order-card__title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text-primary);
}

.order-card__date {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 0.25rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 65px;
  padding: 0.2rem 0.625rem;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge--success {
  color: #80FB39;
  border: 1px solid color-mix(in srgb, #80FB39 40%, transparent);
}

.badge--pending {
  color: var(--text-secondary);
  border: 1px solid var(--border-primary);
}

.rows {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.row > p {
  color: var(--text-secondary);
  font-size: 16px;
}

.row > b {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  text-align: right;
}

.btn {
  font-family: var(--font-body);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 65px;
  padding: 0.75rem 1.5rem;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
}


.btn-primary {
  background-image: var(--gradient-primary);
  background-size: 200% 200%;
  background-position: -1rem center;
  border-color: var(--border-secondary-20);
}

.btn-primary:hover {
  background-position: calc(100% + 1rem) center;
  scale: 1.025;
}

.btn-surface {
  width: 100%;
  background: var(--bg-secondary);
  border-color: var(--border-primary);
  color: var(--text-primary);
}

.btn-surface:hover {
  background-image: var(--gradient-primary);
  border-color: transparent;
}

.profile-card__head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.profile-card__avatar,
.profile-card__avatar--fallback {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid var(--border-primary);
  object-fit: cover;
  background: var(--bg-primary);
  flex-shrink: 0;
}

.profile-card__avatar--fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.profile-card__name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-primary);
}

.profile-card__handle {
  color: var(--text-secondary);
  font-size: 15px;
  margin-top: 0.2rem;
}

.settings-card {
  padding: 0.35rem 0.5rem;
}

.settings-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1rem;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}

.settings-row:last-child { border-bottom: 0; }
.settings-row__chev { color: var(--text-secondary); font-size: 1.25rem; }

.section__title {
  position: relative;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 0.75rem;
  text-align: center;
  margin: 0 auto;
  max-width: 925px;
}

.section__eyebrow {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  background-color: var(--bg-primary-10);
  padding: 0.625rem 1.5rem;
  backdrop-filter: blur(2.5px);
  -webkit-backdrop-filter: blur(2.5px);
  box-shadow: var(--glass-shadow);
  border-radius: 100px;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  line-height: normal;
  z-index: 0;
}

.section__eyebrow::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 100px;
  padding: 1px;
  background: linear-gradient(var(--angle), transparent 0%, rgba(129, 11, 37, 0.25) 100%);
  animation: rotate-gradient 8s linear infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: -1;
}

.section__title h1 {
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 500;
  max-width: 925px;
  line-height: 1.15;
}

@media (min-width: 992px) {
  .section__title h1 { font-size: 4rem; }
}

.section__title h1 span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 1000px;
  border: 1px solid #fff;
  background: var(--gradient-primary);
  padding: 0.35rem 1.25rem;
  line-height: 100%;
  opacity: 0.85;
}

.section__lead {
  color: var(--text-secondary);
  text-align: center;
  font-size: 18px;
  font-weight: 400;
  line-height: 150%;
  max-width: 510px;
}

/* Sway — animations.css */
.animate--swaying {
  animation: swaying 5s linear infinite;
}

@keyframes swaying {
  0% { rotate: 0deg; }
  25% { rotate: -2deg; }
  50% { rotate: 0deg; }
  75% { rotate: 2deg; }
  100% { rotate: 0deg; }
}

@keyframes rotate-gradient {
  to { --angle: 570deg; }
}

@property --angle {
  syntax: "<angle>";
  initial-value: 210deg;
  inherits: false;
}

/* ========== TAB BAR (glass pill dock) ========== */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  padding: 0 0.875rem calc(0.75rem + var(--safe-bottom));
  pointer-events: none;
}

.tabbar__glass {
  pointer-events: auto;
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.25rem;
  max-width: 560px;
  margin: 0 auto;
  padding: 8px 10px;
  border-radius: 100px;
  background: var(--bg-primary-10);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}

.tabbar__pill {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 0;
  width: 25%;
  border-radius: 100px;
  background: color-mix(in srgb, var(--bg-secondary) 88%, transparent);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 0;
  pointer-events: none;
  will-change: transform, width;
}

.tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: 48px;
  padding: 0.4rem 0.25rem;
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.28s ease, transform 0.2s ease;
  position: relative;
  z-index: 1;
}

.tab:active { color: var(--text-primary); }

.tab.active {
  color: var(--text-primary);
}

.tab svg { display: block; }
