/* Mosvik pages (privacy, support). Tokens from apps/mosvik/design/marca.md:
   paper and ink for the page, petrol as the brand note (the visor band),
   copper only for the reading line on petrol, never as text on paper. */

@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/InstrumentSans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/InstrumentSans-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  /* Visor band: same in both appearances */
  --petrol: #0F3440;
  --visor-top: #16434F;
  --visor-bottom: #0B2A33;
  --on-visor: #F6F4EE;           /* 12.04:1 on petrol */
  --on-visor-2: #9DB2B8;         /* 5.99:1 on petrol */
  --visor-line: #E58B4C;         /* copper reading line, 5.13:1 on petrol (graphic) */
  --visor-rule: rgba(246, 244, 238, 0.18);
  /* Page, light: paper */
  --bg: #F6F4EE;
  --surface: #FFFFFF;
  --separator: #D9DDD6;
  --text: #0B1F26;               /* 15.42:1 */
  --text-2: #4E6670;             /* 5.52:1 */
  --link: #2E5A78;               /* reading blue, 6.70:1 */
  --tint: #DCE7EE;
  --measure: 38rem;
  --gutter: 20px;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Page, dark: ink */
    --bg: #081A20;
    --surface: #0F262E;
    --separator: #22404B;
    --text: #EEF3EE;             /* 15.85:1 */
    --text-2: #9DB2B8;           /* 8.05:1 */
    --link: #86B2D1;             /* 7.89:1 */
    --tint: #163440;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Instrument Sans", -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  font-feature-settings: "kern", "calt";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--tint); color: var(--text); }

.wrap {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 10;
  padding: 8px 16px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { left: 12px; }

/* Visor: petrol band with the wordmark, the page title and the reading line */
.band {
  background: var(--petrol);
  color: var(--on-visor);
}
header.band { background: var(--visor-top); }
main > .band {
  background: linear-gradient(180deg, var(--visor-top) 0%, var(--visor-bottom) 100%);
}
.band-head { padding-top: 28px; }
.wordmark {
  display: block;
  width: 120px;
  height: 28px;
}
.band-title { padding-top: 64px; padding-bottom: 0; }
.band-title + .reading { margin-top: 30px; }
.band-title h1 {
  margin: 0;
  font-size: 46px;
  line-height: 1.06;
  font-weight: 600;
  letter-spacing: -0.022em;
  color: var(--on-visor);
  text-wrap: balance;
}

/* The reading line: the border between the tinted field (petrol band) and
   the sample (paper page), as seen through the eyepiece. It runs edge to edge
   and rises against the right edge of the window, which acts as the wall,
   thinning as it climbs like a meniscus. Never left out. 8 px of petrol stay
   below it so copper never touches paper. */
.reading {
  display: flex;
  align-items: flex-end;
  height: 18px;
  padding-bottom: 8px;
  box-sizing: content-box;
}
.reading::before {
  content: "";
  flex: 1 1 auto;
  height: 3px;
  background: var(--visor-line);
}
.reading::after {
  content: "";
  flex: 0 0 24px;
  height: 18px;
  background: no-repeat right bottom / 24px 18px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 18'%3E%3Cpath d='M0 15 H4 C12 15 18.5 11 22.8 2 H24 C22 12 14 18 4 18 H0 Z' fill='%23E58B4C'/%3E%3C/svg%3E");
}

/* Body text */
.prose {
  padding-top: 44px;
  padding-bottom: 56px;
}
.prose > :first-child { margin-top: 0; }

.prose p,
.prose ul { margin: 0 0 16px; }

.prose ul { padding-left: 1.25em; }
.prose li { margin: 0 0 8px; padding-left: 0.25em; }
.prose li::marker { color: var(--text-2); }

.prose strong { font-weight: 600; }

.prose h2 {
  margin: 56px 0 14px;
  font-size: 25px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.012em;
}
/* Section number read like an instrument value: tabular figures, secondary ink */
.prose h2 .num {
  display: inline-block;
  min-width: 1.6em;
  color: var(--text-2);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.prose h3 {
  margin: 32px 0 6px;
  font-size: 19px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: -0.008em;
}
.prose h2 + h3 { margin-top: 24px; }

/* Support questions: each one set apart by a hairline */
.faq h3 {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--separator);
}
.faq h2 + h3 { margin-top: 24px; padding-top: 0; border-top: 0; }
.prose .aside { margin-top: 40px; color: var(--text-2); }

.prose p > em:only-child {
  display: block;
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--separator);
  font-size: 14px;
  line-height: 1.6;
  font-style: normal;
  color: var(--text-2);
}

/* Contents, privacy page */
.toc {
  margin: 28px 0 8px;
  padding: 18px 22px 12px;
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: 14px;
}
.toc ol {
  margin: 0;
  padding-left: 1.4em;
  columns: 2 15rem;
  column-gap: 32px;
  font-size: 16px;
}
.toc li { margin: 0 0 6px; break-inside: avoid; }
.toc li::marker { color: var(--text-2); font-variant-numeric: tabular-nums; }

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
}
a:hover { text-decoration-thickness: 2px; }
a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: 4px;
}
.band a:focus-visible { outline-color: var(--on-visor); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--separator);
  padding: 20px 0 48px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-2);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 24px;
}
.site-footer p { margin: 0; }
.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-footer a {
  display: inline-block;
  padding: 12px 0;
  text-decoration: none;
  font-weight: 600;
}
.site-footer a:hover { text-decoration: underline; }
.site-footer a[aria-current="page"] { color: var(--text); }

@media (max-width: 600px) {
  body { font-size: 16.5px; }
  .band-head { padding-top: 20px; }
  .wordmark { width: 103px; height: 24px; }
  .band-title { padding-top: 44px; }
  .band-title h1 { font-size: 36px; }
  .band-title + .reading { margin-top: 24px; }
  .prose { padding-top: 34px; }
  .prose h2 { margin-top: 48px; font-size: 24px; }
  .prose h3 { font-size: 18px; }
  .toc { padding: 16px 18px 10px; }
  .site-footer .wrap { flex-direction: column; align-items: flex-start; }
}
