/* Shared base: the app's own colours and typeface, the header with the
   language selector, the footer, and the legal pages' text. */

@font-face {
  font-family: "DM Sans";
  src: url("/fonts/DMSans_400Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("/fonts/DMSans_500Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("/fonts/DMSans_600SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("/fonts/DMSans_700Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* The app's dark theme is its default, so it is the site's too. */
:root {
  --page: #121416;
  --card: #181c20;
  --line: #2c3034;
  --text: #f0f4f8;
  --muted: rgba(240, 244, 248, 0.66);
  --faint: rgba(240, 244, 248, 0.42);
  --soft: rgba(240, 244, 248, 0.06);
  --header: rgba(18, 20, 22, 0.78);
  --primary: #378dff;
  --secondary: #b071ff;
  --accent: #00d3bb;
  --success: #0bbf58;
  --warning: #f5a524;
  --error: #f31260;
  --grad: linear-gradient(135deg, #378dff, #b071ff);
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --page: #fafbfc;
    --card: #ffffff;
    --line: #dcdee0;
    --text: #1e2328;
    --muted: rgba(30, 35, 40, 0.7);
    --faint: rgba(30, 35, 40, 0.48);
    --soft: rgba(30, 35, 40, 0.05);
    --header: rgba(250, 251, 252, 0.82);
    --primary: #167bff;
    --secondary: #9c5de8;
    --grad: linear-gradient(135deg, #167bff, #9c5de8);
    --shadow: 0 24px 60px -28px rgba(30, 35, 40, 0.35);
    color-scheme: light;
  }
}

/* One language at a time. */
html[data-lang="en"] [data-l="es"],
html[data-lang="es"] [data-l="en"] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
}

img,
svg {
  display: block;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.wrap.narrow {
  max-width: 800px;
}

/* Lucide icons, drawn from the inline sprite. */
.i {
  width: var(--z, 20px);
  height: var(--z, 20px);
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: var(--w, 2);
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Header */

header.site {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
}

header.site .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--text);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

nav.site {
  display: flex;
  gap: 22px;
}

nav.site a {
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}

nav.site a:hover {
  color: var(--text);
}

.lang {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
}

.lang button {
  min-width: 38px;
  padding: 4px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
  cursor: pointer;
}

.lang button:hover {
  color: var(--text);
}

.lang button[aria-pressed="true"] {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--line);
}

.lang button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Footer */

footer.site {
  border-top: 1px solid var(--line);
  padding: 28px 0 44px;
  color: var(--muted);
  font-size: 14px;
}

footer.site .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-right: auto;
}

footer.site a {
  color: var(--muted);
  text-decoration: none;
}

footer.site a:hover {
  color: var(--text);
}

/* Legal pages */

main.legal {
  padding: 48px 0 80px;
}

main.legal h1 {
  margin: 0 0 4px;
  font-size: 36px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

main.legal h2 {
  margin: 36px 0 8px;
  font-size: 20px;
  line-height: 1.3;
}

main.legal p,
main.legal ul,
main.legal ol {
  margin: 0 0 14px;
}

main.legal li {
  margin-bottom: 6px;
}

main.legal [data-anchor] {
  scroll-margin-top: 80px;
}

main.legal code {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--soft);
  font-size: 0.92em;
}

.meta {
  margin: 0 0 28px !important;
  color: var(--muted);
  font-size: 14px;
}

/* Not found */

.notfound {
  padding: 96px 0 120px;
  text-align: center;
}

.notfound img {
  width: 88px;
  height: 88px;
  margin: 0 auto 20px;
  border-radius: 22px;
}

.notfound h1 {
  margin: 0 0 8px;
  font-size: 32px;
}

@media (max-width: 640px) {
  nav.site {
    display: none;
  }

  main.legal h1 {
    font-size: 30px;
  }
}

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