:root {
  --bg: #0b0d12;
  --bg-2: #12151d;
  --card: #171b25;
  --card-hover: #1d2230;
  --border: #262c3a;
  --text: #eef1f7;
  --muted: #8b93a7;
  --accent: #7c9cff;
  --accent-2: #b28cff;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(124, 156, 255, 0.16), transparent 60%),
    var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
}

.home {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding:
    calc(env(safe-area-inset-top) + 48px)
    calc(env(safe-area-inset-right) + 20px)
    calc(env(safe-area-inset-bottom) + 24px)
    calc(env(safe-area-inset-left) + 20px);
}

.home-header { text-align: center; margin-bottom: 24px; }

/* Avatar rond façon photo de profil Twitter / X : photo recadrée dans un cercle,
   entourée d'un anneau de la couleur du fond. */
.logo {
  width: 112px;
  height: 112px;
  margin: 0 auto 18px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--bg);
  outline: 1px solid var(--border);
  background: var(--card);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.tagline a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: -0.02em;
  font-weight: 800;
  line-height: 1.1;
  text-wrap: balance;
  background: linear-gradient(90deg, #ffffff, #c9d4ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  margin: 10px auto 0;
  max-width: 34ch;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.tools { display: flex; flex-direction: column; gap: 12px; }

.tool-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  min-height: 76px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
  transition: transform 0.12s ease, background 0.15s ease;
}

.tool-card:active { transform: scale(0.98); background: var(--card-hover); }
@media (hover: hover) { .tool-card:hover { background: var(--card-hover); } }

.tool-icon {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
}

.tool-icon--retouche { background: linear-gradient(145deg, var(--accent), var(--accent-2)); }
.tool-icon--mosaic { background: linear-gradient(145deg, #ffb86b, #ff6fa8); }
.tool-icon--gif { background: linear-gradient(145deg, #7ee2a8, #2fb3a0); }
.tool-icon--impressionne { background: linear-gradient(145deg, #f0c27b, #6f93b8); }
.tool-icon--croque { background: linear-gradient(145deg, #a8a29a, #3a3735); }
.tool-icon--neon { background: linear-gradient(145deg, #ff3fb4, #7b3cff); }
.tool-icon--pixel { background: linear-gradient(145deg, #7ee2a8, #4a7bd8); }
.tool-icon--secret { background: linear-gradient(145deg, #c3a6ff, #3a2a6b); }
.tool-icon--story { background: linear-gradient(145deg, #fcebee, #e8b9c3 45%, #b26a7b); color: #3b272c; }
.tool-icon--tools { background: linear-gradient(145deg, var(--accent), #ffb86b 55%, #2fb3a0); }
.tool-icon--filters { background: linear-gradient(145deg, #f0c27b, #a8a29a 45%, #ff3fb4); }

.tool-text { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tool-name { font-size: 17px; font-weight: 650; }
.tool-desc { font-size: 14px; color: var(--muted); }
.tool-chevron { color: var(--muted); flex: none; }

/* ---------- Groupe dépliable (accordéon) ---------- */
.tool-group { display: flex; flex-direction: column; }
.group-toggle { width: 100%; font: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.group-chevron svg { display: block; transition: transform 0.25s ease; }
.group-toggle[aria-expanded="true"] .group-chevron svg { transform: rotate(90deg); }

/* grid 0fr → 1fr : la hauteur s'anime sans la connaître à l'avance */
.group-panel {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  transition: grid-template-rows 0.3s ease, opacity 0.25s ease, visibility 0s linear 0.3s;
}
.tool-group.is-open .group-panel {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  transition: grid-template-rows 0.3s ease, opacity 0.25s ease 0.05s, visibility 0s;
}
.group-inner {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-left: 14px;
  margin-left: 6px;
  border-left: 2px solid var(--border);
}
.group-inner > :first-child { margin-top: 12px; }
@media (prefers-reduced-motion: reduce) {
  .group-panel, .tool-group.is-open .group-panel, .group-chevron svg { transition: none; }
}

/* ---------- Texte d'accueil ---------- */
.manifesto {
  margin: 0 0 28px;
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
}
.manifesto p { margin: 0; }
.manifesto-motto { margin-top: 10px !important; color: var(--text); font-weight: 600; font-style: italic; }
.manifesto-list { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.manifesto-list li { position: relative; padding-left: 22px; }
.manifesto-list li::before {
  content: "";
  position: absolute; left: 2px; top: 0.45em;
  width: 10px; height: 6px;
  border-left: 2px solid #7ee2a8; border-bottom: 2px solid #7ee2a8;
  transform: rotate(-45deg);
}

.home-footer { margin-top: auto; padding-top: 40px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.contact { margin: 0; color: var(--muted); font-size: 15px; }
.contact a { color: var(--accent); font-weight: 600; text-decoration: none; }
.nowrap { white-space: nowrap; }

.offline-badge {
  font-size: 13px;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-2);
}

.offline-badge.is-ready { color: #7ee2a8; }
