/* ==========================================================================
   PALAZE® — Base layer
   Modern reset, document defaults, typography primitives, accessibility
   affordances and the small utility layer used by every template.
   ========================================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--topbar-h) + 1rem);
  -moz-tab-size: 4;
  tab-size: 4;
}

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

body {
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--t-base);
  line-height: var(--leading-body);
  font-weight: 400;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  overflow-x: hidden;
  transition: background-color var(--dur-3) var(--ease-out),
              color var(--dur-3) var(--ease-out);
}

/* Lock scroll while a drawer / modal owns the viewport. */
body[data-scroll-lock="true"] { overflow: hidden; }

img, svg, video, canvas, picture {
  display: block;
  max-width: 100%;
}

img, svg { height: auto; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button { background: none; border: 0; padding: 0; cursor: pointer; }

ul, ol { list-style: none; padding: 0; }

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-1) var(--ease-out),
              opacity var(--dur-1) var(--ease-out);
}

table { border-collapse: collapse; border-spacing: 0; width: 100%; }

fieldset { border: 0; padding: 0; }

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}

::selection {
  background: var(--fg);
  color: var(--bg);
}

/* ── Focus ────────────────────────────────────────────────────────────────
   Never remove the outline; make it beautiful instead.
   ---------------------------------------------------------------------- */
:focus { outline: none; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

/* ── Typography primitives ───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: var(--leading-tight);
  letter-spacing: var(--track-display);
  text-wrap: balance;
  margin: 0;
}

h1 { font-size: var(--t-5xl); }
h2 { font-size: var(--t-4xl); }
h3 { font-size: var(--t-2xl); }
h4 { font-size: var(--t-xl); }
h5 { font-size: var(--t-lg); }
h6 { font-size: var(--t-md); }

p { text-wrap: pretty; }

strong, b { font-weight: 600; }

em, i { font-style: italic; }

sup {
  font-size: 0.4em;
  vertical-align: super;
  line-height: 0;
  letter-spacing: 0;
  font-weight: 500;
}

/* The French tagline. Used sparingly — it is the brand's signature. */
.tagline,
.serif {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.1;
}

/* ── Utility layer ───────────────────────────────────────────────────────
   Small, honest set. Layout complexity lives in component classes.
   ---------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--wide { max-width: none; }
.container--narrow { max-width: 46rem; }
.container--text { max-width: var(--measure); }

.gutters { padding-inline: var(--gutter); }

.section {
  padding-block: var(--section-y);
  position: relative;
}

.section--lg { padding-block: var(--section-y-lg); }
.section--top { padding-block-start: var(--section-y); padding-block-end: 0; }
.section--bottom { padding-block-start: 0; padding-block-end: var(--section-y); }
.section--flush { padding-block: 0; }

.stack > * + * { margin-block-start: var(--flow, var(--sp-4)); }
.stack--2 { --flow: var(--sp-2); }
.stack--3 { --flow: var(--sp-3); }
.stack--5 { --flow: var(--sp-5); }
.stack--6 { --flow: var(--sp-6); }
.stack--7 { --flow: var(--sp-7); }

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--gap, var(--sp-4));
}
.cluster--2 { --gap: var(--sp-2); }
.cluster--3 { --gap: var(--sp-3); }
.cluster--5 { --gap: var(--sp-5); }
.cluster--between { justify-content: space-between; }
.cluster--center { justify-content: center; }
.cluster--end { justify-content: flex-end; }

.u-upper {
  text-transform: uppercase;
  letter-spacing: var(--track-nav);
  font-weight: 500;
}

.u-label {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: var(--track-label);
  font-size: var(--t-2xs);
  font-weight: 500;
  color: var(--fg-muted);
}

.u-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.u-muted { color: var(--fg-muted); }
.u-subtle { color: var(--fg-subtle); }
.u-center { text-align: center; }
.u-right { text-align: right; }
.u-nowrap { white-space: nowrap; }
.u-balance { text-wrap: balance; }
.u-hidden { display: none !important; }

.u-display {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: var(--track-display);
  line-height: var(--leading-none);
  text-transform: uppercase;
}

.u-mono-cap {
  font-family: var(--font-mono);
  font-size: var(--t-2xs);
  text-transform: uppercase;
  letter-spacing: var(--track-label);
}

/* Hairline rules used to structure editorial layouts. */
.rule { border-top: 1px solid var(--line); }
.rule--strong { border-top-color: var(--line-strong); }

.rule-label {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  border-top: 1px solid var(--line-strong);
  padding-top: var(--sp-3);
  justify-content: space-between;
}

/* ── Accessibility ───────────────────────────────────────────────────── */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: var(--sp-3);
  left: var(--sp-3);
  z-index: var(--z-skip);
  transform: translateY(-160%);
  background: var(--plz-bone);
  color: var(--plz-ink);
  padding: var(--sp-3) var(--sp-5);
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: var(--track-label);
  border-radius: var(--r-xs);
  transition: transform var(--dur-2) var(--ease-out);
}
.skip-link:focus { transform: translateY(0); }

/* Visible-but-tidy scrollbars. */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: var(--r-pill);
}
*::-webkit-scrollbar-thumb:hover { background-clip: content-box; background-color: var(--fg-muted); }

/* ── Film grain ──────────────────────────────────────────────────────────
   One 140px noise tile is rasterised once by the browser and repeated.
   Far cheaper than running feTurbulence inside every generated SVG, and it
   gives the whole site the analogue-photography texture the brand asks for.
   ---------------------------------------------------------------------- */
.grain { position: relative; }

.grain::after {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: var(--grain-z, 1);
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 140px 140px;
  opacity: var(--grain-opacity, 0.42);
  mix-blend-mode: overlay;
}
.grain--soft { --grain-opacity: 0.26; }
.grain--heavy { --grain-opacity: 0.62; }

/* Vignette used on campaign imagery. */
.vignette::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: var(--vignette-z, 2);
  pointer-events: none;
  background: radial-gradient(ellipse 78% 68% at 50% 45%, transparent 40%, rgba(6, 6, 6, 0.55) 100%);
}

@media print {
  .grain::after, .vignette::before { display: none; }
}

/* ── Boot state ───────────────────────────────────────────────────────── */
[data-boot="pending"] .fallback-header,
[data-boot="pending"] #static-fallback { }

.fallback-header { padding: var(--sp-9) var(--gutter) var(--sp-6); }
.fallback-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--t-4xl);
  letter-spacing: var(--track-display);
  line-height: 1;
}
.fallback-tagline { font-size: var(--t-xl); margin-block-start: var(--sp-2); color: var(--fg-muted); }
.fallback-est { font-family: var(--font-mono); font-size: var(--t-2xs); letter-spacing: var(--track-label); text-transform: uppercase; margin-block-start: var(--sp-4); }
.fallback-nav { display: flex; flex-wrap: wrap; gap: var(--sp-5); padding: 0 var(--gutter) var(--sp-7); font-size: var(--t-xs); text-transform: uppercase; letter-spacing: var(--track-nav); }
#static-fallback main { padding: 0 var(--gutter) var(--sp-9); max-width: 60rem; display: flex; flex-direction: column; gap: var(--sp-5); }
#static-fallback h1 { font-size: var(--t-3xl); }
#static-fallback h2 { font-size: var(--t-xl); margin-block-start: var(--sp-5); }
#static-fallback ul { display: flex; flex-direction: column; gap: var(--sp-2); }
#static-fallback a { text-decoration: underline; text-underline-offset: 3px; }
.fallback-noscript { border: 1px solid var(--line); padding: var(--sp-4); font-size: var(--t-sm); }

/* The SPA takes over: the fallback is removed by JS, but if JS is off it stays. */
body[data-app-ready="true"] #static-fallback { display: none; }
