/* Constat website (docs/WEBSITE.md): colours of the app logo, system fonts
   (nothing loaded from other sites), readable line length, dark mode. */
:root {
  --blue: #1f5f8b;
  --blue-dark: #15466a;
  --amber: #ffb23f;
  --ink: #16212b;
  --muted: #4d5b67;
  --ground: #f3f6f9;
  --card: #ffffff;
  --line: #d9e1e8;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --blue: #7cb8e4;
    --blue-dark: #a9d2f0;
    --ink: #e6edf3;
    --muted: #a7b4c0;
    --ground: #0c2235;
    --card: #12304a;
    --line: #23455f;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--ground);
}

a { color: var(--blue); }
a:hover { color: var(--blue-dark); }
a:focus-visible, .skip:focus { outline: 3px solid var(--amber); outline-offset: 2px; }

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  padding: 0.5rem 1rem;
  background: var(--card);
}
.skip:focus { left: 1rem; }

.top { background: var(--blue-dark); }
@media (prefers-color-scheme: dark) { .top { background: #081827; } }

.bar {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
}
.brand img { border-radius: 9px; }
.brand:hover { color: #fff; }

/* Language menu: <details> opens without JavaScript (the CSP allows none). */
.languages details { position: relative; }
.languages summary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  list-style: none;
}
.languages summary::-webkit-details-marker { display: none; }
.languages summary::after { content: "▾"; font-size: 0.8em; opacity: 0.8; }
.languages summary:hover, .languages details[open] summary { background: rgba(255, 255, 255, 0.14); }
.languages summary:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.languages .globe { fill: none; stroke: currentColor; stroke-width: 1.5; }
.languages ul {
  position: absolute;
  right: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(2, minmax(8.5rem, 1fr));
  gap: 0.1rem 0.5rem;
  width: max-content;
  max-width: calc(100vw - 2rem);
  margin: 0.4rem 0 0;
  padding: 0.5rem;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
@media (min-width: 40rem) { .languages ul { grid-template-columns: repeat(3, minmax(9rem, 1fr)); } }
.languages li { margin: 0; }
.languages li a {
  display: block;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
}
.languages li a:hover { background: var(--ground); color: var(--ink); }
.languages li a[aria-current="true"] { font-weight: 650; color: var(--blue-dark); background: var(--ground); }

.note {
  padding: 0.6rem 0.9rem;
  border-left: 4px solid var(--amber);
  background: var(--ground);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.95rem;
}

main {
  max-width: 46rem;
  margin: 1.5rem auto;
  padding: 1.5rem 1rem 2rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}
@media (min-width: 48rem) { main { padding: 2rem 2.5rem 2.5rem; } }

h1 { font-size: 1.9rem; line-height: 1.25; margin: 0 0 1rem; color: var(--blue-dark); }
h2 { font-size: 1.35rem; margin: 2rem 0 0.5rem; }
h3 { font-size: 1.1rem; margin: 1.6rem 0 0.4rem; }
p, ul { margin: 0 0 1rem; }
ul { padding-left: 1.3rem; }
li { margin: 0.25rem 0; }
code {
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  font-size: 0.92em;
  overflow-wrap: anywhere;
}
strong { font-weight: 650; }

footer {
  max-width: 46rem;
  margin: 0 auto 2rem;
  padding: 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}
footer nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin-bottom: 0.5rem; }
footer a { color: var(--muted); }
footer a[aria-current="page"] { color: var(--ink); font-weight: 600; }
footer p { margin: 0; }
