/* Homepage only. Shared tokens and header styles come from styles.css. */
.home {
  --yellow: #ffd54f;
  --amber: #ffa726;
  --night: #212121;
  --night-text: #fff4e6;
  --rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.home header,
.home main,
.home footer {
  max-width: 68rem;
}

.home main {
  overflow-x: clip;
}

.home h1,
.home h2,
.home h3,
.home .ball {
  font-family: var(--rounded);
}

.home h1,
.home h2 {
  text-wrap: balance;
}

/* Skip link: hidden until focused. */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--card);
  font-weight: 700;
}

.skip-link:focus {
  top: 1rem;
}

.home main:focus {
  outline: none;
}

/* Header: compact on phones (brand, then one row of links);
   brand and navigation share one row on wider screens. */
.home header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding-top: 1rem;
  padding-bottom: 0.25rem;
}

.home .brand {
  gap: 0.5rem;
}

.home .brand .icon {
  width: 40px;
  height: 40px;
  border-radius: 9px;
}

.home .brand .wordmark {
  flex-basis: 12rem;
  width: 12rem;
}

.home header nav {
  margin-top: 0;
  gap: 0 1rem;
  font-size: 0.9375rem;
}

/* Numbered balls, echoing the app's called-number ball. */
.ball {
  display: inline-grid;
  place-items: center;
  width: 3rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe58a 0%, var(--yellow) 45%, var(--amber) 100%);
  color: var(--ink);
  font-weight: 800;
  font-size: 1.125rem;
  line-height: 1;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.08), 0 6px 14px rgba(255, 140, 0, 0.25);
}

/* Screenshots: real captures shown with rounded corners, never cropped.
   The width/height attributes reserve each box, and this static background is
   the loading placeholder: a soft cream panel with a faint called-number ball.
   The opaque screenshot paints over it once decoded. If an image fails, the
   alt text shows in muted type on the same panel. */
.shot {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 1.75rem;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 26%, rgba(255, 213, 79, 0.45) 0 11%, transparent 11.5%),
    linear-gradient(180deg, #fffaf2 0%, #fdeedd 100%);
  box-shadow: 0 18px 40px rgba(185, 58, 18, 0.16);
  color: var(--muted);
  font-size: 0.875rem;
}

figure {
  margin: 0;
}

figcaption {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.9375rem;
  text-align: center;
}

/* Hero: on phones the download actions follow the intro and come before the
   screenshot; on wide screens the screenshot sits beside both. */
.hero {
  display: grid;
  gap: 1.5rem;
  align-items: center;
  padding: 1.5rem 0 3rem;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0.375rem 0.875rem;
  border: 2px solid var(--orange-dark);
  border-radius: 999px;
  background: var(--card);
  color: var(--orange-dark);
  font-weight: 700;
  font-size: 0.9375rem;
}

.status-dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: var(--orange);
}

.home h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2.25rem, 1.5rem + 3.5vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
}

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

.lede {
  margin: 0;
  font-size: 1.125rem;
  max-width: 34rem;
}

/* Small label above each section heading. */
.kicker {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.25rem;
  color: var(--orange-dark);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kicker::before {
  content: "";
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe58a 0%, var(--yellow) 45%, var(--amber) 100%);
}

.dark .kicker {
  color: var(--yellow);
}

/* Download row first, then the secondary links. */
.actions {
  display: grid;
  justify-items: start;
  gap: 1rem;
}

.download {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Apple's badge artwork, shown unmodified at 48px high. Gaps around it keep
   at least a quarter of its height (12px) clear. No transforms, animation,
   filters, opacity changes or shadows. */
.store-badge {
  display: block;
  flex: none;
  border-radius: 8px;
  line-height: 0;
  text-decoration: none;
}

.store-badge img {
  display: block;
  width: auto;
  height: 48px;
}

/* QR code for desktop visitors; hidden on narrow screens, where the badge
   link is used directly. */
.qr {
  display: none;
  align-items: center;
  gap: 0.75rem;
}

.qr img {
  display: block;
  flex: none;
  width: 111px;
  height: 111px;
  border: 1px solid var(--line);
}

.qr figcaption {
  margin: 0;
  max-width: 9rem;
  font-size: 0.9375rem;
  line-height: 1.4;
  text-align: left;
}

.more-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin: 0;
}

.button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  background: var(--orange-dark);
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
}

/* Secondary action: outlined, same size as the filled button. */
.button-secondary {
  padding: calc(0.75rem - 2px) calc(1.5rem - 2px);
  border: 2px solid var(--orange-dark);
  background: transparent;
  color: var(--orange-dark);
}

.text-link {
  font-weight: 700;
}

/* Interaction feedback. Colour and underline changes are static, so they
   apply regardless of motion settings; movement and transitions are added
   further down only when reduced motion is not requested. Hover colours are
   limited to hover-capable devices so a tapped control does not stay dark. */
@media (hover: hover) {
  .button:hover {
    background: #9e300d;
  }

  .home a:not(.button):hover {
    color: #9e300d;
    text-decoration-thickness: 2px;
  }
}

.button:active {
  background: #842809;
}

.home a:not(.button):active {
  color: var(--ink);
}

@media (hover: hover) {
  .button.button-secondary:hover {
    border-color: #9e300d;
    background: #fff1e6;
    color: #9e300d;
  }
}

.button.button-secondary:active {
  border-color: #842809;
  background: #ffe6d4;
  color: #842809;
}

@media (prefers-reduced-motion: no-preference) {
  .button {
    transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  }

  .home a:not(.button):not(.store-badge) {
    transition: color 0.15s ease, text-decoration-thickness 0.15s ease;
  }

  .home .brand .icon {
    transition: transform 0.2s ease;
  }

  /* Press feedback also works on touch screens. */
  .button:active {
    transform: scale(0.97);
  }
}

/* Lift effects only where a pointer can hover. */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(185, 58, 18, 0.28);
  }

  .button:active {
    transform: translateY(0) scale(0.97);
    box-shadow: none;
  }

  .home .brand:hover .icon {
    transform: rotate(-6deg) scale(1.05);
  }
}

.home a:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.hero-visual {
  position: relative;
  justify-self: center;
  width: min(300px, 70vw);
  margin: 0.5rem 2rem 1rem;
}

.hero-visual .ball {
  position: absolute;
  z-index: 1;
}

/* Balls sit over blank margins of the screenshot, never over the board. */
.ball-a {
  top: 3%;
  left: -3rem; /* fully outside the frame, so it never covers fallback text */
}

.ball-b {
  top: 21.5%;
  right: -2rem;
  width: 3.5rem;
}

.ball-c {
  bottom: 7%;
  left: -2rem;
  width: 3.75rem;
  font-size: 1.375rem;
}

.ball-d {
  bottom: -1.5rem;
  right: -1rem;
}

/* A single drop-and-settle for the decorative hero balls; it plays once and
   never loops. Only the balls animate: the heading, copy and screenshot are
   visible from the first paint. */
@media (prefers-reduced-motion: no-preference) {
  .hero-visual .ball {
    animation: ball-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .ball-b { animation-delay: 0.12s; }
  .ball-c { animation-delay: 0.24s; }
  .ball-d { animation-delay: 0.36s; }

  @keyframes ball-in {
    0% {
      opacity: 0;
      transform: translateY(-1rem) scale(0.6);
    }
    60% {
      opacity: 1;
      transform: translateY(2px) scale(1.06);
    }
    100% {
      opacity: 1;
      transform: none;
    }
  }
}

/* Sections */
.how,
.prizes,
.dark,
.privacy-card,
.faq {
  margin: 0 0 3.5rem;
}

.home h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  line-height: 1.2;
}

.steps {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.steps li {
  padding: 1.25rem 1.25rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: var(--card);
}

.steps h3 {
  margin: 0.75rem 0 0.25rem;
  font-size: 1.1875rem;
}

.steps p {
  margin-top: 0;
}

.prizes {
  display: grid;
  gap: 2rem;
  align-items: center;
}

/* Stacked on narrow screens; side by side once both stay readable. */
.shot-pair {
  display: grid;
  grid-template-columns: minmax(0, min(16rem, 75vw));
  justify-content: center;
  gap: 2rem;
}

/* Dark mode band */
.dark {
  display: grid;
  gap: 1.5rem;
  align-items: center;
  padding: 2rem 1.5rem;
  border-radius: 1.75rem;
  background: var(--night);
  color: var(--night-text);
}

.dark h2 {
  color: var(--yellow);
}

.dark-figure {
  justify-self: center;
  width: min(220px, 60vw);
}

.dark .shot {
  border-color: #3a3a3a;
  background:
    radial-gradient(circle at 50% 26%, rgba(255, 213, 79, 0.3) 0 11%, transparent 11.5%),
    linear-gradient(180deg, #2b2b2b 0%, #1c1c1c 100%);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
  color: #c9c2b8;
}

/* Privacy reassurance */
.privacy-card {
  padding: 1.5rem;
  border: 2px solid var(--line);
  border-radius: 1.5rem;
  background: var(--card);
}

.checks {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.checks li {
  position: relative;
  margin: 0.5rem 0;
  padding-left: 2rem;
}

.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.3em;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe58a 0%, var(--yellow) 45%, var(--amber) 100%);
}

/* FAQ */
.faq {
  max-width: 44rem;
}

.faq h3 {
  margin: 1.5rem 0 0.25rem;
  font-size: 1.125rem;
}

.faq p {
  margin-top: 0;
}

.faq-more {
  margin-top: 1.5rem;
  font-weight: 600;
}

.home footer p {
  margin: 0.25rem 0;
}

/* Wider screens */
@media (min-width: 34rem) {
  .shot-pair {
    grid-template-columns: repeat(2, minmax(0, 15rem));
    gap: 1rem;
  }
}

@media (min-width: 40rem) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home header {
    padding-top: 1.5rem;
    padding-bottom: 1rem;
    gap: 0.5rem 1.5rem;
  }

  .home .brand {
    gap: 0.75rem;
  }

  .home .brand .icon {
    width: 48px;
    height: 48px;
    border-radius: 11px;
  }

  .home .brand .wordmark {
    flex-basis: 15rem;
    width: 15rem;
  }

  .home header nav {
    gap: 0.25rem 1.25rem;
    font-size: 1rem;
  }
}

@media (min-width: 52rem) {
  .hero {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    grid-template-areas:
      "intro visual"
      "actions visual";
    column-gap: 2.5rem;
    row-gap: 1.5rem;
    padding-top: 3.5rem;
  }

  .hero-intro {
    grid-area: intro;
    align-self: end;
  }

  .actions {
    grid-area: actions;
    align-self: start;
  }

  .qr {
    display: flex;
  }

  .hero-visual {
    grid-area: visual;
  }

  .prizes {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  }

  .dark {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    padding: 2.5rem 3rem;
  }

  .privacy-card {
    padding: 2rem 2.5rem;
  }
}
