/* ==========================================================================
   Composants : écran, boutons, tags, listes, projets, compétences,
   panneau « En savoir plus », visionneuse de captures
   ========================================================================== */

/* --------------------------------------------------------------------------
   Écran (accueil, contact, vignettes de projets)
   -------------------------------------------------------------------------- */

.screen {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-screen);
  background: var(--screen);
  box-shadow:
    inset 0 0 0 2px #b5b2a6,
    0 1px 0 #fff;
}

/* Lignes de balayage + assombrissement des bords */
.screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  border-radius: inherit;
  background:
    repeating-linear-gradient(0deg, rgb(0 0 0 / 0.18) 0 1px, transparent 1px 4px),
    radial-gradient(ellipse at center, transparent 55%, rgb(0 0 0 / 0.35));
}

/* Image thermique : dessinée en basse définition puis floutée */
.screen__heat {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: blur(9px);
  transform: scale(1.08);
}

/* Repères façon caméra, dans les coins */
.screen__hud {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 22px;
  font-family: var(--font-ui);
  font-size: 1.25rem;
  color: var(--screen-text);
  pointer-events: none;
}

.screen__hud div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Boutons
   -------------------------------------------------------------------------- */

.button,
.more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s,
    transform 0.15s;
}

.button {
  padding: 10px 18px;
  font-size: 1.45rem;
}

.more {
  padding: 6px 12px;
  font-size: 1.2rem;
}

.button:hover,
.more:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}

.button--accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.button--accent:hover {
  background: var(--ink);
  border-color: var(--ink);
}

.more--ghost {
  background: transparent;
}

/* Boutons posés sur un écran sombre */
.screen .button {
  background: transparent;
  border-color: var(--screen-text);
  color: var(--screen-text);
}

.screen .button:hover {
  background: var(--screen-text);
  color: var(--screen);
}

/* --------------------------------------------------------------------------
   Tags
   -------------------------------------------------------------------------- */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 5px 8px;
  border-radius: 5px;
  background: var(--tag);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1;
}

.tag--main {
  padding: 8px 12px;
  background: var(--accent);
  font-size: 0.95rem;
}

/* Voyant « disponible » */
.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--live), transparent 75%);
  animation: blink 1.4s steps(1) infinite;
}

/* --------------------------------------------------------------------------
   Ce que je recherche
   -------------------------------------------------------------------------- */

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

.wanted > div {
  padding: 16px 18px;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
}

.wanted .wanted__wide {
  grid-column: span 2;
}

.wanted dt {
  margin-bottom: 4px;
  font-family: var(--font-ui);
  font-size: 1.2rem;
  line-height: 1;
  color: var(--accent-text);
}

.wanted dd {
  font-size: 1.05rem;
  line-height: 1.35;
}

/* --------------------------------------------------------------------------
   Listes chronologiques (expérience, formation, certifications)
   -------------------------------------------------------------------------- */

.timeline > li {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  padding-block: 24px;
  border-top: 1px solid var(--rule);
}

.timeline > li:first-child {
  border-top: var(--line);
}

.timeline__meta {
  font-family: var(--font-ui);
  font-size: 1.2rem;
  line-height: 1.25;
}

.timeline__meta time,
.timeline__meta strong {
  display: block;
  font-weight: 400;
  color: var(--accent-text);
}

.timeline h3 {
  font-size: 1.2rem;
  line-height: 1.25;
}

.timeline__org {
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
}

.timeline ul:not(.tags) {
  margin-bottom: 14px;
}

.timeline ul:not(.tags) li,
.detail ul:not(.tags) li {
  position: relative;
  padding-left: 18px;
}

.timeline ul:not(.tags) li::before,
.detail ul:not(.tags) li::before {
  content: ">";
  position: absolute;
  left: 0;
  font-family: var(--font-ui);
  font-size: 1.15rem;
  line-height: 1.35;
  color: var(--accent-text);
}

.timeline p + p {
  margin-top: 4px;
}

.timeline p + .tags {
  margin-top: 10px;
}

.timeline .more {
  margin-top: 16px;
}

.timeline .tags + .more--ghost {
  margin-top: 12px;
}

/* --------------------------------------------------------------------------
   Projets
   -------------------------------------------------------------------------- */

.projects {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.project {
  display: flex;
  flex-direction: column;
  padding: 10px;
  border: 1.5px solid var(--rule);
  border-radius: calc(var(--radius) + 4px);
  background: var(--paper);
}

/* Vignette : un petit écran thermique, ou la capture du projet */
.project__media {
  --radius-screen: var(--radius);
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 0;
}

button.project__media:enabled {
  cursor: zoom-in;
}

.project__media img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.25s;
}

.project:hover .project__media img,
.project__media:focus-visible img {
  opacity: 1;
}

.project__media-label {
  position: absolute;
  right: 12px;
  bottom: 10px;
  z-index: 2;
  font-family: var(--font-ui);
  font-size: 1.1rem;
  color: var(--screen-text);
}

/* Pastille « loupe + nombre d'images » */
.project__zoom {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 1.15rem;
  line-height: 1.2;
}

.project__zoom svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: square;
}

.project__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 14px 8px 8px;
}

.project__date {
  font-family: var(--font-ui);
  font-size: 1.2rem;
  line-height: 1;
  color: var(--accent-text);
}

.project h3 {
  font-size: 1.2rem;
  line-height: 1.2;
}

.project p {
  flex: 1;
  font-size: 0.92rem;
}

.project .tags {
  margin-top: 6px;
}

.project__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* Projet en cours : bordure verte et halo qui « respire » */
.project--current {
  position: relative;
  border-color: var(--accent);
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--accent), transparent 85%),
    0 0 26px color-mix(in srgb, var(--accent), transparent 72%);
  animation: aura 3.5s ease-in-out infinite;
}

@keyframes aura {
  50% {
    box-shadow:
      0 0 0 6px color-mix(in srgb, var(--accent), transparent 80%),
      0 0 40px color-mix(in srgb, var(--accent), transparent 62%);
  }
}

.project__badge {
  position: absolute;
  top: -13px;
  left: 18px;
  z-index: 5;
  padding: 1px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 1.1rem;
  line-height: 1.3;
}

/* Projet à venir : simple cadre en pointillés */
.project--planned {
  justify-content: center;
  border: 2px dashed var(--accent);
  background: transparent;
}

.project--planned .project__body {
  flex: 0;
}

/* Carte GitHub */
.project--link {
  justify-content: space-between;
  padding: 22px;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  text-decoration: none;
}

.project--link h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 2.6rem;
  text-transform: uppercase;
}

.project--link p {
  flex: 0;
}

.project--link .arrow {
  font-family: var(--font-ui);
  font-size: 3rem;
  line-height: 1;
  transition: transform 0.15s;
}

.project--link:hover .arrow {
  transform: translateX(8px);
}

/* --------------------------------------------------------------------------
   Compétences
   -------------------------------------------------------------------------- */

.skills {
  display: grid;
  gap: 36px;
}

.skills__main {
  padding: 20px 22px 22px;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  background: var(--paper);
}

.skills__main h3 {
  margin-bottom: 14px;
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--accent-text);
}

.skills__label {
  margin-bottom: -16px;
  font-family: var(--font-ui);
  font-size: 1.3rem;
  color: var(--muted);
}

.skills__group h3 {
  padding-bottom: 6px;
  border-bottom: var(--line);
  font-size: 1.15rem;
}

.skills__row {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  padding-block: 12px;
  border-bottom: 1px solid var(--rule);
}

.skills__row h4 {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
}

.skills__row p {
  max-width: 70ch;
  font-size: 0.92rem;
}

/* Outil d'IA principal, mis en avant */
.tag--ai {
  background: var(--accent);
}

/* --------------------------------------------------------------------------
   Savoir-être
   -------------------------------------------------------------------------- */

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

.cards > li {
  padding: 18px;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
}

.cards h3 {
  margin-bottom: 6px;
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.1;
  color: var(--accent-text);
}

.cards p {
  font-size: 0.92rem;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Centres d'intérêt
   -------------------------------------------------------------------------- */

.interests {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.interests li {
  padding: 4px 14px;
  border: var(--line);
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 1.3rem;
}

/* --------------------------------------------------------------------------
   Bouton « retour en haut »
   -------------------------------------------------------------------------- */

.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--accent), transparent 82%),
    0 6px 18px rgb(0 0 0 / 0.18);
  transition:
    opacity 0.2s,
    visibility 0.2s,
    transform 0.2s,
    background 0.15s;
}

.to-top svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.to-top:hover {
  background: var(--ink);
}

/* Masqué tant que l'accueil est visible (classe posée par js/main.js) */
.to-top.is-hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px);
}

@media (max-width: 720px) {
  .to-top {
    right: 16px;
    bottom: 16px;
  }
}

/* --------------------------------------------------------------------------
   Visionneuse de captures
   -------------------------------------------------------------------------- */

.viewer {
  width: min(1000px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--screen);
  color: var(--screen-text);
  overflow: hidden;
}

.viewer::backdrop {
  background: rgb(21 24 23 / 0.75);
}

.viewer__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  font-family: var(--font-ui);
  font-size: 1.3rem;
}

.viewer__count {
  margin-left: auto;
  margin-right: 14px;
}

.viewer__close,
.drawer__close {
  padding: 0 10px;
  border: 1.5px solid currentColor;
  border-radius: 6px;
  background: transparent;
  font-family: var(--font-ui);
  font-size: 1.2rem;
  cursor: pointer;
}

.viewer__stage {
  position: relative;
  display: flex;
  justify-content: center;
}

.viewer__image {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
}

.viewer__nav {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--screen-text);
  border-radius: 50%;
  background: rgb(11 15 15 / 0.7);
  color: var(--screen-text);
  font-family: var(--font-ui);
  font-size: 1.6rem;
  cursor: pointer;
}

.viewer__nav:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.viewer__nav--prev {
  left: 12px;
}

.viewer__nav--next {
  right: 12px;
}

.viewer--single .viewer__nav,
.viewer--single .viewer__count {
  display: none;
}

/* --------------------------------------------------------------------------
   Panneau « En savoir plus »
   -------------------------------------------------------------------------- */

.drawer {
  width: min(760px, 100%);
  height: 100dvh;
  max-width: 100%;
  max-height: 100dvh;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  background: var(--bg);
  color: var(--ink);
}

.drawer[open] {
  animation: drawer-in 0.2s ease-out;
}

@keyframes drawer-in {
  from {
    transform: translateX(48px);
    opacity: 0;
  }
}

.drawer::backdrop {
  background: rgb(21 24 23 / 0.6);
}

.drawer__bar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px;
  background: var(--screen);
  color: var(--screen-text);
  font-family: var(--font-ui);
  font-size: 1.3rem;
}

.drawer__content {
  padding: 30px 28px 56px;
}

/* Contenu des fiches */

.detail h2 {
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 2.8rem);
  line-height: 1;
  text-transform: uppercase;
}

.detail__meta {
  margin-bottom: 18px;
  font-family: var(--font-ui);
  font-size: 1.2rem;
  line-height: 1.25;
  color: var(--accent-text);
}

.detail__lead {
  margin-bottom: 24px;
  font-size: 1.12rem;
  line-height: 1.45;
}

.detail h3 {
  margin: 32px 0 12px;
  padding-bottom: 4px;
  border-bottom: var(--line);
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--accent-text);
}

.detail h4 {
  margin: 20px 0 6px;
  font-size: 1.02rem;
}

.detail p + p,
.detail ul + p {
  margin-top: 8px;
}

.detail ul:not(.tags) li {
  margin-bottom: 4px;
}

.detail code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--rule);
  font-family: var(--font-mono);
  font-size: 0.85em;
}

.detail a {
  color: var(--accent-text);
  font-weight: 700;
}

.detail figure {
  margin: 24px 0 0;
  overflow: hidden;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
}

.detail figure img {
  width: 100%;
  background: #fff;
}

.detail figcaption {
  padding: 6px 12px;
  border-top: 1.5px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.detail__note {
  margin-top: 24px !important;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

/* Chiffres clés */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.stats > div {
  padding: 12px 14px;
  border: 1.5px solid var(--rule);
  border-radius: 14px;
  background: var(--paper);
}

.stats strong {
  display: block;
  color: var(--accent-text);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 2.4rem;
  line-height: 1;
}

.stats span {
  font-size: 0.8rem;
  line-height: 1.3;
}

/* --------------------------------------------------------------------------
   Écrans moyens et téléphones
   -------------------------------------------------------------------------- */

@media (max-width: 960px) {
  .projects,
  .cards,
  .wanted,
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .timeline > li {
    grid-template-columns: 160px 1fr;
  }
}

@media (max-width: 720px) {
  .projects,
  .cards,
  .wanted {
    grid-template-columns: 1fr;
  }

  .wanted .wanted__wide {
    grid-column: auto;
  }

  .timeline > li,
  .skills__row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .drawer__bar {
    padding: 10px var(--gutter);
  }

  .drawer__content {
    padding: 24px var(--gutter) 48px;
  }
}
