/* Site-level layout, shared across pages: header, footer, language switch,
   section rhythm and responsive rules. Built on top of nocturne.css tokens. */

:root {
  --container: 1120px;
  --gutter: 40px;
  --stair-step: 24px;
}

@media (max-width: 640px) {
  :root {
    --gutter: 24px;
    --stair-step: 12px;
  }
}

body {
  min-height: 100vh;
  overflow-x: hidden; /* the hero's decorative glow is a fixed-width blob;
                         this keeps it from ever forcing a horizontal scroll
                         on narrow screens instead of resizing it. */
}
a { text-decoration: none; }
a:hover { color: var(--color-accent-200); }

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* — header — */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, #161826 84%, transparent);
  border-bottom: 1px solid var(--color-divider);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-text);
}
.site-nav {
  display: flex;
  gap: 22px;
  margin-left: auto;
  font-size: 13px;
  color: var(--color-neutral-400);
  flex-wrap: wrap;
}
.site-nav a { color: inherit; }
.site-nav a.is-current { color: var(--color-text); }

.lang-switch {
  display: flex;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.lang-switch button {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 5px 10px;
  background: transparent;
  color: var(--color-neutral-500);
}
.lang-switch button.is-active {
  background: var(--color-accent-800);
  color: var(--color-accent-200);
}

/* — section rhythm — */
.section { border-top: 1px solid var(--color-divider); }
.section-hero { border-top: none; position: relative; }

/* padding-top/bottom only — these classes always ride along with .wrap on
   the same element, and a full `padding` shorthand here would reset the
   left/right gutter .wrap just set, since both rules have equal specificity
   and this one comes later in the source. */
.py-hero { padding-top: 104px; padding-bottom: 72px; }
.py-1 { padding-top: 72px; padding-bottom: 72px; }
.py-2 { padding-top: 48px; padding-bottom: 48px; }
.py-3 { padding-top: 80px; padding-bottom: 80px; }
@media (max-width: 640px) {
  .py-hero { padding-top: 72px; padding-bottom: 40px; }
  .py-1 { padding-top: 48px; padding-bottom: 48px; }
  .py-2 { padding-top: 32px; padding-bottom: 32px; }
  .py-3 { padding-top: 56px; padding-bottom: 56px; }
}

/* — grids — */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 48px;
  align-items: start;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 36px;
}
.grid-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}
@media (max-width: 560px) {
  .grid-2 { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 420px) {
  .grid-tiles { grid-template-columns: repeat(2, 1fr); }
}

.flex-split {
  display: flex;
  flex-wrap: wrap;
  gap: 56px;
  align-items: flex-start;
}
.flex-side {
  flex: 1 1 220px;
  max-width: 320px;
  border-left: 1px solid var(--color-divider);
  padding-left: 24px;
}
.flex-main {
  flex: 3 1 360px;
  min-width: 0;
}

/* — staircase (methodology timeline) — */
.stairs {
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
  max-width: 620px;
}
.stairs > div {
  margin-left: calc(var(--stair-step) * var(--i, 0));
}
@media (max-width: 400px) {
  /* Below ~400px the growing indent plus the fixed-width step label
     leaves almost nothing for the description; drop the indent and let
     the label sit above the text instead of fighting it for room. */
  .stairs > div {
    margin-left: 0;
    flex-wrap: wrap;
    row-gap: 4px;
  }
  .stairs > div > span:first-child {
    min-width: 0 !important;
  }
}

/* — pull quote — */
.pull-quote {
  margin: 0;
  padding-left: 18px;
  border-left: 2px solid var(--color-accent-700);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-neutral-400);
  font-style: italic;
  max-width: 520px;
}

/* — surface card — */
.surface-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 26px 28px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent-400);
  margin-bottom: 14px;
  line-height: 1.4;
}

/* — reusable page bits (project cards, method cards, stack row) — */
.kicker {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-neutral-600);
}
.project-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border: 1px solid var(--color-divider);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--color-neutral-300);
}
.status-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.callout { border-left: 2px solid var(--color-accent-700); padding-left: 18px; }
.callout-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent-400);
  margin-bottom: 8px;
}
.grid-2-280 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 48px;
}
@media (max-width: 560px) {
  .grid-2-280 { grid-template-columns: 1fr; gap: 32px; }
}
.stack-row { display: flex; gap: 40px; flex-wrap: wrap; align-items: baseline; }
.stack-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-neutral-500);
  min-width: 120px;
}

.py-4 { padding-top: 56px; padding-bottom: 56px; }
.py-5 { padding-top: 88px; padding-bottom: 88px; }
.py-hero-lg { padding-top: 110px; padding-bottom: 80px; }
@media (max-width: 640px) {
  .py-4 { padding-top: 40px; padding-bottom: 40px; }
  .py-5 { padding-top: 56px; padding-bottom: 56px; }
  .py-hero-lg { padding-top: 72px; padding-bottom: 48px; }
}

/* — footer — */
.site-footer { border-top: 1px solid var(--color-divider); }
.site-footer .wrap {
  padding-top: 24px;
  padding-bottom: 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-neutral-600);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* — language content toggle — */
/* Driven purely by the `data-lang` attribute on <html>, set synchronously
   by the inline snippet in <head> (before first paint, to avoid a flash of
   the wrong language) and kept in sync by lang.js on toggle/storage events.
   Flex children (nav links, the FR/EN buttons) get blockified by their flex
   container regardless of `display:block` here, so one rule covers both. */
[data-lang-block] { display: none; }
html[data-lang="fr"] [data-lang-block="fr"],
html[data-lang="en"] [data-lang-block="en"] { display: block; }
