/* ==========================================================================
   Compétences : grille « bento », une visualisation par catégorie
   ========================================================================== */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.skill-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 26px;
}

.skill-card--programming {
  grid-column: span 7;
}
.skill-card--platforms {
  grid-column: span 5;
}
.skill-card--frameworks {
  grid-column: span 12;
}
.skill-card--video {
  grid-column: span 7;
}
.skill-card--architecture {
  grid-column: span 5;
}
.skill-card--tools {
  grid-column: span 6;
}
.skill-card--systems,
.skill-card--languages {
  grid-column: span 3;
}

.skill-card h3 {
  display: flex;
  justify-content: space-between;
  margin: 0;
  color: var(--color-muted);
  font: 500 11px var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.skill-count {
  color: var(--color-fg);
  font-style: normal;
  opacity: 0.45;
}

.skill-visual {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

/* Liste brute des compétences : utilisée uniquement dans le PDF */
.skill-chips {
  display: none;
}

/* ---- Langages : échelle typographique ---- */
.language-scale {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 18px;
}

.language-scale span {
  display: inline-block;
  overflow: hidden;
  padding-bottom: 0.1em;
  font: 700 calc((64px - var(--rank) * 7px) * var(--scale, 1)) / 1.05 var(--font-mono);
  letter-spacing: -0.06em;
}

/* Chaque mot « remonte » à l'apparition de la carte, en cascade */
.language-scale b {
  display: inline-block;
  color: var(--color-muted);
  translate: 0 110%;
  transition:
    translate 0.8s calc(var(--rank) * 0.07s + 0.15s) var(--ease-out),
    color 0.25s;
}

.skill-card.is-visible .language-scale b {
  translate: 0;
}

.language-scale span:not(.is-swift):hover b {
  color: var(--color-fg);
}

.language-scale .is-swift b {
  background: linear-gradient(135deg, var(--color-swift-orange), #ff9f43);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---- Plateformes : appareils ---- */
.device-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  align-items: end;
  gap: 10px;
}

.device-list div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: translate 0.3s;
}

.device-list div:hover {
  translate: 0 -4px;
}

.device-list svg {
  width: 100%;
  max-width: 68px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.device-list span {
  color: var(--color-muted);
  font: 500 11px var(--font-mono);
  letter-spacing: 0.06em;
}

/* ---- Frameworks : lignes « import » vers la doc Apple ---- */
.import-list {
  columns: 3 220px;
  column-gap: 24px;
  font: 500 14.5px/2.1 var(--font-mono);
}

.import-list a {
  display: flex;
  align-items: baseline;
  padding: 0 8px;
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
  break-inside: avoid;
  transition: background 0.2s;
}

.import-list a:hover,
.import-list a:focus-visible {
  background: var(--color-line);
  outline: 0;
}

.import-list i {
  display: inline-block;
  width: 2.4ch;
  margin-right: 14px;
  color: var(--color-muted);
  font-style: normal;
  opacity: 0.6;
}

.import-list b {
  margin-right: 1ch;
  color: #d63c95;
  font-weight: 600;
}

.import-list em {
  margin-left: auto;
  color: var(--color-muted);
  font-size: 12px;
  font-style: normal;
  opacity: 0;
  transition: opacity 0.2s;
}

.import-list a:hover em,
.import-list a:focus-visible em {
  opacity: 1;
}

/* ---- Vidéo & streaming : vrai lecteur HLS ---- */
.player {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  aspect-ratio: 16 / 7.2;
  border-radius: 16px;
  background: #050507;
  color: #fff;
}

/* Mire floutée affichée tant que la lecture n'a pas démarré */
.player-poster {
  position: absolute;
  inset: -30px;
  background: linear-gradient(
    90deg,
    #c0c0c0 0 14.28%,
    #c0c000 0 28.57%,
    #00c0c0 0 42.85%,
    #00c000 0 57.14%,
    #c000c0 0 71.42%,
    #c00000 0 85.71%,
    #0000c0 0
  );
  filter: blur(26px) saturate(1.15);
  opacity: 0.5;
  transition: opacity 0.5s;
}

.player.is-started .player-poster {
  opacity: 0;
}

.player video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: transparent;
}

.player::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #0008, transparent 30%, transparent 55%, #000a);
  pointer-events: none;
}

.player-title {
  position: absolute;
  z-index: 1;
  left: 14px;
  bottom: 42px;
  font: 600 12px var(--font-sans);
  letter-spacing: -0.01em;
  text-shadow: 0 1px 6px #0009;
  transition: opacity 0.3s;
}

.player.is-playing .player-title {
  opacity: 0;
}

.player svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Pastille ronde translucide (boutons et icônes du lecteur) */
.player-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff1f;
  font-style: normal;
  transition:
    background 0.2s,
    color 0.2s;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.player-button {
  padding: 0;
  border: 0;
  color: #fff;
  cursor: pointer;
}

.player-button:hover {
  background: #ffffff45;
}

.player-button:focus-visible {
  outline: 2px solid var(--color-system-blue);
  outline-offset: 2px;
}

.player-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 6px;
  width: auto;
  height: 26px;
  padding: 0 10px 0 8px;
  border-radius: 99px;
  font: 600 10px var(--font-mono);
  letter-spacing: 0.06em;
}

.player-badge svg {
  width: 13px;
  height: 13px;
}

.player-actions {
  position: absolute;
  z-index: 1;
  top: 10px;
  right: 12px;
  display: flex;
  gap: 6px;
}

.player-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 56px;
  height: 56px;
  translate: -50% -50%;
  transition:
    opacity 0.3s,
    background 0.2s;
}

.player-play svg {
  width: 24px;
  height: 24px;
}

.player.is-playing .player-play {
  opacity: 0;
}

.player.is-playing:hover .player-play,
.player.is-playing .player-play:focus-visible {
  opacity: 1;
}

.player-bar {
  position: absolute;
  z-index: 1;
  left: 12px;
  right: 12px;
  bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-scrubber {
  position: relative;
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: #ffffff38;
  cursor: pointer;
  touch-action: none;
}

/* Zone de clic plus haute que la barre visible */
.player-scrubber::before {
  content: "";
  position: absolute;
  inset: -10px 0;
}

.player-scrubber:focus-visible {
  outline: 2px solid var(--color-system-blue);
  outline-offset: 6px;
}

/* s = mémoire tampon, u = progression, b = curseur */
.player-scrubber s,
.player-scrubber u {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  border-radius: 2px;
}

.player-scrubber s {
  background: #ffffff59;
}

.player-scrubber u {
  background: #fff;
}

.player-scrubber b {
  position: absolute;
  top: 50%;
  left: 0;
  width: 12px;
  height: 12px;
  margin: -6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px #0006;
}

.player-time {
  min-width: 44px;
  color: #fff;
  font: 600 10.5px var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* Légende des fonctionnalités */
.video-features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 2px 14px;
  margin-top: 16px;
}

.video-features span {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: default;
  transition: background 0.2s;
}

.video-features svg {
  flex: none;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--color-muted);
}

/* Survol croisé : légende ⇄ contrôle correspondant du lecteur */
.video-skill:has([data-legend="avfoundation"]:hover) [data-feature="avfoundation"],
.video-skill:has([data-legend="drm"]:hover) [data-feature="drm"],
.video-skill:has([data-legend="pip"]:hover) [data-feature="pip"],
.video-skill:has([data-legend="airplay"]:hover) [data-feature="airplay"],
.video-skill:has([data-legend="timeshift"]:hover) [data-feature="timeshift"],
.video-skill:has([data-legend="offline"]:hover) [data-feature="offline"] {
  background: #fff;
  color: #000;
}

.video-skill:has([data-feature="avfoundation"]:hover) [data-legend="avfoundation"],
.video-skill:has([data-feature="drm"]:hover) [data-legend="drm"],
.video-skill:has([data-feature="pip"]:hover) [data-legend="pip"],
.video-skill:has([data-feature="airplay"]:hover) [data-legend="airplay"],
.video-skill:has([data-feature="timeshift"]:hover) [data-legend="timeshift"],
.video-skill:has([data-feature="offline"]:hover) [data-legend="offline"] {
  background: var(--color-line);
}

/* ---- Architecture : sélecteur + diagramme ---- */
.architecture {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.segmented-control {
  display: flex;
  padding: 3px;
  border-radius: 11px;
  background: var(--color-line);
}

.segmented-control label {
  flex: 1;
  cursor: pointer;
}

.segmented-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-control span {
  display: block;
  padding: 7px 4px;
  border-radius: 8px;
  color: var(--color-muted);
  font: 600 11.5px var(--font-mono);
  text-align: center;
  transition:
    background 0.2s,
    color 0.2s;
}

.segmented-control input:checked + span {
  background: var(--color-bg);
  color: var(--color-fg);
  box-shadow: 0 1px 3px #0003;
}

.segmented-control input:focus-visible + span {
  outline: 2px solid var(--color-fg);
}

/* Tous les panneaux sont superposés ; seul celui de l'onglet coché est visible */
.architecture-panels {
  display: grid;
}

.architecture-panel {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s;
}

.architecture:has(.segmented-control label:nth-child(1) input:checked) .architecture-panel:nth-child(1),
.architecture:has(.segmented-control label:nth-child(2) input:checked) .architecture-panel:nth-child(2),
.architecture:has(.segmented-control label:nth-child(3) input:checked) .architecture-panel:nth-child(3),
.architecture:has(.segmented-control label:nth-child(4) input:checked) .architecture-panel:nth-child(4),
.architecture:has(.segmented-control label:nth-child(5) input:checked) .architecture-panel:nth-child(5) {
  visibility: visible;
  opacity: 1;
}

.architecture-panel p {
  margin: 0;
  color: var(--color-muted);
  font-size: 13px;
  text-align: center;
}

/* MVC / MVP / MVVM : View ⇄ intermédiaire → Model */
.triad {
  display: flex;
  align-items: center;
}

.triad b {
  flex: 1;
  min-width: 0;
  padding: 16px 4px;
  border: 1px solid var(--color-line);
  border-radius: 12px;
  font: 600 12px var(--font-mono);
  text-align: center;
}

.triad b.is-middle {
  border-color: var(--color-fg);
  background: var(--color-fg);
  color: var(--color-bg);
}

.triad em {
  flex: 0 0 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--color-muted);
  font: 500 9px var(--font-mono);
  font-style: normal;
}

.triad em i {
  color: var(--color-fg);
  font-size: 16px;
  font-style: normal;
}

/* Clean architecture : cercles concentriques */
.rings {
  display: flex;
  justify-content: center;
}

.ring {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 16px 12px;
  border: 1px dashed var(--color-muted);
  border-radius: 999px;
}

.rings > .ring {
  width: 100%;
}

.ring .ring {
  align-self: stretch;
}

.ring .ring--core {
  align-self: center;
  padding: 8px 16px;
  border: 0;
  background: var(--color-fg);
}

.rings span {
  color: var(--color-muted);
  font: 500 9.5px/1.6 var(--font-mono);
  white-space: nowrap;
}

.ring--core span {
  color: var(--color-bg);
  font-weight: 700;
}

.modelling {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-line);
  font: 500 12.5px var(--font-mono);
}

.modelling span {
  color: var(--color-muted);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ---- Outils & CI : workflow GitHub Actions ---- */
.workflow svg {
  flex: none;
  width: 13px;
  height: 13px;
}

.workflow svg circle {
  fill: var(--color-build-green);
}

.workflow svg path {
  fill: none;
  stroke: #fff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workflow-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-line);
  color: var(--color-muted);
  font: 500 11px var(--font-mono);
}

.workflow-header span:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-fg);
  font-weight: 600;
}

.workflow-stages {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px 14px;
}

.workflow-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.workflow-stage h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  color: var(--color-muted);
  font: 500 10px var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.workflow-stage h4 i {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-build-green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-build-green) 22%, transparent);
}

/* Trait reliant chaque étape à la suivante */
.workflow-stage:not(:last-child) h4::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 100%;
  width: 14px;
  height: 1px;
  background: var(--color-muted);
  opacity: 0.6;
}

.workflow-stage span {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 8px;
  border: 1px solid var(--color-line);
  border-radius: 9px;
  font-size: 12px;
  line-height: 1.25;
  transition: border-color 0.2s;
}

.workflow-stage span:hover {
  border-color: var(--color-fg);
}

.workflow-result {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 0;
  color: var(--color-muted);
  font: 500 11px var(--font-mono);
  letter-spacing: 0.04em;
}

/* ---- Systèmes : sortie de terminal ---- */
.shell-output {
  font: 500 12.5px/1.75 var(--font-mono);
}

.shell-output p {
  margin: 0 0 8px;
}

.shell-output p span {
  display: block;
  color: var(--color-muted);
}

.shell-output p:last-child::after {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  margin-left: 6px;
  background: var(--color-fg);
  vertical-align: -0.2em;
  animation: blink 1s steps(2) infinite;
}

/* ---- Langues : salutations ---- */
.greetings {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 12px;
  font: italic 400 clamp(36px, 3.8vw, 48px) / 1.1 var(--font-serif);
}

.greetings b {
  font-weight: 400;
}

.greetings b + b {
  color: var(--color-muted);
  font-size: 0.6em;
}

.skill-card--languages .skill-visual .chips {
  margin-top: 14px;
}

.skill-card--languages .skill-visual .chips span {
  padding: 4px 10px;
  font-size: 12px;
}

/* ---- Responsive ---- */
@media (max-width: 820px) {
  .skills-grid > .skill-card {
    grid-column: span 12;
  }

  .language-scale span {
    --scale: 0.6;
  }

  .device-list svg {
    max-width: 52px;
  }

  .triad em {
    flex-basis: 40px;
  }

  .triad b {
    padding: 14px 2px;
    font-size: 10.5px;
  }

  .workflow-stages {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workflow-stage:nth-child(2n) h4::after {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .language-scale b {
    translate: 0;
  }
}
