/* Shared by every public page: colour and type tokens, the header and the footer.
   The homepage adds home.css (with dark mode). Other pages add style.css.
   Selectors here are scoped to .top and .foot so style.css element rules do not reach them. */

:root {
  --paper: #F1F2F4;
  --card: #FFFFFF;
  --sunk: #E8EAEF;
  --ink: #12141C;
  --muted: #5A6072;
  --line: #D5D8E0;
  --accent: #2B3FD6;
  --accent-ink: #FFFFFF;
  --ok: #17804F;
  --term-bg: #0B1350;
  --term-fg: #DDE3FF;
  --term-dim: #7E89CF;
  --term-hi: #FFD84A;
  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Geist", "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.1875rem;
  --step-2: clamp(1.6rem, 1.2rem + 1.8vw, 2.5rem);
  --step-3: clamp(2.6rem, 1.4rem + 5.6vw, 6rem);
  --radius: 14px;
}

[hidden] { display: none !important; }
html { scroll-padding-top: 72px; }
body { margin: 0; background: var(--paper); color: var(--ink); }

.shell {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.skip { position: absolute; left: -999px; z-index: 30; }
.skip:focus { left: 8px; top: 8px; padding: 8px 12px; background: var(--card); color: var(--ink); border-radius: 8px; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-body);
}
.top .top-in { display: flex; align-items: center; gap: 16px 24px; padding-block: 12px; }
.top a { color: inherit; }
.top .brand { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; color: var(--ink); text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: 1.125rem; letter-spacing: -0.01em; }
.top .mark, .foot .mark { position: relative; display: inline-block; width: 17px; height: 23px; border-radius: 4px; background: var(--accent); flex: none; }
.top .mark::before, .foot .mark::before { content: ""; position: absolute; top: 4px; left: 50%; width: 7px; height: 3px; border-radius: 2px; background: var(--paper); transform: translateX(-50%); }
.top .nav { display: flex; flex-wrap: nowrap; align-items: center; gap: 22px; margin-left: auto; font-size: var(--step--1); }
.top .nav a { display: inline-flex; align-items: center; min-height: 40px; color: var(--muted); font-size: var(--step--1); text-decoration: none; }
.top .nav a:hover, .top .nav a[aria-current="page"] { color: var(--ink); }
.top .nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }
.top .switch { display: inline-flex; flex: none; gap: 16px; padding: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; font-size: var(--step--1); }
.top .switch button { min-height: 0; margin: 0 0 -1px; border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 6px 0 8px; border-radius: 0; color: var(--muted); font: inherit; font-weight: 500; cursor: pointer; }
.top .switch button:hover { background: transparent; color: var(--ink); }
.top .switch button[aria-pressed="true"] { background: transparent; color: var(--ink); border-bottom-color: var(--accent); }
.top .switch button:disabled { cursor: default; }
/* The homepage in the other language: EN on /fr, FR on / */
.top .lang-link { display: inline-flex; flex: none; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; color: var(--muted); font-size: var(--step--1); font-weight: 600; letter-spacing: 0.04em; text-decoration: none; }
.top .lang-link:hover { color: var(--ink); }

/* Small screens: the links move into a menu. */
.top .menu { display: none; position: relative; }
.top .menu summary { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; margin: 0; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); font: inherit; font-size: var(--step--1); font-weight: 500; list-style: none; cursor: pointer; }
.top .menu summary::-webkit-details-marker { display: none; }
.top .menu:not([open]) > :not(summary) { display: none; }
.top .menu-panel { position: absolute; right: 0; top: calc(100% + 8px); display: flex; flex-direction: column; align-items: stretch; gap: 0; min-width: 200px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: 0 12px 28px -18px color-mix(in srgb, var(--ink) 45%, transparent); }
.top .menu-panel a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--ink); font-size: var(--step-0); text-decoration: none; }
.top .menu-panel a:hover, .top .menu-panel a[aria-current="page"] { background: var(--sunk); }
.top .menu-panel .menu-lang { margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; color: var(--muted); }
@media (max-width: 760px) {
  .top .top-in { gap: 8px; }
  .top .nav { display: none; }
  .top .switch { margin-left: auto; }
  .top .lang-link { margin-left: auto; min-width: 32px; }
  .top .lang-link + .switch { margin-left: 0; }
  .top .switch button { padding-inline: 11px; }
  .top .menu { display: block; }
  .top .nav + .menu { margin-left: auto; }
}
/* Phones: the language link moves into the menu. */
@media (max-width: 420px) {
  .top .lang-link { display: none; }
  .top .lang-link + .switch { margin-left: auto; }
}

/* Footer */
.foot { border-top: 1px solid var(--line); font-family: var(--font-body); }
.foot .foot-in { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding-block: 28px 40px; font-size: var(--step--1); line-height: 1.55; color: var(--muted); }
.foot p { margin: 0; max-width: none; }
.foot a { color: inherit; }
.foot a:hover { color: var(--ink); }
.foot .foot-brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; color: var(--ink); }
.foot .foot-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin-left: auto; }
.foot .foot-links a { display: inline-flex; align-items: center; min-height: 32px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }
.foot .foot-note { flex-basis: 100%; }
@media (max-width: 760px) {
  .foot .foot-links { flex-basis: 100%; margin-left: 0; gap: 0 18px; }
  .foot .foot-links a { min-height: 44px; }
}
