/*
 * "Earn with Tilted": the Agent Program presentation (a swipeable
 * full-screen deck) that the "Earn" menu link opens. Builds on the brand
 * tokens in brand.css and the page classes in index.html (.eyebrow, .hl,
 * .sg, .btn). Gold marks money, as everywhere else on the site.
 */

/* ---------- the deck ---------- */
html.deck-open { overflow: hidden; }
dialog.deck {
  margin: auto; padding: 0; border: 1px solid var(--shell-800); border-radius: 20px;
  width: min(980px, calc(100vw - 32px)); height: min(740px, calc(100dvh - 32px));
  max-width: none; max-height: none; overflow: hidden;
  background:
    radial-gradient(ellipse 60% 50% at 100% 0%, rgba(220, 174, 63, 0.10), transparent 60%),
    radial-gradient(ellipse 70% 60% at 0% 0%, rgba(52, 179, 241, 0.14), transparent 60%),
    var(--shell-950);
  color: var(--ink);
  box-shadow: 0 50px 110px -30px rgba(0, 0, 0, 0.8);
}
/* the dialog takes focus when it opens; that needs no outline of its own */
dialog.deck:focus { outline: none; }
dialog.deck::backdrop { background: rgba(6, 12, 24, 0.82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
@media (max-width: 640px) {
  dialog.deck { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
}
.deck-shell { display: grid; grid-template-rows: auto 1fr auto; height: 100%; }

.deck-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) 20px 14px; border-bottom: 1px solid var(--shell-800);
}
.deck-top .caps { color: var(--money-400); }
.deck-count { font-size: 13px; color: var(--slate-400); font-variant-numeric: tabular-nums; margin-left: auto; }
.deck-count b { color: var(--ink); font-weight: 600; }
.deck-close {
  width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; cursor: pointer;
  border-radius: 50%; border: 1px solid var(--shell-700); background: transparent; color: var(--slate-300);
}
.deck-close:hover { color: var(--ink); border-color: var(--slate-500); }
.deck-close svg { width: 16px; height: 16px; }

.deck-track {
  display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain; scrollbar-width: none; min-height: 0;
}
.deck-track::-webkit-scrollbar { display: none; }
.deck-track:focus-visible { outline: 2px solid var(--brand-400); outline-offset: -4px; }
.slide {
  flex: 0 0 100%; min-width: 0; scroll-snap-align: start; scroll-snap-stop: always;
  display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior-y: contain;
  padding: clamp(24px, 5vw, 52px) clamp(20px, 5vw, 60px);
}
/* margin:auto centres short slides and still lets tall ones scroll from the top */
.slide-inner { margin: auto 0; width: 100%; display: flex; flex-direction: column; gap: 18px; }
.slide h2 { font-size: clamp(38px, 6vw, 66px); line-height: 0.95; text-wrap: balance; }
.slide .lede { font-size: clamp(16px, 1.8vw, 18px); color: var(--slate-300); max-width: 56ch; text-wrap: pretty; }
.slide .note { font-size: 13.5px; color: var(--slate-400); }
.slide .note b { color: var(--slate-200); font-weight: 600; }
.money { color: var(--money-400); }

.deck-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px max(14px, env(safe-area-inset-bottom)); border-top: 1px solid var(--shell-800);
}
.deck-dots { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.deck-dot {
  width: 8px; height: 8px; padding: 0; border: 0; border-radius: var(--radius-pill); cursor: pointer;
  background: var(--shell-700); transition: width 0.25s var(--ease-out), background-color 0.25s ease;
}
.deck-dot[aria-current="true"] { width: 26px; background: var(--money-500); }
/* dots are 8px to look right; this widens what a thumb can hit */
.deck-dot { position: relative; }
.deck-dot::before { content: ""; position: absolute; inset: -10px -4px; }
.deck-btn { min-height: 44px !important; padding: 10px 18px !important; font-size: 14px !important; width: auto !important; }
.deck-btn:disabled { visibility: hidden; }
.deck-btn svg { width: 16px; height: 16px; }
@media (max-width: 640px) {
  /* room for all eight dots on one line */
  .deck-nav { gap: 8px; padding-inline: 14px; }
  .deck-dots { gap: 6px; flex-wrap: nowrap; }
  .deck-btn[data-deck-prev] { font-size: 0 !important; padding: 10px 13px !important; }
}

/* ---------- slide parts ---------- */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 8px; }
.stat {
  padding: 18px; border-radius: var(--radius-md); background: var(--shell-900); border: 1px solid var(--shell-800);
  display: flex; flex-direction: column; gap: 6px;
}
.stat b { font-family: var(--font-display); font-weight: 800; font-size: clamp(30px, 4vw, 42px); line-height: 1; color: var(--money-400); text-transform: uppercase; }
.stat span { font-size: var(--caps-size); font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--slate-400); }
.swipe-hint { display: none; font-size: 13px; color: var(--slate-400); }
@media (max-width: 640px) {
  .stat-row { grid-template-columns: 1fr; }
  .stat { flex-direction: row; align-items: baseline; gap: 12px; padding: 14px 16px; }
  .swipe-hint { display: block; }
}

.step-list { list-style: none; display: grid; gap: 12px; counter-reset: step; }
.step-list li {
  display: grid; grid-template-columns: 34px 1fr; gap: 14px; align-items: start;
  padding: 16px 18px; border-radius: var(--radius-md); background: var(--shell-900); border: 1px solid var(--shell-800);
}
.step-list li::before {
  counter-increment: step; content: counter(step);
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-500); color: var(--shell-950); font-family: var(--font-display); font-weight: 800; font-size: 18px;
}
.step-list b { display: block; font-size: 16px; color: var(--ink); margin-bottom: 2px; }
.step-list p { color: var(--slate-300); font-size: 14.5px; }
.earn-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.earn-two div { padding: 12px 14px; border-radius: 10px; background: var(--shell-950); border: 1px solid var(--shell-700); }
.earn-two b { font-family: var(--font-display); font-size: 30px; line-height: 1; color: var(--money-400); margin: 0 0 4px; }
.earn-two span { font-size: 13px; color: var(--slate-300); }

.tiers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tier {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 18px; border-radius: var(--radius-md); background: var(--shell-900); border: 1px solid var(--shell-700);
}
.tier .caps { color: var(--slate-400); }
.tier .refs { font-family: var(--font-display); font-weight: 800; font-size: 44px; line-height: 0.9; }
.tier .refs small { display: block; font-family: var(--font-sans); font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--slate-400); margin-top: 6px; }
.tier .rate { display: flex; align-items: baseline; gap: 8px; border-top: 1px solid var(--shell-800); padding-top: 10px; }
.tier .rate b { font-family: var(--font-display); font-weight: 800; font-size: 32px; line-height: 1; color: var(--money-400); }
.tier .rate span { font-size: 12.5px; color: var(--slate-300); line-height: 1.3; }
.tier.top { border-color: rgba(220, 174, 63, 0.6); background: linear-gradient(180deg, rgba(220, 174, 63, 0.10), var(--shell-900) 60%); }
.tier.top::after {
  content: "Top tier"; position: absolute; top: -10px; right: 14px; padding: 2px 10px; border-radius: var(--radius-pill);
  background: var(--money-500); color: var(--onmoney); font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
}
.tier.beyond { border-style: dashed; border-color: rgba(220, 174, 63, 0.5); background: transparent; }
.tier.beyond p { font-size: 13.5px; color: var(--slate-300); }
@media (max-width: 760px) {
  /* one row per tier: the count on the left, its two rates on the right */
  .tiers { grid-template-columns: 1fr; gap: 10px; }
  .tier { display: grid; grid-template-columns: 84px 1fr; column-gap: 16px; row-gap: 8px; align-items: center; padding: 14px 16px; }
  .tier .caps { grid-column: 1 / -1; }
  .tier .refs { grid-row: span 2; font-size: 40px; }
  .tier .rate { border-top: 0; padding-top: 0; }
  .tier .rate b { font-size: 28px; }
  .tier.beyond p { grid-row: span 2; }
}

.rules { list-style: none; display: grid; gap: 12px; }
.rules li { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; font-size: 15.5px; color: var(--slate-200); }
.rules li .sg { width: 16px; height: 16px; margin-top: 4px; color: var(--money-400); }
.rules li:nth-child(even) .sg { color: var(--brand-400); }
.rules b { color: var(--ink); font-weight: 600; }

.story { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.story-step { padding: 16px; border-radius: var(--radius-md); background: var(--shell-900); border: 1px solid var(--shell-800); display: flex; flex-direction: column; gap: 12px; }
.story-step .caps { color: var(--money-400); }
.story-step b { font-size: 16px; color: var(--ink); }
.story-step p { font-size: 14px; color: var(--slate-300); }
.diagram { display: flex; align-items: center; gap: 6px; min-height: 52px; flex-wrap: wrap; }
.node {
  display: grid; place-items: center; flex-shrink: 0; border-radius: 50%;
  width: 40px; height: 40px; font-family: var(--font-display); font-weight: 800; font-size: 19px;
}
.node.a { background: var(--money-500); color: var(--onmoney); }
.node.b { background: var(--brand-500); color: var(--shell-950); }
.node.p { width: 14px; height: 14px; background: var(--slate-400); }
.link-line { width: 22px; height: 2px; background: var(--shell-600); flex-shrink: 0; }
.link-line.dash { background: repeating-linear-gradient(90deg, var(--money-500) 0 4px, transparent 4px 8px); }
.node-group { display: flex; gap: 4px; }
.badge-agent { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brand-400); border: 1px solid rgba(52, 179, 241, 0.4); border-radius: var(--radius-pill); padding: 2px 8px; }
@media (max-width: 760px) { .story { grid-template-columns: 1fr; } }

.week { display: flex; align-items: stretch; gap: 6px; flex-wrap: wrap; }
.day {
  flex: 1 1 0; min-width: 40px; padding: 12px 4px; text-align: center; border-radius: 10px;
  background: var(--shell-900); border: 1px solid var(--shell-800);
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--slate-300);
}
.payday {
  flex: 1 1 100%; display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 6px;
  padding: 14px; border-radius: 12px; background: var(--money-500); color: var(--onmoney);
  font-family: var(--font-display); font-weight: 800; font-size: 22px; text-transform: uppercase; letter-spacing: 0.04em;
}
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.fact { padding: 16px; border-radius: var(--radius-md); background: var(--shell-900); border: 1px solid var(--shell-800); }
.fact .caps { color: var(--slate-400); display: block; margin-bottom: 6px; }
.fact b { font-size: 16px; color: var(--ink); font-weight: 600; }
@media (max-width: 760px) { .facts { grid-template-columns: 1fr; } }

.slide-final .slide-inner { align-items: center; text-align: center; }
.slide-final img { height: clamp(90px, 14vw, 130px); width: auto; }
.slide-final .tagline { font-family: var(--font-display); font-weight: 800; font-size: clamp(18px, 2.4vw, 24px); letter-spacing: 0.12em; text-transform: uppercase; color: var(--slate-200); display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; }
.slide-final .tagline i { font-style: normal; color: var(--money-400); }
.final-ctas { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
@media (max-width: 640px) { .final-ctas { flex-direction: column; align-self: stretch; } }

@media (prefers-reduced-motion: reduce) { .deck-dot { transition: none; } }
