/* ============================================================
   CHARTE COMMUNE « VOLCAN & LAGON » — tools.dindar.re
   Fichier de style partagé par la page liste et les futures applis.
   Pour changer l'apparence du site, c'est ICI qu'on modifie.
   ============================================================ */

:root {
  /* Couleurs */
  --abysse:      #0a1418;   /* fond profond, basalte humide */
  --basalte:     #11212a;   /* surfaces / cartes */
  --basalte-2:   #16303b;   /* survol / élévation */
  --lagon:       #2ec4b6;   /* accent froid — eau du lagon */
  --lagon-clair: #6fe3d8;
  --magma:       #ff6b35;   /* accent chaud — coulée de lave */
  --magma-clair: #ff9166;
  --ecume:       #eaf4f2;   /* texte principal */
  --brume:       #8aa6a8;   /* texte secondaire */
  --trait:       rgba(110,227,216,0.14);

  /* Typo */
  --display: "Fraunces", Georgia, serif;
  --corps:   "Inter", system-ui, sans-serif;
  --mono:    "JetBrains Mono", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--abysse);
  color: var(--ecume);
  font-family: var(--corps);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(60% 50% at 12% 0%, rgba(255,107,53,0.10), transparent 70%),
    radial-gradient(55% 55% at 92% 18%, rgba(46,196,182,0.12), transparent 70%),
    radial-gradient(50% 50% at 50% 110%, rgba(46,196,182,0.06), transparent 70%);
  z-index: -1;
  pointer-events: none;
}

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 28px; }

/* ---------- En-tête ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(10,20,24,0.6);
  border-bottom: 1px solid var(--trait);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}
.brand .dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--magma);
  box-shadow: 0 0 12px var(--magma), 0 0 0 4px rgba(255,107,53,0.12);
}
.nav-links { display: flex; gap: 26px; }
.nav-links a {
  color: var(--brume);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--lagon-clair); }
@media (max-width: 640px) { .nav-links { display: none; } }

/* ---------- Hero ---------- */
.hero { padding: 84px 0 56px; }
.eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lagon);
  margin-bottom: 22px;
  opacity: 0;
  animation: rise 0.7s 0.05s forwards;
}
.hero h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.3rem, 5.5vw, 3.8rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  max-width: 18ch;
  margin-bottom: 22px;
  opacity: 0;
  animation: rise 0.8s 0.14s forwards;
}
.hero h1 em {
  font-style: italic;
  font-weight: 500;
  background: linear-gradient(100deg, var(--magma-clair), var(--lagon-clair));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lede {
  font-size: clamp(1.02rem, 2.1vw, 1.22rem);
  color: var(--brume);
  max-width: 60ch;
  opacity: 0;
  animation: rise 0.8s 0.28s forwards;
}

/* ---------- Section ---------- */
.section { padding: 24px 0 100px; }
.section-head { margin-bottom: 34px; }
.section-head .label {
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brume);
  display: flex; align-items: center; gap: 12px;
}
.section-head .label::before {
  content: ""; width: 28px; height: 1px; background: var(--lagon); display: inline-block;
}
.section-head h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.6rem, 3.6vw, 2.2rem);
  letter-spacing: -0.02em;
  margin-top: 12px;
}
.section-head .count {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--brume);
  margin-top: 8px;
}

/* ---------- Grille d'applis ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.app {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 28px;
  background: var(--basalte);
  border: 1px solid var(--trait);
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform 0.28s cubic-bezier(.2,.7,.3,1), border-color 0.28s, background 0.28s;
  opacity: 0;
  transform: translateY(24px);
}
.app.in { animation: rise 0.7s forwards; }
.app::after {
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: var(--accent, var(--lagon));
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.32s;
}
.app:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--accent, var(--lagon)) 45%, transparent);
  background: var(--basalte-2);
}
.app:hover::after { transform: scaleX(1); }

.app .ic {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent, var(--lagon)) 14%, transparent);
  color: var(--accent, var(--lagon));
  margin-bottom: 20px;
}
.app .ic svg { width: 24px; height: 24px; }
.app h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.3rem;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.app p { color: var(--brume); font-size: 0.95rem; flex: 1; }
.app .meta {
  margin-top: 16px;
  display: flex; gap: 8px; flex-wrap: wrap;
}
.app .chip {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--brume);
  border: 1px solid var(--trait);
  padding: 4px 9px; border-radius: 20px;
}
.app .go {
  margin-top: 18px;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.88rem; font-weight: 600;
  color: var(--accent, var(--lagon));
}
.app .go svg { width: 15px; height: 15px; transition: transform 0.25s; }
.app:hover .go svg { transform: translateX(4px); }

.app .tag {
  position: absolute; top: 22px; right: 22px;
  font-family: var(--mono); font-size: 0.68rem;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--brume);
  border: 1px solid var(--trait);
  padding: 4px 9px; border-radius: 20px;
}

/* Accents par appli */
.app.a-bac  { --accent: var(--magma); }
.app.a-soon { --accent: var(--brume); opacity: 0.6; }
.app.a-soon:hover { transform: translateY(-2px); cursor: default; }

/* ---------- Pied ---------- */
footer {
  border-top: 1px solid var(--trait);
  padding: 38px 0;
  color: var(--brume);
  font-size: 0.88rem;
}
.foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.foot a { color: var(--lagon); text-decoration: none; }
.foot a:hover { text-decoration: underline; }


  
  /* ====== THÈME CLAIR (bascule) ====== */
  [data-theme="light"] {
    --abysse:#f4f8f7;        /* fond clair, écume très pâle */
    --basalte:#ffffff;       /* cartes blanches */
    --basalte-2:#eef5f3;     /* survol */
    --lagon:#0f9e90;         /* lagon assombri pour contraste sur blanc */
    --lagon-clair:#0c7d72;
    --magma:#e85d2a;         /* magma légèrement assombri */
    --magma-clair:#c94d1f;
    --ecume:#13262b;         /* texte foncé */
    --brume:#5a7378;         /* texte secondaire */
    --trait:rgba(15,158,144,0.18);
  }
  [data-theme="light"] body::before {
    background:
      radial-gradient(55% 45% at 12% 0%, rgba(232,93,42,0.07), transparent 70%),
      radial-gradient(50% 50% at 92% 12%, rgba(15,158,144,0.09), transparent 70%),
      radial-gradient(50% 50% at 50% 112%, rgba(15,158,144,0.05), transparent 70%);
  }
  [data-theme="light"] header { background:rgba(255,255,255,0.7); }
  /* boutons primaires : garder le texte lisible en clair */
  [data-theme="light"] .btn-primary { color:#fff; }

  /* ====== BOUTON BASCULE THÈME ====== */
  .theme-toggle {
    display:inline-flex; align-items:center; justify-content:center;
    width:40px; height:40px; border-radius:50%;
    background:var(--basalte); border:1px solid var(--trait);
    color:var(--ecume); cursor:pointer; padding:0; flex:0 0 auto;
    transition:background .25s, border-color .25s, transform .2s, color .25s;
  }
  .theme-toggle:hover { background:var(--basalte-2); transform:translateY(-1px) rotate(-8deg); border-color:color-mix(in srgb,var(--lagon) 45%,transparent); }
  .theme-toggle svg { width:19px; height:19px; }
  .theme-toggle .i-sun { display:none; }
  .theme-toggle .i-moon { display:block; }
  [data-theme="light"] .theme-toggle .i-sun { display:block; }
  [data-theme="light"] .theme-toggle .i-moon { display:none; }
  /* transition douce du fond global au changement */
  body { transition:background .3s ease, color .3s ease; }

/* ---------- Avatar ---------- */
  .brand-av {
    width: 30px; height: 30px; border-radius: 50%;
    object-fit: cover; flex: 0 0 auto;
    background: radial-gradient(circle at 50% 35%, #ffe36b, #f5c518);
    border: 1.5px solid var(--trait);
  }
  .hero-av {
    width: 112px; height: 112px; border-radius: 50%;
    object-fit: cover; margin-bottom: 26px;
    background: radial-gradient(circle at 50% 35%, #ffe36b, #f5c518);
    border: 2px solid color-mix(in srgb, var(--magma) 50%, transparent);
    box-shadow: 0 10px 30px rgba(255,107,53,0.22), 0 0 0 6px rgba(255,107,53,0.06);
    opacity: 0; animation: rise .8s .02s forwards;
  }
  .cv-av {
    width: 132px; height: 132px; border-radius: 50%;
    object-fit: cover; margin-bottom: 24px; display: block;
    background: radial-gradient(circle at 50% 35%, #ffe36b, #f5c518);
    border: 2px solid color-mix(in srgb, var(--lagon) 55%, transparent);
    box-shadow: 0 12px 34px rgba(46,196,182,0.20), 0 0 0 6px rgba(46,196,182,0.06);
    opacity: 0; animation: rise .8s .02s forwards;
  }

/* ---------- Animations ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .eyebrow, .hero h1, .hero p.lede, .app { opacity: 1 !important; transform: none !important; }
}
:focus-visible { outline: 2px solid var(--lagon-clair); outline-offset: 3px; border-radius: 4px; }
