﻿/* =============================================================
   moi.tomasgosselin.be — main.css
   Design system partagé par toutes les pages.
   Palette : sauge poudrée + pastels froids.
   Esthétique : glassmorphisme raffiné, scroll long, typographie soignée.
   ============================================================= */

/* -------------------------------------------------------------
   1. Fonts locales — servies depuis /fonts, pas de Google.
   ------------------------------------------------------------- */
@font-face {
  font-family: 'Fraunces';
  src: url('../fonts/fraunces-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('../fonts/fraunces-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('../fonts/fraunces-semibold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('../fonts/fraunces-bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PublicSans';
  src: url('../fonts/publicsans-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'PublicSans';
  src: url('../fonts/publicsans-medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'PublicSans';
  src: url('../fonts/publicsans-semibold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* -------------------------------------------------------------
   2. Variables — design tokens.
   ------------------------------------------------------------- */
:root {
  /* Palette — sauge poudrée en principale, pastels complémentaires pour les couches */
  --sage-50:  #f3f5ef;
  --sage-100: #e4e9dc;
  --sage-200: #ccd4bf;
  --sage-300: #a8b8a0;   /* accent principal */
  --sage-400: #8a9c82;
  --sage-500: #6b7d65;
  --sage-700: #3f4a3c;

  --lavender-100: #e8e4f0;
  --lavender-200: #d5cde6;
  --lavender-300: #b9aed4;

  --sky-100: #e1ecf0;
  --sky-200: #c5d9e1;
  --sky-300: #9dbcc9;

  --rose-100: #efe2e0;
  --rose-200: #e0c7c3;

  --sand-100: #efe9dd;
  --sand-200: #ddd2bb;

  --ink-deep:    #2a2e2a;   /* texte principal, gris-vert très foncé, pas noir pur */
  --ink-mid:     #5a5f5a;
  --ink-soft:    #8a8d88;

  /* Surfaces pour le glassmorphisme */
  --glass-bg:       rgba(255, 255, 255, 0.55);
  --glass-bg-strong: rgba(255, 255, 255, 0.7);
  --glass-border:   rgba(255, 255, 255, 0.65);
  --glass-shadow:   0 8px 32px rgba(80, 100, 75, 0.08),
                    0 2px 6px rgba(80, 100, 75, 0.04);

  /* Fond d'ensemble — dégradé doux de crème-sauge à lavande-ciel */
  --bg-wash: radial-gradient(ellipse at 20% 0%, #e8eee0 0%, transparent 50%),
             radial-gradient(ellipse at 80% 30%, #e4e8f1 0%, transparent 50%),
             radial-gradient(ellipse at 30% 80%, #eee6ec 0%, transparent 55%),
             linear-gradient(180deg, #f5f7f0 0%, #eef0ea 100%);

  /* Typographies */
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body:    'PublicSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'SF Mono', 'Menlo', 'Consolas', monospace;

  /* Typographie scale — contrastes francs pour la hiérarchie */
  --fs-hero:   clamp(2.5rem, 6vw + 1rem, 5rem);
  --fs-h1:     clamp(2rem, 3.5vw + 0.8rem, 3.2rem);
  --fs-h2:     clamp(1.4rem, 1.4vw + 0.9rem, 1.9rem);
  --fs-h3:     clamp(1.1rem, 0.5vw + 0.95rem, 1.25rem);
  --fs-body:   1.0625rem;
  --fs-lead:   clamp(1.15rem, 0.6vw + 1rem, 1.3rem);
  --fs-small:  0.88rem;
  --fs-tiny:   0.75rem;

  /* Espacements */
  --space-xs:  0.5rem;
  --space-sm:  1rem;
  --space-md:  1.75rem;
  --space-lg:  3rem;
  --space-xl:  5rem;
  --space-2xl: 8rem;

  /* Largeurs */
  --width-text:  660px;
  --width-wide:  980px;
  --width-full:  1200px;

  /* Rayons */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  /* Transitions */
  --ease-out:  cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* -------------------------------------------------------------
   3. Reset — moderne, minimal.
   ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--ink-deep);
  background: var(--bg-wash);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; display: block; }

/* -------------------------------------------------------------
   4. Typographie.
   ------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink-deep);
  margin: 0 0 var(--space-sm);
  font-feature-settings: "onum", "liga";
}

h1 { font-size: var(--fs-h1); font-weight: 700; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 600; letter-spacing: 0; }

p { margin: 0 0 1em; }

em { font-style: italic; font-family: var(--font-display); }
strong { font-weight: 600; color: var(--ink-deep); }

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: rgba(168, 184, 160, 0.15);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  color: var(--sage-700);
}

blockquote {
  margin: var(--space-md) 0;
  padding: var(--space-sm) var(--space-md);
  border-left: 3px solid var(--sage-300);
  font-style: italic;
  color: var(--ink-mid);
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: var(--fs-lead);
  color: var(--ink-mid);
  margin: -0.5rem 0 var(--space-md);
  letter-spacing: 0;
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--ink-mid);
  font-weight: 400;
}

.email-reveal__btn {
  display: inline-block;
  padding: 0.45em 1.1em;
  border: 1.5px solid var(--ink-mid);
  border-radius: 99px;
  background: transparent;
  color: var(--ink-mid);
  font-size: var(--fs-lead);
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.email-reveal__btn:hover {
  background: var(--ink-mid);
  color: #fff;
}
.email-reveal__addr {
  font-size: var(--fs-lead);
  color: var(--ink-mid);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

/* Petite étiquette type "chapitre" */
.chapter-tag {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--fs-tiny);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sage-400);
  padding: 0.35em 0.9em;
  border: 1px solid var(--sage-200);
  border-radius: 100px;
  margin-bottom: var(--space-sm);
  background: rgba(255, 255, 255, 0.4);
}

/* -------------------------------------------------------------
   5. Navigation haute (site-wide).
   ------------------------------------------------------------- */
.site-nav {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: calc(100% - 2rem);
  max-width: var(--width-full);
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;

  background: var(--glass-bg-strong);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  box-shadow: var(--glass-shadow);

  font-family: var(--font-body);
}

.site-nav .brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--ink-deep);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.site-nav .brand::before {
  content: "◆";
  color: var(--sage-400);
  margin-right: 0.5em;
  font-size: 0.75em;
  vertical-align: 1px;
}
.site-nav .brand .short-name { display: none; }

.site-nav .links {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.site-nav .links a {
  color: var(--ink-mid);
  text-decoration: none;
  font-size: var(--fs-small);
  font-weight: 500;
  padding: 0.45rem 0.9rem;
  border-radius: 100px;
  transition: all 0.2s var(--ease-out);
}
.site-nav .links a:hover {
  color: var(--ink-deep);
  background: rgba(168, 184, 160, 0.15);
}
.site-nav .links a.current {
  color: var(--sage-700);
  background: rgba(168, 184, 160, 0.2);
}

/* -------------------------------------------------------------
   6. Structure générale de page.
   ------------------------------------------------------------- */
main {
  padding-top: 6rem;
  padding-bottom: var(--space-2xl);
  position: relative;
  z-index: 1;
}

.page-content {
  max-width: var(--width-text);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.page-content.wide {
  max-width: var(--width-wide);
}

/* -------------------------------------------------------------
   7. Cartes glass (utilisées dans toutes les pages).
   ------------------------------------------------------------- */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  margin: var(--space-md) 0;
}

/* Fallback si backdrop-filter non supporté */
@supports not (backdrop-filter: blur(10px)) {
  .glass-card,
  .site-nav {
    background: rgba(255, 255, 255, 0.94);
  }
}

/* -------------------------------------------------------------
   8. Section héro (landing).
   ------------------------------------------------------------- */
.hero {
  max-width: var(--width-wide);
  margin: 0 auto;
  padding: var(--space-xl) 1.5rem var(--space-lg);
  position: relative;
  z-index: 2;
}

/* Voile doux derrière le hero pour que le titre respire devant le diagramme */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%,
    rgba(255, 255, 255, 0.75) 0%,
    rgba(255, 255, 255, 0.55) 40%,
    transparent 75%);
  z-index: -1;
  pointer-events: none;
}

.hero-title {
  font-family: var(--font-display);
  font-size: var(--fs-hero);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0 0 var(--space-sm);
  color: var(--ink-deep);
}
.hero-title em {
  font-weight: 400;
  font-style: italic;
  color: var(--sage-500);
}

.hero-subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.2rem, 1.2vw + 1rem, 1.6rem);
  color: var(--ink-mid);
  margin: 0 0 var(--space-md);
  font-weight: 400;
}

.hero-lead {
  max-width: 580px;
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--ink-mid);
}

/* -------------------------------------------------------------
   9. Chapitres du fil (landing seulement).
   ------------------------------------------------------------- */
.chapter {
  max-width: var(--width-text);
  margin: 0 auto;
  padding: var(--space-xl) 1.5rem;
  position: relative;
}

.chapter-number {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--sage-400);
  letter-spacing: 0.02em;
  margin-bottom: 0.4rem;
}

.chapter h2 {
  margin-top: 0.2rem;
  margin-bottom: var(--space-sm);
}

/* Espaces de respiration entre chapitres — laissent voir le diagramme */
.spacer {
  height: 16vh;
  min-height: 110px;
}
.spacer-lg { height: 30vh; min-height: 210px; }
.spacer-step-x { height: 42vh; min-height: 320px; }
.spacer-step-xi { height: 40vh; min-height: 300px; }
.spacer-step-xii { height: 28vh; min-height: 210px; }
.spacer-tight { height: 6vh; min-height: 36px; }

/* -------------------------------------------------------------
   10. Pied de page.
   ------------------------------------------------------------- */
.site-footer {
  margin-top: var(--space-xl);
  padding: var(--space-lg) 1.5rem var(--space-md);
  max-width: var(--width-wide);
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  color: var(--ink-soft);
  font-size: var(--fs-small);
  border-top: 1px solid rgba(168, 184, 160, 0.3);
}

.site-footer a {
  color: var(--sage-500);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.site-footer a:hover { border-bottom-color: var(--sage-400); }

/* -------------------------------------------------------------
   11. Liens.
   ------------------------------------------------------------- */
a {
  color: var(--sage-500);
  text-decoration: none;
  border-bottom: 1px solid rgba(168, 184, 160, 0.5);
  transition: all 0.2s var(--ease-out);
  padding-bottom: 1px;
}
a:hover {
  color: var(--sage-700);
  border-bottom-color: var(--sage-500);
  background: rgba(168, 184, 160, 0.1);
}

/* -------------------------------------------------------------
   12. Accessibilité — respect de reduced motion.
   ------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* -------------------------------------------------------------
   13. Responsive.
   ------------------------------------------------------------- */
@media (max-width: 720px) {
  .site-nav {
    padding: 0.5rem 0.8rem;
    top: 0.6rem;
    gap: 0.5rem;
  }
  .site-nav .links { gap: 0.05rem; }
  .site-nav .links a {
    padding: 0.35rem 0.55rem;
    font-size: 0.78rem;
  }
  .site-nav .brand {
    font-size: 0.88rem;
    white-space: nowrap;
  }
  .site-nav .brand::before { display: none; }

  .hero { padding: var(--space-lg) 1rem; }
  .chapter { padding: var(--space-lg) 1rem; }
  main { padding-top: 5rem; }
}

@media (max-width: 560px) {
  /* En-dessous de 560px, on remplace le nom complet par les initiales,
     sinon la nav déborde et tout se casse. */
  .site-nav .brand .full-name { display: none; }
  .site-nav .brand .short-name { display: inline; }
  .site-nav .links a { padding: 0.3rem 0.5rem; font-size: 0.74rem; }
}

@media (max-width: 480px) {
  .site-nav { border-radius: 18px; }
  .glass-card { padding: 1.25rem; }
}

/* -------------------------------------------------------------
   14. Impression.
   ------------------------------------------------------------- */
@media print {
  body { background: white; color: black; }
  .site-nav, .diagram-bg, .site-footer { display: none; }
  .glass-card { background: white; border: 1px solid #ccc; box-shadow: none; }
}
