/* =========================================================
   Jubéo Hernandez — portfolio
   Tokens repris de la maquette Figma (node 276:2146)
   ========================================================= */

:root {
  --bg:            #efefef;
  --surface:       #fcfcfc;
  --panel:         #f3f3f3;
  --segment:       #f5f5f5;
  --segment-on:    #e5e5e5;
  --ink:           #424242;
  --ink-muted:     #737373;
  --dark:          #262626;
  --hairline:      rgba(0, 0, 0, .06);

  --r-frame:  32px;
  --r-panel:  24px;
  --r-media:  16px;
  --r-chip:    7px;
  --r-pill:   100px;

  --col:      520px;
  --inset:      8px;

  --font: "Google Sans Flex", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Axes de la variable font, alignés sur la maquette Figma.
     Ce sont les valeurs par défaut — à changer si tu veux jouer avec :
     wdth 25→151 (condensé/étendu), GRAD 0→100 (graisse optique), ROND 0→100 (rondeur) */
  --axes: "wdth" 100, "GRAD" 0, "ROND" 0;

  --shadow-card: 0 2px 2px rgba(0,0,0,.04), 0 1px 1px rgba(0,0,0,.06);
  --shadow-dock: 0 24px 24px rgba(0,0,0,.12), 0 1px 1px rgba(0,0,0,.06);

  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* Mode sombre — palette Tailwind "Neutral" (uicolors.app/tailwind-colors/neutral).
   Le menu sticky du bas (--dark, --shadow-dock) n'est volontairement pas repris ici :
   il garde les mêmes couleurs dans les deux thèmes. */
:root[data-theme="dark"] {
  --bg:            #0a0a0a;
  --surface:       #171717;
  --panel:         #262626;
  --segment:       #262626;
  --segment-on:    #404040;
  --ink:           #f5f5f5;
  --hairline:      rgba(255, 255, 255, .08);
}

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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  font-family: var(--font);
  font-weight: 500;
  font-variation-settings: var(--axes);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }

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

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Surface + voiles ---------- */

.surface {
  position: fixed;
  inset: var(--inset);
  background: var(--surface);
  border-radius: var(--r-frame);
  z-index: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.veil {
  position: fixed;
  left: var(--inset);
  right: var(--inset);
  z-index: 20;
  pointer-events: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transform: translateZ(0);
  will-change: backdrop-filter, transform;
  isolation: isolate;
}

.veil--top {
  top: var(--inset);
  height: 73px;
  border-radius: var(--r-frame) var(--r-frame) 0 0;
  mask-image: linear-gradient(to bottom, #000 42%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 42%, transparent 100%);
}

.veil--bottom {
  bottom: var(--inset);
  height: 155px;
  border-radius: 0 0 var(--r-frame) var(--r-frame);
  mask-image: linear-gradient(to top, #000 38%, transparent 100%);
  -webkit-mask-image: linear-gradient(to top, #000 38%, transparent 100%);
}

.scroll-progress {
  width: 48px;
  height: 2px;
  border-radius: 100px;
  background: #e5e5e5;
  overflow: hidden;
  pointer-events: none;
}

.scroll-progress__fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 100px;
  background: #262626;
  transform: scaleX(0);
  transform-origin: left;
}

:root[data-theme="dark"] .scroll-progress { background: #333; }
:root[data-theme="dark"] .scroll-progress__fill { background: #f5f5f5; }

/* ---------- Barre supérieure ---------- */

.topbar {
  position: fixed;
  top: 24px;
  left: 0;
  right: 40px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 40px;
  gap: 24px;
  pointer-events: none;
}

.topbar > * { pointer-events: auto; }

.idcard {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -12px);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px 2px 2px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 11px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .32s var(--ease), transform .32s var(--ease), visibility .32s;
}

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

:root[data-theme="dark"] .idcard { background: rgba(23, 23, 23, .72); }

.idcard__avatar {
  width: 24px;
  height: 24px;
  border-radius: var(--r-pill);
  object-fit: cover;
  display: block;
}

.idcard__arrow {
  width: 12px;
  height: 12px;
  color: var(--ink-muted);
  transition: transform .25s var(--ease);
}

.idcard:hover .idcard__arrow { transform: translateY(-2px); }

@keyframes idcard-bounce {
  0%   { transform: translate(-50%, 0) scale(1); }
  35%  { transform: translate(-50%, 0) scale(.88); }
  65%  { transform: translate(-50%, 0) scale(1.06); }
  100% { transform: translate(-50%, 0) scale(1); }
}

.idcard.is-bouncing { animation: idcard-bounce .4s var(--ease); }

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 400;
  font-size: 11px;
  color: var(--ink-muted);
}

.status__time { font-variant-numeric: tabular-nums; }

.status__theme {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s var(--ease);
}

.status__theme:hover { transform: rotate(12deg); }

.status__icon { width: 16px; height: 16px; }

.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun  { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }

/* ---------- Colonne ---------- */

.column {
  width: var(--col);
  max-width: calc(100vw - 48px);
  margin: 0 auto;
  padding: 203px 0 220px;
}

/* ---------- Présentation ---------- */

.intro {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-bottom: 96px;
}

/* conserve l'espacement d'origine (40px) avant les réseaux */
.social { margin-top: 8px; }

.identity {
  display: flex;
  align-items: center;
  gap: 16px;
}

.identity__avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--r-media);
  object-fit: cover;
  background: #d9d9d9;
  display: block;
  transition: transform .15s var(--ease);
  will-change: transform;
}

:root[data-theme="dark"] .identity__avatar { background: #404040; }

.identity__text { display: flex; flex-direction: column; gap: 6px; }
.identity__name { margin: 0; font-size: 15px; font-weight: inherit; }
.identity__role { margin: 0; font-size: 15px; font-weight: 400; color: var(--ink-muted); }

.identity__share {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--segment);
  color: #737373;
  transition: background .18s var(--ease), color .18s var(--ease);
}

.identity__share svg { width: 16px; height: 16px; }

.identity__share:hover {
  background: var(--segment-on);
  color: #525252;
}

.bio { display: flex; flex-direction: column; gap: 12px; }

.bio__line {
  margin: 0;
  font-size: 15px;
  font-weight: 400;
  line-height: 24px;
  color: var(--ink-muted);
}

.bio__line--muted { color: var(--ink-muted); }

.bio__body {
  margin: 0;
  font-size: 15px;
  font-weight: 400;
  line-height: 26px;
  color: var(--ink-muted);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  margin: 0 2px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-chip);
  font-size: 13px;
  font-weight: 500;
  line-height: normal;
  color: var(--ink);
  background: transparent;
  vertical-align: middle;
}

.chip--link { cursor: pointer; transition: background .18s var(--ease), border-color .18s var(--ease); }
.chip--link:hover { background: var(--segment); border-color: rgba(0, 0, 0, .12); }

.chip svg { flex-shrink: 0; }

/* ---------- Réseaux ---------- */

.social {
  display: flex;
  padding: 2px;
  border-radius: 10px;
  background: var(--segment);
}

.social__item {
  flex: 1 0 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 4px 2px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 20px;
  color: var(--ink-muted);
  transition: background .2s var(--ease), color .2s var(--ease);
}

.social__item:hover,
.social__item:focus-visible {
  background: var(--segment-on);
  color: var(--ink);
  gap: 6px;
}

.social__icon {
  width: 0;
  height: 16px;
  opacity: 0;
  transition: width .2s var(--ease), opacity .2s var(--ease);
}

.social__item:hover .social__icon,
.social__item:focus-visible .social__icon { width: 16px; opacity: 1; }

/* ---------- Thread ---------- */

.thread {
  display: flex;
  flex-direction: column;
  gap: 48px;
  transition: transform .32s var(--ease), opacity .32s var(--ease);
}

.thread.is-entering-right { transform: translateX(28px); opacity: 0; }
.thread.is-entering-left  { transform: translateX(-28px); opacity: 0; }

.post {
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  transform: translateY(10px);
  filter: blur(6px);
}

.post.in-view {
  animation: enter .48s var(--ease) both;
}

/* ---------- Entrées en cascade (intro + posts) ---------- */

@keyframes enter {
  from { opacity: 0; transform: translateY(10px); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}

.animate-enter {
  animation: enter .5s var(--ease) both;
  animation-delay: calc(90ms * var(--stagger, 0));
}

.post__head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 24px;
}

.post__meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.post__stamp {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-muted);
}

.post__dot {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: currentColor;
}

.post__caption { margin: 0; font-size: 13px; font-weight: inherit; color: var(--ink); }

.gallery-wrap { position: relative; }

.gallery-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 64px;
  border-radius: 0 var(--r-panel) var(--r-panel) 0;
  background: linear-gradient(to right, transparent, var(--panel));
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s var(--ease);
}

.gallery-wrap.has-scroll-right::after { opacity: 1; }

.gallery {
  display: flex;
  gap: 10px;
  padding: 32px;
  border-radius: var(--r-panel);
  background: var(--panel);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 32px;
  scrollbar-width: none;
  cursor: grab;
}

.gallery::-webkit-scrollbar { display: none; }
.gallery.is-dragging { cursor: grabbing; scroll-snap-type: none; }

.gallery img {
  flex: 0 0 auto;
  display: block;
  object-fit: cover;
  background: #e8e8e8;
  scroll-snap-align: start;
  outline: 1px solid rgba(0, 0, 0, .1);
  outline-offset: -1px;
  cursor: zoom-in;
  -webkit-user-drag: none;
  user-select: none;
  opacity: 0;
  filter: blur(16px);
  transition: opacity .5s var(--ease), filter .5s var(--ease),
              transform .4s cubic-bezier(.34, 1.56, .64, 1), box-shadow .2s var(--ease);
}

.gallery img.is-loaded { opacity: 1; filter: blur(0); }

.gallery img:hover {
  transform: scale(1.04);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .10);
}

:root[data-theme="dark"] .gallery img {
  background: #404040;
  outline-color: rgba(255, 255, 255, .1);
}

.gallery--photo img {
  width: 193.333px;
  height: 290px;
  border-radius: var(--r-media);
}

.gallery--single { justify-content: center; }

/* ---------- Couverture Work (feed) + blocs page détail ---------- */

.work-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 380px;
  padding: 32px;
  border-radius: var(--r-panel);
  background: var(--panel);
  cursor: pointer;
  overflow: hidden;
}

.detail__blocks {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail__block {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 480px;
  padding: 32px;
  border-radius: var(--r-panel);
  background: var(--panel);
}

.work-cover__img,
.detail__block img {
  width: 100%;
  max-width: 340px;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
  outline: 1px solid rgba(0, 0, 0, .1);
  outline-offset: -1px;
  cursor: zoom-in;
  opacity: 0;
  filter: blur(16px);
  transition: opacity .5s var(--ease), filter .5s var(--ease),
              transform .4s cubic-bezier(.34, 1.56, .64, 1), box-shadow .2s var(--ease);
}

.work-cover__img { cursor: pointer; }

.work-cover__img.is-loaded,
.detail__block img.is-loaded { opacity: 1; filter: blur(0); }

.work-cover:hover .work-cover__img,
.detail__block img:hover {
  transform: scale(1.04);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .10);
}

:root[data-theme="dark"] .work-cover__img,
:root[data-theme="dark"] .detail__block img { outline-color: rgba(255, 255, 255, .1); }

/* ---------- Bascule des vues feed / détail ---------- */

.detail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.intro[hidden],
.thread[hidden],
.detail[hidden] { display: none; }

.empty {
  padding: 48px 24px;
  font-size: 13px;
  color: var(--ink-muted);
  text-align: center;
}

/* ---------- Menu bas ---------- */

.dock {
  position: fixed;
  bottom: 42px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  gap: 4px;
}

.dock__feed,
.dock__detail { display: flex; gap: 4px; }

.dock__detail { display: none; }

body[data-view="detail"] .dock__feed { display: none; }
body[data-view="detail"] .dock__detail { display: flex; }

.dock__group,
.dock__mail {
  background: var(--dark);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-dock);
}

.dock__back { cursor: pointer; }
.dock__back .dock__mark svg { width: 14px; height: 14px; }

.dock__back-label {
  font-size: 13px;
  line-height: 12px;
  font-weight: 500;
  color: #a1a1a1;
  padding-right: 4px;
  transition: color .22s var(--ease);
}

.dock__back:hover .dock__mark { color: #fff; }
.dock__back:hover .dock__back-label { color: #fff; }

.dock__group {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 4px 4px 4px 10px;
}

/* Indice de scroll : remplace les filtres tant qu'on n'a pas scrollé une fois */

.dock__scrollhint {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 6px 12px 6px 8px;
  background: var(--dark);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-dock);
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 12px;
  transition: color .22s var(--ease);
}

.dock__scrollhint:hover { color: #fff; }

.dock__scrollhint svg {
  width: 16px;
  height: 16px;
  animation: scrollhint-fall 1.6s ease-in-out infinite;
}

@keyframes scrollhint-fall {
  0%   { transform: translateY(-5px); opacity: 0; }
  35%  { opacity: 1; }
  65%  { opacity: 1; }
  100% { transform: translateY(5px); opacity: 0; }
}

.dock__feed .dock__group { display: none; }

.dock.has-scrolled .dock__scrollhint { display: none; }
.dock.has-scrolled .dock__feed .dock__group { display: flex; }

.dock__mark { display: flex; color: #a1a1a1; }
.dock__mark svg { width: 12px; height: 12px; }

.dock__sep {
  width: 1px;
  height: 11px;
  background: rgba(255, 255, 255, .22);
}

.dock__filters { position: relative; display: flex; align-items: center; gap: 4px; }

.dock__pill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: #fff;
  border-radius: var(--r-pill);
  transition: transform .32s var(--ease), width .32s var(--ease);
  z-index: 0;
}

.dock__tab {
  position: relative;
  z-index: 1;
  padding: 6px 8px;
  border-radius: var(--r-pill);
  font-size: 12px;
  line-height: 12px;
  color: var(--ink-muted);
  transition: color .22s var(--ease);
}

.dock__tab:hover { color: #fff; }

.dock__tab.is-active { color: var(--dark); }

.dock__mail {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: #fff;
  transition: transform .2s var(--ease);
}

.dock__mail svg { width: 14px; height: 14px; }
.dock__mail:hover { transform: translateY(-2px); }
.dock__mail:active { transform: scale(.94); }

/* ---------- Icônes copié / confirmé (mail, partage) ---------- */

.icon-check { display: none; }
.is-done .icon-default { display: none; }
.is-done .icon-check { display: block; color: #fff; }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translate(-50%, 8px);
  z-index: 60;
  padding: 8px 12px;
  border-radius: var(--r-pill);
  background: var(--dark);
  color: #fff;
  font-size: 12px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .24s var(--ease), transform .24s var(--ease), visibility .24s;
}

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

/* ---------- Responsive ---------- */

@media (max-width: 560px) {
  :root { --inset: 6px; --r-frame: 24px; }

  .column {
    width: auto;
    max-width: none;
    margin: 0 20px;
    padding: 60px 0 180px;
  }

  .topbar { right: 20px; padding-left: 20px; }
  .intro { gap: 32px; margin-bottom: 64px; }
  .post__head { padding: 0 8px; }
  .gallery { padding: 20px; scroll-padding-inline: 20px; }
  .work-cover, .detail__block { padding: 20px; }
  .social__item span { font-size: 11px; }
}

/* ---------- Visionneuse plein écran ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #171717;
  opacity: 0;
  transition: opacity .2s var(--ease);
}

.lightbox[hidden] { display: none; }
.lightbox.is-open { opacity: 1; }

.lightbox__image {
  max-width: min(92vw, 900px);
  max-height: 86vh;
  border-radius: 16px;
  object-fit: contain;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}

.lightbox__close,
.lightbox__nav {
  position: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #404040;
  color: #a1a1a1;
  transition: background .18s var(--ease), color .18s var(--ease);
}

.lightbox__close:hover,
.lightbox__nav:hover { background: #525252; color: #fff; }

.lightbox__close svg,
.lightbox__nav svg { width: 24px; height: 24px; }

.lightbox__close { top: 24px; left: 24px; }
.lightbox__nav--prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lightbox__nav--next { right: 24px; top: 50%; transform: translateY(-50%); }
.lightbox__nav--next svg { transform: rotate(180deg); }

.lightbox__nav[disabled] { opacity: .3; pointer-events: none; }

@media (max-width: 560px) {
  .lightbox__close { top: 16px; left: 16px; }
  .lightbox__nav--prev { left: 16px; }
  .lightbox__nav--next { right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
