/* Para's landing page, in the app's own look: paper, ink and one marker, in Atkinson
   Hyperlegible. The colours and sizes are the app's (src/app.css). Everything the page
   needs is in this folder; it asks no other server for anything. */

@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(fonts/atkinson-hyperlegible-next-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Atkinson Hyperlegible Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(fonts/atkinson-hyperlegible-mono-latin-wght-normal.woff2) format('woff2-variations');
}

:root {
  color-scheme: light dark;
  --bg: light-dark(#f8f8f4, #111113);
  --border: light-dark(#dddcd6, #2c2c32);
  --text: light-dark(#121214, #f3f2ee);
  --muted: light-dark(#5b5a64, #a5a4ae);
  --faint: light-dark(#706f79, #85848e);
  --mark: light-dark(#d9cfff, #cbbfff);
  --on-mark: #17132b;
  --sans: 'Atkinson Hyperlegible Next', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Atkinson Hyperlegible Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  /* The page's side margin, wide on a wide window. */
  --pad: max(1.25rem, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px), min(6.5vw, 12rem));
  --gap: clamp(2rem, 6vw, 8rem);
  /* The height of the bar that stays at the top. */
  --top: 4rem;
  /* Type and spacing are in rem, and the root grows with the window, so a wide screen gets
     larger words instead of wider margins. */
  font-size: clamp(16px, 11px + 0.36vw, 22px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  background: var(--bg);
  scroll-padding-top: var(--top);
}
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1,
h2,
h3,
p,
ol,
ul,
figure {
  margin: 0;
}
ol,
ul {
  padding: 0;
  list-style: none;
}
a {
  color: inherit;
}
::selection {
  background: var(--mark);
  color: var(--on-mark);
}
:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
  border-radius: 0.2rem;
}
mark {
  display: inline-block;
  border-radius: 0.08em;
  background: var(--mark);
  padding: 0 0.07em;
  color: var(--on-mark);
  line-height: 0.98;
}

/* The page's one action, in ink. */
.btn {
  display: inline-flex;
  align-items: center;
  min-height: 3.1rem;
  border: 2px solid var(--text);
  border-radius: 0.7rem;
  background: var(--text);
  padding: 0.3rem 1.35rem;
  color: var(--bg);
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  transition:
    border-color 0.15s,
    background-color 0.15s;
}
.btn:hover {
  border-color: color-mix(in oklab, var(--text) 84%, var(--mark));
  background: color-mix(in oklab, var(--text) 84%, var(--mark));
}
.btn.large {
  min-height: 3.9rem;
  padding: 0.6rem 1.75rem;
  font-size: 1.3rem;
}
.btn.small {
  min-height: 2.4rem;
  border-radius: 0.55rem;
  padding: 0.2rem 0.9rem;
  font-size: 0.95rem;
}

/* Para's logo, as the app icon draws it: the parentheses of the app's mark close around a
   block of the marker. */
.par {
  display: inline-flex;
  align-items: center;
  gap: 0.07em;
  white-space: nowrap;
}
.par i {
  width: 0.7em;
  height: 0.7em;
  border-radius: 0.16em;
  background: var(--mark);
}
.par svg {
  flex: none;
  width: 0.36em;
  height: 1.2em;
  fill: none;
  stroke: currentColor;
  stroke-width: 3.2;
  stroke-linecap: round;
}
.par .flip {
  transform: scaleX(-1);
}

/* The bar that stays at the top: the mark, and the way to the end of the page. */
.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: var(--top);
  padding: env(safe-area-inset-top, 0px) var(--pad) 0;
  background: var(--bg);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}
.brand .name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.top nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-left: auto;
  font-weight: 500;
}
.top nav a:not(.btn) {
  color: var(--muted);
  text-decoration: none;
}
.top nav a:not(.btn):hover {
  color: var(--text);
}
@media (max-width: 36rem) {
  /* A narrow bar has room for the mark and the one action. */
  .top nav a:not(.btn) {
    display: none;
  }
}

main > section,
.prop {
  max-width: 132rem;
  margin: 0 auto;
  padding-inline: var(--pad);
}

/* The opening: what Para is, in two sentences, and the app itself. */
.hero {
  display: grid;
  align-items: center;
  gap: clamp(2.5rem, 6vh, 4rem) var(--gap);
  padding-block: clamp(1.75rem, 5vh, 4rem) clamp(2.25rem, 6vh, 4.5rem);
}
h1 {
  font-size: clamp(2.7rem, 6.6vw, 10.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
/* Two wordings in one place, each shown in turn: the second waits out of sight while the
   first is read, then they change over. Without motion, the first stays. */
.turn {
  display: inline-grid;
}
.turn > * {
  grid-area: 1 / 1;
  justify-self: start;
}
.turn > :last-child {
  opacity: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .turn > * {
    animation: turn 9s infinite both;
    /* Begun part-way, so the page opens on the first wording, already in place. */
    animation-delay: -0.6s;
  }
  .turn > :last-child {
    animation-delay: -5.1s;
  }
  /* The second line follows the first by a moment. */
  .turn.later > * {
    animation-delay: -0.48s;
  }
  .turn.later > :last-child {
    animation-delay: -4.98s;
  }
}
@keyframes turn {
  0% {
    opacity: 0;
    transform: translateY(0.18em);
  }
  6%,
  44% {
    opacity: 1;
    transform: none;
  }
  50%,
  100% {
    opacity: 0;
    transform: translateY(-0.18em);
  }
}
/* What sets Para apart, in ink under the headline. */
.claim {
  margin-top: 0.7em;
  font-size: clamp(1.45rem, 2.5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
}
/* Each claim stays whole; a narrow column breaks the line between them. */
.claim span {
  white-space: nowrap;
}
.lede {
  max-width: 24em;
  margin-top: 0.45em;
  color: var(--muted);
  font-size: clamp(1.3rem, 2.2vw, 3rem);
  line-height: 1.25;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.75rem;
  margin-top: clamp(1.75rem, 4vh, 3rem);
}

/* What Para does for you, each said in a line and shown in the app itself. */
main > .props {
  max-width: none;
  padding-inline: 0;
}
.prop {
  display: grid;
  gap: clamp(1.75rem, 3.2vw, 3.25rem) var(--gap);
}
/* A hairline opens each part of the page, as wide as the words under it. */
.prop,
.how,
.get {
  padding-bottom: clamp(3.5rem, 9vh, 6.5rem);
}
.prop::before,
.how::before,
.get::before {
  content: '';
  display: block;
  grid-column: 1 / -1;
  margin-bottom: clamp(1.25rem, 4.8vh, 2.75rem);
  border-top: 1px solid var(--border);
}
.how::before,
.get::before {
  margin-bottom: clamp(3rem, 8vh, 6rem);
}
/* How it works follows the opening closely, so its title shows in the first window. */
.how::before {
  margin-bottom: clamp(1.75rem, 5vh, 3.5rem);
}
/* The opening's picture loses the empty paper at its foot. */
.hero .shot img {
  aspect-ratio: 2560 / 1340;
  object-fit: cover;
  object-position: top left;
}
.words {
  display: grid;
  align-items: start;
  gap: 0.9rem var(--gap);
}
h2 {
  font-size: clamp(2rem, 3.6vw, 5.2rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.032em;
  text-wrap: balance;
}
.words p {
  max-width: 34em;
  font-size: clamp(1.1rem, 1.35vw, 1.7rem);
  text-wrap: pretty;
}
.words .aside {
  margin-top: 0.6em;
  color: var(--muted);
  font-size: clamp(1rem, 1.1vw, 1.35rem);
}
/* A picture of the app's window, which floats over the page. */
.shot {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  background: var(--bg);
  box-shadow: 0 2rem 4.5rem -2.25rem light-dark(rgb(18 18 20 / 0.3), rgb(0 0 0 / 0.85));
}
.shot img {
  display: block;
  width: 100%;
  height: auto;
}

/* How it works: four steps, in order. */
.steps {
  display: grid;
  gap: 2.25rem clamp(1.5rem, 3vw, 3.5rem);
  margin-top: clamp(2rem, 5vh, 3.5rem);
}
.steps li {
  border-top: 2px solid var(--text);
  padding-top: 0.9rem;
}
.steps .n {
  color: var(--faint);
  font: 0.95rem var(--mono);
}
.steps h3 {
  margin-top: 0.45rem;
  font-size: 1.4rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.steps p {
  max-width: 30em;
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 1.05rem;
  text-wrap: pretty;
}

/* The end: how to get it. */
.get {
  padding-bottom: clamp(4rem, 14vh, 9rem);
}
.get h2 {
  font-size: clamp(2.4rem, 5.4vw, 8rem);
  line-height: 1;
  letter-spacing: -0.035em;
}
.get .aside {
  margin-top: 0.45em;
  color: var(--faint);
  font-size: clamp(1.2rem, 2.2vw, 3rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.get .or,
.get .note {
  color: var(--muted);
  font-size: 1.05rem;
}
/* The address is there to be copied, for whoever's browser opens no mail app. */
.get .address {
  color: var(--text);
  font-weight: 600;
  user-select: all;
}
.get .note {
  max-width: 34em;
  margin-top: 1.25rem;
  text-wrap: balance;
}

footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  border-top: 1px solid var(--border);
  padding: 1.5rem var(--pad) max(2rem, env(safe-area-inset-bottom, 0px));
  color: var(--muted);
  font-size: 0.875rem;
}
footer p:last-child {
  margin-left: auto;
}

@media (min-width: 40rem) {
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 64rem) {
  /* The words on the left and the app on the right, wider than its column: it runs off the
     edge of the window, which cuts it short. */
  .hero {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
    overflow-x: clip;
  }
  .hero h1 {
    font-size: clamp(2.7rem, 5vw, 8rem);
  }
  .hero .claim {
    font-size: clamp(1.3rem, 1.8vw, 2.6rem);
  }
  .hero .lede {
    max-width: none;
    font-size: clamp(1rem, 1.4vw, 2rem);
  }
  .hero .shot {
    width: 125%;
  }
}
@media (min-width: 56rem) {
  /* The line on the left, what it means on the right, and the picture under both. */
  .words {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  }
  .words > :last-child {
    padding-top: 0.5rem;
  }
}
@media (min-width: 72rem) {
  .steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (min-width: 110rem) {
  /* A very wide window has room for the words beside the picture. */
  .prop {
    grid-template-columns: minmax(0, 1fr) minmax(0, 80rem);
    align-items: start;
  }
  .words {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 0.5rem;
  }
  .words > :last-child {
    padding-top: 0;
  }
  .words h2 {
    font-size: 3.6rem;
  }
  .words p {
    font-size: 1.3rem;
  }
  .words .aside {
    font-size: 1.1rem;
  }
}
