/*
 * Built for the audience in the brief: most arrive in the Facebook in-app
 * browser, many are 50+. So body text starts at 18px, tap targets are at
 * least 48px tall, contrast is high, and nothing depends on hover.
 */

:root {
  --ink: #14211c;
  --ink-soft: #46564f;
  --ink-faint: #6d7c74;
  --paper: #fbfaf7;
  --surface: #ffffff;
  --rule: #ddd9d0;
  --rule-soft: #ebe8e1;
  --accent: #0b6b4f;
  --accent-dark: #075039;
  --accent-soft: #e6f0ea;
  --urgent: #a8431a;
  --urgent-soft: #fbeade;
  --locked: #f2efe8;

  --display: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  --body: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;

  --wrap: 680px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-inline: 20px;
}

/* ---------- type ---------- */

h1,
h2,
h3 {
  font-family: var(--display);
  letter-spacing: -0.015em;
  text-wrap: balance;
  margin: 0;
}

h1 {
  font-size: clamp(30px, 7vw, 42px);
  font-weight: 800;
  line-height: 1.12;
}

h2 {
  font-size: clamp(23px, 5vw, 29px);
  font-weight: 700;
  line-height: 1.2;
}

h3 {
  font-size: 20px;
  font-weight: 700;
}

p {
  margin: 0;
}

a {
  color: var(--accent-dark);
}

section {
  padding-block: 44px;
  border-top: 1px solid var(--rule);
}

section:first-of-type {
  border-top: 0;
}

.stack {
  display: grid;
  gap: 18px;
}

.eyebrow {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- hero ---------- */

.hero {
  padding-block: 40px 44px;
}

/*
 * The hero takes the same measure as every other section: one column at the
 * .wrap width, so the headline, the paragraph, the button and the sections
 * below all share a left and a right edge.
 *
 * An earlier version capped the headline at 460px while the paragraph kept
 * its own 46ch cap and the button stayed full width — three widths stacked
 * on each other, which reads as misalignment rather than as a deliberately
 * narrower column. If the hero ever wants a narrower measure than the page,
 * every element in it has to move together.
 */

.brandbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-block: 18px 26px;
}

.mark {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-family: var(--display);
  font-weight: 800;
  font-size: 18px;
  display: grid;
  place-items: center;
}

.brandname {
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.promise {
  font-size: 19px;
  color: var(--ink-soft);
  /* Roomier than the body default so the count's cells, which are taller
     than the text they sit in, do not crowd the line above. */
  line-height: 1.62;
}

/* The live count of enterable sweepstakes is the claim the page turns on. */
.promise strong {
  color: var(--ink);
  font-weight: 700;
}

/* ---------- the count, as a split-flap board ---------- */

/*
 * The count is the claim the page turns on, so it is set as a departures
 * board: dark cells, one digit each, that flap down and settle.
 *
 * It settles ONCE, on the real number, and never moves again. It is not a
 * ticker. A number that kept climbing would read as sweepstakes arriving
 * live while you watch, which is not true — the figure comes from a file
 * written by the last crawl — and LANDING_BRIEF.md rules out fake scarcity.
 * The motion is a reveal of a static fact, not a claim about rate.
 */
.count {
  display: inline-flex;
  gap: 3px;
  margin-right: 3px;
  /* Pulls the taller cells back onto the sentence's baseline. */
  vertical-align: -0.22em;
}

.count-cell {
  position: relative;
  overflow: hidden;
  width: 0.74em;
  height: 1.1em;
  border-radius: 4px;
  /* Accent rather than ink: the headline directly above is already ink, and
     dark cells under it read as a redaction instead of a display. Accent
     also ties the number to the button it is arguing for. */
  background: var(--accent);
  color: var(--paper);
  font-family: var(--display);
  font-size: 34px;
  font-weight: 800;
  line-height: 1.1em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* The seam a real split-flap has, where the two halves of the card meet. */
.count-cell::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(251, 250, 247, 0.22);
  pointer-events: none;
}

/*
 * Driven by a CSS animation rather than a JS-set transform, and the digit it
 * rests on is the real one.
 *
 * This matters more than it looks. The first version transitioned from a
 * start position that JS set on requestAnimationFrame — but rAF is paused in
 * a background tab, so a page opened in one sat at its start position and
 * read "000 free-to-enter US sweepstakes" until focused. A CSS animation
 * needs no frame callback, and because the resting state (no animation, or
 * animation finished, or reduced motion) is translateY(0) and the target
 * digit sits at index 0, every path that skips the motion still shows the
 * true number.
 */
.count-strip {
  display: block;
  animation-name: count-flap;
  animation-duration: 1150ms;
  animation-timing-function: cubic-bezier(0.16, 0.84, 0.26, 1);
  animation-iteration-count: 1;
}

.count-strip span {
  display: block;
  height: 1.1em;
}

/* --count-travel is set per board by app.js, from how many digit cards the
   strip holds. */
@keyframes count-flap {
  from {
    transform: translateY(calc(var(--count-travel) * -1));
  }
  to {
    transform: translateY(0);
  }
}

@media (max-width: 520px) {
  .count-cell {
    font-size: 30px;
  }
}

/*
 * Available to assistive technology, invisible on screen. The flapping
 * digits are decorative duplicates, so they are hidden from screen readers
 * and the real number is exposed through this instead — otherwise a reader
 * announces thirty digits of travel.
 */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- buttons ---------- */

.btn {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 15px 20px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-family: var(--display);
  font-size: 19px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.3;
}

.btn:hover,
.btn:focus-visible {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.btn.secondary {
  background: transparent;
  color: var(--accent-dark);
}

.btn.secondary:hover,
.btn.secondary:focus-visible {
  background: var(--accent-soft);
  border-color: var(--accent-dark);
  color: var(--accent-dark);
}

.btn[aria-disabled="true"],
.btn[disabled] {
  background: var(--rule-soft);
  border-color: var(--rule);
  color: var(--ink-faint);
  cursor: not-allowed;
}

:focus-visible {
  outline: 3px solid var(--urgent);
  outline-offset: 2px;
}

/* ---------- sample list ---------- */

.samplemeta {
  font-size: 16px;
  color: var(--ink-faint);
}

.list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.item {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 15px 16px;
}

.item-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin-bottom: 7px;
}

.value {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
  color: var(--accent-dark);
  font-variant-numeric: tabular-nums;
}

.item h3 {
  font-size: 18.5px;
  font-weight: 700;
  line-height: 1.3;
}

.item h3 a {
  color: var(--accent-dark);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

.item h3 a:hover,
.item h3 a:focus-visible {
  color: var(--ink);
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 11px;
}

.fact {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--rule-soft);
  color: var(--ink-soft);
  white-space: nowrap;
}

.fact.soon {
  background: var(--urgent-soft);
  color: var(--urgent);
}

.fact.daily {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.locked {
  position: relative;
  border: 1px dashed var(--rule);
  border-radius: 8px;
  background: var(--locked);
  padding: 20px 16px;
  text-align: center;
}

.locked .count {
  font-family: var(--display);
  font-size: 21px;
  font-weight: 800;
  color: var(--ink);
}

.locked .blurred {
  margin-top: 10px;
  display: grid;
  gap: 7px;
}

.locked .ghost {
  height: 13px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--rule) 0%, var(--rule-soft) 100%);
  filter: blur(2.5px);
}

.locked .ghost:nth-child(2) {
  width: 82%;
  margin-inline: auto;
}

.locked .ghost:nth-child(3) {
  width: 64%;
  margin-inline: auto;
}

.loading,
.sample-error {
  padding: 18px 16px;
  border: 1px dashed var(--rule);
  border-radius: 8px;
  color: var(--ink-faint);
  font-size: 16px;
}

/* ---------- steps ---------- */

.steps {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: s;
}

.steps li {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 14px;
  align-items: start;
}

.steps li::before {
  counter-increment: s;
  content: counter(s);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-family: var(--display);
  font-weight: 800;
  font-size: 18px;
  display: grid;
  place-items: center;
}

.steps h3 {
  margin-bottom: 2px;
}

/* ---------- pricing ---------- */

.plans {
  display: grid;
  gap: 14px;
}

.plan {
  border: 2px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
  padding: 18px;
  display: grid;
  gap: 12px;
}

.plan.featured {
  border-color: var(--accent);
}

.plan-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.amount {
  font-family: var(--display);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.per {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink-faint);
}

.badge {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  padding: 4px 9px;
  border-radius: 999px;
}

.plan-note {
  font-size: 16.5px;
  color: var(--ink-soft);
}

.renewal {
  font-size: 15.5px;
  color: var(--ink-soft);
  border-top: 1px solid var(--rule-soft);
  padding-top: 11px;
}

.terms {
  border: 2px solid var(--accent);
  border-radius: 10px;
  background: var(--accent-soft);
  padding: 16px 18px;
  display: grid;
  gap: 10px;
}

.terms h3 {
  color: var(--accent-dark);
}

.terms ul {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 7px;
  font-size: 16.5px;
}

/*
 * One consent box per plan, sitting inside the card directly above that
 * plan's button. The tint ties it to the green button below it, so the
 * tick and the thing it unlocks read as one action rather than a box
 * somewhere else on the page.
 */
.consent {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--accent-soft);
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 12px 13px;
  font-size: 16.5px;
  line-height: 1.45;
  color: var(--accent-dark);
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Ticked is the state that matters, so make it visible without hover. */
.consent:has(input:checked) {
  border-color: var(--accent);
}

.consent input {
  width: 26px;
  height: 26px;
  margin: 0;
  flex: none;
  accent-color: var(--accent);
}

.consent input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.notready {
  background: var(--urgent-soft);
  border: 2px solid var(--urgent);
  border-radius: 8px;
  padding: 14px 16px;
  color: var(--urgent);
  font-size: 16.5px;
}

.notready b {
  font-family: var(--display);
}

/* ---------- faq ---------- */

.faq {
  display: grid;
  gap: 2px;
}

details {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
}

details + details {
  margin-top: 10px;
}

summary {
  padding: 15px 16px;
  min-height: 52px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 17.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}

summary::marker {
  color: var(--accent);
}

details > p,
details > ul {
  margin: 0;
  padding: 0 16px 16px;
  font-size: 17px;
  color: var(--ink-soft);
}

details > ul {
  padding-left: 38px;
}

/* ---------- footer ---------- */

footer {
  border-top: 1px solid var(--rule);
  padding-block: 32px 48px;
  font-size: 16px;
  color: var(--ink-faint);
}

footer .links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 14px;
}

footer p {
  margin-bottom: 9px;
  max-width: 60ch;
}

/* ---------- legal pages ---------- */

.legal {
  padding-block: 28px 56px;
}

.legal h2 {
  margin-top: 30px;
  font-size: 22px;
}

.legal p,
.legal li {
  color: var(--ink-soft);
  margin-top: 12px;
}

.legal ul {
  padding-left: 22px;
}

.back {
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
}

@media (min-width: 620px) {
  .plans {
    gap: 16px;
  }

  .btn.inline {
    width: auto;
    min-width: 260px;
  }
}

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