/* Above: viewabove.app. One stylesheet, no build step, no JavaScript. */

@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* The app's night sky. */
  --ground: #050a1c;
  --raised: #0a1332;
  --lift: #101c44;
  --text: #e9effc;
  --text-2: #aab9db;
  --text-3: #8697bf;
  --accent: #8cc2ff;
  --accent-ink: #051430;
  --rule: rgb(150 180 255 / 0.18);
  --rule-strong: rgb(150 180 255 / 0.34);

  /* The app's layer colours: the board's kind key. */
  --drone: #ff6482;
  --aircraft: #ff9f0a;
  --balloon: #63e6be;
  --satellite: #64d2ff;
  --solar: #ffd60a;
  --deep: #bf5af2;
  --star: #e9effc;

  --measure: 66ch;
  --page: 72rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--lift) var(--ground);
  scroll-padding-top: 5rem;
}

body {
  position: relative;
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  text-rendering: optimizeLegibility;
  caret-color: var(--accent);
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

/* Text for screen readers where the page shows split-flap characters. */
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 8px;
  font-weight: 600;
}

.skip:focus {
  top: 0.75rem;
}

/* Header and footer */

.bar,
.site-footer,
main {
  width: min(100% - 2 * var(--gutter), var(--page));
  margin-inline: auto;
}

.bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  text-decoration: none;
  font-stretch: 125%;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.01em;
}

.brand img {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav a {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  color: var(--text-2);
  text-decoration: none;
  font-weight: 500;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--text);
}

.nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.5em;
}

.site-footer {
  display: grid;
  gap: 1.5rem;
  margin-top: clamp(4rem, 9vw, 7rem);
  padding-block: 2.5rem 3.5rem;
  border-top: 1px solid var(--rule);
  color: var(--text-3);
  font-size: 0.9375rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
}

.site-footer a {
  color: var(--text-2);
}

.site-footer a:hover {
  color: #fff;
}

.site-footer p {
  max-width: 62ch;
}

/* The App Store link, as text until the listing exists */

.store {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 3rem;
  padding: 0.7rem 1.25rem;
  border-radius: 14px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  white-space: nowrap;
}

a.store {
  background: var(--accent);
  color: var(--accent-ink);
  transition: background 160ms var(--ease), transform 160ms var(--ease);
}

a.store:hover {
  background: #b4d8ff;
  color: var(--accent-ink);
}

a.store:active {
  transform: translateY(1px);
}

.store--soon {
  border: 1px solid var(--rule-strong);
  background: var(--raised);
  color: var(--text-2);
  cursor: default;
}

.store--soon::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgb(140 194 255 / 0.18);
}

/* Home: hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  align-items: end;
  gap: clamp(1.5rem, 5vw, 4rem);
  padding-block: clamp(0.5rem, 2.5vw, 2rem) 0;
}

.glow {
  position: absolute;
  inset: 0 0 auto;
  height: 38rem;
  z-index: -1;
  background:
    radial-gradient(60% 70% at 78% 8%, rgb(48 92 214 / 0.42), transparent 70%),
    radial-gradient(40% 50% at 12% 0%, rgb(30 60 150 / 0.3), transparent 70%);
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-stretch: 115%;
  line-height: 1;
  letter-spacing: -0.025em;
}

.hero .lead {
  max-width: 34rem;
  margin-top: 1.25rem;
  color: var(--text-2);
  font-size: clamp(1.0625rem, 1.8vw, 1.25rem);
  line-height: 1.55;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  margin-top: 1.4rem;
}

.facts {
  margin-top: 0.9rem;
  color: var(--text-3);
  font-size: 0.9375rem;
}

/* The app capture rises from behind the board and fades out. */

.rise {
  position: relative;
  z-index: 0;
  display: flex;
  flex-direction: column;
  justify-self: end;
  width: min(100%, 17rem);
  margin: 0 0 -4.5rem;
}

.rise figcaption {
  order: -1;
  margin-bottom: 0.6rem;
  color: var(--text-3);
  font-size: 0.8125rem;
}

.rise img {
  width: 100%;
  height: 22rem;
  object-fit: cover;
  object-position: top;
  border: 1px solid var(--rule-strong);
  border-bottom: 0;
  border-radius: 2rem 2rem 0 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 52%, transparent 96%);
  mask-image: linear-gradient(to bottom, #000 52%, transparent 96%);
}

/* Home: the departures board */

.board {
  position: relative;
  z-index: 1;
  margin-top: clamp(1.25rem, 2.5vw, 1.75rem);
  background: var(--raised);
  border: 1px solid var(--rule-strong);
  border-radius: 14px;
  overflow: hidden;
}

.board-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding: 0.85rem 1.4rem 0.75rem;
  border-bottom: 1px solid var(--rule-strong);
}

.board-head h2 {
  font-size: 1rem;
  font-stretch: 125%;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.board-head p {
  color: var(--text-3);
  font-size: 0.875rem;
}

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

.board table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

.board th,
.board td {
  padding: 0.42rem 1.4rem;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  border-bottom: 1px solid var(--rule);
  background: none;
}

.board thead th {
  padding-block: 0.7rem;
  color: var(--text-3);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.board tbody tr:last-child > * {
  border-bottom: 0;
}

.board tbody th {
  font-weight: inherit;
}

.c-kind {
  color: var(--text-2);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.board tbody .c-kind::before {
  content: "";
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  margin-right: 0.65rem;
  border-radius: 2px;
  background: var(--c);
  vertical-align: 0.03em;
}

.board tbody .c-kind {
  font-weight: 500;
}

/* Split-flap characters: each one a small card with a hinge. */

.flaps {
  display: inline-flex;
  gap: 0.14rem;
}

.flaps i {
  position: relative;
  display: inline-block;
  min-width: 0.66em;
  height: 1.55em;
  padding-inline: 0.09em;
  font: normal 650 1.05rem/1.55 "Archivo", sans-serif;
  font-stretch: 78%;
  text-align: center;
  color: var(--text);
  background: linear-gradient(#152658 0 50%, #0d1a42 50% 100%);
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgb(150 180 255 / 0.1);
  animation: flap 0.6s var(--ease) calc(var(--r, 0) * 0.14s + var(--k, 0) * 0.022s) backwards;
}

.flaps i::after {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  height: 1px;
  background: rgb(0 0 0 / 0.6);
}

.flaps i.gap {
  min-width: 0.4em;
  padding: 0;
  background: none;
  box-shadow: none;
  animation: none;
}

.flaps i.gap::after {
  display: none;
}

.board tr.below {
  opacity: 0.55;
}

.board tr.below .flaps i {
  font-style: italic;
}

@keyframes flap {
  from {
    transform: perspective(240px) rotateX(-90deg);
    opacity: 0;
  }
}

/* Home: how to read it, and the rest */

.how,
.spec,
.promise,
.closing {
  margin-top: clamp(3rem, 7vw, 5.5rem);
  padding-top: clamp(3rem, 7vw, 5.5rem);
  border-top: 1px solid var(--rule);
}

.section-head {
  max-width: 46rem;
}

.section-head h2 {
  font-size: clamp(1.9rem, 4.2vw, 3rem);
  font-stretch: 112%;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.section-head p {
  margin-top: 1.25rem;
  color: var(--text-2);
  max-width: 40rem;
}

.three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 clamp(1.5rem, 4vw, 3rem);
  margin: clamp(2rem, 5vw, 3rem) 0 0;
}

.three > div {
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule-strong);
}

.three dt {
  font-weight: 650;
  font-size: 1.125rem;
}

.three dd {
  margin: 0.5rem 0 0;
  color: var(--text-2);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.75rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--text-2);
  font-size: 0.9375rem;
}

.legend li::before {
  content: "";
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  margin-right: 0.55rem;
  border-radius: 2px;
  background: var(--c);
}

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

.spec dl > div {
  padding-block: 1.4rem 1.5rem;
  border-top: 1px solid var(--rule);
}

.spec dt {
  font-weight: 650;
  font-size: 1.125rem;
  line-height: 1.3;
}

.spec dt small,
.spec dd small {
  margin-left: 0.35rem;
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.spec dd {
  margin: 0.45rem 0 0;
  color: var(--text-2);
  max-width: 34rem;
}

.promise ul {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem clamp(1.5rem, 4vw, 3rem);
  margin: clamp(2rem, 4vw, 2.75rem) 0 0;
  padding: 0;
  list-style: none;
}

.promise li {
  padding-top: 1rem;
  border-top: 1px solid var(--rule-strong);
  color: var(--text-2);
}

.promise li strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--text);
  font-weight: 650;
}

.promise .more {
  display: inline-block;
  margin-top: 2rem;
  font-weight: 600;
}

.closing {
  display: grid;
  justify-items: start;
  gap: 1.5rem;
}

.closing h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-stretch: 118%;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.closing p {
  max-width: 36rem;
  color: var(--text-2);
}

/* Reading pages: privacy, contact, terms, credits */

main.doc {
  display: grid;
  grid-template-columns: minmax(0, 14rem) minmax(0, var(--measure));
  gap: 0 clamp(2rem, 6vw, 5rem);
  align-items: start;
  padding-block: clamp(2rem, 6vw, 4.5rem) 1rem;
}

.doc-head {
  grid-column: 1 / -1;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.doc-head h1 {
  font-size: clamp(2.25rem, 5.5vw, 4rem);
  font-stretch: 118%;
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.doc-head p {
  margin-top: 1rem;
  max-width: 44rem;
  color: var(--text-2);
  font-size: 1.1875rem;
}

.doc-head .updated {
  margin-top: 0.9rem;
  color: var(--text-3);
  font-size: 0.9375rem;
}

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

.toc h2 {
  margin-bottom: 0.75rem;
  color: var(--text-3);
  font-size: 0.875rem;
  font-weight: 600;
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc a {
  display: block;
  padding: 0.3rem 0;
  color: var(--text-2);
  text-decoration: none;
}

.toc a:hover {
  color: #fff;
}

.prose section {
  padding-block: 0.25rem 2.5rem;
}

.prose h2 {
  margin-bottom: 0.9rem;
  font-size: 1.5rem;
  font-stretch: 108%;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

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

.prose p,
.prose li {
  color: var(--text);
  line-height: 1.7;
}

.prose p + p,
.prose p + ul,
.prose ul + p {
  margin-top: 1rem;
}

.prose ul,
.prose ol {
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
}

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

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

.prose strong {
  font-weight: 650;
}

.prose .quiet {
  color: var(--text-2);
}

.prose .mail {
  display: inline-block;
  margin-block: 0.25rem;
  font-size: clamp(1.375rem, 3.4vw, 2rem);
  font-stretch: 112%;
  font-weight: 700;
  text-decoration-thickness: 2px;
}

.table-wrap {
  margin-top: 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 12px;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.prose th,
.prose td {
  padding: 0.8rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--rule);
}

.prose th {
  color: var(--text-3);
  font-size: 0.8125rem;
  font-weight: 600;
  background: var(--raised);
}

.prose tr:last-child td {
  border-bottom: 0;
}

.prose td:first-child {
  font-weight: 600;
  white-space: nowrap;
}

/* 404 */

.lost {
  display: grid;
  gap: 1.25rem;
  justify-items: start;
  padding-block: clamp(4rem, 12vw, 9rem);
}

.lost h1 {
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-stretch: 125%;
  line-height: 1;
}

.lost p {
  color: var(--text-2);
  max-width: 34rem;
}

/* Narrow screens */

@media (max-width: 62rem) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .rise {
    justify-self: start;
    width: min(100%, 15rem);
    margin-bottom: -3rem;
  }

  .rise img {
    height: 14rem;
  }

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

  .toc {
    position: static;
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--rule);
  }
}

@media (max-width: 52rem) {
  .board .c-kind,
  .board .c-status {
    display: none;
  }

  .board th,
  .board td {
    padding-inline: 0.5rem;
  }

  .board th:first-child {
    padding-left: 0.9rem;
  }

  .flaps {
    gap: 0.08rem;
  }

  .flaps i {
    font-size: 0.75rem;
  }

  .three,
  .spec dl,
  .promise ul {
    grid-template-columns: minmax(0, 1fr);
  }

  .nav a {
    padding-inline: 0.5rem;
  }

  .bar .store {
    display: none;
  }
}

@media (max-width: 24rem) {
  .board th,
  .board td {
    padding-inline: 0.4rem;
  }

  .board th:first-child {
    padding-left: 0.7rem;
  }

  .flaps i {
    font-size: 0.6875rem;
  }
}

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

@media print {
  :root {
    --ground: #fff;
    --raised: #f2f4fa;
    --text: #0a1332;
    --text-2: #2b3a63;
    --text-3: #4a5a85;
    --accent: #1b4fb3;
    --accent-ink: #fff;
    --rule: #c6cde0;
    --rule-strong: #9aa6c8;
  }

  .glow,
  .rise,
  .toc,
  .skip {
    display: none;
  }

  main.doc {
    display: block;
  }

  .flaps i {
    color: #0a1332;
    background: none;
  }
}
