/*
  ============================================================================
  Hall-MacQueen.ca: shared styles / styles partagés
  ============================================================================

  ONE STYLESHEET, NO INLINE STYLES / UNE FEUILLE, AUCUN STYLE EN LIGNE
    Every page links this file and carries no <style> block or style=""
    attribute, which is what lets `_headers` hold the CSP at `style-src 'self'`.
    Chaque page lie ce fichier, sans bloc <style> ni attribut style="", ce qui
    permet à la CSP de rester à `style-src 'self'`.

  THE LOOK / L'ALLURE
    A proudly Canadian nameplate: the double name set large in Gloock, the
    hyphen drawn as a red bar, a woven selvedge along the top edge in the
    colours of the Maple Leaf tartan (Canada's national tartan), an "Elbows Up!"
    pennant, and a silhouette scene of a moose, a Mountie beside the flag, a
    beaver and Canada geese. Dark ink by default, warm paper in light mode.
    Une plaque fièrement canadienne : le double nom en grand, le trait d'union
    en barre rouge, une lisière aux couleurs du tartan Feuille d'érable (tartan
    national du Canada), un fanion « Elbows Up! » et une scène en silhouette.

  CONTENTS / SOMMAIRE
    01 Tokens  02 Base  03 Language visibility  04 Header and controls
    05 Home  06 Documents (privacy, security)  07 Contact  08 Footer  09 Motion
    10 Screen sizes
  ============================================================================
*/

/* ---------------------------------------------------------------------------
   01  Tokens / Jetons
--------------------------------------------------------------------------- */
:root {
  /* Dark is the default: bare :root (no script yet) must already be dark.
     Le sombre est le thème par défaut, même avant l'exécution du script. */
  --ground: #101211;
  --ground-raised: #171a18;
  --ground-sunk: #0b0d0c;
  --ink: #ede8dd;
  --ink-dim: #c8c2b5;
  --muted: #959084;
  --line: #2f332f;
  --line-soft: #222523;
  --accent: #ef5b4c;
  --accent-ink: #101211;
  --glow: rgba(239, 91, 76, 0.07);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 32px -12px rgba(0, 0, 0, 0.55);
  color-scheme: dark;

  /* Maple Leaf tartan: the maple's colours through the seasons (green, gold,
     red, brown). Tartan Feuille d'érable : les couleurs de l'érable au fil
     des saisons (vert, or, rouge, brun). */
  --tartan-green: #2f6b3c;
  --tartan-gold: #d4a43a;
  --tartan-red: #b5312b;
  --tartan-brown: #6e4a2a;

  /* Flag and pennant reds, the same in both themes: the pennant's white text
     on #c0281f is 5.5:1. Rouges du drapeau et du fanion, identiques dans les
     deux thèmes. */
  --flag-red: #d52b1e;
  --flag-white: #ede8dd;
  --pennant: #c0281f;
  --pennant-ink: #faf7f1;

  --font-display: "Gloock", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Spacing scale, used everywhere instead of one-off values.
     Échelle d'espacement, employée partout. */
  --s1: 0.375rem;
  --s2: 0.75rem;
  --s3: 1.25rem;
  --s4: 2rem;
  --s5: 3.25rem;
  --s6: 5.5rem;
  --edge: clamp(1.25rem, 5vw, 3.5rem);
  --measure: 62ch;
  --rule: 1px;
  --radius: 6px;
  --spring: cubic-bezier(0.2, 0.8, 0.2, 1);
}

:root[data-theme="light"] {
  --ground: #f3eee4;
  --ground-raised: #faf7f1;
  --ground-sunk: #ebe4d7;
  --ink: #1c1b18;
  --ink-dim: #3a3833;
  --muted: #69655c;
  --line: #d3cbbb;
  --line-soft: #e3dccf;
  --accent: #b3261e;
  --accent-ink: #faf7f1;
  --glow: rgba(179, 38, 30, 0.05);
  --flag-white: #ffffff;
  --shadow: 0 1px 2px rgba(60, 40, 20, 0.08), 0 14px 30px -14px rgba(60, 40, 20, 0.22);
  color-scheme: light;
}

/* ---------------------------------------------------------------------------
   02  Base
--------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--ground);
  /* Two soft lights and a fine grain, so the ground has depth rather than
     reading as a flat fill. The grain is an inline SVG (allowed by img-src data:).
     Deux lumières douces et un grain fin pour donner de la profondeur. */
  background-image:
    radial-gradient(60rem 40rem at 85% -10%, var(--glow), transparent 70%),
    radial-gradient(40rem 30rem at -10% 110%, var(--glow), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--ink-dim);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.35s ease, color 0.35s ease;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.1;
}

a { color: var(--ink); text-decoration-color: var(--accent); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
a:active { opacity: 0.7; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

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

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: var(--accent-ink);
  padding: var(--s1) var(--s2); z-index: 10; text-decoration: none;
}
.skip:focus { left: var(--s2); top: var(--s2); }

/* Read by screen readers, invisible on screen / Lu par les lecteurs d'écran, invisible à l'écran */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.shell { flex: 1 0 auto; width: 100%; }

/* The woven selvedge along the top edge, in Maple Leaf tartan colours.
   La lisière tissée en haut de page, aux couleurs du tartan Feuille d'érable. */
.selvedge {
  height: 6px;
  background:
    repeating-linear-gradient(90deg,
      var(--tartan-green) 0 18px,
      var(--tartan-gold) 18px 21px,
      var(--tartan-green) 21px 28px,
      var(--tartan-red) 28px 40px,
      var(--tartan-brown) 40px 44px,
      var(--tartan-red) 44px 52px,
      var(--tartan-gold) 52px 54px);
  opacity: 0.9;
}

/* ---------------------------------------------------------------------------
   03  Language visibility / Visibilité des langues
   Both languages are in the markup; only the active one is shown. Without
   script, English shows.
   Les deux langues sont dans le balisage ; seule la langue active s'affiche.
--------------------------------------------------------------------------- */
:root[data-lang="en"] .l-fr,
:root[data-lang="fr"] .l-en,
:root:not([data-lang]) .l-fr { display: none !important; }

/* ---------------------------------------------------------------------------
   04  Header and controls / En-tête et commandes
--------------------------------------------------------------------------- */
header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding: var(--s3) var(--edge);
  border-bottom: var(--rule) solid var(--line-soft);
}

.brand {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0;
  transition: color 0.25s ease;
}
.brand:hover { color: var(--accent); }
.brand .dot { color: var(--accent); }

.controls { display: flex; align-items: center; gap: var(--s3); }

.lang {
  display: flex; align-items: center; gap: 0.2rem;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em;
}
.lang-btn {
  background: none; border: none; color: var(--muted);
  cursor: pointer; font: inherit; letter-spacing: inherit;
  text-transform: uppercase; padding: var(--s1) 0.25rem;
  transition: color 0.25s ease;
}
.lang-btn[aria-pressed="true"] { color: var(--accent); }
.lang-btn:hover { color: var(--ink); }
.lang-btn:active { opacity: 0.6; }
.lang-div { color: var(--line); }

.theme-btn {
  background: none; border: var(--rule) solid var(--line); color: var(--ink);
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease, transform 0.4s var(--spring);
}
.theme-btn:hover { border-color: var(--accent); color: var(--accent); transform: rotate(-18deg); }
.theme-btn:active { transform: rotate(-18deg) scale(0.92); }
.theme-btn svg { width: 16px; height: 16px; }
:root[data-theme="dark"] .theme-btn .ic-sun,
:root:not([data-theme]) .theme-btn .ic-sun { display: none; }
:root[data-theme="light"] .theme-btn .ic-moon { display: none; }

/* ---------------------------------------------------------------------------
   05  Home / Accueil
--------------------------------------------------------------------------- */
.home {
  padding: clamp(3.5rem, 14vh, 9rem) var(--edge) var(--s6);
  max-width: 1100px;
}

.label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 var(--s4);
}
.label .tick { color: var(--accent); }

.wordmark {
  margin: 0 0 var(--s5);
  font-size: clamp(3.4rem, 13vw, 9.5rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
}
.wordmark > span { display: block; }
/* The hyphen, drawn as a brass bar that leads into the second name.
   Le trait d'union, dessiné comme une barre de laiton. */
.wordmark .hy {
  display: inline-block;
  width: 0.42em;
  height: 0.075em;
  margin: 0 0.12em 0.22em 0;
  vertical-align: middle;
  background: var(--accent);
  border-radius: 1px;
  /* the real hyphen stays in the text for copy-paste and screen readers */
  color: transparent;
  overflow: hidden;
  font-size: inherit;
  line-height: 0;
}

.message {
  max-width: 34rem;
  border-left: 2px solid var(--accent);
  padding: 0 0 0 var(--s3);
  margin: 0 0 var(--s5);
}
.message p { margin: 0; font-size: clamp(1.1rem, 2.2vw, 1.3rem); line-height: 1.6; color: var(--ink-dim); }

.home-top {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: var(--s2) var(--s4);
  margin: 0 0 var(--s4);
}
.home-top .label { margin: 0; }

/* "Elbows Up!": a small pennant with a notched tail, tilted like it was
   pinned on in a hurry. Un petit fanion à queue échancrée, légèrement incliné. */
.elbows {
  display: inline-flex; align-items: center; gap: 0.45rem;
  margin: 0;
  padding: 0.38rem 1.35rem 0.38rem 0.75rem;
  background: var(--pennant);
  color: var(--pennant-ink);
  font-family: var(--font-mono); font-size: 0.74rem; font-weight: 400;
  letter-spacing: 0.14em; text-transform: uppercase;
  clip-path: polygon(0 0, 100% 0, calc(100% - 0.7rem) 50%, 100% 100%, 0 100%);
  transform: rotate(-2deg);
  box-shadow: 0 6px 18px -8px rgba(192, 40, 31, 0.6);
}
.elbows .leaf { width: 0.95rem; height: 0.95rem; fill: currentColor; flex: none; }

.scene { margin: 0; max-width: 1100px; }
.frieze { display: block; width: 100%; height: auto; }
.fz-ink { fill: var(--ink-dim); }
.fz-far { fill: var(--line); }
.fz-ground { fill: var(--line); }
.fz-red { fill: var(--flag-red); }
.fz-white { fill: var(--flag-white); }

/* ---------------------------------------------------------------------------
   06  Documents: privacy, security, 404 / Documents : confidentialité, sécurité
--------------------------------------------------------------------------- */
.doc {
  max-width: 760px;
  padding: clamp(2.5rem, 9vh, 5rem) var(--edge) var(--s6);
}
.doc h1 {
  font-size: clamp(2.4rem, 7vw, 4rem);
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0 0 var(--s3);
}
.doc .updated { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 var(--s5); }
.doc .lede { font-size: 1.2rem; line-height: 1.6; color: var(--ink); margin: 0 0 var(--s5); max-width: var(--measure); }
.doc h2 {
  font-size: 1.5rem;
  margin: var(--s5) 0 var(--s2);
  padding-top: var(--s3);
  border-top: var(--rule) solid var(--line-soft);
}
.doc p, .doc li { max-width: var(--measure); }
.doc p { margin: 0 0 var(--s3); }
.doc ul { margin: 0 0 var(--s3); padding-left: 1.1rem; }
.doc li { margin: 0 0 var(--s2); padding-left: 0.2rem; }
.doc li::marker { color: var(--accent); }
.doc strong { color: var(--ink); font-weight: 600; }

.back {
  display: inline-block;
  margin-top: var(--s5);
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.08em;
  color: var(--muted); text-decoration: none;
  transition: color 0.25s ease, transform 0.35s var(--spring);
}
.back:hover { color: var(--accent); transform: translateX(-4px); }

/* ---------------------------------------------------------------------------
   07  Contact (not yet open / pas encore ouvert)
--------------------------------------------------------------------------- */
.status {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent);
  border: var(--rule) solid var(--accent);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  margin: 0 0 var(--s4);
}
.status .pip { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.8); } }

.card {
  background: var(--ground-raised);
  border: var(--rule) solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--s4);
  max-width: 34rem;
}
.form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.form .field { margin: 0 0 var(--s3); }
.form label { display: block; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 var(--s1); }
.form input, .form textarea {
  width: 100%;
  font: inherit; color: var(--ink);
  background: var(--ground-sunk);
  border: var(--rule) solid var(--line);
  border-radius: 4px;
  padding: 0.6rem 0.75rem;
}
.form textarea { min-height: 8rem; resize: vertical; }
.form fieldset:disabled input,
.form fieldset:disabled textarea { opacity: 0.55; cursor: not-allowed; }
.form button {
  font: inherit; font-weight: 600;
  background: var(--accent); color: var(--accent-ink);
  border: 0; border-radius: 4px;
  padding: 0.65rem 1.3rem;
}
.form fieldset:disabled button { opacity: 0.45; cursor: not-allowed; }
.form .form-note { margin: var(--s3) 0 0; font-size: 0.92rem; color: var(--muted); }

/* ---------------------------------------------------------------------------
   08  Footer / Pied de page
--------------------------------------------------------------------------- */
footer.site {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3);
  padding: var(--s4) var(--edge);
  border-top: var(--rule) solid var(--line-soft);
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em;
  color: var(--muted);
}
footer.site nav { display: flex; flex-wrap: wrap; gap: var(--s3); margin-left: auto; }
footer.site a { color: var(--muted); text-decoration: none; transition: color 0.25s ease; }
footer.site a:hover { color: var(--accent); }
footer.site a[aria-current="page"] { color: var(--ink); }

/* ---------------------------------------------------------------------------
   09  Motion / Mouvement
   One staggered entrance on load; transform and opacity only.
   Une seule entrée échelonnée au chargement ; transform et opacity seulement.
--------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.8s var(--spring), transform 0.8s var(--spring);
}
.ready .reveal { opacity: 1; transform: none; }
.ready .reveal:nth-child(2) { transition-delay: 90ms; }
.ready .reveal:nth-child(3) { transition-delay: 180ms; }
.ready .reveal:nth-child(4) { transition-delay: 270ms; }
.ready .reveal:nth-child(5) { transition-delay: 360ms; }
.no-js .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .status .pip { animation: none; }
  .theme-btn, .back { transition: none; }
}

/* ---------------------------------------------------------------------------
   10  Screen sizes / Tailles d'écran
   Phones (up to 560px), tablets (561 to 1024px), desktops (above). Type sizes
   already scale with clamp(); these adjust spacing and the scene.
   Téléphones, tablettes et ordinateurs : la typographie suit clamp() ; ces
   règles ajustent les espacements et la scène.
--------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .home { padding-top: clamp(2.5rem, 9vh, 5rem); }
}

@media (max-width: 560px) {
  header.site { padding-top: var(--s2); padding-bottom: var(--s2); }
  .brand { font-size: 1.05rem; }
  .home { padding-bottom: var(--s5); }
  .home-top { margin-bottom: var(--s3); }
  .wordmark { margin-bottom: var(--s4); }
  .message { margin-bottom: var(--s4); }
  /* Let the scene run edge to edge so the animals stay as large as possible.
     La scène occupe toute la largeur pour garder les silhouettes lisibles. */
  .scene { margin: 0 calc(var(--edge) * -1); overflow: hidden; }
  /* Crop only the outer pines (x 0 to 130 and 800 to 920 of the 920-wide
     scene) so the animals and the Mountie are drawn about 28% larger.
     On ne rogne que les pins extérieurs pour agrandir les silhouettes. */
  .frieze { width: 128%; max-width: none; margin-left: -15%; }
  .card { padding: var(--s3); }
  footer.site nav { margin-left: 0; width: 100%; }
}
