@font-face {
  src: url("fonts/MonoLisaText.woff2") format("woff2");
  font-family: MonoLisaText;
  font-weight: 1 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0020-007F;
}

@font-face {
  src: url("fonts/MonoLisaText-Latin1.woff2") format("woff2");
  font-family: MonoLisaText;
  font-weight: 1 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0080-00FF;
}

:root {
  --bg: #ffffff;
  --fg: #111111;
  --fg-muted: #666666;
  --fg-faint: #8a8a8a;
  --fg-link: #444444;
  --code: #0085c7;
  --line: color-mix(in srgb, var(--fg-faint) 45%, transparent);

  --gutter: 1.25rem;
  --phone: 8.4rem;

  font-size: clamp(20px, 4vw, 28px);
  scroll-behavior: smooth;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f0f;
    --fg: #e6e6e6;
    --fg-muted: #9a9a9a;
    --fg-faint: #7f7f7f;
    --fg-link: #c0c0c0;
    --code: #40b3f5;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    scroll-behavior: auto;
  }
}

html,
body {
  margin: 0;
}

body {
  box-sizing: border-box;
  padding: 3.4rem var(--gutter) 1.6rem;
  background-color: var(--bg);
  color: var(--fg);
  font-family:
    MonoLisaText,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    "Liberation Mono",
    "Courier New",
    monospace;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--fg-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 0.18rem;
  border-radius: 4px;
}

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

.page {
  width: min(100%, 36rem);
  margin: 0 auto;
}

/* Language, at the upper right */

.language {
  position: absolute;
  top: max(1rem, env(safe-area-inset-top));
  right: max(1rem, env(safe-area-inset-right));
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  z-index: 10;
}

.language a,
.language span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  padding: 0.18rem 0.28rem;
  border: 1px solid color-mix(in srgb, var(--fg-muted) 55%, transparent);
  border-radius: 6px;
  background-color: var(--bg);
  color: var(--fg-muted);
  text-decoration: none;
}

.language [aria-current="page"] {
  background-color: var(--fg);
  border-color: var(--fg);
  color: var(--bg);
}

.language a:hover,
.language a:focus-visible {
  color: var(--fg);
  border-color: var(--fg);
}

/* Top of the page */

.hero {
  text-align: center;
  opacity: 0;
  animation: fade-in 1.2s ease-out forwards;
}

.app-icon {
  width: 4.6rem;
  height: 4.6rem;
  margin: 0 auto 0.5rem;
}

h1 {
  margin: 0;
  font-size: clamp(1.65rem, 10vw, 2.2rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.tagline {
  max-width: 24rem;
  margin: 0.7rem auto 0;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1.45;
  color: var(--fg-muted);
  text-wrap: balance;
}

.store {
  margin: 1.7rem 0 0;
}

.store-button {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--fg);
  border-radius: 8px;
  background-color: var(--fg);
  color: var(--bg);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.store-button:hover,
.store-button:focus-visible {
  background-color: transparent;
  color: var(--fg);
}

.platforms {
  margin: 0.8rem 0 0;
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.hero .shot {
  margin-top: 2.6rem;
}

/* Links to the parts of the page */

.contents {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem;
  margin: 2.2rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.55rem;
  letter-spacing: 0.08em;
}

.contents a {
  display: block;
  padding: 0.22rem 0.4rem;
  border: 1px solid color-mix(in srgb, var(--fg-muted) 55%, transparent);
  border-radius: 6px;
  color: var(--fg-muted);
  text-decoration: none;
}

.contents a:hover,
.contents a:focus-visible {
  color: var(--fg);
  border-color: var(--fg);
}

/* Text */

.section-title {
  margin: 0 0 0.65rem;
  font-size: 0.55rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg);
}

h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.3;
  text-wrap: balance;
}

.feature p,
.plain p,
.steps p {
  margin: 0.7rem 0 0;
  font-size: max(0.6rem, 14px);
  letter-spacing: 0.03em;
  line-height: 1.6;
  color: var(--fg-muted);
}

p.section-title {
  margin: 0 0 0.65rem;
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  line-height: 1.4;
  color: var(--fg);
}

code {
  font: inherit;
  color: var(--code);
  white-space: nowrap;
}

/* Names with a hyphen, such as ICD-11, stay on one line. */

.nb {
  white-space: nowrap;
}

/* A feature: its text, and the screenshots that show it */

.feature,
.plain {
  margin-top: 4.6rem;
  scroll-margin-top: 1.5rem;
}

.feature {
  max-width: 24rem;
  margin-inline: auto;
}

.shots {
  display: flex;
  gap: 0.6rem;
  margin: 1.5rem calc(-1 * var(--gutter)) 0;
  padding: 0 var(--gutter);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--gutter);
}

.shots .shot {
  flex: none;
  width: 11rem;
  scroll-snap-align: start;
}

.shot {
  margin: 0;
}

.feature > .shot {
  margin-top: 1.5rem;
}

/* Screenshots without a device around them get a rim in the shape of the display.
   A screenshot that brings its own device frame loses the class "bare". */

.shot.bare img {
  box-sizing: border-box;
  border: 1px solid var(--line);
}

.shot.iphone.bare img {
  border-radius: 15.4% / 7.1%;
}

.shot.ipad.bare img {
  border-radius: 1.7% / 2.3%;
}

@media (min-width: 700px) {
  .shots {
    margin-inline: 0;
    padding: 0;
    overflow-x: visible;
  }

  .shots .shot {
    width: var(--phone);
  }
}

@media (min-width: 1040px) {
  .feature {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 1.8rem;
    align-items: center;
    max-width: none;
  }

  .feature-text {
    max-width: 22rem;
  }

  .shots {
    margin-top: 0;
  }

  .feature > .shot {
    grid-column: 1 / -1;
    margin-top: 1.8rem;
  }

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

  .feature.turned .feature-text {
    order: 2;
    justify-self: end;
  }

  .feature.turned > .shot {
    order: 3;
  }
}

/* Smaller things, in boxes */

.plain {
  max-width: 24rem;
  margin-inline: auto;
}

.plain.broad {
  max-width: none;
}

.plain.broad > .section-title,
.plain.broad > h2 {
  text-align: center;
}

.cards,
.steps {
  display: grid;
  gap: 0.55rem;
  margin: 1.3rem 0 0;
  padding: 0;
  list-style: none;
}

.cards li,
.steps li {
  padding: 0.65rem 0.85rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.card-name {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  line-height: 1.35;
  color: var(--fg-link);
}

.card-text {
  display: block;
  margin-top: 0.3rem;
  font-size: max(0.5rem, 13px);
  letter-spacing: 0.03em;
  line-height: 1.5;
  color: var(--fg-muted);
}

.steps {
  counter-reset: step;
}

.steps li {
  counter-increment: step;
}

.steps .card-name::before {
  content: counter(step) "  ";
  white-space: pre;
  color: var(--fg-faint);
}

@media (min-width: 700px) {
  .cards {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1040px) {
  .cards {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.closing {
  margin-top: 4.6rem;
  text-align: center;
}

/* Foot of the page */

footer {
  max-width: 24rem;
  margin: 4.6rem auto 0;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  font-size: max(0.45rem, 12px);
  letter-spacing: 0.03em;
  line-height: 1.6;
  color: var(--fg-faint);
}

footer p {
  margin: 0 0 0.7rem;
}

footer a {
  color: inherit;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero {
    animation: none;
    opacity: 1;
  }
}
