/*
 * Component and page styles.
 *
 * Astro scoped each of these to its own component file. Plain CSS has no
 * scoping, so they live here together under BEM-ish class names -- the naming
 * is what keeps them apart. Keep the section order below; it mirrors the order
 * things appear in the markup.
 */

/* ======================================================================== */
/* Logo                                                                     */
/* ======================================================================== */

.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  text-decoration: none;
  /* Each usage sets --logo-size inline; this is the fallback. */
  --logo-size: 32px;
}

.logo__mark {
  width: var(--logo-size);
  height: var(--logo-size);
  flex: none;
}

.logo__word {
  color: var(--color-text);
  font-size: var(--text-title-lg);
  font-weight: var(--weight-extrabold);
  letter-spacing: -0.02em;
}

/* ======================================================================== */
/* Header                                                                   */
/* ======================================================================== */

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--color-surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  min-height: 64px;
}

.header__brand {
  text-decoration: none;
  margin-inline-end: auto;
}

/* The nav is a convenience on desktop; on phones the page is short enough
   to scroll, so it collapses rather than earning a hamburger and the JS
   that comes with it. */
.header__nav {
  display: none;
}

.header__list {
  display: flex;
  gap: var(--space-xl);
  list-style: none;
  padding: 0;
}

.header__link {
  color: var(--color-text-label);
  font-size: var(--text-body-md);
  font-weight: var(--weight-semibold);
  text-decoration: none;
}

.header__link:hover {
  color: var(--color-primary);
}

/*
 * The install CTA stays visible at every width. Most visitors arrive on the
 * phone they would install on, so hiding it there would drop the one click
 * this page exists to earn. Padding tightens below 48rem so it still fits
 * beside the wordmark on a 320px screen.
 */
.header__cta {
  padding-inline: var(--space-md);
}

@media (min-width: 48rem) {
  .header__nav {
    display: block;
  }

  .header__cta {
    padding-inline: var(--space-xl);
  }
}

/* ======================================================================== */
/* Hero                                                                     */
/* ======================================================================== */

.hero {
  padding-block: clamp(3rem, 1.5rem + 8vw, 7rem);
  background:
    radial-gradient(
      ellipse 80% 60% at 50% -10%,
      var(--color-primary-container) 0%,
      transparent 70%
    ),
    var(--color-surface-tinted);
}

.hero__inner {
  display: grid;
  justify-items: start;
  gap: var(--space-xxl);
}

/* Copy above the phone on a narrow screen, beside it once there is room. */
@media (min-width: 64rem) {
  .hero__inner {
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: var(--space-section);
  }
}

.hero__copy {
  display: grid;
  justify-items: start;
  gap: var(--space-lg);
}

.hero__shot {
  justify-self: center;
}

.hero__shot img {
  width: clamp(200px, 54vw, 300px);
  height: auto;
  border-radius: 22px;
  border: 1px solid var(--color-border);
  /* Lifted off the tinted hero background rather than sitting flat on it. */
  box-shadow:
    0 18px 40px -20px rgb(38 12 92 / 45%),
    0 4px 12px -6px rgb(38 12 92 / 25%);
}

@media (min-width: 64rem) {
  .hero__shot img {
    width: 300px;
  }
}

.hero__eyebrow {
  padding: var(--space-xxs) var(--space-sm);
  border-radius: var(--radius-pill);
  background: var(--color-primary-container-strong);
  color: var(--color-primary-dark);
  font-size: var(--text-label-md);
  font-weight: var(--weight-bold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero__title {
  max-width: 18ch;
  color: var(--color-text);
}

.hero__lede {
  max-width: 52ch;
  color: var(--color-text-info);
  font-size: var(--text-body-lg);
}

/* ======================================================================== */
/* Sections                                                                 */
/* ======================================================================== */

.section--tinted {
  background: var(--color-surface-muted);
}

.section__lede {
  margin-top: var(--space-sm);
  color: var(--color-text-info);
}

/* ======================================================================== */
/* Feature cards                                                            */
/* ======================================================================== */

.grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: 1fr;
  margin-top: var(--space-xxl);
  padding: 0;
  list-style: none;
}

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

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

.card {
  padding: var(--space-xl);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.card__title {
  font-size: var(--text-title-lg);
  line-height: var(--leading-title-lg);
}

.card__body {
  margin-top: var(--space-xs);
  color: var(--color-text-info);
  font-size: var(--text-body-md);
}

/* ======================================================================== */
/* Screenshots                                                              */
/* ======================================================================== */

.shots {
  display: grid;
  gap: var(--space-xl);
  /* Two up on a phone, four across once there is room. Nothing in between
     needs its own breakpoint — auto-fit handles the middle. */
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
  margin-top: var(--space-xxl);
  padding: 0;
  list-style: none;
}

@media (min-width: 64rem) {
  .shots {
    grid-template-columns: repeat(4, 1fr);
  }
}

.shot {
  display: grid;
  gap: var(--space-sm);
  justify-items: center;
  text-align: center;
}

.shot__image {
  width: 100%;
  /* The exports are a few pixels apart in height, which left the captions on
     four different baselines. A shared ratio lines them up; anything taller
     than it loses a sliver of the bottom, where these screens carry least. */
  aspect-ratio: 640 / 1310;
  height: auto;
  object-fit: cover;
  object-position: top;
  border-radius: 16px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: 0 10px 26px -18px rgb(38 12 92 / 40%);
}

.shot__caption {
  color: var(--color-text-info);
  font-size: var(--text-body-md);
  text-wrap: balance;
}

/* ======================================================================== */
/* Steps                                                                    */
/* ======================================================================== */

.steps {
  display: grid;
  gap: var(--space-xl);
  grid-template-columns: 1fr;
  margin-top: var(--space-xxl);
  padding: 0;
  list-style: none;
}

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

.step {
  display: grid;
  gap: var(--space-sm);
}

.step__number {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-size: var(--text-title-md);
  font-weight: var(--weight-extrabold);
}

/* ======================================================================== */
/* FAQ                                                                      */
/* ======================================================================== */

.faq {
  margin-top: var(--space-xxl);
}

.faq__item + .faq__item {
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-divider);
}

/*
 * <summary> in a <details>. The default disclosure triangle is replaced with a
 * chevron drawn in CSS so it can pick up the brand colour and rotate; both
 * vendor selectors are needed to suppress the native marker.
 */
.faq__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  min-height: var(--touch-target);
  font-size: var(--text-title-md);
  font-weight: var(--weight-bold);
  cursor: pointer;
  list-style: none;
}

.faq__q::-webkit-details-marker {
  display: none;
}

.faq__q::after {
  content: "";
  flex: none;
  width: 0.55em;
  height: 0.55em;
  border-right: 2px solid var(--color-primary);
  border-bottom: 2px solid var(--color-primary);
  transform: rotate(45deg) translate(-0.1em, -0.1em);
  transition: transform var(--duration-fast) var(--ease-out);
}

.faq__item[open] .faq__q::after {
  transform: rotate(-135deg) translate(-0.1em, -0.1em);
}

.faq__q:hover {
  color: var(--color-primary);
}

.faq__a {
  margin: var(--space-xs) 0 0;
  color: var(--color-text-info);
  font-size: var(--text-body-md);
}

/* ======================================================================== */
/* Closing CTA                                                              */
/* ======================================================================== */

.cta {
  display: grid;
  justify-items: center;
  gap: var(--space-md);
  padding: var(--space-section) var(--space-xl);
  border-radius: var(--radius-lg);
  background: var(--color-primary-container);
  text-align: center;
}

.cta__title {
  font-size: var(--text-headline-md);
  line-height: var(--leading-headline);
}

.cta__body {
  max-width: 44ch;
  color: var(--color-text-label);
}

/* ======================================================================== */
/* Download buttons                                                         */
/* ======================================================================== */

.downloads__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.store {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: var(--touch-target);
  padding: var(--space-xs) var(--space-lg);
  border-radius: var(--radius-md);
  background: var(--color-on-surface);
  color: var(--color-surface);
  text-decoration: none;
  transition: transform var(--duration-fast) var(--ease-out);
}

.store:hover {
  transform: translateY(-1px);
}

.store__glyph {
  width: 24px;
  height: 24px;
  flex: none;
}

.store__text {
  display: grid;
  line-height: 1.2;
}

.store__kicker {
  font-size: var(--text-body-sm);
  opacity: 0.75;
}

.store__name {
  font-size: var(--text-title-md);
  font-weight: var(--weight-bold);
}

.downloads__pending {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  color: var(--color-text-info);
  font-size: var(--text-body-md);
}

.downloads__badge {
  padding: var(--space-xxs) var(--space-sm);
  border-radius: var(--radius-pill);
  background: var(--color-primary-container);
  color: var(--color-primary);
  font-size: var(--text-label-md);
  font-weight: var(--weight-bold);
}

/* ======================================================================== */
/* Footer                                                                   */
/* ======================================================================== */

.footer {
  margin-top: var(--space-section);
  padding-block: var(--space-xxl) var(--space-xl);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-muted);
}

.footer__inner {
  display: grid;
  gap: var(--space-xl);
  grid-template-columns: 1fr;
}

@media (min-width: 48rem) {
  .footer__inner {
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: var(--space-xxl);
  }
}

.footer__tagline {
  margin-top: var(--space-sm);
  max-width: 28ch;
  color: var(--color-text-info);
  font-size: var(--text-body-md);
}

.footer__heading {
  margin-bottom: var(--space-sm);
  font-size: var(--text-label-md);
  font-weight: var(--weight-extrabold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-hint);
}

.footer__list {
  display: grid;
  gap: var(--space-xs);
  list-style: none;
  padding: 0;
  font-size: var(--text-body-md);
}

.footer__list a {
  color: var(--color-text-label);
  text-decoration: none;
}

.footer__list a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.footer__legal {
  margin-top: var(--space-xxl);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-hint);
  font-size: var(--text-body-sm);
}

/* ======================================================================== */
/* 404 page                                                                 */
/* ======================================================================== */

.notfound {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: var(--space-md);
  min-height: 100svh;
  padding: var(--space-xxl) var(--space-md);
  text-align: center;
}

.notfound__code {
  margin-top: var(--space-xl);
  color: var(--color-primary);
  font-size: var(--text-label-md);
  font-weight: var(--weight-extrabold);
  letter-spacing: 0.16em;
}

.notfound__title {
  font-size: var(--text-display-sm);
}

.notfound__body {
  max-width: 44ch;
  color: var(--color-text-info);
}

/* ======================================================================== */
/* Privacy page                                                             */
/* ======================================================================== */

.policy-page {
  border-top: 1px solid var(--color-divider);
}

.policy-shell {
  max-width: var(--width-prose);
  padding-block: var(--space-section);
}

.policy-intro {
  padding-bottom: var(--space-xxl);
  border-bottom: 1px solid var(--color-border);
}

.policy__title {
  font-size: var(--text-headline-lg);
  line-height: var(--leading-headline-lg);
}

.policy__meta {
  margin-top: var(--space-xs);
  color: var(--color-text-info);
  font-size: var(--text-body-md);
}

.policy-intro > p:last-child {
  max-width: var(--width-prose);
  margin-top: var(--space-xl);
  color: var(--color-text-label);
}

.policy-contents {
  padding-block: var(--space-xxl);
  border-bottom: 1px solid var(--color-border);
}

.policy-contents h2 {
  margin-bottom: var(--space-md);
  font-size: var(--text-title-lg);
  line-height: var(--leading-title-lg);
}

.policy-contents ol {
  columns: 2;
  gap: var(--space-xxl);
  padding-left: var(--space-lg);
}

.policy-contents li {
  margin-bottom: var(--space-xs);
  break-inside: avoid;
  color: var(--color-text-info);
  font-size: var(--text-body-md);
}

.policy-contents a {
  color: var(--color-text-label);
}

.policy {
  margin-inline: 0;
}

.policy section {
  margin-top: var(--space-xxl);
  scroll-margin-top: var(--space-xxl);
}

.policy h2 {
  margin-bottom: var(--space-md);
  font-size: var(--text-headline-sm);
  line-height: var(--leading-headline);
}

.policy h3 {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-xs);
  font-size: var(--text-title-md);
  line-height: var(--leading-title-md);
}

.policy p,
.policy li,
.policy address {
  color: var(--color-text-label);
}

.policy p + p,
.policy p + ul,
.policy ul + p,
.policy address + p {
  margin-top: var(--space-md);
}

.policy ul {
  padding-left: var(--space-lg);
}

.policy li + li {
  margin-top: var(--space-sm);
}

.policy address {
  margin-top: var(--space-md);
  font-style: normal;
}

@media (max-width: 39.99rem) {
  .policy-contents ol {
    columns: 1;
  }
}
