/* ============================================================
   CardXchange — Public site  (v2 · elevated)
   Landing · Rates & Converter
   ============================================================ */

body.public { display: flex; flex-direction: column; min-height: 100vh; }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.88);
  border-bottom-color: var(--line);
  box-shadow: 0 6px 24px rgba(23, 17, 49, 0.06);
}
.site-header .inner {
  display: flex; align-items: center; gap: 28px;
  min-height: 78px;
}
.site-nav { display: flex; gap: 4px; margin-left: 8px; }
.site-nav a {
  position: relative;
  padding: 9px 14px;
  border-radius: 10px;
  font-weight: 600; font-size: 14.5px;
  color: var(--ink-2);
  transition: color 0.14s ease;
}
.site-nav a:hover { color: var(--ink); text-decoration: none; }
.site-nav a::after {
  content: "";
  position: absolute; left: 14px; right: 14px; bottom: 4px;
  height: 2px; border-radius: 2px;
  background: var(--grad-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s var(--ease-out);
}
.site-nav a:hover::after, .site-nav a.is-active::after { transform: scaleX(1); }
.site-nav a.is-active { color: var(--ink); font-weight: 700; }

.header-cta { margin-left: auto; display: flex; align-items: center; gap: 20px; }
.header-cta .signin { font-weight: 700; color: var(--ink); font-family: var(--font-display); font-size: 16px; }
.header-cta .signin:hover { color: var(--accent); text-decoration: none; }

.nav-toggle { display: none; margin-left: auto; padding: 8px; border-radius: 10px; }
.nav-toggle span { display: block; width: 22px; height: 2.5px; background: var(--ink); border-radius: 2px; margin: 5px 0; }

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  padding: clamp(48px, 6.5vw, 96px) 0 clamp(40px, 5vw, 72px);
  overflow: clip;
}

/* Atmosphere: layered glows + dot grid + grain */
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.hero-bg .glow-a {
  position: absolute;
  top: -220px; right: -140px;
  width: 780px; height: 780px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.2) 0%, rgba(139, 92, 246, 0.07) 42%, transparent 68%);
  filter: blur(4px);
}
.hero-bg .glow-b {
  position: absolute;
  top: 120px; left: -260px;
  width: 640px; height: 640px;
  background: radial-gradient(circle, rgba(192, 38, 211, 0.1) 0%, rgba(192, 38, 211, 0.04) 45%, transparent 70%);
}
.hero-bg .grid-dots {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(76, 29, 149, 0.13) 1px, transparent 1.4px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 75% 65% at 42% 22%, #000 0%, transparent 68%);
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 42% 22%, #000 0%, transparent 68%);
}
.hero-bg .grain {
  position: absolute; inset: 0;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.05'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hero .inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(28px, 5vw, 76px);
  align-items: start;
}

.hero h1 {
  font-size: clamp(38px, 5.4vw, 66px);
  letter-spacing: -0.028em;
  line-height: 1.06;
}
.hero h1 .hl {
  font-style: italic;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .lede {
  margin: 24px 0 30px;
  font-size: 17.5px;
  line-height: 1.65;
  color: var(--ink-2);
  max-width: 46ch;
}
.hero .actions { display: flex; gap: 14px; flex-wrap: wrap; }

.rating-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(124, 58, 237, 0.09);
  border: 1px solid rgba(124, 58, 237, 0.16);
  color: var(--violet-700);
  font-weight: 700; font-size: 13.5px;
  padding: 7px 16px;
  border-radius: var(--r-pill);
  margin-bottom: 26px;
}
.rating-badge .star { color: #f59e0b; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: clamp(20px, 4vw, 52px);
  justify-content: start;
  margin-top: clamp(34px, 4vw, 56px);
}
.hero-stats .stat { position: relative; }
.hero-stats .stat + .stat::before {
  content: "";
  position: absolute; left: calc(-1 * clamp(10px, 2vw, 26px)); top: 8px; bottom: 8px;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--line-2), transparent);
}

/* ---------------- Quick-redeem widget ---------------- */
.quick-redeem { position: relative; }
.quick-redeem > .card {
  position: relative;
  --pad: 30px;
  padding: var(--pad);
  border-radius: var(--r-xl);
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(160deg, rgba(139, 92, 246, 0.4), rgba(139, 92, 246, 0.06) 38%, rgba(192, 38, 211, 0.18)) border-box;
  border: 1.5px solid transparent;
  box-shadow:
    0 1px 2px rgba(23, 17, 49, 0.05),
    0 16px 40px rgba(76, 29, 149, 0.12),
    0 40px 90px rgba(76, 29, 149, 0.12);
}
.quick-redeem .head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }

/* Ticket tear-line spanning the full card width, notches punched at the edges */
.quick-redeem .perf-divider { margin: 22px calc(-1 * var(--pad)) 0; }

.receive-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--grad-strip);
  border: 1px solid rgba(124, 58, 237, 0.14);
  border-radius: var(--r-md);
  padding: 17px 20px;
  margin: 20px 0;
}
.receive-strip .amount {
  font-family: var(--font-display);
  font-size: clamp(23px, 2.6vw, 31px);
  font-weight: 700;
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -0.02em;
  background: linear-gradient(100deg, var(--violet-700), var(--violet-500));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Compact inline currency picker inside the receive strip */
.cur-mini {
  appearance: none;
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.65);
  color: var(--violet-700);
  font-size: 12.5px; font-weight: 700;
  padding: 3px 22px 3px 9px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235b21b6' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
}
.cur-mini:focus { outline: none; border-color: var(--violet-500); }

.rate-chip {
  background: #ece4fb; color: var(--violet-700);
  font-weight: 700; font-size: 13px;
  font-variant-numeric: tabular-nums;
  padding: 5px 10px; border-radius: 8px;
}

.qr-footnote {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  margin-top: 14px;
  font-size: 12.5px; color: var(--ink-3);
}

.float-toast {
  position: absolute;
  left: -38px; bottom: -28px;
  z-index: 5;
  max-width: 330px;
  animation: floatSlow 6s ease-in-out infinite;
}
@keyframes floatSlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

/* Decorative mini brand chips drifting behind the widget */
.deco-chip {
  position: absolute;
  z-index: -1;
  opacity: 0.9;
  animation: floatSlow 7s ease-in-out infinite;
}
.deco-chip.a { top: -26px; right: -20px; animation-delay: -2s; transform: rotate(8deg); }
.deco-chip.b { bottom: 64px; right: -34px; animation-delay: -4s; transform: rotate(-7deg); }

/* ---------------- Brand marquee ---------------- */
.brand-strip { padding: clamp(30px, 4vw, 52px) 0 clamp(56px, 6vw, 88px); }
.brand-strip .eyebrow {
  font-size: 12.5px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 24px;
  display: flex; align-items: center; gap: 16px;
}
.brand-strip .eyebrow::after {
  content: "";
  flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--line-2), transparent);
}

.marquee {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  padding: 10px 0 16px;
}
.marquee-track {
  display: flex; gap: 18px;
  width: max-content;
  animation: marquee 36s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee .brand-tile { width: 158px; flex: 0 0 auto; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------------- Rates page ---------------- */
.page-head {
  position: relative;
  padding: clamp(36px, 5vw, 60px) 0 28px;
  overflow: clip;
}
.page-head .halo {
  position: absolute;
  top: -240px; left: 50%;
  transform: translateX(-50%);
  width: 900px; height: 480px;
  background: radial-gradient(ellipse, rgba(139, 92, 246, 0.14) 0%, transparent 65%);
  pointer-events: none;
}
.page-head .inner {
  position: relative;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
}
.page-head .sub {
  margin-top: 12px;
  color: var(--ink-2); font-size: 14.5px;
  display: flex; align-items: center; gap: 9px;
}
.page-head .sub .dot { background: var(--green-600); }

.rates-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 372px;
  gap: 28px;
  align-items: start;
  padding-bottom: clamp(48px, 6vw, 88px);
}

.rates-table-card { padding: 8px 20px; }
.rates-table tbody { transition: opacity 0.2s ease; }
.rates-table tbody.is-refreshing { opacity: 0; }
.rates-table .btn-sm { opacity: 0.92; }
.rates-table tr:hover .btn-sm { opacity: 1; }

.converter {
  position: sticky; top: 102px;
  border-radius: var(--r-xl);
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(160deg, rgba(139, 92, 246, 0.35), rgba(139, 92, 246, 0.05) 40%, rgba(192, 38, 211, 0.15)) border-box;
  border: 1.5px solid transparent;
}
.converter .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.converter .divider { border-top: 2px dashed var(--line-2); margin: 20px 0 14px; }
.converter .kv { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.converter .receive {
  font-family: var(--font-display);
  font-size: 30px; font-weight: 700;
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -0.02em;
  background: linear-gradient(100deg, var(--violet-700), var(--violet-500));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------------- Footer ---------------- */
.site-footer {
  position: relative;
  background:
    radial-gradient(ellipse 720px 320px at 82% -60px, rgba(124, 58, 237, 0.28), transparent 68%),
    radial-gradient(ellipse 560px 300px at 8% 110%, rgba(192, 38, 211, 0.12), transparent 70%),
    var(--navy);
  color: rgba(255, 255, 255, 0.72);
  padding: 54px 0 34px;
  margin-top: auto;
  overflow: clip;
}
.site-footer::before {          /* light hairline along the top edge */
  content: "";
  position: absolute; top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.55), transparent);
}
.site-footer .inner {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 36px; flex-wrap: wrap;
}
.site-footer .tagline { margin-top: 14px; font-size: 14px; max-width: 34ch; color: rgba(255, 255, 255, 0.55); }
.site-footer .cols { display: flex; gap: clamp(28px, 6vw, 84px); flex-wrap: wrap; }
.site-footer .col h5 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 14px; font-weight: 700;
  color: #fff;
}
.site-footer .col a { display: block; padding: 5px 0; color: rgba(255, 255, 255, 0.62); font-size: 14px; }
.site-footer .col a:hover { color: #fff; text-decoration: none; }
.site-footer .bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 44px; padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 12.5px; color: rgba(255, 255, 255, 0.45);
}
.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.22);
  color: #6ee7a0;
  font-size: 12.5px; font-weight: 600;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 1020px) {
  .hero .inner { grid-template-columns: 1fr; }
  .float-toast { position: static; margin-top: 16px; max-width: none; animation: none; }
  .deco-chip { display: none; }
  .rates-layout { grid-template-columns: 1fr; }
  .converter { position: static; }
}

@media (max-width: 720px) {
  .site-nav, .header-cta .signin { display: none; }
  .nav-toggle { display: block; }
  .site-header.nav-open .site-nav {
    display: flex; flex-direction: column;
    position: absolute; left: 0; right: 0; top: 100%;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    padding: 12px var(--gutter) 18px;
    box-shadow: var(--shadow-card);
  }
  .site-nav a::after { display: none; }
  .hero-stats { grid-template-columns: repeat(2, auto); row-gap: 24px; }
  .hero-stats .stat:nth-child(odd)::before { display: none; }
  .converter .row2 { grid-template-columns: 1fr; }
  .quick-redeem > .card { --pad: 22px; }
}

/* ============================================================
   QA pass — responsive polish (visual QA sweep)
   ============================================================ */

/* Keep single-line labels from wrapping mid-word anywhere */
.site-nav a,
.header-cta .signin,
.site-header .logo-sub { white-space: nowrap; }

/* Hero stats: "< 8 min" must never break into two lines; slightly
   tighter gaps so all four labels keep a single line at desktop */
.hero-stats .stat .v { white-space: nowrap; }
.hero-stats { gap: clamp(20px, 3vw, 44px); }

/* Rates page-head subline: when the text wraps on narrow screens,
   pin the live-dot to the first line instead of floating mid-block */
.page-head .sub { align-items: flex-start; }
.page-head .sub .dot { flex: 0 0 auto; margin-top: 7px; }

/* Restore horizontal swipe on the rates table: `.card { overflow: clip }`
   (components.css, loaded after base.css) beats `.scroll-x { overflow-x:
   auto }`, leaving the table clipped and unscrollable on narrow screens */
.rates-table-card { overflow-x: auto; }

/* Contain the screen-reader-only <th> label: absolutely positioned
   .visually-hidden otherwise resolves against the page and drags a 1px
   box past the card's scroll container, forcing page-wide horizontal
   scroll on phones */
.rates-table th { position: relative; }


/* Quick-redeem: keep typed value clear of the rate chip overlay */
.quick-redeem .input-wrap .input { padding-right: 96px; }

/* Desktop: drop the floating payout toast low enough that it no
   longer covers the card's reassurance footnote */
@media (min-width: 1021px) {
  .float-toast { left: -46px; bottom: -50px; }
}

/* Tablet (721–1020px): the full nav + CTAs no longer fit without
   wrapping, so collapse to the hamburger earlier. "Sign in" and the
   CTA button stay visible beside the toggle. */
@media (max-width: 1020px) {
  .site-nav { display: none; }
  .nav-toggle { display: block; }
  .site-header .inner { gap: 16px; }
  .header-cta { gap: 14px; }
  .site-header.nav-open .site-nav {
    display: flex; flex-direction: column;
    position: absolute; left: 0; right: 0; top: 100%;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    padding: 12px var(--gutter) 18px;
    box-shadow: var(--shadow-card);
  }
  .site-nav a::after { display: none; }
  /* Rates table: once the card scrolls horizontally, wrapped cells
     ("E-" / "CODE" / "RATE", split ranges, 3-line sublabels) read
     badly — keep every cell on one line and let the card swipe.
     Desktop (>1020px) keeps the original wrapping headers so the
     gift-card column is never starved of width. */
  .rates-table .entity .s { white-space: nowrap; }
  .rates-table th { white-space: nowrap; }
  .rates-table td.muted { white-space: nowrap; }
}

/* Mobile menu: surface Sign in inside the dropdown once the header
   link is hidden (≤720px). Hidden everywhere else. */
.site-nav .nav-signin { display: none; }
@media (max-width: 720px) {
  .site-header.nav-open .site-nav .nav-signin {
    display: block;
    margin-top: 6px; padding-top: 14px;
    border-top: 1px solid var(--line);
  }
  /* Compact header so logo + CTA + toggle fit without page scroll */
  .site-header .inner { min-height: 64px; gap: 12px; }
  .header-cta { gap: 10px; }
  .header-cta .btn { padding: 10px 16px; font-size: 14px; }
}

/* Small phones: mark-only logo lockup so the CTA never collides */
@media (max-width: 520px) {
  .site-header .logo > span { display: none; }
  .site-header .logo-mark { height: 38px; }
}

/* Small phones: receive strip must fit inside the card */
@media (max-width: 480px) {
  .receive-strip { flex-wrap: wrap; padding: 15px 16px; }
  .receive-strip .amount { font-size: 22px; }
  .rate-chip { font-size: 12px; padding: 4px 8px; }
  .quick-redeem .input-wrap .input { padding-right: 84px; }
}

/* ============================================================
   FAQ section (admin-managed content)
   ============================================================ */
.faq-section { padding: clamp(40px, 6vw, 88px) 0 clamp(56px, 7vw, 100px); }
.faq-head { text-align: center; max-width: 46ch; margin: 0 auto clamp(28px, 4vw, 44px); }
.faq-head h2 { font-size: clamp(26px, 3.4vw, 38px); letter-spacing: -0.02em; }
.faq-head .muted { margin-top: 10px; font-size: 16px; }

.faq-list { max-width: 820px; margin-inline: auto; display: grid; gap: 12px; }

.faq-item {
  background: var(--surface);
  border: var(--edge);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  overflow: clip;
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}
.faq-item[open] { box-shadow: var(--shadow-card); border-color: var(--violet-100); }

.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 24px;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-display);
  font-size: 17px; font-weight: 700;
  color: var(--ink);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: var(--violet-700); }

.faq-item .chev {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--violet-50);
  color: var(--violet-600);
  font-size: 18px; font-weight: 700;
  transition: transform 0.22s var(--ease-out), background 0.18s ease;
}
.faq-item[open] .chev { transform: rotate(45deg); background: var(--violet-100); }

.faq-answer {
  padding: 0 24px 22px;
  font-size: 15.5px; line-height: 1.7;
  color: var(--ink-2);
  max-width: 68ch;
}

@media (max-width: 560px) {
  .faq-item summary { padding: 16px 18px; font-size: 15.5px; }
  .faq-answer { padding: 0 18px 18px; font-size: 14.5px; }
}
