/* ============================================================
   danwalex.com
   Liste groupée façon Réglages iOS : surfaces plates, séparateurs
   d'un pixel, typo système. Aucun dégradé décoratif, aucune police
   à télécharger. Clair et sombre suivent le réglage du système.
   ============================================================ */

:root {
  color-scheme: light dark;

  /* --- Clair (valeurs système Apple) --- */
  --ground: #f5f5f7;
  --surface: #ffffff;
  --text: #1d1d1f;
  /* Les gris système d'Apple (#6e6e73 / #86868b) ne passent pas AA sur #f5f5f7
     à 12-13 px. Ces valeurs sont recalculées pour tenir 4,5:1 même quand une
     lettre tombe sur un point de la trame de fond (4,8:1 dans ce cas). */
  --text-2: #54555a;
  --text-3: #5d5e63;
  --hairline: rgba(0, 0, 0, 0.1);
  --fill-hover: rgba(0, 0, 0, 0.032);
  --fill-press: rgba(0, 0, 0, 0.065);
  --accent: #005bb8;
  /* Teinte de tuile distincte de l'accent texte : en sombre, un glyphe blanc
     sur l'accent (#2997ff) ne tenait que 3,02:1, soit 0,7 % de marge. */
  --tile-accent: #005bb8;
  /* Le badge est posé sur la CARTE, pas sur le fond : sa pastille teintée y est
     plus claire qu'ailleurs. En sombre, l'accent dessus ne tenait que 4,25:1. */
  --badge-fg: #005bb8;
  --tile-neutral: #1d1d1f;
  --tile-ink: #ffffff;
  --avatar: #e8e8ed;
  /* En clair c'est l'ombre (--lift) qui détache la carte, le liseré ne fait
     que la souligner ; en sombre il n'y a pas d'ombre et le liseré prend le relais. */
  --card-border: rgba(0, 0, 0, 0.07);
  --ok: #248a3d;
  --tile-presta: #1e8e3e;
  --tile-status: #0f8b9e;
  /* Encre du fond et PLAFOND d'opacité de la couche. Le filtre produit du noir
     ou du blanc pur ; c'est cette opacité qui borne ce que la page reçoit, donc
     le pire cas de contraste est garanti quoi qu'il arrive dans le filtre. */
  --field-ink: #000000;
  --field-opacity: 0.11;
  --lift: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 28px -14px rgba(0, 0, 0, 0.14);

  /* --- Typo : celle du système. Sur ton Mac et ton iPhone c'est SF Pro. --- */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display",
    "Segoe UI Variable Display", "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;

  /* --- Mouvement ---
     --spring est un vrai ressort amorti (ζ=0,78) échantillonné en 26 points :
     il dépasse de 2 % puis se pose. Pas une courbe de Bézier qui l'imite.
     --ease est la courbe des feuilles iOS. */
  --spring: linear(
    0, 0.05, 0.1662, 0.3103, 0.4575, 0.5931, 0.7093, 0.8037, 0.8768, 0.9306,
    0.9683, 0.9932, 1.0084, 1.0164, 1.0196, 1.0197, 1.0179, 1.0152, 1.0123,
    1.0094, 1.0069, 1.0048, 1.0031, 1.0019, 1.001, 1.0004, 1
  );
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --fast: 150ms;
}

/* Sombre : par réglage système, ou forcé via data-theme (utilisé par l'aperçu) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    /* Graphite plutôt que noir pur : le noir absolu creuse trop le contraste
       avec les cartes et durcit la page. L'écart de luminance carte/fond n'est
       plus que de 1,18:1, c'est le liseré qui détache la carte. */
    --ground: #15161a;
    --surface: #24252c;
    --text: #f5f5f7;
    --text-2: #a8a8b0;
    --text-3: #9e9ea6;
    --hairline: rgba(255, 255, 255, 0.12);
    --fill-hover: rgba(255, 255, 255, 0.055);
    --fill-press: rgba(255, 255, 255, 0.1);
    --accent: #2997ff;
    --tile-accent: #1a7fe0;
    --badge-fg: #7ab8ff;
    /* Sur fond sombre une tuile grise disparaît (1,9:1) : les marques
       noires (X, TikTok, GitHub) s'inversent, comme leurs vraies icônes. */
    --tile-neutral: #f5f5f7;
    --tile-ink: #1d1d1f;
    --avatar: #2f3038;
    --card-border: rgba(255, 255, 255, 0.09);
    --ok: #30d158;
    --tile-presta: #1e8e3e;
    --tile-status: #0f8b9e;
    --field-ink: #ffffff;
    --field-opacity: 0.13;
    --lift: none;
  }
}

:root[data-theme="dark"] {
  --ground: #15161a;
  --surface: #24252c;
  --text: #f5f5f7;
  --text-2: #a8a8b0;
  --text-3: #9e9ea6;
  --hairline: rgba(255, 255, 255, 0.12);
  --fill-hover: rgba(255, 255, 255, 0.055);
  --fill-press: rgba(255, 255, 255, 0.1);
  --accent: #2997ff;
  --tile-accent: #1a7fe0;
  --badge-fg: #7ab8ff;
  --tile-neutral: #f5f5f7;
  --tile-ink: #1d1d1f;
  --avatar: #2f3038;
  --card-border: rgba(255, 255, 255, 0.09);
  --ok: #30d158;
  --tile-presta: #1e8e3e;
  --tile-status: #0f8b9e;
  --field-ink: #ffffff;
  --field-opacity: 0.13;
  --lift: none;
}

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

* { margin: 0; padding: 0; }

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

body {
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  padding: clamp(40px, 9vh, 84px) 20px calc(40px + env(safe-area-inset-bottom));
  background-color: var(--ground);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   Fond animé — metaballs : des formes qui dérivent et fusionnent
   ============================================================ */

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Metaballs : quatre formes dérivent ; le flou les fait déborder l'une sur
   l'autre, le contraste reseuille le résultat, donc elles FUSIONNENT en se
   rapprochant puis se séparent. C'est ce qui rend le mouvement organique — il
   n'y a ni maille, ni motif, ni boucle perceptible. */
.bg__goo {
  position: absolute;
  inset: -12%;
  background: var(--ground);
  filter: blur(34px) contrast(22);
  opacity: var(--field-opacity);
  -webkit-mask-image: radial-gradient(ellipse 115% 95% at 50% 28%, #000 25%, transparent 92%);
  mask-image: radial-gradient(ellipse 115% 95% at 50% 28%, #000 25%, transparent 92%);
}

.bg__ball {
  position: absolute;
  border-radius: 50%;
  background: var(--field-ink);
  will-change: transform;
}

.bg__ball--1 {
  top: 2%;
  left: 6%;
  width: 44vmin;
  height: 44vmin;
  animation: goo-1 23s ease-in-out infinite alternate;
}

.bg__ball--2 {
  top: 12%;
  right: 2%;
  width: 38vmin;
  height: 38vmin;
  animation: goo-2 31s ease-in-out infinite alternate;
}

.bg__ball--3 {
  bottom: 6%;
  left: 18%;
  width: 50vmin;
  height: 50vmin;
  animation: goo-3 27s ease-in-out infinite alternate;
}

.bg__ball--4 {
  bottom: 18%;
  right: 14%;
  width: 32vmin;
  height: 32vmin;
  animation: goo-4 19s ease-in-out infinite alternate;
}

@keyframes goo-1 { to { transform: translate3d(22vmin, 16vmin, 0) scale(1.18); } }
@keyframes goo-2 { to { transform: translate3d(-26vmin, 22vmin, 0) scale(0.82); } }
@keyframes goo-3 { to { transform: translate3d(18vmin, -20vmin, 0) scale(1.12); } }
@keyframes goo-4 { to { transform: translate3d(-16vmin, -14vmin, 0) scale(1.25); } }

/* ============================================================
   Utilitaires
   ============================================================ */

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 30;
  transform: translate(-50%, -160%);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 6px 20px -6px rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-size: 15px;
  text-decoration: none;
  transition: transform var(--fast) var(--ease);
}

.skip:focus-visible {
  transform: translate(-50%, 0);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ============================================================
   Colonne
   ============================================================ */

.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
}

/* ============================================================
   En-tête
   ============================================================ */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.avatar {
  position: relative;
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--avatar);
  animation: pop 640ms var(--spring) both;
}

/* Anneau tracé au bruit : chaque point du cercle est déplacé par un bruit
   octavé qui dérive, donc le contour ondule sans jamais se répéter. Dessiné
   hors du disque, il ne passe sous aucun texte. */
.avatar__ring {
  position: absolute;
  /* Écart calculé pour que l'anneau ne touche jamais le disque, même à
     l'amplitude maximale du bruit : sinon il passerait sur un fond plus clair
     et perdrait son contraste. */
  inset: -22px;
  width: calc(100% + 44px);
  height: calc(100% + 44px);
  pointer-events: none;
}

.avatar__mark {
  position: relative;
  z-index: 1;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 37px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.045em;
}

.hero__name {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  font-family: var(--font-display);
  font-size: clamp(32px, 8.5vw, 40px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.028em;
}

/* Chaque lettre monte derrière son propre masque. Le décalage n'est PAS posé
   sur l'état de base : sans lui, mouvement réduit laisserait les lettres
   cachées hors de leur masque. Il ne vit que dans la keyframe. */
.glyph {
  display: inline-block;
  overflow: hidden;
  /* Marge symétrique : le masque ne doit rogner ni les hampes ni les jambages,
     et ne doit pas décaler l'alignement des lettres entre elles. */
  padding: 0.09em 0;
  margin: -0.09em 0;
}

.glyph i {
  display: inline-block;
  font-style: normal;
  /* Flou vertical résorbé par le filtre SVG pendant la montée. Retiré tout à
     fait une fois l'animation finie, pour un rendu de texte parfaitement net. */
  filter: url("#rise-blur");
  animation: glyph-in 820ms var(--spring) both;
}

.hero__name.is-settled .glyph i { filter: none; }

.glyph:nth-child(1) i { animation-delay: 60ms; }
.glyph:nth-child(2) i { animation-delay: 100ms; }
.glyph:nth-child(3) i { animation-delay: 140ms; }
.glyph:nth-child(4) i { animation-delay: 180ms; }
.glyph:nth-child(5) i { animation-delay: 220ms; }
.glyph:nth-child(6) i { animation-delay: 260ms; }
.glyph:nth-child(7) i { animation-delay: 300ms; }
.glyph:nth-child(8) i { animation-delay: 340ms; }

@keyframes glyph-in {
  from { transform: translateY(110%); }
  to   { transform: none; }
}

.hero__handle {
  margin-top: 3px;
  color: var(--text-2);
  font-size: 15px;
  animation: rise 560ms var(--spring) 105ms both;
}

.hero__bio {
  margin-top: 15px;
  max-width: 27ch;
  font-size: 17px;
  text-wrap: pretty;
  animation: rise 560ms var(--spring) 150ms both;
}

.hero__meta {
  margin-top: 11px;
  color: var(--text-3);
  font-size: 13px;
  letter-spacing: 0;
  animation: rise 560ms var(--spring) 195ms both;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 15px;
  padding: 5px 13px 5px 11px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  animation: rise 560ms var(--spring) 235ms both;
}

.status__dot {
  position: relative;
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
}

/* Onde : signale que la dispo est un état, pas une décoration. */
.status__dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--ok);
  animation: ping 2.8s var(--ease) infinite;
}

@keyframes ping {
  0%        { opacity: 0.7; transform: scale(1); }
  70%, 100% { opacity: 0; transform: scale(2.6); }
}

/* ============================================================
   Sections
   ============================================================ */

.section {
  margin: 32px 0 8px;
  padding-left: 16px;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  animation: rise 560ms var(--spring) both;
}

#parcours { animation-delay: 250ms; }
#reseaux  { animation-delay: 400ms; }
#contact  { animation-delay: 590ms; }
#infra    { animation-delay: 690ms; }

/* ============================================================
   Liste groupée
   ============================================================ */

.group {
  border-radius: 16px;
  border: 1px solid var(--card-border);
  background: var(--surface);
  box-shadow: var(--lift);
  /* Les coins arrondis rognent le surlignage des lignes : pas besoin
     d'arrondir chaque ligne individuellement. */
  overflow: hidden;
  animation: rise 560ms var(--spring) 270ms both;
}

.group ul { list-style: none; }

.row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 9px 14px 9px 12px;
  color: var(--text);
  text-decoration: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--fast) linear;
  /* Les lignes n'apparaissent qu'en opacité : un translate ici les ferait
     glisser à l'intérieur du bloc arrondi, ce qui se voit. */
  animation: fade 420ms var(--ease) both;
}

/* Deux sections : chaque groupe a sa propre base, sinon les lignes du second
   démarreraient en même temps que celles du premier. */
.group--parcours { animation-delay: 265ms; }
.group--reseaux  { animation-delay: 415ms; }
.group--contact  { animation-delay: 605ms; }
.group--infra    { animation-delay: 705ms; }

.group--parcours li:nth-child(1) .row { animation-delay: 300ms; }
.group--parcours li:nth-child(2) .row { animation-delay: 330ms; }
.group--parcours li:nth-child(3) .row { animation-delay: 360ms; }

.group--reseaux li:nth-child(1) .row { animation-delay: 450ms; }
.group--reseaux li:nth-child(2) .row { animation-delay: 480ms; }
.group--reseaux li:nth-child(3) .row { animation-delay: 510ms; }
.group--reseaux li:nth-child(4) .row { animation-delay: 540ms; }
.group--reseaux li:nth-child(5) .row { animation-delay: 570ms; }
.group--reseaux li:nth-child(6) .row { animation-delay: 600ms; }

.group--contact li:nth-child(1) .row { animation-delay: 640ms; }
.group--contact li:nth-child(2) .row { animation-delay: 670ms; }

.group--infra li:nth-child(1) .row { animation-delay: 740ms; }

/* Séparateur en retrait, aligné sur le libellé — comme dans Réglages */
.group li + li .row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 54px;
  right: 0;
  height: 1px;
  background: var(--hairline);
}

@media (min-resolution: 2dppx) {
  .group li + li .row::before { height: 0.5px; }
}

.row__tile {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background-color: var(--tile, var(--accent));
  color: var(--tile-fg, #ffffff);
  transition: transform var(--fast) var(--ease);
}

.row__label {
  flex: 0 0 auto;
  font-size: 17px;
  letter-spacing: -0.015em;
}

.row__value {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--text-2);
  font-size: 15px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row__chevron {
  flex: 0 0 auto;
  color: var(--text-3);
  transition: transform var(--fast) var(--ease);
}

/* Seules les lignes cliquables réagissent : celles du parcours sont des <div>. */
a.row { cursor: pointer; }

@media (hover: hover) and (pointer: fine) {
  a.row:hover { background-color: var(--fill-hover); }
  a.row:hover .row__chevron { transform: translateX(2px); }
  a.row:hover .row__tile { transform: scale(1.06); }
}

a.row:active { background-color: var(--fill-press); }

a.row:focus-visible {
  background-color: var(--fill-hover);
  outline: 2px solid var(--accent);
  outline-offset: -3px;
}

/* Parcours : tuile ajourée pour ce qui est passé, tuile pleine pour l'actuel.
   La distinction ne repose pas que sur la couleur, les libellés disent « Ex- ». */
/* Parcours : le NOM porte l'information, le rôle est secondaire. L'inverse
   (rôle en gras, nom en gris à droite) enterrait la seule chose qui compte. */
.row--info {
  align-items: flex-start;
  padding-top: 13px;
  padding-bottom: 13px;
}

.row--info .row__tile { margin-top: 1px; }

.row__body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.row__name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.row__detail {
  color: var(--text-3);
  font-size: 13px;
  line-height: 1.35;
}

.badge {
  flex: 0 0 auto;
  margin-top: 2px;
  padding: 3px 9px;
  border-radius: 999px;
  background-color: color-mix(in srgb, var(--badge-fg) 14%, transparent);
  color: var(--badge-fg);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
}

.row--info .row__tile {
  background-color: transparent;
  border: 1px solid var(--hairline);
  color: var(--text-3);
}

.row--now .row__tile {
  background-color: var(--tile-accent);
  border: none;
  color: #ffffff;
}


/* Couleur de tuile par plateforme. Les marques noires passent sur le neutre
   du thème, sinon la tuile disparaît sur fond noir. */
.row--twitch    { --tile: #9146ff; }
.row--discord   { --tile: #5865f2; }
.row--instagram { --tile: #e1306c; }
.row--x         { --tile: var(--tile-neutral); --tile-fg: var(--tile-ink); }
.row--tiktok    { --tile: var(--tile-neutral); --tile-fg: var(--tile-ink); }
.row--github    { --tile: var(--tile-neutral); --tile-fg: var(--tile-ink); }
.row--mail      { --tile: var(--tile-accent); }
.row--presta    { --tile: var(--tile-presta); }
.row--status    { --tile: var(--tile-status); }

.row--instagram .row__tile {
  background-image: linear-gradient(135deg, #f9ce34, #ee2a7b 55%, #6228d7);
}

/* ============================================================
   Bouton
   ============================================================ */

.actions {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  animation: rise 560ms var(--spring) 775ms both;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 20px;
  border: none;
  border-radius: 999px;
  background-color: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--fast) var(--ease),
    background-color var(--fast) linear;
}

.button:hover {
  background-color: color-mix(in srgb, var(--accent) 18%, transparent);
}

.button:active { transform: scale(0.96); }

.button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ============================================================
   Pied
   ============================================================ */

.footer {
  margin-top: 28px;
  color: var(--text-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: center;
  animation: rise 560ms var(--spring) 810ms both;
}

/* ============================================================
   Toast — inversé par rapport au fond, comme les retours iOS
   ============================================================ */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 40;
  max-width: calc(100vw - 40px);
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--text);
  color: var(--surface);
  font-size: 14px;
  opacity: 0;
  transform: translate(-50%, 12px) scale(0.96);
  pointer-events: none;
  transition: opacity 180ms var(--ease), transform 440ms var(--spring);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

/* ============================================================
   Animations — toutes finissent sur « transform: none »
   ============================================================ */

@keyframes pop {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: none; }
}

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

@keyframes fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ============================================================
   Écrans plus larges
   ============================================================ */

/* Le flou du filtre goo est le poste le plus lourd : on l'allège sur petit
   écran, où la surface à recomposer est aussi la moins large. */
@media (max-width: 600px) {
  .bg__goo { filter: blur(24px) contrast(18); }
}

@media (min-width: 600px) {
  .page { max-width: 440px; }
  .avatar { width: 92px; height: 92px; font-size: 40px; }
}

/* ============================================================
   Mouvement réduit : plus rien ne bouge, tout reste lisible
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
  a.row:hover .row__chevron,
  a.row:hover .row__tile,
  .button:active { transform: none; }
  .glyph i { filter: none; }
}
