/* Lyfe's design language, taken from the app (Theme.swift, LivingPalette.swift,
   Typography.swift): Figtree, warm paper, the ballpoint ink and its faint
   tone, one 1.5 line, one 14 radius. The logo is the app icon's pen line,
   running to both edges like the welcome screen's mark. */

@font-face { font-family: Figtree; src: url(fonts/Figtree-Regular.ttf) format("truetype"); font-weight: 400; font-display: swap }
@font-face { font-family: Figtree; src: url(fonts/Figtree-SemiBold.ttf) format("truetype"); font-weight: 600; font-display: swap }
@font-face { font-family: Figtree; src: url(fonts/Figtree-Bold.ttf) format("truetype"); font-weight: 700; font-display: swap }
@font-face { font-family: Figtree; src: url(fonts/Figtree-ExtraBold.ttf) format("truetype"); font-weight: 800; font-display: swap }

:root {
  --paper: #F3F1EA;
  --surface: #FBFAF6;
  --ink: #1F3398;
  --faint: #5669A0;
  --rule: #7888B1;
  --ruled: rgba(31, 51, 152, .07);
  --line: 1.5px;
  --radius: 14px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121212;
    --surface: #1E1E1E;
    --ink: #F2F2F2;
    --faint: #949494;
    --rule: #6A6A6A;
    --ruled: rgba(255, 255, 255, .05);
  }
}

* { box-sizing: border-box }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden }
body {
  margin: 0;
  background-color: var(--paper);
  background-image: repeating-linear-gradient(to bottom, transparent 0 31px, var(--ruled) 31px 32px);
  color: var(--ink);
  font-family: Figtree, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-size: 16.5px;
  line-height: 1.6;
  padding: 28px max(22px, env(safe-area-inset-right)) 64px max(22px, env(safe-area-inset-left));
}
main { max-width: 640px; margin: 0 auto }

/* The head: the language on its own line, then the pen line with "lyfe" in it. */
nav { display: flex; flex-wrap: wrap; align-items: center }
nav .lang {
  order: -1; margin-left: auto; margin-bottom: 14px;
  font-size: 12px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase;
  color: var(--faint); text-decoration: none;
}
nav .lang:hover { color: var(--ink) }
.mark {
  --logo: 76px;
  /* The line runs to the screen's edges, past the text column. */
  flex: 0 0 100vw;
  margin-left: calc(50% - 50vw);
  display: flex; align-items: center;
  color: var(--ink); text-decoration: none;
}
/* The line, as thick as the letters' stroke (26.2 of the logo's 680 units). */
.mark::before, .mark::after {
  content: ""; flex: 1;
  height: calc(var(--logo) * 26.2 / 680);
  background: currentColor;
}
.mark .logo {
  width: var(--logo); aspect-ratio: 680 / 452; flex: none;
  background: currentColor;
  -webkit-mask: url(logo.svg) center / contain no-repeat;
  mask: url(logo.svg) center / contain no-repeat;
}

a { color: var(--ink); text-decoration-thickness: var(--line); text-underline-offset: 3px }
h1 { font-size: 40px; font-weight: 800; letter-spacing: -1px; line-height: 1.1; margin: 30px 0 8px; text-wrap: balance }
.date {
  color: var(--faint); margin-bottom: 26px;
  font-size: 12px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase;
}
h2 {
  font-size: 22px; font-weight: 700; line-height: 1.25; margin: 40px 0 10px; text-wrap: balance;
  padding-top: 16px; border-top: var(--line) solid var(--rule);
}
p, li { color: var(--ink) }
p { margin: 0 0 12px }
b { font-weight: 700 }
ul { padding-left: 18px; margin: 0 0 12px }
li { margin-bottom: 8px }
li::marker { color: var(--faint) }

.lead { background: var(--surface); border-radius: var(--radius); padding: 16px 20px; margin: 22px 0 8px }
.lead ul { margin: 0 }
.lead li:last-child { margin-bottom: 0 }

.q { margin-top: 18px }
.q b { display: block; margin-bottom: 2px }
.q p { margin-top: 0 }

/* Rows, like a list in the app: a surface, a title, a chevron. */
.links { display: grid; gap: 10px; margin-top: 24px }
.links a {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface); border-radius: var(--radius);
  padding: 16px 20px; font-size: 18px; font-weight: 700; text-decoration: none;
}
.links a::after { content: "›"; color: var(--faint); font-size: 24px; font-weight: 600; line-height: 1 }
.links a:active { opacity: .7 }

footer {
  margin-top: 48px; padding-top: 14px; border-top: var(--line) solid var(--rule);
  color: var(--faint); font-size: 13px; font-weight: 600;
}
footer a { color: var(--faint) }
