/*
 * The landing pages built by scripts/build-site.mjs. Every colour, radius,
 * space and duration comes from the variables in shared.css, which are the
 * app's own tokens, so dark mode follows by itself and no value here can
 * drift from the app. Mobile first: the base rules are the 375px phone a
 * visitor arrives on from an ad; wider screens only add room.
 *
 * Two rules from the brand brief: no shadows, and yellow is a fill only
 * (never text on white, where it cannot be read).
 */

.lp {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--s-md) var(--s-xxl);
}

/* On the home page the hero's .page already holds the side gutter. */
.lp-home {
  padding: var(--s-xl) 0 var(--s-xxl);
}

/* ------------------------------------------------------------ header */

.lp-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-md);
  min-height: 64px;
  padding: var(--s-sm) 0;
}

.lp-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-sm);
  min-height: var(--touch);
  color: var(--text-primary);
  text-decoration: none;
}

.lp-brand img {
  height: 28px;
  width: auto;
}

.lp-brand .wordmark {
  font-size: 17px;
  font-weight: 800;
}

.lp-nav {
  display: flex;
  gap: var(--s-xs);
}

.lp-nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  padding: 0 var(--s-sm);
  color: var(--text-primary);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--r-pill);
}

.lp-nav a:hover {
  background: var(--tint);
}

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

.lp-hero {
  margin-top: var(--s-sm);
  padding: var(--s-xl) var(--s-lg);
  border-radius: var(--r-card);
  background: var(--surface-contrast);
  color: var(--on-surface-contrast);
}

.lp-h1 {
  margin: 0 0 var(--s-md);
  font-size: 34px;
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.lp-sub {
  margin: 0 0 var(--s-lg);
  font-size: 17px;
  line-height: 1.4;
  opacity: 0.92;
}

.lp-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-md);
}

.lp-hero .lp-small {
  margin: var(--s-md) 0 0;
  color: var(--on-surface-contrast);
  opacity: 0.85;
}

.lp-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  color: inherit;
  font-weight: 600;
  text-underline-offset: 4px;
}

/* The App Store button on the landing pages is a touch target first: at least
   the app's button height, whatever the clamp in shared.css says on a phone. */
.lp .store,
.lp-sticky .store {
  min-height: var(--button-h);
  padding: 0 var(--s-lg) 0 var(--s-md);
}

.lp .store .kicker,
.lp-sticky .store .kicker {
  font-size: 10px;
}

.lp .store .name,
.lp-sticky .store .name {
  font-size: 18px;
}

.lp .store svg,
.lp-sticky .store svg {
  width: 22px;
}

.store:focus-visible,
.lp a:focus-visible,
.lp summary:focus-visible,
.lp button:focus-visible,
.lp-consent button:focus-visible,
.lp input:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 3px;
}

.lp-hero .store:focus-visible,
.lp-hero a:focus-visible,
.lp-final .store:focus-visible {
  outline-color: var(--accent);
}

/* ------------------------------------------------------------ sections */

.lp-section {
  margin-top: var(--s-xxl);
}

.lp-section h2,
.lp-final h2 {
  margin: 0 0 var(--s-md);
  font-size: 26px;
  line-height: 1.1;
  font-weight: 800;
}

.lp-section h1 {
  margin: var(--s-lg) 0 var(--s-md);
  font-size: 34px;
  line-height: 1.05;
  font-weight: 800;
}

.lp-section h3 {
  margin: 0 0 var(--s-xs);
}

.lp-section p {
  margin: 0 0 var(--s-md);
}

.lp-small {
  font-size: 13px;
  line-height: 18px;
  color: var(--text-secondary);
}

.lp-section ul,
.lp-section ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* The three sentences of the problem, each its own card. */
.lp-problem {
  display: grid;
  gap: var(--s-sm);
}

.lp-problem li {
  padding: var(--s-md) var(--s-lg);
  border-radius: var(--r-input);
  background: var(--surface);
  border: 1px solid var(--outline);
  font-size: 17px;
  font-weight: 600;
}

.lp-steps {
  display: grid;
  gap: var(--s-md);
}

.lp-step {
  padding: var(--s-lg);
  border-radius: var(--r-card);
  background: var(--surface);
  border: 1px solid var(--outline);
}

.lp-num {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: var(--s-md);
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 800;
}

.lp-callout {
  margin-top: var(--s-md);
  padding: var(--s-lg);
  border-radius: var(--r-card);
  background: var(--secondary);
  color: var(--on-secondary);
}

.lp-callout p {
  margin: 0;
  opacity: 0.92;
}

/* ------------------------------------------------------------ is / is not */

.lp-isnot {
  display: grid;
  gap: var(--s-md);
}

.lp-is,
.lp-not {
  padding: var(--s-lg);
  border-radius: var(--r-card);
  border: 1px solid var(--outline);
}

.lp-is {
  background: var(--surface);
}

.lp-not {
  background: var(--tint);
}

.lp-is li,
.lp-not li {
  position: relative;
  padding: var(--s-sm) 0 var(--s-sm) 28px;
}

.lp-is li::before,
.lp-not li::before,
.lp-checks li::before,
.lp-plan li::before {
  position: absolute;
  left: 0;
  top: var(--s-sm);
  width: 20px;
  text-align: center;
  font-weight: 800;
}

.lp-is li::before,
.lp-checks li::before,
.lp-plan li::before {
  content: '✓';
  color: var(--success);
}

.lp-not li::before {
  content: '✕';
  color: var(--text-secondary);
}

.lp-checks li,
.lp-plan li {
  position: relative;
  padding: var(--s-xs) 0 var(--s-xs) 28px;
}

.lp-checks li::before,
.lp-plan li::before {
  top: var(--s-xs);
}

/* ------------------------------------------------------------ the show */

.lp-facts {
  display: grid;
  gap: var(--s-sm);
  margin: 0 0 var(--s-md);
}

.lp-facts div {
  padding: var(--s-md);
  border-radius: var(--r-input);
  background: var(--surface);
  border: 1px solid var(--outline);
}

.lp-facts dt {
  font-size: 13px;
  color: var(--text-secondary);
}

.lp-facts dd {
  margin: 0;
  font-weight: 600;
}

.lp-phases {
  display: grid;
  gap: var(--s-sm);
  margin-bottom: var(--s-md) !important;
}

.lp-phases li {
  padding: var(--s-md);
  border-radius: var(--r-input);
  background: var(--tint);
}

/* ------------------------------------------------------------ screens */

.lp-screens {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 62%;
  gap: var(--s-md);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: var(--s-sm);
}

.lp-phone {
  margin: 0;
  scroll-snap-align: start;
  aspect-ratio: 390 / 844;
  border-radius: var(--r-card-lg);
  border: 6px solid var(--text-primary);
  overflow: hidden;
  background: var(--surface);
}

.lp-phone img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lp-phone-empty {
  display: grid;
  place-items: center;
  padding: var(--s-md);
  background: var(--tint);
  color: var(--text-secondary);
  text-align: center;
  font-size: 13px;
}

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

.lp-plans {
  display: grid;
  gap: var(--s-md);
  margin-bottom: var(--s-md);
}

.lp-plan {
  padding: var(--s-lg);
  border-radius: var(--r-card);
  background: var(--surface);
  border: 1px solid var(--outline);
}

.lp-plan-premium {
  border: 2px solid var(--surface-contrast);
}

.lp-price {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: var(--s-sm) !important;
}

.lp-table-wrap {
  overflow-x: auto;
  border-radius: var(--r-input);
  border: 1px solid var(--outline);
  background: var(--surface);
}

.lp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 20px;
}

.lp-table th,
.lp-table td {
  padding: var(--s-sm) var(--s-md);
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--outline);
}

.lp-table tbody tr:last-child th,
.lp-table tbody tr:last-child td {
  border-bottom: 0;
}

.lp-table thead th {
  background: var(--tint);
}

.lp-table tbody th {
  font-weight: 600;
}

.lp-grid {
  display: grid;
  gap: var(--s-md);
}

.lp-card {
  padding: var(--s-lg);
  border-radius: var(--r-card);
  background: var(--surface);
  border: 1px solid var(--outline);
}

.lp-card p {
  margin: 0;
}

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

.lp-faq {
  border-radius: var(--r-card);
  background: var(--surface);
  border: 1px solid var(--outline);
  overflow: hidden;
}

.lp-faq details + details {
  border-top: 1px solid var(--outline);
}

.lp-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-md);
  min-height: var(--touch);
  padding: var(--s-md) var(--s-lg);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.lp-faq summary::-webkit-details-marker {
  display: none;
}

.lp-faq summary::after {
  content: '+';
  flex: none;
  font-size: 22px;
  color: var(--link);
  transition: transform var(--t-base) var(--ease-out);
}

.lp-faq details[open] summary::after {
  transform: rotate(45deg);
}

.lp-faq details p {
  margin: 0;
  padding: 0 var(--s-lg) var(--s-md);
  color: var(--text-secondary);
}

/* ------------------------------------------------------------ final + shows */

.lp-final {
  margin-top: var(--s-xxl);
  padding: var(--s-xl) var(--s-lg);
  border-radius: var(--r-card);
  background: var(--accent);
  color: var(--on-accent);
}

.lp-final p {
  margin: 0 0 var(--s-lg);
}

.lp-shows {
  display: grid;
  gap: var(--s-sm);
}

.lp-shows a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-md);
  min-height: var(--touch);
  padding: var(--s-sm) var(--s-md);
  border-radius: var(--r-input);
  background: var(--surface);
  border: 1px solid var(--outline);
  color: var(--text-primary);
  font-weight: 600;
  text-decoration: none;
}

.lp-shows a:hover {
  border-color: var(--link);
}

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

.lp-footer {
  display: block;
  margin-top: var(--s-xxl);
  padding: var(--s-lg) 0 0;
  border-top: 1px solid var(--outline);
}

.lp-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-xs) var(--s-md);
  margin-bottom: var(--s-md);
}

.lp-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--text-secondary);
  text-decoration: none;
}

.lp-footer a:hover {
  color: var(--link);
}

.lp-footer-shows a {
  color: var(--text-primary);
  font-weight: 600;
}

/* ------------------------------------------------------------ sticky CTA */

/* On a phone, once the hero's button has scrolled away, the App Store button
   waits at the bottom. site.js shows it; wider screens never need it. */
.lp-sticky {
  position: fixed;
  z-index: 10;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  padding: var(--s-sm) var(--s-md) calc(var(--s-sm) + env(safe-area-inset-bottom));
  background: var(--background);
  border-top: 1px solid var(--outline);
  animation: rise var(--t-base) var(--ease-out) both;
}

.lp-sticky[hidden] {
  display: none;
}

.lp-sticky .store {
  width: 100%;
  justify-content: center;
}

/* ------------------------------------------------------------ forms */

.lp-form {
  display: grid;
  gap: var(--s-md);
  margin-top: var(--s-lg);
  padding: var(--s-lg);
  border-radius: var(--r-card);
  background: var(--surface);
  border: 1px solid var(--outline);
}

.lp-form label {
  display: grid;
  gap: var(--s-xs);
  font-weight: 600;
}

.lp-form input {
  min-height: var(--button-h);
  padding: 0 var(--s-md);
  border-radius: var(--r-input);
  border: 1px solid var(--outline);
  background: var(--background);
  color: var(--text-primary);
  font: inherit;
}

.btn-primary {
  min-height: var(--button-h);
  padding: 0 var(--s-lg);
  border: 0;
  border-radius: var(--r-pill);
  background: var(--surface-contrast);
  color: var(--on-surface-contrast);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--t-press) var(--ease-out);
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-primary[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.lp-btn-quiet {
  min-height: var(--touch);
  padding: 0 var(--s-md);
  border: 1px solid var(--outline);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  cursor: pointer;
}

.lp-form-done {
  margin: 0;
  padding: var(--s-md);
  border-radius: var(--r-input);
  background: var(--tint);
  font-weight: 600;
}

.lp-form-failed {
  margin: 0;
  color: var(--error);
  font-weight: 600;
}

.lp-form .lp-small {
  margin: 0;
}

/* ------------------------------------------------------------ /download */

.lp-route {
  margin-top: var(--s-lg);
  padding: var(--s-xl) var(--s-lg);
  border-radius: var(--r-card);
  background: var(--surface);
  border: 1px solid var(--outline);
}

.lp-route h2 {
  margin: 0 0 var(--s-sm);
  font-size: 26px;
  line-height: 1.1;
  font-weight: 800;
}

/* One route at a time: site.js marks the body with the route the router chose.
   Until it runs, nothing flashes the wrong answer. */
.route-pending .lp-route,
body:not(.route-ios) .lp-route[data-show='ios'],
body:not(.route-desktop) .lp-route[data-show='desktop'],
body:not(.route-android) .lp-route[data-show='android'],
body:not(.route-unavailable) .lp-route[data-show='unavailable'] {
  display: none;
}

.lp-qr {
  width: 200px;
  height: 200px;
  margin: var(--s-lg) 0;
  padding: var(--s-sm);
  border-radius: var(--r-input);
  background: var(--on-surface-contrast);
}

.lp-qr svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* ------------------------------------------------------------ consent */

.lp-consent {
  position: fixed;
  z-index: 20;
  left: var(--s-md);
  right: var(--s-md);
  bottom: var(--s-md);
  max-width: 560px;
  margin: 0 auto;
  padding: var(--s-md) var(--s-lg);
  border-radius: var(--r-card);
  background: var(--surface);
  border: 1px solid var(--outline);
}

.lp-consent[hidden] {
  display: none;
}

.lp-consent p {
  margin: 0 0 var(--s-md);
  font-size: 14px;
  line-height: 20px;
}

.lp-consent-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--s-sm);
}

.lp-consent .btn-primary {
  min-height: var(--touch);
}

/* ------------------------------------------------------------ wider screens */

@media (min-width: 720px) {
  .lp {
    padding: 0 var(--s-xl) var(--s-xxl);
  }
  .lp-home {
    padding: var(--s-xl) 0 var(--s-xxl);
  }
  .lp-hero {
    padding: var(--s-xxl);
  }
  .lp-h1 {
    font-size: 52px;
    max-width: 16ch;
  }
  .lp-sub {
    font-size: 20px;
    max-width: 40ch;
  }
  .lp-section h2,
  .lp-final h2,
  .lp-section h1 {
    font-size: 34px;
  }
  .lp-problem,
  .lp-steps,
  .lp-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .lp-isnot,
  .lp-plans,
  .lp-facts {
    grid-template-columns: repeat(2, 1fr);
  }
  .lp-shows {
    grid-template-columns: repeat(3, 1fr);
  }
  .lp-screens {
    grid-auto-columns: calc((100% - 3 * var(--s-md)) / 4);
  }
  .lp-final {
    padding: var(--s-xxl);
  }
  .lp-sticky {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lp-sticky,
  .lp-faq summary::after {
    animation: none;
    transition: none;
  }
}
