/* alix&leo — mobile-first, Safari-friendly */

:root {
  --bg: #060607;
  --bg-elevated: #0e0e12;
  --surface: #14141a;
  --border: rgba(255, 255, 255, 0.06);
  --text: rgba(255, 255, 255, 0.92);
  --text-muted: rgba(255, 255, 255, 0.5);
  --text-faint: rgba(255, 255, 255, 0.32);
  --violet: #9b8cff;
  --violet-soft: rgba(155, 140, 255, 0.22);
  --violet-glow: rgba(155, 140, 255, 0.45);
  /* Messages type iMessage (mode sombre) : alix = bleu, leo = gris */
  --bubble-gray: #262629;
  --bubble-blue: #007aff;
  --imessage-meta: rgba(255, 255, 255, 0.4);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  --space-page: max(1.25rem, env(safe-area-inset-left));
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 80% at 50% -30%, var(--violet-soft), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(155, 140, 255, 0.08), transparent 50%);
  z-index: -1;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ——— Layout ——— */
.page {
  padding: 1rem var(--space-page) 2rem;
  max-width: 32rem;
  margin: 0 auto;
}

.page--messages {
  padding-bottom: 2rem;
}

/* ——— Header ——— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0.5rem var(--space-page) 0.65rem;
  margin: 0 calc(-1 * var(--space-page));
  background: linear-gradient(to bottom, var(--bg) 72%, transparent);
}

.site-header__inner {
  max-width: 32rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 44px;
}

/* Même largeur que le bouton menu : le logo reste centré dans la bande utile */
.site-header__balance {
  flex: 0 0 44px;
  width: 44px;
  pointer-events: none;
}

.site-menu {
  position: relative;
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  display: flex;
  justify-content: flex-end;
}

.site-menu > summary {
  list-style: none;
  width: 44px;
  height: 44px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s var(--ease-out);
}

.site-menu > summary::-webkit-details-marker {
  display: none;
}

.site-menu > summary:hover {
  background: rgba(255, 255, 255, 0.06);
}

.site-menu > summary:active {
  background: rgba(255, 255, 255, 0.1);
}

.site-menu__icon {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 18px;
}

.site-menu__icon span {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 1px;
  background: currentColor;
}

.site-menu__panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: auto;
  min-width: 12.5rem;
  padding: 0.35rem;
  background: rgba(22, 22, 28, 0.94);
  -webkit-backdrop-filter: saturate(1.2) blur(24px);
  backdrop-filter: saturate(1.2) blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

.site-menu__panel a {
  display: block;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
  border-radius: var(--radius-sm);
  transition: background 0.2s var(--ease-out);
}

.site-menu__panel a:hover,
.site-menu__panel a:active {
  background: rgba(255, 255, 255, 0.08);
}

.site-menu__panel a[aria-current="page"] {
  color: var(--violet);
}

.wordmark {
  flex: 1;
  min-width: 0;
  font-size: clamp(1.95rem, 7.5vw, 2.85rem);
  font-weight: 580;
  letter-spacing: -0.018em;
  color: rgba(255, 255, 255, 0.95);
  text-align: center;
  line-height: 1.1;
  -webkit-tap-highlight-color: transparent;
  text-shadow: 0 0 20px rgba(0, 0, 0, 0.18);
}

.wordmark span {
  color: var(--violet);
  font-weight: 620;
  text-shadow:
    0 0 14px rgba(155, 140, 255, 0.42),
    0 0 32px rgba(155, 140, 255, 0.2);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ——— Hero accueil ——— */
.hero {
  padding-top: clamp(1.1rem, 4vh, 2rem);
  padding-bottom: 2rem;
}

.hero .hero__prose {
  max-width: 22em;
  margin-left: auto;
  margin-right: auto;
}

/* Texte lettre d’accueil : police un peu plus grande (uniquement dans .hero) */
.hero .hero__prose p {
  font-size: clamp(1.12rem, 3.5vw, 1.22rem);
  color: var(--text-muted);
  margin: 0 0 1.05em;
  line-height: 1.58;
  letter-spacing: 0.012em;
}

.hero .hero__prose p:last-child {
  margin-bottom: 0;
}

.hero > .hero__prose:nth-of-type(1) p:nth-child(2) {
  color: rgba(255, 255, 255, 0.48);
}

/* « 3 rubriques » : même ton que le corps, sans teinte lavande */
.hero > .hero__prose:nth-of-type(1) p:nth-child(3) {
  color: var(--text-muted);
  margin-bottom: 0;
}

.hero > .hero__prose:nth-of-type(2) p:first-child {
  color: rgba(255, 255, 255, 0.52);
}

/* Cartes au milieu de la lettre : aération nette autour du bloc */
.hero > .card-grid--in-hero {
  max-width: none;
  width: 100%;
  margin-top: clamp(1.35rem, 5vh, 2.35rem);
  margin-bottom: clamp(1.35rem, 4.5vh, 2.1rem);
  gap: 0.85rem;
}

.hero > .card-grid--in-hero + .hero__prose {
  margin-top: 0.15rem;
}

/* Spécificité > .hero .hero__prose p pour que couleur / taille s’appliquent vraiment */
.hero .hero__prose p.hero__heart {
  margin-top: 0.65rem;
  margin-bottom: 0;
  letter-spacing: 0.1em;
  color: #ebe4ff;
  font-size: clamp(1.35rem, 5vw, 1.65rem);
  font-weight: 600;
  line-height: 1.2;
  text-shadow:
    0 0 20px rgba(155, 140, 255, 0.85),
    0 0 50px rgba(155, 140, 255, 0.45);
}

.hero__lede {
  font-size: 1.0625rem;
  color: var(--text-muted);
  margin: 0 0 2rem;
  max-width: 22em;
}

/* ——— Cards accueil ——— */
.card-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.nav-card {
  display: block;
  padding: 1.25rem 1.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: transform 0.35s var(--ease-out), border-color 0.35s var(--ease-out),
    box-shadow 0.35s var(--ease-out);
}

.nav-card:active {
  transform: scale(0.98);
}

.nav-card:hover {
  border-color: rgba(155, 140, 255, 0.25);
  box-shadow: 0 0 0 1px rgba(155, 140, 255, 0.08), 0 20px 50px -24px var(--violet-glow);
}

.nav-card__label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--violet);
  margin-bottom: 0.35rem;
}

.nav-card__title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
  text-transform: none;
}

.nav-card__desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

/* Cartes d’accueil : sans bandeau, accent violet discret */
.hero > .card-grid--in-hero .nav-card--hero {
  padding: 1.35rem 1.4rem 1.3rem;
  background: linear-gradient(145deg, rgba(22, 22, 30, 0.95) 0%, var(--surface) 55%);
  border: 1px solid rgba(155, 140, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.hero > .card-grid--in-hero .nav-card--hero:hover {
  border-color: rgba(155, 140, 255, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 0 1px rgba(155, 140, 255, 0.06),
    0 20px 50px -24px var(--violet-glow);
}

.hero > .card-grid--in-hero .nav-card--hero .nav-card__title {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: rgba(232, 228, 255, 0.96);
}

.hero > .card-grid--in-hero .nav-card--hero .nav-card__desc {
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.45;
  letter-spacing: 0.01em;
}

/* ——— Blocs « pour toi » (infos) ——— */
.info-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 0.25rem;
}

.info-item {
  padding: 1.25rem 1.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.info-item--link {
  display: block;
  transition: transform 0.35s var(--ease-out), border-color 0.35s var(--ease-out),
    box-shadow 0.35s var(--ease-out);
}

.info-item--link:hover,
.info-item--link:focus-visible {
  border-color: rgba(155, 140, 255, 0.28);
  box-shadow: 0 0 0 1px rgba(155, 140, 255, 0.08), 0 16px 42px -24px var(--violet-glow);
}

.info-item--link:active {
  transform: scale(0.99);
}

.info-item__date {
  font-size: 0.75rem;
  color: var(--text-faint);
  margin-bottom: 0.5rem;
}

.info-item__title {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

.info-item--link .info-item__title {
  margin-bottom: 0;
}

.info-item__body {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin: 0;
}

.detail-article {
  padding: 1.25rem 1.35rem;
  background:
    radial-gradient(ellipse 90% 55% at 50% -18%, rgba(155, 140, 255, 0.12), transparent 58%),
    var(--surface);
  border: 1px solid rgba(155, 140, 255, 0.18);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 18px 44px -28px rgba(0, 0, 0, 0.6);
}

.detail-article::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(155, 140, 255, 0.7), rgba(92, 225, 255, 0.42));
}

.detail-back-link {
  display: inline-block;
  margin: 0 0 0.9rem;
  font-size: 0.82rem;
  color: rgba(199, 191, 228, 0.75);
  letter-spacing: 0.01em;
}

.detail-back-link:hover,
.detail-back-link:focus-visible {
  color: rgba(224, 218, 252, 0.9);
}

.detail-article__date {
  display: inline-flex;
  margin: 0 0 0.85rem;
  color: rgba(222, 215, 248, 0.78);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: rgba(155, 140, 255, 0.12);
  border: 1px solid rgba(155, 140, 255, 0.24);
}

.detail-article__title {
  margin: 0 0 1.05rem;
  font-size: clamp(1.15rem, 4.5vw, 1.45rem);
  line-height: 1.28;
  letter-spacing: -0.01em;
  color: rgba(236, 232, 250, 0.95);
  text-wrap: balance;
}

.detail-article__body {
  margin: 0 0 1.1rem;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.58);
  line-height: 1.58;
}

.detail-article__list {
  margin: 0 0 1.1rem;
  padding-left: 1.2rem;
  color: rgba(236, 232, 250, 0.85);
}

.detail-article__list li {
  margin: 0 0 0.48rem;
  line-height: 1.55;
}

.detail-video-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.2rem 0.15rem 0.2rem 0;
  color: rgba(226, 217, 255, 0.95);
  transition: transform 0.22s var(--ease-out), color 0.22s var(--ease-out);
}

.detail-video-link:hover,
.detail-video-link:focus-visible {
  color: rgba(240, 235, 255, 1);
  transform: translateX(1px);
}

.detail-video-link__icon {
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 0.58rem;
  line-height: 1;
  color: rgba(238, 232, 255, 0.95);
  background: rgba(155, 140, 255, 0.36);
  box-shadow:
    inset 0 0 0 1px rgba(200, 191, 241, 0.45),
    0 0 14px rgba(155, 140, 255, 0.2);
}

.detail-video-link__text {
  font-size: 1.02rem;
  font-weight: 540;
  letter-spacing: 0.01em;
  text-decoration: underline;
  text-decoration-color: rgba(198, 186, 236, 0.78);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

/* ——— Mini-jeu placeholder ——— */
.minijeu-placeholder {
  margin-top: 0.5rem;
  padding: 2rem 1.5rem;
  text-align: center;
  background: var(--surface);
  border: 1px dashed rgba(155, 140, 255, 0.35);
  border-radius: var(--radius-lg);
}

.minijeu-placeholder__pixel {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin: 0 3px 1rem;
  background: var(--violet);
  border-radius: 2px;
  opacity: 0.9;
  box-shadow: 0 0 20px var(--violet-glow);
  animation: pixel-float 2.4s ease-in-out infinite;
}

.minijeu-placeholder__pixel:nth-child(2) {
  animation-delay: 0.2s;
  opacity: 0.65;
}

.minijeu-placeholder__pixel:nth-child(3) {
  animation-delay: 0.4s;
  opacity: 0.45;
}

@keyframes pixel-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.minijeu-placeholder p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

/* ——— Messages (iMessage, mode sombre) ——— */
.messages-thread {
  padding-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.msg-date {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--imessage-meta);
  padding: 0.85rem 0 0.65rem;
}

.msg-date time {
  font: inherit;
  color: inherit;
}

.msg-row {
  display: flex;
  width: 100%;
}

/* alix : droite */
.msg-row--them {
  justify-content: flex-end;
}

/* leo : gauche */
.msg-row--me {
  justify-content: flex-start;
}

.msg-stack {
  display: flex;
  flex-direction: column;
  max-width: 100%;
}

.msg-stack--end {
  align-items: flex-end;
}

.msg-stack--start {
  align-items: flex-start;
}

.msg-bubble {
  max-width: 84%;
  padding: 0.55rem 0.85rem;
  border-radius: 18px;
  font-size: 1.0625rem;
  line-height: 1.35;
  letter-spacing: -0.015em;
  margin-bottom: 0.05rem;
  word-wrap: break-word;
}

/* alix (droite) : bleu iMessage */
.msg-bubble--them {
  background: linear-gradient(180deg, #0a84ff 0%, var(--bubble-blue) 100%);
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* leo (gauche) : gris */
.msg-bubble--me {
  background: var(--bubble-gray);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.msg-bubble--nowrap {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

/* Hashtag court : largeur collée au texte ; padding droit un peu plus large que le gauche pour l’arrondi */
.msg-bubble--tag.msg-bubble--nowrap {
  min-width: 0;
  width: max-content;
  max-width: 84%;
  padding-right: 2rem;
}

.msg-bubble--line-keep {
  min-width: 20ch;
}

/* Hashtag long : une ligne sans casser l'alignement global */
.msg-bubble--hashtag-long {
  max-width: 100%;
  white-space: nowrap;
  font-size: 1rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.msg-meta {
  font-size: 0.6875rem;
  color: var(--imessage-meta);
  padding: 0.15rem 0.5rem 0.45rem;
  letter-spacing: -0.01em;
}

.msg-row--them .msg-meta {
  text-align: right;
  width: 100%;
  max-width: 84%;
}

.msg-row--me .msg-meta {
  text-align: left;
  width: 100%;
  max-width: 84%;
}

/* ——— Footer ——— */
.foot-note {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-faint);
  text-align: center;
}

@media (min-width: 48em) {
  .page {
    max-width: 40rem;
  }

  .site-header__inner {
    max-width: 40rem;
  }
}
