/* Clear Market — about / explainer (Clear Hub purple theme) */
html.capacitor-android {
  --clearli-top-inset-extra: 0.75rem;
}

:root {
  --cma-bg: #f5f3ff;
  --cma-card: #ffffff;
  --cma-ink: #1c1543;
  --cma-muted: #4c4570;
  --cma-line: #e7e3f8;
  --cma-navy: #5b3df5;
  --cma-navy-deep: #3f22d9;
  --cma-grad-hero: linear-gradient(135deg, #5b3df5 0%, #8b5cf6 38%, #ec4899 72%, #ff8a4c 100%);
  --cma-grad-primary: linear-gradient(135deg, #5b3df5, #8b5cf6);
  --cma-shadow: 0 10px 30px rgba(76, 52, 200, 0.12);
  --cma-shadow-pop: 0 18px 40px rgba(91, 61, 245, 0.28);
}

html.night-mode,
body.night-mode.cma-page {
  --cma-bg: #0f0c22;
  --cma-card: #1b1735;
  --cma-ink: #f1eeff;
  --cma-muted: #c4bfdc;
  --cma-line: #2d2852;
  --cma-navy: #a48bff;
  --cma-navy-deep: #c4b5fd;
  --cma-grad-hero: linear-gradient(135deg, #3b23b8 0%, #6d3fd6 40%, #b8337a 75%, #c4562d 100%);
  --cma-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
}

.cma-page,
.cma-page button,
.cma-page a,
.cma-page li,
.cma-page p,
.cma-page h1,
.cma-page h2,
.cma-page h3 {
  font-family: 'Space Mono', ui-monospace, monospace;
}

.cma-page {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(120% 60% at 100% 0%, color-mix(in srgb, #ec4899 10%, transparent), transparent 60%),
    radial-gradient(120% 60% at 0% 100%, color-mix(in srgb, #06b6d4 10%, transparent), transparent 60%),
    var(--cma-bg);
  color: var(--cma-ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.cma-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding:
    calc(env(safe-area-inset-top, 0px) + var(--clearli-top-inset-extra, 0px) + 10px)
    calc(14px + env(safe-area-inset-right, 0px))
    10px
    calc(14px + env(safe-area-inset-left, 0px));
  border-bottom: 1px solid color-mix(in srgb, var(--cma-line) 80%, transparent);
  background: color-mix(in srgb, var(--cma-bg) 88%, transparent);
  backdrop-filter: blur(12px);
}

.cma-topbar__back {
  justify-self: start;
  color: var(--cma-navy-deep);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.cma-topbar__brand {
  justify-self: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--cma-grad-hero);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.cma-main {
  max-width: 520px;
  margin: 0 auto;
  padding:
    16px
    calc(16px + env(safe-area-inset-right, 0px))
    calc(28px + env(safe-area-inset-bottom, 0px))
    calc(16px + env(safe-area-inset-left, 0px));
}

.cma-hook {
  margin-bottom: 18px;
  padding: 18px 16px 16px;
  border-radius: 20px;
  background: var(--cma-card);
  border: 2px solid var(--cma-navy);
  box-shadow: var(--cma-shadow);
}

.cma-hook__kicker {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cma-navy-deep);
}

.cma-hook__headline {
  margin: 10px 0 0;
  font-size: clamp(1.05rem, 4.5vw, 1.22rem);
  font-weight: 700;
  line-height: 1.45;
  color: var(--cma-ink);
}

.cma-hook__headline em {
  font-style: normal;
  color: var(--cma-navy-deep);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, #ec4899 55%, var(--cma-navy));
  text-underline-offset: 3px;
}

.cma-hook__body {
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--cma-muted);
  font-weight: 500;
}

.cma-hook__body strong {
  color: var(--cma-ink);
  font-weight: 700;
}

.cma-hook__tagline {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--cma-navy) 10%, var(--cma-card));
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--cma-ink);
  letter-spacing: 0.02em;
}

/* Clear Market flip card (virtual-card style) */
.cma-flip-block {
  margin-bottom: 20px;
}

.cma-flip-card {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  perspective: 1100px;
  -webkit-tap-highlight-color: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
}

.cma-flip-card__inner {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-areas: "stack";
  transform-style: preserve-3d;
  transform-origin: center center;
  transition: transform 0.7s cubic-bezier(0.34, 1.05, 0.45, 1);
}

.cma-flip-card.is-flipped .cma-flip-card__inner {
  transform: rotateY(180deg);
}

.cma-flip-card__face {
  grid-area: stack;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
  transform-origin: center center;
}

.cma-flip-card__face--front {
  transform: rotateY(0deg);
}

.cma-flip-card__face--back {
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* Back face only: keep in layout for height, hide from interaction when facing away */
  pointer-events: none;
}

.cma-flip-card.is-flipped .cma-flip-card__face--front {
  pointer-events: none;
}

.cma-flip-card.is-flipped .cma-flip-card__face--back {
  pointer-events: auto;
}

.cma-hero-face {
  position: relative;
  padding: 22px 18px 20px;
  border-radius: 24px;
  background: var(--cma-grad-hero);
  color: #ffffff;
  box-shadow: var(--cma-shadow-pop);
  overflow: hidden;
}

.cma-hero-face::before {
  content: "";
  position: absolute;
  width: 160px;
  height: 160px;
  top: -70px;
  right: -40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  pointer-events: none;
}

.cma-hero-face > * {
  position: relative;
  z-index: 1;
}

.cma-flip-hint {
  margin: 10px 0 0;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--cma-muted);
}

.cma-flip-hint__icon {
  display: inline-block;
  margin-right: 4px;
}

.cma-flip-card.is-flipped + .cma-flip-hint .cma-flip-hint__icon {
  transform: scaleX(-1);
}

@media (prefers-reduced-motion: reduce) {
  .cma-flip-card__inner {
    transition-duration: 0.01ms;
  }
}

.cma-hero__eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.92;
}

.cma-hero__title {
  margin: 8px 0 0;
  font-size: clamp(2rem, 8vw, 2.5rem);
  font-weight: 700;
  line-height: 1.1;
}

.cma-hero__lede {
  margin: 14px 0 0;
  font-size: 15px;
  line-height: 1.55;
  color: #ffffff;
  font-weight: 500;
}

.cma-hero__lede strong {
  font-weight: 700;
}

.cma-hero__region {
  margin: 16px 0 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.22);
  border: 1.5px solid rgb(0, 0, 0);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  color: #ffffff;
}

.cma-hero__region strong {
  font-weight: 800;
}

.cma-hero__back-copy {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.58;
  color: #ffffff;
  font-weight: 800;
}

.cma-flip-card__face--back .cma-hero__region {
  margin-top: 14px;
}

.cma-section-title {
  margin: 0 0 12px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--cma-ink);
}

.cma-steps,
.cma-note,
.cma-bags-why {
  margin-bottom: 18px;
  padding: 16px 16px 18px;
  border-radius: 20px;
  background: var(--cma-card);
  border: 1px solid var(--cma-line);
  box-shadow: var(--cma-shadow);
}

.cma-bags-why__intro {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.58;
  font-weight: 500;
  color: var(--cma-ink);
}

.cma-bags-why__intro strong {
  color: var(--cma-navy-deep);
  font-weight: 700;
}

.cma-bags-why__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cma-bags-why__item {
  padding: 14px 0;
  border-bottom: 1px solid var(--cma-line);
}

.cma-bags-why__item:first-child {
  padding-top: 0;
}

.cma-bags-why__item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.cma-bags-why__heading {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--cma-ink);
}

.cma-bags-why__text {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.58;
  font-weight: 500;
  color: var(--cma-muted);
}

.cma-bags-why__text--punch {
  color: var(--cma-ink);
  font-weight: 600;
}

.cma-bags-why__contrast {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.55;
  font-weight: 500;
  color: var(--cma-ink);
  background: color-mix(in srgb, var(--cma-navy) 6%, var(--cma-card));
  border-left: 3px solid var(--cma-line);
}

.cma-bags-why__contrast + .cma-bags-why__contrast {
  margin-top: 8px;
}

.cma-bags-why__label {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cma-bags-why__label--no {
  color: #be123c;
}

.cma-bags-why__label--yes {
  color: var(--cma-navy-deep);
}

.cma-bags-why__contrast:has(.cma-bags-why__label--yes) {
  border-left-color: var(--cma-navy);
  background: color-mix(in srgb, var(--cma-navy) 10%, var(--cma-card));
}

.cma-step-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cma-step {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--cma-line);
}

.cma-step:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.cma-step__num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--cma-grad-primary);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
}

.cma-step__heading {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--cma-ink);
}

.cma-step__text {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--cma-muted);
  font-weight: 500;
}

.cma-bullets {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--cma-muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
}

.cma-bullets li + li {
  margin-top: 8px;
}

.cma-bullets a {
  color: var(--cma-navy-deep);
  font-weight: 700;
}

.cma-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.cma-btn {
  display: block;
  width: 100%;
  padding: 14px 18px;
  border-radius: 16px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  border: none;
  -webkit-tap-highlight-color: transparent;
}

.cma-btn--primary {
  background: var(--cma-grad-primary);
  color: #ffffff;
  box-shadow: 0 10px 28px rgba(91, 61, 245, 0.35);
}

.cma-btn--primary:active {
  transform: scale(0.98);
}

.cma-btn--ghost {
  background: color-mix(in srgb, var(--cma-navy) 8%, var(--cma-card));
  color: var(--cma-navy-deep);
  border: 1.5px solid var(--cma-line);
}

/* Tablet + desktop (explain page only — does not touch Clear Market app shell) */
@media (min-width: 600px) {
  .cma-page .cma-main {
    max-width: 560px;
    padding:
      24px
      calc(24px + env(safe-area-inset-right, 0px))
      calc(36px + env(safe-area-inset-bottom, 0px))
      calc(24px + env(safe-area-inset-left, 0px));
  }

  .cma-page .cma-topbar {
    padding-left: max(calc(20px + env(safe-area-inset-left, 0px)), calc((100% - 560px) / 2 + 12px));
    padding-right: max(calc(20px + env(safe-area-inset-right, 0px)), calc((100% - 560px) / 2 + 12px));
  }

  .cma-page .cma-hook {
    padding: 22px 20px 18px;
  }

  .cma-page .cma-hook__headline {
    font-size: 1.28rem;
  }

  .cma-page .cma-hero__title {
    font-size: 2.6rem;
  }

  .cma-page .cma-flip-card__inner {
    min-height: 320px;
  }
}

@media (min-width: 900px) {
  .cma-page {
    font-size: 16px;
  }

  .cma-page .cma-main {
    max-width: 680px;
    padding:
      32px
      calc(28px + env(safe-area-inset-right, 0px))
      calc(48px + env(safe-area-inset-bottom, 0px))
      calc(28px + env(safe-area-inset-left, 0px));
  }

  .cma-page .cma-topbar {
    padding-top: calc(env(safe-area-inset-top, 0px) + var(--clearli-top-inset-extra, 0px) + 14px);
    padding-bottom: 14px;
    padding-left: max(calc(28px + env(safe-area-inset-left, 0px)), calc((100% - 680px) / 2 + 16px));
    padding-right: max(calc(28px + env(safe-area-inset-right, 0px)), calc((100% - 680px) / 2 + 16px));
  }

  .cma-page .cma-hook,
  .cma-page .cma-steps,
  .cma-page .cma-note,
  .cma-page .cma-bags-why {
    padding: 20px 22px 22px;
  }

  .cma-page .cma-section-title {
    font-size: 1.25rem;
  }

  .cma-page .cma-bags-why__text,
  .cma-page .cma-step__text {
    font-size: 14px;
  }

  .cma-page .cma-actions {
    flex-direction: row;
    align-items: stretch;
    gap: 12px;
  }

  .cma-page .cma-btn {
    flex: 1;
  }

  .cma-page .cma-flip-hint {
    font-size: 12px;
  }
}

@media (min-width: 1200px) {
  .cma-page .cma-main {
    max-width: 720px;
  }

  .cma-page .cma-topbar {
    padding-left: max(calc(32px + env(safe-area-inset-left, 0px)), calc((100% - 720px) / 2 + 20px));
    padding-right: max(calc(32px + env(safe-area-inset-right, 0px)), calc((100% - 720px) / 2 + 20px));
  }
}
