/* Peron brand values come from the Peron iOS Figma file (peron-mobile-app/src/theme/tokens.ts). */
:root {
  --red: #d31212;
  --red-dark: #a90e0e;
  --red-soft: #ffe5e5;
  --ink: #1a1a1a;
  --grey: #6b6b6b;
  --divider: #ededed;
  --bg: #f8f8f8;
  --white: #ffffff;
  --font: 'Figtree', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --radius-control: 0.875rem;
  --radius-panel: 1.25rem;
  --radius-banner: 1.75rem;
  --stop: 1.375rem;
  --track: 0.25rem;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 1.5rem;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 0.14em;
}

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

h1,
h2,
h3 {
  margin: 0;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p,
ul,
ol,
dl {
  margin: 0;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--white);
}

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

/* Header: the red bar of the app's splash screen. */

.site-header {
  background: var(--red);
  color: var(--white);
}

.site-header :focus-visible {
  outline-color: var(--white);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.875rem;
}

.wordmark {
  display: block;
  color: inherit;
}

.wordmark svg {
  display: block;
  width: 7rem;
  height: auto;
  aspect-ratio: 200 / 66;
}

.main-nav ul {
  display: flex;
  align-items: center;
  gap: 0.25rem 1.5rem;
  padding: 0;
  list-style: none;
  font-weight: 600;
}

.main-nav a {
  text-decoration: none;
}

.main-nav a:hover,
.main-nav a[aria-current='page'] {
  text-decoration: underline;
  text-decoration-thickness: 0.12em;
}

.main-nav .nav-cta {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--white);
  color: var(--red);
  border-radius: var(--radius-control);
}

.main-nav .nav-cta:hover {
  text-decoration: none;
  background: var(--red-soft);
}

/* Shared blocks */

.lead {
  max-width: 36rem;
  font-size: clamp(1.125rem, 2vw, 1.25rem);
  line-height: 1.5;
  color: var(--grey);
}

.btn {
  display: inline-block;
  padding: 0.875rem 1.375rem;
  border: 2px solid transparent;
  border-radius: var(--radius-control);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

.btn-primary {
  background: var(--red);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--red-dark);
}

.btn-secondary {
  border-color: var(--divider);
  color: var(--ink);
}

.btn-secondary:hover {
  border-color: var(--ink);
}

.btn-light {
  background: var(--white);
  color: var(--red);
}

.btn-light:hover {
  background: var(--red-soft);
}

.band {
  padding-block: clamp(3.5rem, 8vw, 6rem);
}

.band h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  margin-bottom: 1.25rem;
}

.band-muted {
  background: var(--bg);
}

.band-red {
  background: var(--red);
  color: var(--white);
}

.band-red :focus-visible {
  outline-color: var(--white);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
}

.split-center {
  align-items: center;
}

.split-text p {
  max-width: 34rem;
}

.split-text p + p {
  margin-top: 1rem;
}

/* Hero: the app's welcome screen, opened up to the page width. */

.hero {
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 34rem);
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
}

.hero h1 {
  font-size: clamp(2.75rem, 7vw, 5rem);
  font-style: italic;
  line-height: 1;
  letter-spacing: -0.035em;
  margin-bottom: 1.5rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.hero-photo {
  display: block;
  width: 100%;
  border-radius: var(--radius-banner);
}

/* The order route: stops along a track, the last one in brand red. */

.route {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-top: 2.5rem;
  padding: 0;
  list-style: none;
}

.route li {
  position: relative;
  padding: calc(var(--stop) + 1.25rem) 1.25rem 0 0;
}

.route li::before {
  content: '';
  position: absolute;
  top: calc((var(--stop) - var(--track)) / 2);
  left: 0;
  right: 0;
  height: var(--track);
  background: var(--ink);
}

.route li:last-child::before {
  display: none;
}

.route li::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: var(--stop);
  height: var(--stop);
  border: var(--track) solid var(--ink);
  border-radius: 50%;
  background: var(--white);
}

.route li:last-child::after {
  border-color: var(--red);
  background: var(--red);
}

.route h3 {
  font-size: 1.1875rem;
  margin-bottom: 0.375rem;
}

.route p {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--grey);
}

/* Facts list */

.facts {
  border-top: 2px solid var(--red);
}

.facts > div {
  padding-block: 1.125rem;
  border-bottom: 1px solid var(--divider);
}

.facts dt {
  font-weight: 800;
  font-size: 1.125rem;
}

.facts dd {
  margin: 0.25rem 0 0;
  color: var(--grey);
}

/* Payment */

.pay-panel {
  display: grid;
  place-items: center;
  padding: clamp(2rem, 6vw, 3.5rem);
  background: var(--bg);
  border-radius: var(--radius-panel);
}

.pay-panel img {
  width: min(100%, 22rem);
}

/* Download */

.download {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
}

.download h2 {
  font-style: italic;
  margin-bottom: 0.75rem;
}

.store-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Inner pages */

.page,
.doc {
  padding-block: clamp(2.5rem, 7vw, 5rem) clamp(4rem, 9vw, 6.5rem);
}

.page-head {
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
  padding-bottom: clamp(1.5rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--divider);
}

.page-head h1 {
  max-width: 22ch;
  font-size: clamp(2.25rem, 5.5vw, 3.75rem);
  font-style: italic;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.doc-meta {
  color: var(--grey);
}

.prose {
  max-width: 44rem;
}

.prose h2 {
  font-size: clamp(1.375rem, 2.6vw, 1.75rem);
  margin: 2.75rem 0 0.875rem;
}

.prose > h2:first-child,
.prose > dl:first-child {
  margin-top: 0;
}

.prose h3 {
  font-size: 1.125rem;
  margin: 1.75rem 0 0.75rem;
}

.prose p,
.prose ul,
.prose ol,
.prose dl,
.prose .table-scroll {
  margin-bottom: 1rem;
}

.prose ul {
  padding-left: 1.25rem;
}

.prose li + li {
  margin-top: 0.5rem;
}

.prose li::marker {
  color: var(--red);
}

.prose a {
  color: var(--red-dark);
}

.info-list > div {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  gap: 1rem;
  padding-block: 0.75rem;
  border-bottom: 1px solid var(--divider);
}

.info-list > div:first-child {
  border-top: 1px solid var(--divider);
}

.info-list dt {
  font-weight: 600;
  color: var(--grey);
}

.info-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.doc-body {
  display: grid;
  grid-template-columns: 15rem minmax(0, 44rem);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.toc {
  position: sticky;
  top: 1.5rem;
  font-size: 0.9375rem;
  line-height: 1.4;
}

.toc h2 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.toc ol {
  padding: 0;
  list-style: none;
  border-left: var(--track) solid var(--red);
}

.toc li {
  padding: 0.3125rem 0 0.3125rem 0.875rem;
}

.toc a {
  color: var(--grey);
  text-decoration: none;
}

.toc a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 32rem;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.45;
}

th,
td {
  padding: 0.75rem 1rem 0.75rem 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--divider);
}

thead th {
  border-bottom: 2px solid var(--ink);
}

/* Footer */

.site-footer {
  background: var(--ink);
  color: #e8e8e8;
  padding-block: clamp(3rem, 7vw, 4.5rem) 2rem;
  font-size: 0.9375rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.3fr 1.6fr;
  gap: 2rem;
}

.site-footer .wordmark {
  color: var(--white);
}

.footer-brand p {
  margin-top: 0.75rem;
  color: #b8b8b8;
}

.site-footer h2 {
  font-size: 0.9375rem;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--white);
  margin-bottom: 0.75rem;
}

.site-footer ul {
  padding: 0;
  list-style: none;
}

.site-footer li + li {
  margin-top: 0.375rem;
}

.site-footer a {
  text-decoration-color: rgb(232 232 232 / 0.4);
}

.site-footer a:hover {
  text-decoration-color: currentColor;
}

.site-footer :focus-visible {
  outline-color: var(--white);
}

address {
  font-style: normal;
  line-height: 1.7;
  color: #b8b8b8;
  overflow-wrap: anywhere;
}

address strong {
  color: #e8e8e8;
  font-weight: 600;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgb(232 232 232 / 0.16);
  color: #b8b8b8;
}

.payment-band {
  width: min(100%, 28.5rem);
}

/* Narrow screens */

@media (max-width: 60rem) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

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

  .toc {
    position: static;
  }
}

@media (max-width: 48rem) {
  .split,
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-photo {
    max-width: 30rem;
  }

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

  .route li {
    padding: 0 0 1.75rem calc(var(--stop) + 1rem);
  }

  .route li::before {
    top: 0;
    bottom: 0;
    left: calc((var(--stop) - var(--track)) / 2);
    right: auto;
    width: var(--track);
    height: auto;
  }

  .info-list > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.125rem;
  }
}

@media (max-width: 36rem) {
  .wordmark svg {
    width: 5.5rem;
  }

  .main-nav ul {
    gap: 1rem;
  }

  /* The hero repeats this action, so the bar keeps only the two links. */
  .main-nav li:has(.nav-cta) {
    display: none;
  }
}

@media (max-width: 30rem) {
  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
