/*
  Papey: the store site (index, privacy, support).
  Tokens follow DESIGN.md: the Night theme by default, Midnight sun for light
  mode. Fonts are self-hosted (SIL OFL 1.1, licences in fonts/), so the pages
  make no third-party requests and work offline.

  Language: each page holds an English and a Dutch block. English shows by
  default; the Dutch block shows when the URL ends in #nl (or points inside
  it). Browsers without :has() simply show both languages.
*/

@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('fonts/bricolage-grotesque-latin-wght-normal.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Figtree';
  src: url('fonts/figtree-latin-wght-normal.woff2') format('woff2');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Literata';
  src: url('fonts/literata-latin-wght-normal.woff2') format('woff2');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --c-canvas: #070b14;
  --c-surface: #0e1522;
  --c-raised: #152033;
  --c-line: rgb(180 200 255 / 0.1);
  --c-line-strong: rgb(180 200 255 / 0.2);
  --c-fg: #eef3fa;
  --c-muted: #a9b6ca;
  --c-faint: #8391a8;
  --c-accent: #ff7a3d;
  --c-accent-soft: rgb(255 122 61 / 0.16);
  --c-on-accent: #1a0a02;
  --c-press: #b8501f;
  --c-aurora: #46e6a4;
  --c-aurora-soft: rgb(70 230 164 / 0.14);
  --c-glacier: #7cc4ff;
  --c-glacier-soft: rgb(124 196 255 / 0.14);
  --c-gold: #ffc94d;
  --glow-a: rgb(70 230 164 / 0.16);
  --glow-b: rgb(124 196 255 / 0.1);
  --glow-c: rgb(165 139 255 / 0.08);
  --halo-a: rgb(124 196 255 / 0.3);
  --halo-b: rgb(70 230 164 / 0.12);

  --font-display: 'Bricolage Grotesque', 'Figtree', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-ui: 'Figtree', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-is: 'Literata', ui-serif, Georgia, serif;

  --radius: 18px;
  --gutter: max(16px, env(safe-area-inset-left));
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --c-canvas: #f4f2ed;
    --c-surface: #ffffff;
    --c-raised: #ebe8e1;
    --c-line: rgb(12 20 36 / 0.1);
    --c-line-strong: rgb(12 20 36 / 0.2);
    --c-fg: #0c1424;
    --c-muted: #46526a;
    --c-faint: #566074;
    --c-accent: #b5430f;
    --c-accent-soft: rgb(181 67 15 / 0.12);
    --c-on-accent: #ffffff;
    --c-press: #7a2c08;
    --c-aurora: #097752;
    --c-aurora-soft: rgb(9 119 82 / 0.12);
    --c-glacier: #1b62a2;
    --c-glacier-soft: rgb(27 98 162 / 0.1);
    --c-gold: #905e00;
    --glow-a: rgb(9 119 82 / 0.1);
    --glow-b: rgb(27 98 162 / 0.07);
    --glow-c: rgb(99 73 199 / 0.05);
    --halo-a: rgb(27 98 162 / 0.12);
    --halo-b: rgb(9 119 82 / 0.06);
  }
}

/* Base */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--c-canvas);
  /* A still northern-lights glow at the top, as on the app's Home screen. */
  background-image:
    radial-gradient(60rem 26rem at 18% -6rem, var(--glow-a), transparent 70%),
    radial-gradient(44rem 22rem at 86% -4rem, var(--glow-b), transparent 70%),
    radial-gradient(36rem 20rem at 52% 4rem, var(--glow-c), transparent 70%);
  background-repeat: no-repeat;
  color: var(--c-fg);
  font-family: var(--font-ui);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.25rem, 1.6rem + 3vw, 3.5rem);
  font-weight: 750;
}

h2 {
  font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  font-weight: 700;
  margin-top: 3rem;
}

h3 {
  font-size: 1.125rem;
  font-weight: 650;
  margin-top: 1.75rem;
}

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

ul,
ol {
  padding-left: 1.25rem;
}

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

strong {
  font-weight: 650;
}

a {
  color: var(--c-glacier);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--c-glacier);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Icelandic text: Literata, always with lang="is". */
.is-text {
  font-family: var(--font-is);
  font-weight: 450;
}

/* One label style, as the app's Kicker: sentence case, small, semibold. */
.kicker {
  display: block;
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--c-muted);
  margin: 0 0 0.5rem;
}

.muted {
  color: var(--c-muted);
}

.small {
  font-size: 0.9375rem;
}

/* Language blocks */

[data-lang] {
  scroll-margin-top: 100vh; /* jumping to #nl or #en keeps the page at the top */
}

body:not(:has([data-lang='nl']:target, [data-lang='nl'] :target)) [data-lang='nl'] {
  display: none;
}

body:has([data-lang='nl']:target, [data-lang='nl'] :target) [data-lang='en'] {
  display: none;
}

[data-lang] [id] {
  scroll-margin-top: 1.5rem;
}

/* Skip link */

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 0.65rem 1rem;
  border-radius: 12px;
  background: var(--c-surface);
  color: var(--c-fg);
  font-weight: 600;
}

.skip:focus {
  top: 12px;
}

/* Header */

.site-header {
  max-width: 68rem;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) var(--gutter) 0;
}

.bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  margin-right: auto;
  color: var(--c-fg);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 750;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.bar nav ul {
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bar nav li + li {
  margin-top: 0;
}

.bar a:not(.brand) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  justify-content: center;
  padding: 0 0.8rem;
  border-radius: 999px;
  color: var(--c-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
}

.bar a:not(.brand):hover {
  color: var(--c-fg);
  background: var(--c-raised);
}

.bar a[aria-current='page'] {
  color: var(--c-fg);
}

.bar .lang-link {
  border: 1px solid var(--c-line-strong);
}

/* Keep brand, pages and language on one row on a 375 px phone. */
@media (max-width: 26rem) {
  .bar {
    gap: 0.25rem;
  }

  .brand {
    gap: 0.45rem;
    font-size: 1.125rem;
  }

  .brand img {
    width: 30px;
    height: 30px;
  }

  .bar a:not(.brand) {
    padding: 0 0.55rem;
    font-size: 0.875rem;
  }
}

/* Page */

main {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 var(--gutter) 4rem;
}

.page {
  max-width: 42rem;
  padding-top: clamp(2rem, 6vw, 4.5rem);
}

.lede {
  font-size: clamp(1.125rem, 1.05rem + 0.35vw, 1.25rem);
  color: var(--c-muted);
  margin-top: 1.25rem;
  max-width: 38rem;
}

.meta {
  margin-top: 1rem;
  color: var(--c-faint);
  font-size: 0.9375rem;
}

/* Home hero: text left, puffin right, offset from the column. */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
  padding-top: clamp(2rem, 7vw, 5.5rem);
}

@media (min-width: 52rem) {
  .hero {
    grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
    gap: 3rem;
  }
}

.hero-art {
  position: relative;
  justify-self: center;
  width: min(15rem, 62vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.hero-art::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  /* A halo, so the puffin's dark body reads against the night canvas. */
  background: radial-gradient(circle at 50% 46%, var(--halo-a), var(--halo-b) 46%, transparent 70%);
}

.hero-art img {
  position: relative;
  width: 78%;
  height: auto;
}

@media (min-width: 52rem) {
  .hero-art {
    justify-self: end;
    width: 17rem;
    margin-top: 2rem;
  }
}

.hero-copy {
  max-width: 40rem;
}

/* The App Store badge placeholder: the page's one action, in puffin orange. */
.store {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 52px;
  margin-top: 2rem;
  padding: 0.75rem 1.4rem;
  border-radius: 14px;
  background: var(--c-accent);
  color: var(--c-on-accent);
  box-shadow: 0 4px 0 var(--c-press);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  text-decoration: none;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.store:hover {
  text-decoration: none;
}

.store:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 var(--c-press);
}

.store svg {
  width: 22px;
  height: 22px;
  flex: none;
}

/* Before launch the build puts this label where the badge goes. It is not a
   link, so it does not look like a button. */
.store-soon {
  margin-top: 2rem;
  color: var(--c-accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
}

.store-note {
  margin-top: 0.9rem;
  color: var(--c-faint);
  font-size: 0.9375rem;
}

/* Facts and cards */

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 3.5rem 0 0;
  padding: 0;
  list-style: none;
  max-width: 50rem;
}

@media (min-width: 40rem) {
  .facts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.facts li {
  margin: 0;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  background: var(--c-surface);
  border: 1px solid var(--c-line);
}

.facts .num {
  display: block;
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 750;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.facts .lbl {
  display: block;
  margin-top: 0.3rem;
  color: var(--c-muted);
  font-size: 0.9375rem;
  line-height: 1.35;
}

.card {
  margin-top: 1.25rem;
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius);
  background: var(--c-surface);
  border: 1px solid var(--c-line);
}

.card > :first-child {
  margin-top: 0;
}

.card h2,
.card h3 {
  margin-top: 0;
}

.summary {
  border-color: var(--c-aurora-soft);
  background: linear-gradient(var(--c-aurora-soft), var(--c-aurora-soft)), var(--c-surface);
}

.features {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
  padding: 0;
  list-style: none;
}

@media (min-width: 44rem) {
  .features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.features li {
  margin: 0;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius);
  background: var(--c-surface);
  border: 1px solid var(--c-line);
}

.features h3 {
  margin: 0;
  font-size: 1.0625rem;
}

.features p {
  margin-top: 0.35rem;
  color: var(--c-muted);
  font-size: 0.9875rem;
}

.wide {
  max-width: 50rem;
}

/* Table of contents on the longer pages */

.toc {
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--c-line);
}

.toc ul {
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
  columns: 2 12rem;
  column-gap: 1.5rem;
}

.toc li {
  margin: 0;
  break-inside: avoid;
}

.toc a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* Steps on the support page */

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 2.4rem;
}

.steps li + li {
  margin-top: 0.75rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 1.65rem;
  height: 1.65rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--c-raised);
  color: var(--c-fg);
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 700;
}

.path {
  font-weight: 600;
  color: var(--c-fg);
}

.credits dt {
  font-weight: 650;
  margin-top: 1rem;
}

.credits dt:first-child {
  margin-top: 0;
}

.credits dd {
  margin: 0.2rem 0 0;
  color: var(--c-muted);
  font-size: 0.9875rem;
}

/* Footer */

.site-footer {
  max-width: 68rem;
  margin: 0 auto;
  padding: 2rem var(--gutter) max(2.5rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--c-line);
  color: var(--c-faint);
  font-size: 0.9375rem;
}

.site-footer p {
  margin: 0;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.25rem;
  margin: 0.5rem 0 0 -0.6rem;
  padding: 0;
  list-style: none;
}

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

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.6rem;
  color: var(--c-muted);
}

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

@media print {
  body {
    background: #fff;
    color: #000;
  }

  .skip,
  .bar nav,
  .lang-link,
  .store {
    display: none !important;
  }

  [data-lang] {
    display: block !important;
  }
}
