/*
 * optimum.ad: the public site. The same look as the app (apps/web/app/styles.css): one accent,
 * the system's own sans-serif, light and dark from the same tokens. Here the type is a little
 * larger, because these pages are read, not operated.
 *
 * No web fonts, no images fetched from elsewhere, no script. A page built from this file
 * makes no request to any other host and sets no cookie.
 */

:root {
  --bg: oklch(0.977 0.003 240);
  --surface: oklch(1 0 0);
  --sunken: oklch(0.962 0.004 240);
  --line: oklch(0.905 0.006 240);
  --line-strong: oklch(0.82 0.01 240);
  --ink: oklch(0.25 0.015 250);
  --ink-muted: oklch(0.47 0.015 250);
  --ink-faint: oklch(0.6 0.012 250);
  --accent: oklch(0.47 0.085 200);
  --accent-ink: oklch(0.99 0 0);
  --accent-soft: oklch(0.945 0.025 200);

  --font-sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', 'Segoe UI Mono', Menlo, Consolas, monospace;

  --radius-control: 0.375rem;
  --radius-card: 0.5rem;
  --measure: 65ch;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: oklch(0.175 0.008 250);
    --surface: oklch(0.215 0.009 250);
    --sunken: oklch(0.195 0.008 250);
    --line: oklch(0.29 0.01 250);
    --line-strong: oklch(0.38 0.012 250);
    --ink: oklch(0.93 0.005 250);
    --ink-muted: oklch(0.72 0.01 250);
    --ink-faint: oklch(0.58 0.01 250);
    --accent: oklch(0.74 0.095 195);
    --accent-ink: oklch(0.17 0.01 250);
    --accent-soft: oklch(0.29 0.04 200);
  }
}

/* Base */

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

html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 100%;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
}

@media (min-width: 40em) {
  body {
    font-size: 1.0625rem;
  }
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection {
  background: var(--accent-soft);
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
  text-decoration-color: color-mix(in oklch, var(--accent) 45%, transparent);
}

a:hover {
  text-decoration-color: var(--accent);
}

h1,
h2,
h3 {
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: 1.75rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.25rem;
}

h3 {
  font-size: 1.0625rem;
}

@media (min-width: 40em) {
  h1 {
    font-size: 2.25rem;
  }
  h2 {
    font-size: 1.375rem;
  }
}

p,
li,
dd,
dt {
  max-width: var(--measure);
}

p {
  margin: 0;
}

p + p {
  margin-top: 0.85em;
}

ul,
ol {
  margin: 0;
  padding-left: 1.25em;
}

dl {
  margin: 0;
}

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

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--sunken);
  border-radius: 0.25rem;
  padding: 0.05em 0.3em;
}

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

.faint {
  color: var(--ink-faint);
}

.small {
  font-size: 0.875rem;
}

.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* The page frame: a narrow column, 16px from each edge on a phone. */

.wrap {
  width: 100%;
  max-width: 46rem;
  margin-inline: auto;
  padding-inline: 1rem;
}

@media (min-width: 40em) {
  .wrap {
    padding-inline: 1.5rem;
  }
}

/* Header: the mark and the word, and a way into the app. */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.mark {
  display: inline-grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: var(--radius-control);
  background: var(--accent);
  flex: none;
}

.mark::before {
  content: '';
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  border: 2px solid var(--accent-ink);
}

.top nav a {
  font-size: 0.9375rem;
  color: var(--ink-muted);
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-control);
  padding: 0.35rem 0.7rem;
}

.top nav a:hover {
  border-color: var(--line-strong);
  background: var(--sunken);
  color: var(--ink);
}

/* Main */

main {
  flex: 1;
  padding-block: 2rem 4rem;
}

@media (min-width: 40em) {
  main {
    padding-block: 3rem 5rem;
  }
}

.lead {
  font-size: 1.125rem;
  color: var(--ink-muted);
  margin-top: 1rem;
}

@media (min-width: 40em) {
  .lead {
    font-size: 1.25rem;
  }
}

.label {
  display: block;
  font-size: 0.6875rem;
  line-height: 1rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.5rem;
}

section + section {
  margin-top: 3.25rem;
}

section > h2 + p,
section > h2 + ol,
section > h2 + ul,
section > h2 + dl {
  margin-top: 0.75rem;
}

section > p + dl,
section > p + ol,
section > p + ul {
  margin-top: 1.25rem;
}

.meta {
  color: var(--ink-muted);
  font-size: 0.9375rem;
  margin-top: 0.75rem;
}

/* Cards: the one container shape, as in the app. */

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

.steps {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.75rem;
  counter-reset: step;
}

.steps > li {
  max-width: none;
  margin: 0;
  counter-increment: step;
}

.steps > li h3 {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
}

.steps > li h3::before {
  content: counter(step);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  width: 1.5rem;
  height: 1.5rem;
  display: inline-grid;
  place-items: center;
  flex: none;
  transform: translateY(-0.1em);
}

.steps > li p {
  margin-top: 0.5rem;
  color: var(--ink-muted);
}

.facts {
  display: grid;
  gap: 0.6rem 1.25rem;
}

@media (min-width: 40em) {
  .facts {
    grid-template-columns: 10rem 1fr;
  }
}

.facts dt {
  font-weight: 600;
  color: var(--ink);
}

.facts dd {
  margin: 0;
  color: var(--ink-muted);
}

@media (max-width: 39.99em) {
  .facts dd + dt {
    margin-top: 0.5rem;
  }
}

/* Policy pages: longer reading. */

.prose h2 {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.prose h2:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.prose h3 {
  margin-top: 1.5rem;
}

.prose h2 + p,
.prose h2 + ul,
.prose h2 + ol,
.prose h3 + p,
.prose h3 + ul,
.prose h3 + ol {
  margin-top: 0.75rem;
}

.prose p + ul,
.prose p + ol,
.prose ul + p,
.prose ol + p {
  margin-top: 0.85em;
}

.prose ul,
.prose ol {
  padding-left: 1.4em;
}

.contents {
  margin-top: 1.5rem;
  padding: 0.85rem 1rem;
}

.contents ol {
  columns: 2;
  column-gap: 1.5rem;
  padding-left: 1.2em;
  font-size: 0.9375rem;
}

@media (max-width: 39.99em) {
  .contents ol {
    columns: 1;
  }
}

.contents li {
  break-inside: avoid;
}

.contents li + li {
  margin-top: 0.25em;
}

.contents a {
  text-decoration: none;
  color: var(--ink-muted);
}

.contents a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Footer */

.foot {
  border-top: 1px solid var(--line);
  padding-block: 1.5rem 2rem;
  color: var(--ink-muted);
  font-size: 0.875rem;
}

.foot .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  align-items: baseline;
}

.foot ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
}

.foot li {
  margin: 0;
}

.foot a {
  color: var(--ink-muted);
}

.foot a:hover {
  color: var(--ink);
}

.foot .owner {
  color: var(--ink);
  font-weight: 500;
}

.foot .mail {
  margin-left: auto;
}

@media print {
  .top nav,
  .contents {
    display: none;
  }
  a {
    color: inherit;
  }
}
