/* ==========================================================================
   n4p design tokens
   --------------------------------------------------------------------------
   The one source of the colours, type, spacing and shape shared by the owner
   console and the public record pages on the index host. The backend embeds a
   byte-identical copy (backend/internal/crawl/tokens.css) for the generated
   pages; `make tokens` copies this file there, and a Go test fails when the
   two differ. Edit this file, never the copy.
   ========================================================================== */

:root {
  /* Typography */
  --font-sans:
    Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --text-2xs: 0.7rem;
  --text-xs: 0.78rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.35rem;

  /* Space */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Shape */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  /* Layout */
  --container: 72rem;
  --gutter: 1.25rem;
  --header-height: 4.25rem;

  /* Light palette: Swiss red on graphite and paper. Red is the brand and the next action;
     everything else is neutral grey so facts and status keep their own colours. */
  --ink: #141414;
  --ink-soft: #2d2d30;
  --muted: #5c5c63;
  --faint: #76767e;
  --bg: #f5f5f6;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --panel: #f0f0f2;
  --line: #e2e2e5;
  --line-strong: #cbcbd0;

  --brand-red: #d21e27;
  --logo-ink: #141414;
  --logo-tag: #6b6b72;

  --accent: #d21e27;
  --accent-strong: #a8151d;
  --accent-fill: #d21e27;
  --accent-fill-strong: #b0141c;
  --accent-ink: #ffffff;
  --accent-soft: #fdeeee;
  --accent-line: #f2bfc1;

  --steel: #4a4a52;
  --steel-soft: #ececee;
  --graphite: #141414;
  --graphite-soft: #e4e4e7;

  --ok: #0d7a46;
  --ok-soft: #e4f7ed;
  --warn: #8a5a00;
  --warn-soft: #fff4dc;
  --bad: #b42318;
  --bad-soft: #fdecea;

  --glow-1: rgba(210, 30, 39, 0.06);
  --glow-2: rgba(20, 20, 20, 0.035);
  --glow-3: rgba(191, 191, 194, 0.14);

  --shadow-xs: 0 1px 2px rgba(20, 20, 22, 0.05);
  --shadow-sm: 0 1px 2px rgba(20, 20, 22, 0.04), 0 4px 12px -6px rgba(20, 20, 22, 0.12);
  --shadow-md: 0 2px 4px rgba(20, 20, 22, 0.04), 0 18px 36px -22px rgba(20, 20, 22, 0.28);
  --ring: 0 0 0 3px rgba(210, 30, 39, 0.22);

  --input-bg: #ffffff;
  --secondary-bg: #ffffff;
  --on-accent: #ffffff;

  color-scheme: light;
}

/* The theme attribute is set before first paint by the inline script in layout.tsx.
   Without an attribute the operating system decides. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #f4f4f5;
    --ink-soft: #d6d6da;
    --muted: #a3a3ab;
    --faint: #85858e;
    --bg: #0c0c0d;
    --surface: #161618;
    --surface-2: #1b1b1e;
    --panel: #1f1f23;
    --line: #2c2c31;
    --line-strong: #3d3d44;

    --brand-red: #d21e27;
    --logo-ink: #ffffff;
    --logo-tag: #bfbfc2;

    /* Text and outlines need a lighter red on graphite; fills keep the brand red. */
    --accent: #ff6b70;
    --accent-strong: #ff8a8e;
    --accent-fill: #d21e27;
    --accent-fill-strong: #b0141c;
    --accent-ink: #ffffff;
    --accent-soft: #2a1214;
    --accent-line: #5a2125;

    --steel: #bfbfc2;
    --steel-soft: #232327;
    --graphite: #e4e4e7;
    --graphite-soft: #26262a;

    --ok: #5cd99a;
    --ok-soft: #0d2a1d;
    --warn: #f0c063;
    --warn-soft: #2c2312;
    --bad: #ff8b82;
    --bad-soft: #2f1413;

    --glow-1: rgba(210, 30, 39, 0.08);
    --glow-2: rgba(255, 255, 255, 0.025);
    --glow-3: rgba(191, 191, 194, 0.04);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 20px -12px rgba(0, 0, 0, 0.7);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.4), 0 24px 50px -28px rgba(0, 0, 0, 0.9);
    --ring: 0 0 0 3px rgba(255, 107, 112, 0.32);

    --input-bg: #111113;
    --secondary-bg: #1b1b1e;
    --on-accent: #ffffff;

    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --ink: #f4f4f5;
  --ink-soft: #d6d6da;
  --muted: #a3a3ab;
  --faint: #85858e;
  --bg: #0c0c0d;
  --surface: #161618;
  --surface-2: #1b1b1e;
  --panel: #1f1f23;
  --line: #2c2c31;
  --line-strong: #3d3d44;

  --brand-red: #d21e27;
  --logo-ink: #ffffff;
  --logo-tag: #bfbfc2;

  /* Text and outlines need a lighter red on graphite; fills keep the brand red. */
  --accent: #ff6b70;
  --accent-strong: #ff8a8e;
  --accent-fill: #d21e27;
  --accent-fill-strong: #b0141c;
  --accent-ink: #ffffff;
  --accent-soft: #2a1214;
  --accent-line: #5a2125;

  --steel: #bfbfc2;
  --steel-soft: #232327;
  --graphite: #e4e4e7;
  --graphite-soft: #26262a;

  --ok: #5cd99a;
  --ok-soft: #0d2a1d;
  --warn: #f0c063;
  --warn-soft: #2c2312;
  --bad: #ff8b82;
  --bad-soft: #2f1413;

  --glow-1: rgba(210, 30, 39, 0.08);
  --glow-2: rgba(255, 255, 255, 0.025);
  --glow-3: rgba(191, 191, 194, 0.04);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 20px -12px rgba(0, 0, 0, 0.7);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.4), 0 24px 50px -28px rgba(0, 0, 0, 0.9);
  --ring: 0 0 0 3px rgba(255, 107, 112, 0.32);

  --input-bg: #111113;
  --secondary-bg: #1b1b1e;
  --on-accent: #ffffff;

  color-scheme: dark;
}

/* Stylesheet for the legal pages (/privacy, /terms, /support, /imprint).

   legal.go serves it after the owner console's design tokens (internal/brand/tokens.css, a
   copy of frontend/app/tokens.css) and before the logo, so the notices look like the rest of
   n4p and follow the reader's theme choice. It is deliberately separate from the generated
   pages' style.css: those pages are rebuilt by the static run, these are not. */

@media (min-width: 900px) {
  :root {
    --gutter: 2rem;
  }
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 480px at 8% -8%, var(--glow-1), transparent 62%),
    radial-gradient(760px 420px at 92% 2%, var(--glow-2), transparent 60%),
    var(--bg);
  color: var(--ink);
  font: var(--text-base) / 1.65 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent-fill);
  color: var(--accent-ink);
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-strong);
  text-decoration-thickness: 2px;
}

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

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

.container {
  width: min(100% - (var(--gutter) * 2), var(--container));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: -4rem;
  left: 1rem;
  z-index: 100;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  font-weight: 650;
}

.skip-link:focus {
  top: 1rem;
}

/* --- header -------------------------------------------------------------- */

header.site {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  min-height: var(--header-height);
  padding-block: 0.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border-radius: var(--radius-sm);
}

/* The image itself is appended by legal.go as a data: URL. */
.brand-logo {
  display: block;
  width: 5.39rem;
  height: 2.25rem;
  background: center / contain no-repeat;
}

.langs ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.langs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.75rem;
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
}

.langs a:hover {
  color: var(--ink);
  background: var(--panel);
}

.langs a[aria-current] {
  color: var(--accent);
  background: var(--accent-soft);
}

/* --- content ------------------------------------------------------------- */

main {
  padding-block: clamp(1.25rem, 2.5vw, 2.5rem) 4rem;
}

.prose {
  max-width: 46rem;
  padding: clamp(1.25rem, 1rem + 2vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 0 0 0.75rem;
  color: var(--ink);
}

h1 {
  font-size: clamp(1.75rem, 1.3rem + 2vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.25rem;
}

h2 {
  font-size: clamp(1.2rem, 1.1rem + 0.5vw, 1.4rem);
  font-weight: 700;
  margin-top: 2rem;
}

.prose p,
.prose ul,
.prose address {
  margin: 0 0 1rem;
}

.prose li {
  margin-bottom: 0.35rem;
}

address {
  font-style: normal;
}

.updated,
.lede {
  color: var(--muted);
  margin-top: 0;
}

.binding-note {
  padding: 0.75rem 1rem;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--ink-soft);
  font-size: var(--text-sm);
}

dl.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.35rem 1.25rem;
  margin: 0 0 1rem;
}

dl.facts dt {
  color: var(--muted);
}

dl.facts dd {
  margin: 0;
}

@media (max-width: 559px) {
  dl.facts {
    grid-template-columns: 1fr;
  }

  dl.facts dd {
    margin-bottom: 0.5rem;
  }
}

/* --- footer -------------------------------------------------------------- */

footer.site {
  border-top: 1px solid var(--line);
  padding-block: 2rem 3rem;
  color: var(--muted);
  font-size: var(--text-sm);
}

.footer-inner {
  display: grid;
  gap: 1.25rem;
}

.footer-brand {
  display: grid;
  gap: 0.5rem;
  max-width: 46rem;
}

.footer-wordmark {
  color: var(--ink);
  font-size: var(--text-lg);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.footer-brand p {
  margin: 0;
  color: var(--faint);
  line-height: 1.55;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.1rem;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}

.footer-links a:hover,
.footer-links a[aria-current] {
  color: var(--accent);
}

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

:root{--n4p-logo-light:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%22236 445 1484 620%22 width=%221484%22 height=%22620%22 role=%22img%22 aria-labelledby=%22title%22%3E%0A  %3Ctitle id=%22title%22%3EN4P Swiss AI Index%3C/title%3E%0A  %3Crect x=%22259%22 y=%22465%22 width=%22412%22 height=%22413%22 fill=%22%23d21e27%22/%3E%0A  %3Cpath d=%22M427 546h76v87h88v76h-88v88h-76v-88h-88v-76h88z%22 fill=%22%23fff%22/%3E%0A  %3Cpath d=%22M736,465 L736,877 L821,877 L821,874 L822,873 L822,644 L821,643 L821,618 L822,617 L824,618 L832,634 L859,678 L865,690 L889,729 L891,734 L902,751 L908,763 L912,768 L918,780 L932,802 L934,807 L945,824 L948,831 L955,841 L976,877 L1059,877 L1059,777 L989,777 L983,775 L983,763 L982,762 L982,682 L998,661 L1000,657 L1008,648 L1016,636 L1026,624 L1034,612 L1057,583 L1059,579 L1059,466 L1058,465 L972,465 L972,563 L973,564 L973,719 L972,720 L969,717 L967,712 L962,705 L960,700 L955,693 L939,664 L932,654 L920,632 L913,622 L910,615 L884,573 L877,559 L873,554 L868,544 L854,522 L851,515 L844,505 L842,500 L840,498 L838,493 L836,491 L821,465Z M1180,461 L1154,495 L1150,502 L1138,517 L1130,529 L1126,533 L1124,537 L1093,576 L1091,580 L1071,605 L1060,621 L1030,660 L1028,664 L1009,688 L1009,751 L1202,751 L1203,752 L1203,877 L1288,877 L1288,776 L1289,775 L1289,758 L1288,757 L1288,753 L1290,751 L1350,751 L1352,749 L1360,732 L1360,730 L1369,713 L1383,694 L1399,677 L1415,664 L1428,656 L1440,650 L1460,643 L1460,640 L1461,639 L1461,632 L1460,631 L1460,537 L1462,535 L1463,536 L1554,536 L1555,537 L1561,537 L1562,538 L1569,539 L1580,543 L1588,548 L1601,562 L1606,572 L1608,582 L1609,583 L1609,590 L1610,591 L1610,603 L1609,604 L1608,618 L1604,629 L1599,638 L1594,644 L1585,652 L1575,657 L1562,661 L1557,661 L1556,662 L1549,662 L1548,663 L1495,663 L1494,664 L1480,665 L1453,673 L1430,686 L1408,705 L1392,726 L1383,745 L1378,760 L1377,768 L1376,769 L1376,774 L1375,775 L1375,780 L1374,781 L1374,921 L1370,929 L1361,940 L1356,950 L1354,956 L1353,969 L1352,970 L1353,984 L1358,1000 L1365,1011 L1376,1022 L1392,1031 L1405,1035 L1410,1035 L1411,1036 L1426,1036 L1427,1035 L1436,1034 L1447,1030 L1457,1024 L1469,1013 L1475,1005 L1479,997 L1483,983 L1483,963 L1482,962 L1480,951 L1473,937 L1464,927 L1461,921 L1461,736 L1462,735 L1541,735 L1542,734 L1561,734 L1562,733 L1571,733 L1572,732 L1584,731 L1585,730 L1589,730 L1590,729 L1601,727 L1623,719 L1625,717 L1641,709 L1655,699 L1670,683 L1681,666 L1688,650 L1694,629 L1694,625 L1695,624 L1695,618 L1696,617 L1696,580 L1695,579 L1694,568 L1693,567 L1691,556 L1685,539 L1679,527 L1670,514 L1650,495 L1636,486 L1624,480 L1593,470 L1589,470 L1588,469 L1579,468 L1578,467 L1573,467 L1572,466 L1562,466 L1561,465 L1374,465 L1374,673 L1372,676 L1366,681 L1308,681 L1307,682 L1295,681 L1294,682 L1291,682 L1288,680 L1288,461Z M1202,546 L1203,547 L1203,681 L1202,682 L1103,682 L1102,680 L1107,672 L1125,649 L1127,645 L1142,626 L1153,610 L1160,602 L1162,598 L1174,584 L1198,550Z%22 fill=%22%23141414%22 fill-rule=%22evenodd%22/%3E%0A  %3Ctext x=%22256%22 y=%221026%22 font-family=%22Helvetica, Arial, sans-serif%22 font-size=%22126%22 fill=%22%236b6b72%22 textLength=%221040%22 lengthAdjust=%22spacingAndGlyphs%22%3ESWISS AI  INDEX%3C/text%3E%0A%3C/svg%3E%0A");--n4p-logo-dark:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%22236 445 1484 620%22 width=%221484%22 height=%22620%22 role=%22img%22 aria-labelledby=%22title%22%3E%0A  %3Ctitle id=%22title%22%3EN4P Swiss AI Index%3C/title%3E%0A  %3Crect x=%22259%22 y=%22465%22 width=%22412%22 height=%22413%22 fill=%22%23d21e27%22/%3E%0A  %3Cpath d=%22M427 546h76v87h88v76h-88v88h-76v-88h-88v-76h88z%22 fill=%22%23fff%22/%3E%0A  %3Cpath d=%22M736,465 L736,877 L821,877 L821,874 L822,873 L822,644 L821,643 L821,618 L822,617 L824,618 L832,634 L859,678 L865,690 L889,729 L891,734 L902,751 L908,763 L912,768 L918,780 L932,802 L934,807 L945,824 L948,831 L955,841 L976,877 L1059,877 L1059,777 L989,777 L983,775 L983,763 L982,762 L982,682 L998,661 L1000,657 L1008,648 L1016,636 L1026,624 L1034,612 L1057,583 L1059,579 L1059,466 L1058,465 L972,465 L972,563 L973,564 L973,719 L972,720 L969,717 L967,712 L962,705 L960,700 L955,693 L939,664 L932,654 L920,632 L913,622 L910,615 L884,573 L877,559 L873,554 L868,544 L854,522 L851,515 L844,505 L842,500 L840,498 L838,493 L836,491 L821,465Z M1180,461 L1154,495 L1150,502 L1138,517 L1130,529 L1126,533 L1124,537 L1093,576 L1091,580 L1071,605 L1060,621 L1030,660 L1028,664 L1009,688 L1009,751 L1202,751 L1203,752 L1203,877 L1288,877 L1288,776 L1289,775 L1289,758 L1288,757 L1288,753 L1290,751 L1350,751 L1352,749 L1360,732 L1360,730 L1369,713 L1383,694 L1399,677 L1415,664 L1428,656 L1440,650 L1460,643 L1460,640 L1461,639 L1461,632 L1460,631 L1460,537 L1462,535 L1463,536 L1554,536 L1555,537 L1561,537 L1562,538 L1569,539 L1580,543 L1588,548 L1601,562 L1606,572 L1608,582 L1609,583 L1609,590 L1610,591 L1610,603 L1609,604 L1608,618 L1604,629 L1599,638 L1594,644 L1585,652 L1575,657 L1562,661 L1557,661 L1556,662 L1549,662 L1548,663 L1495,663 L1494,664 L1480,665 L1453,673 L1430,686 L1408,705 L1392,726 L1383,745 L1378,760 L1377,768 L1376,769 L1376,774 L1375,775 L1375,780 L1374,781 L1374,921 L1370,929 L1361,940 L1356,950 L1354,956 L1353,969 L1352,970 L1353,984 L1358,1000 L1365,1011 L1376,1022 L1392,1031 L1405,1035 L1410,1035 L1411,1036 L1426,1036 L1427,1035 L1436,1034 L1447,1030 L1457,1024 L1469,1013 L1475,1005 L1479,997 L1483,983 L1483,963 L1482,962 L1480,951 L1473,937 L1464,927 L1461,921 L1461,736 L1462,735 L1541,735 L1542,734 L1561,734 L1562,733 L1571,733 L1572,732 L1584,731 L1585,730 L1589,730 L1590,729 L1601,727 L1623,719 L1625,717 L1641,709 L1655,699 L1670,683 L1681,666 L1688,650 L1694,629 L1694,625 L1695,624 L1695,618 L1696,617 L1696,580 L1695,579 L1694,568 L1693,567 L1691,556 L1685,539 L1679,527 L1670,514 L1650,495 L1636,486 L1624,480 L1593,470 L1589,470 L1588,469 L1579,468 L1578,467 L1573,467 L1572,466 L1562,466 L1561,465 L1374,465 L1374,673 L1372,676 L1366,681 L1308,681 L1307,682 L1295,681 L1294,682 L1291,682 L1288,680 L1288,461Z M1202,546 L1203,547 L1203,681 L1202,682 L1103,682 L1102,680 L1107,672 L1125,649 L1127,645 L1142,626 L1153,610 L1160,602 L1162,598 L1174,584 L1198,550Z%22 fill=%22%23fff%22 fill-rule=%22evenodd%22/%3E%0A  %3Ctext x=%22256%22 y=%221026%22 font-family=%22Helvetica, Arial, sans-serif%22 font-size=%22126%22 fill=%22%23bfbfc2%22 textLength=%221040%22 lengthAdjust=%22spacingAndGlyphs%22%3ESWISS AI  INDEX%3C/text%3E%0A%3C/svg%3E%0A")}
.brand-logo{background-image:var(--n4p-logo-light)}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]) .brand-logo{background-image:var(--n4p-logo-dark)}}
:root[data-theme="dark"] .brand-logo{background-image:var(--n4p-logo-dark)}
