/* Same tokens as the app (src/ui/design-system/utils/colors.ts). */

@font-face {
  font-family: "Figtree";
  src: url("/fonts/Figtree_400Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("/fonts/Figtree_600SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("/fonts/Figtree_700Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/BricolageGrotesque_700Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --background: #f7f4ee;
  --surface: #ffffff;
  --surface-muted: #f2eee6;
  --text-primary: #22201c;
  --text-secondary: #57514a;
  --text-tertiary: #6b655c;
  --brand: #1f6b57;
  --brand-strong: #15503f;
  --brand-soft: #e3efe9;
  --border-subtle: #e2dbce;
  --separator: #efeae0;
  --card-shadow: #e7e1d6;
  --danger: #a33a1a;
  --danger-soft: #fbe3d8;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #171614;
    --surface: #23211e;
    --surface-muted: #2e2b27;
    --text-primary: #f2eee6;
    --text-secondary: #c9c1b3;
    --text-tertiary: #a39b8f;
    --brand: #3e9a7f;
    --brand-strong: #8ccbb4;
    --brand-soft: #1e3a31;
    --border-subtle: #34312c;
    --separator: #2e2b27;
    --card-shadow: #0e0d0c;
    --danger: #f0a487;
    --danger-soft: #3d2118;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--background);
  color: var(--text-primary);
  font-family: "Figtree", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

/* Header ------------------------------------------------------------------ */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  text-decoration: none;
  font-family: "Bricolage Grotesque", "Figtree", sans-serif;
  font-weight: 700;
  font-size: 20px;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.language {
  padding: 6px 14px;
  border: 1.5px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}

.language:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* Text -------------------------------------------------------------------- */

h1,
h2 {
  font-family: "Bricolage Grotesque", "Figtree", sans-serif;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

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

h2 {
  margin: 32px 0 8px;
  font-size: 22px;
}

p,
ul,
ol {
  margin: 0 0 12px;
}

li {
  margin-bottom: 6px;
}

a {
  color: var(--brand);
  font-weight: 600;
  text-underline-offset: 3px;
}

strong {
  font-weight: 700;
}

.lead {
  color: var(--text-secondary);
  font-size: 19px;
}

.updated {
  color: var(--text-tertiary);
  font-size: 15px;
}

/* Blocks ------------------------------------------------------------------ */

.card {
  margin: 16px 0;
  padding: 20px;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 2px 0 var(--card-shadow);
}

.card > :last-child {
  margin-bottom: 0;
}

.card h2 {
  margin-top: 0;
}

.callout {
  margin: 16px 0;
  padding: 16px 20px;
  background: var(--brand-soft);
  border-radius: 16px;
}

.callout > :last-child {
  margin-bottom: 0;
}

.callout.danger {
  background: var(--danger-soft);
}

.links {
  display: grid;
  gap: 12px;
  margin: 24px 0;
  padding: 0;
  list-style: none;
}

.links li {
  margin: 0;
}

.links a {
  display: block;
  padding: 16px 20px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 2px 0 var(--card-shadow);
  color: var(--text-primary);
  text-decoration: none;
}

.links a:hover {
  outline: 1.5px solid var(--brand);
}

.links span {
  display: block;
  color: var(--text-secondary);
  font-weight: 400;
  font-size: 15px;
}

/* Data table: stacks into cards on narrow screens. */
.table {
  width: 100%;
  margin: 16px 0;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 0 var(--card-shadow);
  font-size: 15px;
}

.table th,
.table td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--separator);
}

.table th {
  background: var(--surface-muted);
  font-weight: 700;
}

.table tr:last-child td {
  border-bottom: none;
}

@media (max-width: 600px) {
  .table thead {
    display: none;
  }
  .table,
  .table tbody,
  .table tr,
  .table td {
    display: block;
  }
  .table tr {
    padding: 12px 14px;
    border-bottom: 1px solid var(--separator);
  }
  .table tr:last-child {
    border-bottom: none;
  }
  .table td {
    padding: 2px 0;
    border: none;
  }
  .table td::before {
    content: attr(data-label) " : ";
    color: var(--text-tertiary);
  }
  .table td:first-child {
    font-weight: 600;
  }
  .table td:first-child::before {
    content: none;
  }
}

/* Footer ------------------------------------------------------------------ */

.footer {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--separator);
  color: var(--text-tertiary);
  font-size: 15px;
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 8px;
}

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