/*
 * The public site of Blåmail. The colours are those of the web application (frontend/packages/ui),
 * light, and dark where the reader's device is.
 */

:root {
  --background: oklch(1 0 0);
  --foreground: oklch(0.2 0.02 250);
  --muted: oklch(0.965 0.006 250);
  --muted-foreground: oklch(0.46 0.02 250);
  --primary: oklch(0.48 0.14 250);
  --primary-foreground: oklch(0.985 0 0);
  --border: oklch(0.9 0.008 250);
  --input: oklch(0.7 0.01 250);
  --ring: oklch(0.55 0.14 250);
  --radius: 0.625rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: oklch(0.17 0.015 250);
    --foreground: oklch(0.96 0.005 250);
    --muted: oklch(0.24 0.018 250);
    --muted-foreground: oklch(0.75 0.02 250);
    --primary: oklch(0.74 0.13 250);
    --primary-foreground: oklch(0.17 0.015 250);
    --border: oklch(0.32 0.018 250);
    --input: oklch(0.5 0.02 250);
    --ring: oklch(0.74 0.13 250);
  }
}

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font: 1rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Liberation Sans", Arial, sans-serif;
}

a {
  color: var(--primary);
  text-underline-offset: 0.2em;
}

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

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 2px;
}

code {
  font: 0.92em/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.01em;
}

main h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.2rem;
  font-weight: 650;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -10rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--primary-foreground);
}

.skip:focus {
  top: 1rem;
}

.top,
main {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 40rem) {
  .top,
  main {
    padding: 0 1.5rem;
  }
}

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

.brand {
  color: var(--foreground);
  font-size: 1.15rem;
  font-weight: 650;
  text-decoration: none;
}

.corner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

.button {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  filter: brightness(1.08);
}

.languages {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
}

.languages a {
  color: var(--muted-foreground);
}

.languages [aria-current] {
  font-weight: 600;
}

.hero {
  padding: 3.5rem 0 3rem;
}

.hero.small {
  padding: 2rem 0 0.5rem;
}

.hero h1 {
  max-width: 44rem;
  margin: 0;
  font-size: clamp(2rem, 1.4rem + 3vw, 3rem);
  font-weight: 650;
}

.lede {
  max-width: 42rem;
  color: var(--muted-foreground);
  font-size: 1.15rem;
}

.hero .lede {
  font-size: 1.25rem;
  margin-top: 1.25rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin: 1.75rem 0 0;
}

.button.big {
  padding: 0.7rem 1.3rem;
  font-size: 1.05rem;
}

.promise {
  max-width: 42rem;
  margin: 0.75rem 0 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.hero.small h1 {
  font-size: 2rem;
}

section {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
}

section h2 {
  margin: 0;
  font-size: 1.35rem;
}

main > p {
  max-width: 42rem;
}

.facts {
  display: grid;
  gap: 1.25rem 2rem;
  margin: 1.5rem 0 0;
}

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

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

.facts dt {
  font-weight: 600;
}

.facts dd {
  margin: 0.15rem 0 0;
  color: var(--muted-foreground);
}

.scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  text-align: left;
}

th,
td {
  padding: 0.5rem 1rem 0.5rem 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

thead th {
  color: var(--muted-foreground);
  font-weight: 500;
}

tbody th {
  font-weight: 500;
}

tbody tr:last-child > * {
  border-bottom: 0;
}

.number {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* The same width as the content above it, its border too: margins, not padding, at the sides. */
.bottom {
  max-width: 61rem;
  margin: 2rem 1rem 0;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 0.9rem;
}

@media (min-width: 40rem) {
  .bottom {
    margin: 2rem 1.5rem 0;
  }
}

@media (min-width: 64rem) {
  .bottom {
    margin: 2rem auto 0;
  }
}

.bottom nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.bottom p {
  margin: 1rem 0 0;
}

.bottom a {
  color: var(--muted-foreground);
}
