:root {
  --wine: #43121E;          /* brand background */
  --wine-deep: #370E18;
  --wine-soft: #521C2A;     /* watermark / raised surfaces */
  --ivory: #FBF4EF;         /* brand text */
  --ivory-2: rgba(251, 244, 239, .78);
  --muted: rgba(251, 244, 239, .58);
  --line: rgba(251, 244, 239, .16);
  --blush: #E9CFC7;
  --ok: #F1E4DC;
  --radius: 18px;
  --serif: 'Cormorant Garamond', 'Garamond', 'Times New Roman', serif;
  --script: 'Great Vibes', 'Edwardian Script ITC', cursive;
  --ar-body: 'Jost', 'Segoe UI', Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100dvh;
  background: radial-gradient(130% 80% at 80% 100%, var(--wine-deep) 0%, transparent 60%), var(--wine);
  color: var(--ivory);
  font-family: var(--ar-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  position: relative;
}

/* Giant faint "B" watermark, as in the brand artwork */
body::before {
  content: 'B';
  position: fixed;
  left: -0.08em;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--serif);
  font-weight: 500;
  font-size: min(150vw, 980px);
  line-height: .8;
  color: var(--wine-soft);
  opacity: .9;
  pointer-events: none;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 440px;
  margin: 0 auto;
  padding: calc(56px + env(safe-area-inset-top)) 20px calc(32px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 24px;
}

/* ── Brand lockup: SHEIN  By  BALQEES ──── */
.brand { text-align: center; }
.logo {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 2.4vw, 12px);
  font-weight: 500;
  line-height: 1;
}
.logo-word {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(17px, 5.3vw, 26px);
  letter-spacing: .24em;
  margin-right: -.24em;         /* balance trailing letter-spacing */
  color: var(--ivory);
}
.logo-by {
  font-family: var(--script);
  font-size: clamp(48px, 15vw, 72px);
  line-height: .8;
  color: var(--ivory);
  transform: translateY(.14em);
  padding: 0 .04em;
}
.tagline { margin: 22px 0 0; color: var(--ivory-2); font-size: 15.5px; line-height: 1.7; text-wrap: balance; }

/* ── Coupon ────────────────────────────── */
.coupon {
  background: rgba(251, 244, 239, .06);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.coupon-label { font-size: 13px; color: var(--muted); letter-spacing: .02em; }
.code {
  all: unset;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 12px;
  padding: 10px 14px 10px 18px;
  border: 1.5px dashed rgba(251, 244, 239, .55);
  border-radius: 12px;
}
.code #code {
  font-family: var(--serif);
  font-size: 30px; font-weight: 600; letter-spacing: .16em; color: var(--ivory);
  font-variant-numeric: lining-nums;
}
.copy-chip {
  font-size: 13px; font-weight: 600;
  background: var(--ivory); color: var(--wine);
  padding: 6px 12px; border-radius: 999px;
}
.code:focus-visible { outline: 2px solid var(--blush); outline-offset: 3px; }
.coupon-hint { font-size: 12.5px; color: var(--muted); }

/* ── CTA ───────────────────────────────── */
.cta {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 60px;
  padding: 0 22px;
  border-radius: 16px;
  background: var(--ivory);
  color: var(--wine);
  text-decoration: none;
  font-size: 18px; font-weight: 600;
  box-shadow: 0 16px 32px -16px rgba(0, 0, 0, .55);
  transition: transform .12s ease, box-shadow .12s ease;
}
.cta svg { width: 20px; height: 20px; fill: none; stroke: var(--wine); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.cta:active { transform: scale(.98); box-shadow: 0 6px 14px -8px rgba(0, 0, 0, .5); }
.cta:focus-visible { outline: 2px solid var(--blush); outline-offset: 3px; }
.cta.small { min-height: 52px; font-size: 16px; }

.web-link {
  align-self: center;
  color: var(--ivory-2);
  font-size: 14px;
  text-decoration: underline;
  text-decoration-color: rgba(251, 244, 239, .35);
  text-underline-offset: 5px;
  padding: 4px 8px;
  margin-top: -8px;
}

/* ── Steps ─────────────────────────────── */
.steps {
  list-style: none; margin: 4px 0 0; padding: 18px 0 0;
  border-top: 1px solid var(--line);
  display: grid; gap: 12px;
}
.steps li { display: flex; align-items: center; gap: 12px; font-size: 14.5px; color: var(--ivory-2); }
.steps b {
  flex: none;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid rgba(251, 244, 239, .45);
  color: var(--ivory);
  font-family: var(--serif);
  font-size: 15px; font-weight: 600;
}

.footnote { text-align: center; font-size: 11.5px; color: var(--muted); margin: 6px 0 0; }

/* ── In-app browser banner ─────────────── */
.inapp {
  position: fixed; inset: 0 0 auto 0;
  padding: calc(12px + env(safe-area-inset-top)) 20px 12px;
  background: var(--ivory); color: var(--wine);
  display: flex; flex-direction: column; gap: 2px;
  text-align: center; font-size: 14px;
  box-shadow: 0 6px 20px -8px rgba(0,0,0,.45);
  z-index: 20;
}
.inapp[hidden] { display: none; }
body.has-inapp .page { padding-top: calc(120px + env(safe-area-inset-top)); }

/* ── Fallback sheet ────────────────────── */
.sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(20, 4, 9, .55);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 30;
  animation: fade .18s ease;
}
.sheet-backdrop[hidden] { display: none; }
.sheet {
  width: 100%; max-width: 480px;
  background: var(--ivory);
  color: var(--wine);
  border-radius: 22px 22px 0 0;
  padding: 24px 20px calc(20px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 14px;
  text-align: center;
  animation: up .22s ease;
}
.sheet h2 { margin: 0; font-size: 20px; }
.sheet p { margin: 0; color: #6B3A45; font-size: 14.5px; line-height: 1.7; }
.sheet .cta { background: var(--wine); color: var(--ivory); }
.sheet .web-link { margin-top: 0; color: var(--wine); text-decoration-color: rgba(67, 18, 30, .3); }
.close { all: unset; cursor: pointer; align-self: center; color: #8A5E67; font-size: 14px; padding: 6px 12px; }

/* ── Toast ─────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  background: var(--ok); color: var(--wine);
  padding: 10px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 40;
  white-space: nowrap;
  box-shadow: 0 10px 24px -12px rgba(0,0,0,.5);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(30px); opacity: .6; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
