/* Charte de DigDash Corpus et d'Audio2Note : mêmes jetons, mêmes valeurs (leurs styles.css). */
@font-face { font-family: 'Open Sans'; font-style: normal; font-display: swap; font-weight: 400; src: url(fonts/open-sans-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Open Sans'; font-style: normal; font-display: swap; font-weight: 600; src: url(fonts/open-sans-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Open Sans'; font-style: normal; font-display: swap; font-weight: 700; src: url(fonts/open-sans-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Open Sans'; font-style: normal; font-display: swap; font-weight: 800; src: url(fonts/open-sans-latin-800-normal.woff2) format('woff2'); }

:root {
  --brand-gradient: linear-gradient(95deg, #3b3a9e 0%, #7b2da0 52%, #b51e8c 100%);
  --ai-indigo: #3b3a9e;
  --ai-violet: #6b2fb5;
  --ai-magenta: #b51e8c;
  --ai-heading: #2e5d6b;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --bg: #ffffff;
  --bg-soft: #f8f7fd;
  --secondary-border: #e6e8f0;
  --page-bg: #f4f3fa;
  --hero-base: #1d1b55;
  --card-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px rgba(59, 58, 158, 0.08);
  --card-shadow-hover: 0 2px 6px rgba(15, 23, 42, 0.06), 0 22px 48px rgba(59, 58, 158, 0.18);
  --kbd-bg: #f1f0f9;
  --radius-card: 20px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ai-heading: #e2e8f0;
    --ai-violet: #b794f6;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --bg: #151c2c;
    --bg-soft: #1a2236;
    --secondary-border: #263147;
    --page-bg: #0d111b;
    --hero-base: #141238;
    --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.35);
    --card-shadow-hover: 0 2px 6px rgba(0, 0, 0, 0.45), 0 22px 48px rgba(91, 60, 196, 0.25);
    --kbd-bg: #222b40;
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: 'Open Sans', system-ui, -apple-system, sans-serif;
  color: var(--text-main);
  background: var(--page-bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

kbd {
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--kbd-bg);
  color: var(--text-muted);
  border: 1px solid var(--secondary-border);
  border-bottom-width: 2px;
}

/* --- Bandeau ------------------------------------------------------------------------------ */
/* Panneau flottant : fond indigo profond, halos de la marque qui dérivent lentement, trame fine. */
.hero {
  position: relative;
  overflow: hidden;
  margin: 12px 12px 0;
  border-radius: 28px;
  background: var(--hero-base);
  color: #fff;
  padding: 52px 16px 120px;
  isolation: isolate;
}

.hero-aurora { position: absolute; inset: 0; z-index: -2; filter: blur(60px); opacity: 0.9; }

.hero-aurora span {
  position: absolute;
  border-radius: 50%;
  animation: drift 22s ease-in-out infinite alternate;
}

.hero-aurora span:nth-child(1) { width: 520px; height: 520px; left: -120px; top: -200px; background: #3b3a9e; }
.hero-aurora span:nth-child(2) { width: 460px; height: 460px; left: 38%; top: -160px; background: #7b2da0; animation-duration: 26s; animation-delay: -6s; }
.hero-aurora span:nth-child(3) { width: 520px; height: 520px; right: -160px; top: -120px; background: #b51e8c; animation-duration: 30s; animation-delay: -12s; }

@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.08); }
  100% { transform: translate(-40px, 70px) scale(0.95); }
}

.hero-grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 30%, transparent 75%);
}

/* Goutte d'eau : app.js redessine la trame dans ce canevas, déformée sous le pointeur comme à
   travers une goutte posée dessus, et le canevas prend la place de la trame CSS, qui reste le
   rendu sans script. */
.hero-drop {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero.drop-ready .hero-grid { visibility: hidden; }

.hero-drop-filter { position: absolute; }

/* Même largeur de contenu que main (1064 - 2 × 24) : le texte s'aligne sur les cartes. */
.hero-inner { max-width: 1016px; margin: 0 auto; }

.hero-logo { height: 32px; display: block; margin-bottom: 40px; }

.hero-greeting {
  display: inline-block;
  margin: 0 0 14px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4.2vw, 44px);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.8px;
}

.hero-sub { margin: 0; font-size: 16px; opacity: 0.82; max-width: 560px; line-height: 1.5; }

/* --- Applications ------------------------------------------------------------------------- */
main {
  flex: 1;
  width: 100%;
  max-width: 1064px;
  margin: -84px auto 0;
  padding: 0 24px 40px;
}

/* Deux colonnes au plus : quatre tuiles font deux rangées pleines, sans tuile seule en bas. */
.apps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: 20px;
}

.app {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: 1fr auto;
  column-gap: 18px;
  row-gap: 18px;
  padding: 24px;
  background: var(--bg);
  border: 1px solid var(--secondary-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  color: inherit;
  text-decoration: none;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s ease;
  animation: rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.app:nth-child(2) { animation-delay: 0.06s; }
.app:nth-child(3) { animation-delay: 0.12s; }
.app:nth-child(4) { animation-delay: 0.18s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* Liseré au dégradé de la marque, révélé au survol. */
.app::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1.5px;
  background: var(--brand-gradient);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.app:hover, .app:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
  outline: none;
}

.app:hover::before, .app:focus-visible::before { opacity: 1; }

.app-icon {
  grid-row: 1 / 3;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--brand-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(123, 45, 160, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.app:hover .app-icon { transform: scale(1.06) rotate(-4deg); }

.app-icon svg { width: 26px; height: 26px; }

.app-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding-top: 2px; }

.app-body strong { font-size: 19px; font-weight: 800; color: var(--ai-heading); letter-spacing: -0.3px; }

.app-body span { font-size: 14px; line-height: 1.5; color: var(--text-muted); }

/* Macaron à côté du nom d'une application encore en rodage. */
.app-body .app-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.5;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  vertical-align: 3px;
  color: #fff;
  background: var(--brand-gradient);
}

.app-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--secondary-border);
}

.app-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ai-violet);
}

.app-open svg { width: 16px; height: 16px; transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); }

.app:hover .app-open svg { transform: translateX(4px); }

/* --- Administration ----------------------------------------------------------------------- */
.admin { margin-top: 48px; animation: rise 0.6s 0.24s cubic-bezier(0.2, 0.8, 0.2, 1) both; }

.admin-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-bottom: 14px;
  color: var(--text-muted);
}

.admin-head svg { width: 14px; height: 14px; align-self: center; }

.admin-head h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.admin-head span { font-size: 12.5px; }

.admin-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px;
}

.admin-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--secondary-border);
  border-radius: 14px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.admin-link:hover, .admin-link:focus-visible {
  border-color: var(--ai-violet);
  background: var(--bg);
  transform: translateY(-2px);
  outline: none;
}

.admin-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ai-violet);
  background: var(--bg);
  border: 1px solid var(--secondary-border);
}

.admin-icon svg { width: 18px; height: 18px; }

.admin-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.admin-text strong { font-size: 14px; font-weight: 700; }

.admin-text span { font-size: 12.5px; color: var(--text-muted); line-height: 1.4; }

/* --- Pied --------------------------------------------------------------------------------- */
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  max-width: 1064px;
  margin: 0 auto;
  padding: 18px 24px 28px;
  font-size: 12px;
  color: var(--text-muted);
}

footer > span:first-child {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.footer-hint kbd { margin: 0 2px; }

/* --- Petits écrans, mouvement réduit ------------------------------------------------------ */
@media (max-width: 600px) {
  .hero { margin: 8px 8px 0; border-radius: 22px; padding: 36px 16px 104px; }
  .hero-logo { margin-bottom: 28px; }
  main { padding: 0 16px 32px; }
  .app { padding: 20px; column-gap: 14px; }
  .app-icon { width: 48px; height: 48px; border-radius: 14px; }
  .app kbd, .footer-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
