/* Launcher D&A TRUST — app launcher springboard (dark command-center).
   Feuille PARTAGÉE par le portail public (/) et le hub (/hub/). Servie via /portal-assets/. */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Marque D&A TRUST */
  --teal: #20A39E;
  --teal-light: #4DB5B1;
  --navy-800: #1C3041;
  --navy-700: #26415A;

  --ink: #e8eef1;
  --ink-soft: #c4d2d9;
  --ink-muted: #7e95a1;

  /* Espacement (base 4pt) */
  --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-6: 24px; --sp-8: 32px; --sp-12: 48px;

  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);

  --tile: clamp(74px, 10vh, 104px);   /* côté du squircle — s'adapte à la hauteur d'écran */
  --radius: clamp(22px, 3vh, 31px);   /* ~30% → galbe app-icon */
}

html, body { height: 100%; }

body {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center; /* retombe sur start si le contenu déborde → le logo n'est jamais rogné */
  gap: clamp(var(--sp-8), 5vh, var(--sp-12));
  padding: clamp(var(--sp-6), 5vh, var(--sp-12)) var(--sp-6);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-kerning: normal;
  color: var(--ink);
  background:
    radial-gradient(125% 80% at 50% -12%, rgba(32, 163, 158, 0.20), transparent 58%),
    radial-gradient(90% 70% at 88% 110%, rgba(38, 65, 90, 0.45), transparent 60%),
    linear-gradient(162deg, #15273600 0%, #0e1a25 0%, #0c1620 55%, #11212f 100%);
  -webkit-font-smoothing: antialiased;
}

/* En-tête compact */
.masthead { text-align: center; }
.masthead img {
  height: clamp(88px, 14vh, 150px); width: auto; /* grand sur écran haut, se réduit sur écran court */
  opacity: 0.95;
  filter: brightness(0) invert(1);
}
.masthead h1 {
  margin-top: var(--sp-4);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #fff;
}
.masthead .subtitle {
  margin-top: 6px;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
}

/* Sections */
.sections {
  display: flex;
  flex-direction: column;
  gap: clamp(var(--sp-6), 4.5vh, var(--sp-12));
  width: 100%;
  max-width: 760px;
}
.group { display: flex; flex-direction: column; gap: var(--sp-6); }
.group-label {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--teal-light);
}

/* Grille de tuiles */
.grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-6) var(--sp-8);
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: var(--tile);
  text-decoration: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  animation: rise 0.55s var(--ease-out-expo) backwards;
  animation-delay: calc(var(--i, 0) * 45ms);
}

.squircle {
  width: var(--tile);
  height: var(--tile);
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: var(--teal-light);
  background:
    linear-gradient(155deg, rgba(38, 65, 90, 0.92), rgba(16, 27, 38, 0.96));
  border: 1px solid rgba(77, 181, 177, 0.22);
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transition:
    transform 0.28s var(--ease-out-quart),
    box-shadow 0.28s var(--ease-out-quart),
    border-color 0.28s var(--ease-out-quart),
    background 0.28s var(--ease-out-quart),
    color 0.28s var(--ease-out-quart);
}
.squircle svg {
  width: clamp(30px, 4.5vh, 42px); height: clamp(30px, 4.5vh, 42px);
  transition: transform 0.28s var(--ease-out-quart);
}

.tile-name {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  text-align: center;
  transition: color 0.2s var(--ease-out-quart);
}

/* Description : masquée par défaut (hub = tuiles compactes),
   affichée en mode carte sur le portail public (.show-desc). */
.tile-desc { display: none; }
/* Portail public : les 4 cartes (descriptions complètes) sur une seule rangée → tient sans scroll. */
.sections.show-desc { max-width: 1000px; }
.sections.show-desc .grid { align-items: stretch; }
.sections.show-desc .tile {
  width: 224px;
  gap: 12px;
  padding: var(--sp-6) var(--sp-4) var(--sp-4);
  border-radius: 18px;
  background: linear-gradient(155deg, rgba(38, 65, 90, 0.28), rgba(16, 27, 38, 0.34));
  border: 1px solid rgba(77, 181, 177, 0.14);
  transition:
    transform 0.28s var(--ease-out-quart),
    border-color 0.28s var(--ease-out-quart),
    background 0.28s var(--ease-out-quart);
}
.sections.show-desc .tile:hover,
.sections.show-desc .tile:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(77, 181, 177, 0.32);
  background: linear-gradient(155deg, rgba(32, 163, 158, 0.16), rgba(16, 27, 38, 0.40));
}
.sections.show-desc .tile-name { font-size: 0.95rem; font-weight: 600; color: #fff; }
.sections.show-desc .tile-desc {
  display: block;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--ink-muted);
  text-align: center;
}

/* Mode dense (hub) : chaque section sur une rangée large → tout tient sans scroll.
   Espacements verticaux pilotés en vh pour absorber les écrans courts. */
.sections.dense { max-width: 1080px; gap: clamp(var(--sp-4), 3vh, var(--sp-8)); }
.sections.dense .group { gap: clamp(var(--sp-3), 2vh, var(--sp-6)); }
.sections.dense.show-desc { max-width: 1080px; }
.sections.dense.show-desc .grid { gap: clamp(var(--sp-3), 2vh, var(--sp-6)) var(--sp-4); }
.sections.dense.show-desc .tile {
  width: 192px;
  gap: 8px;
  padding: clamp(10px, 1.6vh, var(--sp-6)) var(--sp-3) clamp(8px, 1.4vh, var(--sp-4));
}
.sections.dense.show-desc .tile-name { font-size: 0.9rem; }
.sections.dense.show-desc .tile-desc { font-size: 0.72rem; line-height: 1.4; }

/* États */
.tile:hover .squircle,
.tile:focus-visible .squircle {
  transform: translateY(-6px);
  border-color: rgba(77, 181, 177, 0.55);
  background: linear-gradient(155deg, rgba(32, 163, 158, 0.30), rgba(16, 27, 38, 0.96));
  box-shadow:
    0 20px 38px rgba(0, 0, 0, 0.5),
    0 0 26px rgba(32, 163, 158, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: #ffffff;
}
.tile:hover .squircle svg,
.tile:focus-visible .squircle svg { transform: scale(1.06); }
.tile:hover .tile-name,
.tile:focus-visible .tile-name { color: #fff; }

.tile:focus-visible .squircle {
  outline: 2px solid var(--teal-light);
  outline-offset: 3px;
}
.tile:active .squircle { transform: translateY(-2px) scale(0.97); }

/* Pied */
.foot {
  font-size: 0.78rem;
  color: var(--ink-muted);
}
.foot a {
  color: var(--teal-light);
  text-decoration: none;
  transition: color 0.2s var(--ease-out-quart);
}
.foot a:hover { color: #fff; }

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

/* Resserrement sur petits écrans : la grille recompose, pas de scroll forcé. */
@media (max-width: 520px) {
  :root { --tile: 88px; --radius: 26px; }
  .grid { gap: var(--sp-4) var(--sp-6); }
  .masthead img { height: 126px; }
  .masthead h1 { font-size: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  .tile { animation: fade 0.3s ease backwards; animation-delay: 0ms; }
  .tile:hover .squircle,
  .tile:focus-visible .squircle { transform: none; }
  .tile:hover .squircle svg,
  .tile:focus-visible .squircle svg { transform: none; }
  @keyframes fade { from { opacity: 0; } to { opacity: 1; } }
}
