/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  /* Brand colours */
  --orange:           #ff8c00;
  --orange-light:     #ffaa33;
  --orange-dim:       rgba(255, 140, 0, 0.13);
  --orange-glow:      rgba(255, 140, 0, 0.30);
  --red:              #e84000;

  /* Surfaces */
  --bg:               #0d0a07;
  --card-bg:          rgba(255, 160, 60, 0.038);
  --card-border:      rgba(255, 140, 0, 0.15);

  /* Primary button */
  --btn-p-from:       #ff7a00;
  --btn-p-to:         #ff3c00;
  --btn-p-shadow:     0 4px 22px rgba(255, 100, 0, 0.42);
  --btn-p-glow:       0 6px 38px rgba(255, 100, 0, 0.60);

  /* Text */
  --text:             #f5ede0;
  --text-muted:       #8c7e6a;
  --text-faint:       #3a2410;

  /* Layout */
  --divider:          rgba(255, 255, 255, 0.07);
  --r-card:           20px;
  --r-btn:            14px;

  /* Motion */
  --ease:             cubic-bezier(0.22, 1, 0.36, 1);
  --t:                0.22s;

  /* Font */
  --font:             'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ============================================================
   BASE — mobile first
   ============================================================ */
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50%   0%,  rgba(255, 120,  0, 0.10) 0%, transparent 60%),
    radial-gradient(ellipse 55% 40% at 90% 100%,  rgba(255,  60,  0, 0.07) 0%, transparent 60%),
    linear-gradient(160deg, #0d0a07 0%, #1a0e08 55%, #130c07 100%);
  min-height: 100dvh;
  color: var(--text);
  display: flex;
  align-items: flex-start;       /* top-align on mobile so card is near thumb reach */
  justify-content: center;
  padding: 24px 14px 130px;      /* bottom clears sticky bar */
  overflow-x: hidden;
  position: relative;
}

@media (min-width: 640px) {
  body { align-items: center; padding: 40px 20px 60px; }
}

/* ============================================================
   BG ORBS
   ============================================================ */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.bg-orb--1 {
  width: 560px; height: 560px;
  background: radial-gradient(circle, rgba(255, 130, 0, 0.08) 0%, transparent 65%);
  top: -220px; right: -180px;
  animation: drift 22s ease-in-out infinite alternate;
}

.bg-orb--2 {
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(255, 70, 0, 0.06) 0%, transparent 65%);
  bottom: -140px; left: -130px;
  animation: drift 28s ease-in-out infinite alternate-reverse;
}

@keyframes drift {
  from { transform: translate(0, 0); }
  to   { transform: translate(18px, 14px); }
}

/* ============================================================
   LAYOUT
   ============================================================ */
.wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
}

/* ============================================================
   CARD
   ============================================================ */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r-card);
  padding: 28px 20px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow:
    0 0 0 1px rgba(255, 120, 0, 0.09),
    0 20px 60px rgba(0, 0, 0, 0.60),
    inset 0 1px 0 rgba(255, 160, 60, 0.06);
  display: flex;
  flex-direction: column;
  gap: 26px;
  animation: cardIn 0.5s var(--ease) both;
  /* top accent line */
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 8%; width: 84%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,140,0,0.45), transparent);
  pointer-events: none;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

@media (min-width: 640px) {
  .card { padding: 36px 32px; gap: 28px; }
}

/* ============================================================
   BRAND
   ============================================================ */
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.brand__logo-wrap {
  width: 72px; height: 72px;
  border-radius: 18px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,140,0,0.07);
  border: 1px solid rgba(255,140,0,0.18);
  box-shadow:
    0 0 0 5px rgba(255,140,0,0.05),
    0 10px 32px rgba(255,140,0,0.20);
  flex-shrink: 0;
}

.brand__logo-wrap--fallback {
  background: linear-gradient(135deg, rgba(255,140,0,0.18), rgba(220,38,38,0.12));
}

.brand__logo {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}

.brand__name {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ============================================================
   HEADER
   ============================================================ */
.card__header {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.eyebrow {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange);
  opacity: 0.8;
}

.subtitle {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 2px;
}

.title {
  font-size: clamp(1.35rem, 5vw, 1.8rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text);
  word-break: break-word;
}

.title__file {
  color: var(--orange-light);
  word-break: break-word;
}

/* ============================================================
   PROGRESS  (slim, low visual weight)
   ============================================================ */
.progress-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.progress-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--t) ease;
}

.progress-status.done { color: var(--orange-light); }

.progress-status__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
  flex-shrink: 0;
  transition: background var(--t) ease, box-shadow var(--t) ease;
}

.progress-status__dot.active {
  background: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-dim);
  animation: dotPulse 1.4s ease-in-out infinite;
}

.progress-status__dot.done {
  background: var(--orange-light);
  box-shadow: 0 0 0 3px var(--orange-dim);
  animation: none;
}

@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--orange-dim); }
  50%       { box-shadow: 0 0 0 6px rgba(255,140,0,0.06); }
}

.progress-pct {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--orange-light);
  font-variant-numeric: tabular-nums;
  min-width: 32px;
  text-align: right;
  flex-shrink: 0;
}

.progress-track {
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.05);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--red), var(--orange), #ffd54a);
  box-shadow: 0 0 6px rgba(255,140,0,0.28);
  transition: width 80ms linear;
  will-change: width;
}

/* ============================================================
   DOWNLOAD SECTION
   ============================================================ */
.download-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* ── Base button ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: var(--r-btn);
  font-family: var(--font);
  font-weight: 700;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  border: none;
  transition:
    transform   0.12s ease,
    box-shadow  var(--t) ease,
    opacity     var(--t) ease,
    background  0.12s ease;
}

/* ── Primary button ──────────────────────────────────────── */
.btn--primary {
  width: 100%;
  padding: 17px 22px;           /* large tap target */
  font-size: 1rem;
  letter-spacing: 0.01em;
  color: rgba(255,255,255,0.6);
  background: linear-gradient(135deg, var(--btn-p-from), var(--btn-p-to));
  box-shadow: none;
  opacity: 0.5;
  pointer-events: none;
  cursor: default;
}

/* Loading / ready inner states */
.btn__state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.btn--primary .btn__state--ready   { display: none; }
.btn--primary .btn__state--loading { display: flex; }
.btn--primary.ready .btn__state--loading { display: none; }
.btn--primary.ready .btn__state--ready   { display: flex; }

/* Spinner */
.btn__spinner {
  width: 17px; height: 17px;
  flex-shrink: 0;
  animation: spin 0.85s linear infinite;
  opacity: 0.75;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Primary — ready state */
.btn--primary.ready {
  opacity: 1;
  pointer-events: auto;
  color: #fff;
  box-shadow: var(--btn-p-shadow);
  cursor: pointer;
  animation: btnPopIn 0.4s var(--ease), btnPulse 2.8s ease-in-out 0.4s infinite;
}

.btn--primary.ready:hover,
.btn--primary.ready:focus-visible {
  background: linear-gradient(135deg, var(--orange-light), var(--orange));
  box-shadow: var(--btn-p-glow);
  transform: translateY(-2px) scale(1.03);
  animation: none;
}

.btn--primary.ready:active {
  transform: scale(0.96);
  box-shadow: 0 2px 14px rgba(249,115,22,0.3);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  animation: none;
}

@keyframes btnPopIn {
  0%  { transform: scale(0.95); opacity: 0.55; box-shadow: none; }
  65% { transform: scale(1.02); }
  100%{ transform: scale(1);    opacity: 1;    box-shadow: var(--btn-p-shadow); }
}

@keyframes btnPulse {
  0%   { box-shadow: var(--btn-p-shadow), 0 0 0 0   rgba(255,140,0,0); }
  50%  { box-shadow: var(--btn-p-glow),   0 0 0 8px rgba(255,140,0,0.09); }
  100% { box-shadow: var(--btn-p-shadow), 0 0 0 16px rgba(255,140,0,0); }
}

/* ── Secondary button ────────────────────────────────────── */
.btn--secondary {
  width: 100%;
  padding: 14px 22px;
  font-size: 0.88rem;
  letter-spacing: 0.01em;
  color: rgba(255,140,0,0.45);
  background: rgba(255,140,0,0.05);
  border: 1.5px solid rgba(255,140,0,0.18);
  opacity: 0.4;
  pointer-events: none;
  cursor: default;
}

.btn--secondary.ready {
  opacity: 1;
  pointer-events: auto;
  color: var(--orange-light);
  border-color: rgba(255,140,0,0.38);
  cursor: pointer;
  animation: fadeIn 0.4s var(--ease) both;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.btn--secondary.ready:hover,
.btn--secondary.ready:focus-visible {
  background: rgba(255,140,0,0.1);
  border-color: rgba(255,140,0,0.55);
  transform: scale(1.02);
  box-shadow: 0 4px 18px rgba(255,140,0,0.15);
}

.btn--secondary.ready:active {
  transform: scale(0.97);
  transition: transform 0.08s ease;
}

/* ── Shared icon ─────────────────────────────────────────── */
.btn__icon {
  width: 17px; height: 17px;
  flex-shrink: 0;
}

/* ── Hint & source ───────────────────────────────────────── */
.cta-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  transition: color var(--t) ease;
}

.cta-hint.ready { color: var(--orange-light); }

.cta-source {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-faint);
}

.cta-source svg { width: 11px; height: 11px; flex-shrink: 0; }

/* ============================================================
   DIVIDER
   ============================================================ */
.divider {
  border: none;
  border-top: 1px solid var(--divider);
  margin: 0;
}

/* ============================================================
   FILE META  (single centered line)
   ============================================================ */
.file-meta {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  opacity: 0.72;
  letter-spacing: 0.015em;
}

/* ============================================================
   TRUST BADGES
   ============================================================ */
.trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.trust__badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
}

.trust__badge svg {
  width: 14px; height: 14px;
  color: var(--orange);
  opacity: 0.90;
  flex-shrink: 0;
}

.trust__sep {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--text-faint);
  flex-shrink: 0;
}

/* ============================================================
   STICKY MOBILE CTA
   ============================================================ */
.sticky-cta {
  display: none;                 /* hidden until JS reveals + media query */
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(13, 9, 5, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 140, 0, 0.18);
  transform: translateY(100%);
  transition: transform 0.38s var(--ease);
}

.sticky-cta.visible { transform: translateY(0); }
.sticky-cta.scroll-hidden { transform: translateY(100%); }

.btn--sticky {
  width: 100%;
  padding: 16px 20px;
  font-size: 0.96rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--btn-p-from), var(--btn-p-to));
  box-shadow: var(--btn-p-shadow);
  letter-spacing: 0.01em;
}

.btn--sticky:hover,
.btn--sticky:focus-visible {
  background: linear-gradient(135deg, var(--orange-light), var(--orange));
  transform: translateY(-1px);
  box-shadow: var(--btn-p-glow);
}

.btn--sticky:active {
  transform: scale(0.97);
  transition: transform 0.08s ease;
}

/* ============================================================
   FOCUS (accessibility)
   ============================================================ */
.btn:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
}

/* ============================================================
   SCREEN-READER ONLY
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   RESPONSIVE — show sticky bar only on mobile
   ============================================================ */
@media (max-width: 639px) {
  .sticky-cta { display: block; }
}

@media (max-width: 360px) {
  .trust__sep { display: none; }
  .trust       { gap: 8px; }
  .trust__badge { font-size: 0.68rem; }
}
