/* ================================================================
   Panel Crème — Home (App Launcher style Odoo)
   Page d'accueil : grille d'apps sur fond clair, épurée.
   ================================================================ */

.home-body {
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.25rem 2rem;
  position: relative;
  overflow-x: hidden;
}

/* Decor pointillé en arrière-plan */
.home-decor {
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(23,20,18,0.07) 1px, transparent 0);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}
.home-body::before {
  content: "";
  position: fixed;
  top: -15%; right: -8%;
  width: 45vw; height: 45vw;
  background: radial-gradient(circle, rgba(57, 5, 200, 0.08), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.home-body::after {
  content: "";
  position: fixed;
  bottom: -10%; left: -5%;
  width: 40vw; height: 40vw;
  background: radial-gradient(circle, rgba(255, 234, 41, 0.1), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ================================================================
   TOP BAR
   ================================================================ */

.home-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0.25rem;
  margin-bottom: 2rem;
  animation: home-fade 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.home-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.home-brand img {
  width: 54px;
  height: auto;
  display: block;
}
/* ================================================================
   WELCOME
   ================================================================ */

.home-welcome {
  position: relative;
  z-index: 1;
  text-align: center;
  margin-bottom: 2.5rem;
  animation: home-fade 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

/* ================================================================
   WELCOME — style éditorial (mix Alpina italique + Labil bold)
   ================================================================ */

.home-welcome--editorial {
  text-align: center;
  max-width: 1100px;
  margin: 0 auto 2.5rem;
  padding: 0 0.25rem;
}

/* Le gros greeting */
.hw-hello {
  margin: 0 0 1.5rem;
  font-family: Labil, Arial, sans-serif;
  font-size: clamp(2.3rem, 8vw, 4.2rem);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.02;
  color: var(--base);
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0 0.3em;
  min-height: 5.5rem;
}
/* "Bonjour," en style normal, même police / poids que le prénom */
.hw-hello-greet {
  color: var(--base);
}

/* Wrapper typing : contient le nom + le curseur */
.hw-hello-typed-wrap {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
}

/* Base prénom (styles spécifiques ci-dessous via --badge, --outline, --simple) */
.hw-hello-name {
  position: relative;
  display: inline-block;
  min-width: 0.4em;
}

/* ============================================================
   OPTION 1 — Badge pill violet incliné
   ============================================================ */

.hw-hello-name--badge {
  color: #fff;
  background: var(--primary);
  border: 3px solid var(--base);
  border-radius: 0.35em;
  box-shadow: 0.18em 0.2em 0 var(--base);
  padding: 0.02em 0.25em 0.09em;
  transform: rotate(-2.5deg);
  margin: 0 0.1em;
  transition: none;
}

/* Tant que le typing n'a pas commencé, le badge est invisible
   (on évite le "carré violet vide" qui s'affichait avant la 1re lettre) */
.hw-hello-name--badge:empty {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  padding: 0;
  margin: 0;
  transform: none;
}


/* Curseur clignotant (barre verticale) */
.hw-hello-cursor {
  display: inline-block;
  width: 3px;
  height: 0.95em;
  background: var(--primary);
  margin-left: 2px;
  vertical-align: -0.12em;
  animation: hw-blink 0.85s steps(2, start) infinite;
}
.hw-hello-cursor.is-done {
  animation: hw-blink-out 0.6s ease forwards;
}
@keyframes hw-blink {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0; }
}
@keyframes hw-blink-out {
  from { opacity: 1; }
  to   { opacity: 0; visibility: hidden; }
}

/* Titre classique + sous-titre (style d'origine) */
.home-welcome--editorial .home-title {
  font-family: Labil, Arial, sans-serif;
  font-size: clamp(1.75rem, 5.5vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--base);
  margin: 0 auto;
  max-width: 780px;
}
.home-welcome--editorial .home-title .hl {
  display: inline;
  background-image: linear-gradient(transparent 58%, var(--secondary) 58%, var(--secondary) 90%, transparent 90%);
  padding: 0 0.15em;
}
.home-welcome--editorial .home-subtitle {
  font-family: Labil, Arial, sans-serif;
  font-size: clamp(0.95rem, 1.4vw, 1.08rem);
  font-weight: 600;
  color: var(--grey);
  margin-top: 0.85rem;
}

@media (min-width: 900px) {
  .home-welcome--editorial { padding: 0 0.5rem; }
  .hw-hello { gap: 0 0.4em; }
}

/* ================================================================
   APPS GRID
   ================================================================ */

.home-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
  align-content: start;
}
@media (min-width: 600px) {
  .home-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
}
@media (min-width: 1000px) {
  .home-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
}

/* ---- Card d'app ---- */

.home-grid { perspective: 1500px; }

.app-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.6rem 1.4rem;
  background: #fff;
  border: 2.5px solid var(--base);
  border-radius: 1.25rem;
  text-decoration: none;
  color: var(--base);
  box-shadow: 5px 5px 0 var(--base);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}

.app-card::before {
  content: "";
  position: absolute;
  top: -50%; right: -30%;
  width: 220px; height: 220px;
  border-radius: 50%;
  opacity: 0.12;
  pointer-events: none;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Hover identique pour les 4 boutons : translate + shadow */
.app-card:hover {
  transform: translate(-2px, -3px);
  box-shadow: 7px 8px 0 var(--base);
}
.app-card:hover::before { transform: scale(1.3); }
.app-card:active { transform: translate(2px, 2px) !important; box-shadow: 3px 3px 0 var(--base); }

/* Variants (une couleur dominante par app) */
.app-card--atelier   { background: linear-gradient(135deg, #ede4ff 0%, #fff 55%); }
.app-card--atelier::before   { background: var(--primary); }
.app-card--atelier .app-card-icon { background: var(--primary); }

.app-card--roue      { background: linear-gradient(135deg, #fff5c9 0%, #fff 55%); }
.app-card--roue::before      { background: var(--secondary); opacity: 0.3; }
.app-card--roue .app-card-icon { background: var(--secondary); color: var(--base); }

.app-card--fidelite  { background: linear-gradient(135deg, #c9f4dd 0%, #fff 55%); }
.app-card--fidelite::before  { background: var(--green); }
.app-card--fidelite .app-card-icon { background: var(--green); }

.app-card--compte    { background: linear-gradient(135deg, #ffe1d4 0%, #fff 55%); }
.app-card--compte::before    { background: var(--orange); }
.app-card--compte .app-card-icon { background: var(--orange); }

.app-card-icon {
  width: 72px;
  height: 72px;
  border-radius: 1rem;
  border: 2.5px solid var(--base);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  box-shadow: 4px 4px 0 var(--base);
  transform: rotate(-4deg);
  position: relative;
  z-index: 1;
  transition: transform 0.3s var(--ease);
}

/* Animation icône identique pour les 4 boutons */
.app-card:hover .app-card-icon { transform: rotate(0deg) scale(1.08); }

.app-card-body {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}
.app-card-title {
  font-family: Labil, Arial, sans-serif;
  font-size: clamp(1.4rem, 2.5vw, 1.7rem);
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--base);
  margin: 0 0 0.4rem;
}
.app-card-desc {
  font-family: Labil, Arial, sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.5;
  color: rgba(23, 20, 18, 0.65);
  margin: 0;
}

.app-card-arrow {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--base);
  color: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 2px 2px 0 rgba(23, 20, 18, 0.2);
  position: relative;
  z-index: 1;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.app-card:hover .app-card-arrow {
  transform: translateX(4px);
  box-shadow: 4px 4px 0 rgba(23, 20, 18, 0.3);
}

/* ================================================================
   FOOTER
   ================================================================ */

.home-footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  padding-top: 3rem;
}

/* ================================================================
   SIGNATURE — manuscrite (Alpina italique + underline brush)
   ================================================================ */

.sig-handwritten {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.85rem;
  text-decoration: none;
  color: var(--base);
}

.sig-handwritten-label {
  font-family: Labil, Arial, sans-serif;
  font-size: 0.54rem;
  font-weight: 800;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--grey);
}

.sig-handwritten-brand {
  position: relative;
  display: inline-block;
  font-family: Alpina, "Times New Roman", serif;
  font-style: italic;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--base);
  letter-spacing: -0.01em;
  padding-bottom: 0.15em;
}
.sig-handwritten-underline {
  position: absolute;
  left: 0;
  bottom: -0.15em;
  width: 100%;
  height: 10px;
  overflow: visible;
  stroke-dasharray: 0 200;
  animation: hw-draw 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.8s forwards;
}
@keyframes hw-draw {
  to { stroke-dasharray: 200 0; }
}
.sig-handwritten-dot {
  color: var(--primary);
  font-size: 1rem;
  line-height: 1;
  display: inline-block;
}

@media (max-width: 720px) {
  .sig-handwritten-brand { font-size: 1.2rem; }
}

/* ================================================================
   ANIMATIONS
   ================================================================ */

@keyframes home-fade {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes home-card-in {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (min-width: 900px) {
  .home-body { padding: 2rem 2.5rem 2.5rem; }
  .home-top { margin-bottom: 3rem; }
  .home-welcome { margin-bottom: 3rem; }
  .app-card { padding: 2rem 1.75rem; }
  .app-card-icon { width: 80px; height: 80px; }
}
