/**
 * Iroise 2026 — Base
 *
 * Polices auto-hébergées + reset moderne + typographie + utilitaires de mise en page.
 */


/* ============================================
   POLICES (self-hosted, format woff2)
   ============================================ */

@font-face {
  font-family: 'Satoshi';
  font-style:  normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/satoshi-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Satoshi';
  font-style:  normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/satoshi-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Satoshi';
  font-style:  normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/satoshi-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Satoshi';
  font-style:  normal;
  font-weight: 900;
  font-display: swap;
  src: url('../fonts/satoshi-900.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style:  normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-400.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style:  normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-500.woff2') format('woff2');
}


/* ============================================
   RESET MODERNE
   ============================================ */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust:    100%;
  text-size-adjust:         100%;
  scroll-behavior:          smooth;
  scroll-padding-top:       var(--header-height);
}

body {
  min-height:                100vh;
  line-height:               var(--lh-normal);
  font-family:               var(--font-body);
  font-size:                 var(--fs-base);
  color:                     var(--color-text);
  background-color:          var(--color-bg);
  -webkit-font-smoothing:    antialiased;
  -moz-osx-font-smoothing:   grayscale;
  text-rendering:            optimizeLegibility;
}

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

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

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

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

/* Évite les orphelins typographiques (single word on last line)
   sur les titres en remontant un mot quand l'algo de wrap le permet.
   Pas de césure : aucun tiret ajouté, juste un meilleur placement
   des line-break entre mots. Fallback silencieux sur browsers anciens. */
h1, h2, h3, h4, h5, h6 {
  text-wrap: pretty;
}


/* ============================================
   TYPOGRAPHIE
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-family:    var(--font-display);
  line-height:    var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  font-weight:    var(--fw-semibold);
  color:          var(--color-text);
}

h1 {
  font-size:   clamp(var(--fs-2xl), 5vw, var(--fs-4xl));
  font-weight: var(--fw-black);
}

h2 { font-size: clamp(var(--fs-xl), 4vw, var(--fs-3xl)); }
h3 { font-size: clamp(var(--fs-lg), 3vw, var(--fs-2xl)); }
h4 { font-size: var(--fs-xl); }
h5 { font-size: var(--fs-lg); }
h6 { font-size: var(--fs-md); }

p {
  line-height: var(--lh-relaxed);
  max-width:   70ch;
}

a {
  color:                    var(--color-action);
  text-decoration-thickness: 1px;
  text-underline-offset:     0.2em;
  transition:                color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--color-action-hover);
}

.tabular {
  font-family:           var(--font-mono);
  font-variant-numeric:  tabular-nums;
  letter-spacing:        var(--tracking-tight);
}


/* ============================================
   ACCESSIBILITÉ
   ============================================ */

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

:focus:not(:focus-visible) {
  outline: none;
}

.skip-link {
  position:        absolute;
  top:             -100px;
  left:            0;
  z-index:         var(--z-modal);
  padding:         var(--space-3) var(--space-5);
  background:      var(--color-iroise-blue);
  color:           var(--color-text-inverse);
  text-decoration: none;
  border-radius:   0 0 var(--radius-md) 0;
  transition:      top var(--duration-fast) var(--ease-out);
}

.skip-link:focus {
  top: 0;
}

.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;
}


/* ============================================
   PRIMITIVES DE LAYOUT
   ============================================ */

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

.container--narrow { max-width: var(--container-narrow); }
.container--wide   { max-width: var(--container-wide); }

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

.section--dark {
  background: var(--color-iroise-blue);
  color:      var(--color-text-inverse);
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4,
.section--dark h5,
.section--dark h6 {
  color: var(--color-text-inverse);
}

.stack > * + * {
  margin-top: var(--stack-space, var(--space-5));
}

.cluster {
  display:     flex;
  flex-wrap:   wrap;
  gap:         var(--cluster-gap, var(--space-4));
  align-items: center;
}
