/* ─────────────────────────────────────────────
   VARIABLES
───────────────────────────────────────────── */
* {
  user-select: none;
  -webkit-user-select: none;
}

:root {
  --bg-page:      #E8E8E8;
  --bg-phone:     #000000;
  --color-label:  #ffffff;
  --font-label:   'Helvetica Neue', Helvetica, Arial, sans-serif;
  --icon-radius:  8px;
  --phone-w:      312px;
  --phone-h:      653px;
  --frame-radius: 50px;
}

/* ─────────────────────────────────────────────
   RESET + BASE
───────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-page);
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-label);
  font-weight: 500;
  overflow: hidden;
  cursor: none;
}
*, *::before, *::after { cursor: none !important; }

/* ─── Custom cursor ─── */
#cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 28px;
  height: 30px;
  pointer-events: none;
  z-index: 99999;
  opacity: 0;
  will-change: transform;
}

.fake-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 28px;
  height: 30px;
  pointer-events: none;
  z-index: 9997;
  opacity: 0;
  will-change: transform;
}

#cursor-follow-talk {
  position: fixed;
  top: 0;
  left: 0;
  height: 42px;
  padding: 14px 18px;
  background: #FAC645;
  border: 2px solid #C89E37;
  border-radius: 3px 24px 24px 24px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 400;
  color: #000;
  pointer-events: none;
  z-index: 99997;
  opacity: 0;
  will-change: transform;
}

#cursor-follow-talk-green,
#cursor-follow-talk-blue {
  position: fixed;
  top: 10px;
  left: 0;
  height: 42px;
  padding: 14px 18px;
  border-radius: 3px 24px 24px 24px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 400;
  color: #fff;
  pointer-events: none;
  z-index: 9996;
  opacity: 0;
  will-change: transform;
}

#cursor-follow-talk-green {
  background: #3DA059;
  border: 2px solid #207036;
}

#cursor-follow-talk-blue {
  background: #1B71D9;
  border: 2px solid #094EA1;
}

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

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ─────────────────────────────────────────────
   PHONE FRAME
───────────────────────────────────────────── */
.phone-frame {
  position: relative;
  width: var(--phone-w);
  height: var(--phone-h);
  background-color: var(--bg-phone);
  border-radius: var(--frame-radius);
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.30),
    0 15px 40px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

@media (hover: hover) {
  .phone-frame { opacity: 0; }
}

/* ─────────────────────────────────────────────
   BACKGROUND OVERLAY (desktop hover)
───────────────────────────────────────────── */
#bg-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

#bg-overlay img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}

/* ─────────────────────────────────────────────
   DYNAMIC ISLAND
───────────────────────────────────────────── */
.dynamic-island {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 76px;
  height: 22px;
  background-color: #D9D9D9;
  border-radius: 999px;
  z-index: 10;
}

/* ─────────────────────────────────────────────
   SCREEN / SCROLLABLE AREA
───────────────────────────────────────────── */
.phone-screen {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 64px 16px 16px;
  /* Hide scrollbar */
  scrollbar-width: none;
}
.phone-screen::-webkit-scrollbar {
  display: none;
}

/* ─────────────────────────────────────────────
   APP GRID
───────────────────────────────────────────── */
.app-grid {
  display: grid;
  grid-template-columns: repeat(4, 48px);
  gap: 16px 21px;
  justify-content: center;
}

/* ─────────────────────────────────────────────
   APP ICON
───────────────────────────────────────────── */
.app-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transform-origin: center;
  will-change: transform;
}

.icon-img {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: var(--icon-radius);
  overflow: hidden;
}

.app-icon span {
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--color-label);
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
}

/* ─────────────────────────────────────────────
   PROJECT GALLERY (scroll horizontal)
───────────────────────────────────────────── */
#project-gallery {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

#mobile-back-btn {
  display: none;
}

.gallery-track {
  position: absolute;
  display: flex;
  gap: 42px;
  will-change: transform;
}

.gallery-item {
  width: auto;
  height: 395px;
  flex-shrink: 0;
  opacity: 0;
  display: block;
  background: #C5C5C5;
}

/* ─────────────────────────────────────────────
   ABOUT CARD (notification style)
───────────────────────────────────────────── */
.about-card {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  width: 255px;
  height: 48px;
  background: #ffffff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 16px 6px 6px;
  cursor: pointer;
  z-index: 5;
  flex-shrink: 0;
}
.about-card-chevron {
  width: 8px;
  height: 14px;
  flex-shrink: 0;
  margin-left: auto;
}

.about-card-avatar {
  width: 64px;
  height: 48px;
  margin: -6px 0 -6px -6px;
  border-radius: 12px 0 0 12px;
  overflow: hidden;
  flex-shrink: 0;
}
.about-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.about-card-text {
  display: flex;
  flex-direction: column;
  gap: 0px;
  overflow: hidden;
}

.about-card-name {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  color: #000000;
  white-space: nowrap;
}

.about-card-role {
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0;
  color: #888888;
  white-space: nowrap;
}

/* ─────────────────────────────────────────────
   ABOUT OVERLAY
───────────────────────────────────────────── */
#about-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  pointer-events: none;
}

.aw {
  position: absolute;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
}

/* ── Positions : phone 312px → bord gauche à calc(50% - 156px), bord droit à calc(50% + 156px) ── */
/* gap phone ↔ widget : 16px */

/* Colonne gauche — alignés à droite sur calc(50% - 172px) */
.aw-profile  { width: 191px; height: 196px; background: #FF3213; top: calc(50% - 326px); left: calc(50% - 30px); }
.aw-current  { width: 254px; height:  85px; background: #DEF1F5; top: calc(50% - 80px);  left: calc(50% + 70px); }
.aw-linkedin { width: 240px; height:  56px; background: #276EFE; top: calc(50% + 41px);  left: calc(50% - 210px); }

/* Colonne droite — alignés à gauche sur calc(50% + 172px) */
.aw-fwa      { width: 210px; height: 210px; background: #ffffff; top: calc(50% - 237px); left: calc(50% - 372px); }
.aw-weather  { width: 300px; height:  72px; background: #FFD801; top: calc(50% + 184px); left: calc(50% - 326px); }

/* Bas — centré */
.aw-awwwards { width: 327px; height: 127px; background: #27EB63; top: calc(50% + 103px); left: calc(50% + 123px); }

/* ── Contenu widgets ── */

/* Profile */
.aw-profile {
  display: flex;
  flex-direction: column;
  padding: 16px 16px 0;
  gap: 18px;
  overflow: visible;
}
.aw-profile-text { display: flex; flex-direction: column; gap: 2px; }
.aw-profile-name  { font-size: 13px; font-weight: 500; color: #000000; line-height: 1.3; }
.aw-profile-title { font-size: 13px; font-weight: 500; color: #00000; opacity: 0.4; }
.aw-profile-photo     { width: 159px; height: 108px; border-radius: 6px; overflow: hidden; flex-shrink: 0; }
.aw-profile-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }

/* FWA deck */
.aw-fwa {
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: transparent;
}
.aw-fwa-deck {
  position: relative;
  width: 210px;
  height: 210px;
}
.aw-fwa-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 210px;
  height: 210px;
  background: #ffffff;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  cursor: grab;
  user-select: none;
  will-change: transform;
}
.aw-fwa-card:active { cursor: grabbing; }
.aw-fwa-dots {
  display: flex;
  position: absolute;
  margin-top: 224px;
  gap: 4px;
}
.aw-fwa-dot {
  width: 8px;
  height: 8px;
  padding-left: 2px;
  padding-right: 2px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.1);
  transition: background 0.25s;
}
.aw-fwa-dot.active { background: rgba(0, 0, 0, 1); }
.aw-fwa-top     { display: flex; flex-direction: column; gap: 2px; }
.aw-fwa-logo    { width: 52px; height: 15px; display: block; flex-shrink: 0; }
.aw-fwa-label   { font-size: 13px;  font-weight: 500; color: #000000; opacity: 0.4; }
.aw-fwa-number  { font-size: 100px; font-weight: 400; color: #000; line-height: 1; margin-top: auto; text-align: right; letter-spacing: -0.04em; }
.aw-fwa-card .aw-fwa-top,
.aw-fwa-card .aw-fwa-number { opacity: 0; transition: opacity 0.25s ease; }
.aw-fwa-card.is-top .aw-fwa-top,
.aw-fwa-card.is-top .aw-fwa-number { opacity: 1; }

/* Currently */
.aw-current {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 16px;
  gap: 12px;
  text-decoration: none;
  overflow: visible;
}
.aw-current-logo  { width: 53px; height: 53px; object-fit: contain; border-radius: 12px; flex-shrink: 0; }
.aw-current-info  { display: flex; flex-direction: column; gap: 3px; }
.aw-current-passport-wrap {
  position: absolute;
  right: -200px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
.aw-current-passport {
  display: block;
  height: 300px;
  width: auto;
  filter: drop-shadow(0px 0px 14px rgba(0,0,0,0.25));
  opacity: 0;
}
.aw-current-label { font-size: 13px;  font-weight: 500; color: #000000; opacity: 0.4; }
.aw-current-name  { width: 127px; height: 18px; display: block; flex-shrink: 0; }

/* LinkedIn */
.aw-linkedin {
  display: flex;
  align-items: center;
  padding: 16px;
  gap: 10px;
  text-decoration: none;
  position: relative;
}
.aw-linkedin-icon {
  width: 26px;
  height: 26px;
  background: #fff;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #276EFE;
  flex-shrink: 0;
}
.aw-linkedin-text  { font-size: 14px; font-weight: 500; color: #fff; }
.aw-linkedin-arrow { width: 14px; height: 14px; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); }

/* Weather */
.aw-weather          { display: flex; align-items: center; padding: 16px; }
.aw-weather-left     { display: flex; flex-direction: column; flex: 1; }
.aw-weather-location { font-size: 13px; font-weight: 500; color: #000; }
.aw-weather-info     { display: flex; align-items: center; gap: 5px; opacity: 0.4; }
.aw-weather-info span { font-size: 13px; font-weight: 500; color: #000000; }
.aw-weather-dot      { font-size: 12px !important; line-height: 1; }
.aw-weather-temp     { font-size: 42px; font-weight: 400; color: #000; line-height: 1; letter-spacing: -0.03em; }

/* Awwwards */
.aw-awwwards {
  display: flex;
  align-items: center;
  padding: 16px;
  gap: 12px;
}

.aw-awwwards-name{
width: 68px;
}

.aw-ps5-left        { display: flex; flex-direction: column; justify-content: space-between; flex: 1; height: 95px; }
.aw-ps5-top         { display: flex; flex-direction: column; gap: 4px; }
.aw-ps5-logo        { width: 75px; display: block; }
.aw-ps5-label       { font-size: 13px; font-weight: 500; color: #000; opacity: 0.4; }
.aw-ps5-game        { font-size: 13px; font-weight: 500; color: #000; }
.aw-ps5-cover       { width: 95px; height: 95px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }

/* ─────────────────────────────────────────────
   HOME BAR
───────────────────────────────────────────── */
.home-bar {
  flex-shrink: 0;
  height: 24px;
}

/* ─────────────────────────────────────────────
   PAGE PROJET — titre + client
───────────────────────────────────────────── */
/* Stack container */
.project-header-stack {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 321px;
  height: 60px;
  pointer-events: none;
  overflow: visible;
}
/* Carte individuelle */
.project-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 321px;
  height: 60px;
  background: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  padding: 0 6px;
  gap: 12px;
  cursor: pointer;
  pointer-events: auto;
  will-change: transform, opacity;
}
.project-card-inner {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 12px;
}
.project-header-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.project-header-info {
  display: flex;
  flex-direction: column;
  gap: 0px;
  flex: 1;
}
.project-title  { font-size: 13px; font-weight: 500; color: #000; }
.project-client { font-size: 9px;  font-weight: 500; color: rgba(0, 0, 0, 0.4); }
.role           { font-size: 13px; font-weight: 500; color: #000; flex: 1; padding-left: 12px; }
.project-header-dots {
  display: flex;
  flex-direction: column;
  padding-right: 12px;
  gap: 3px;
  flex-shrink: 0;
}
.project-header-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
}
.project-header-dot.active {
  background: #000;
  opacity: 1;
}

/* ─────────────────────────────────────────────
   RESPONSIVE — MOBILE
   Sur mobile : plein écran, fond noir, plus de frame
───────────────────────────────────────────── */
@media (max-width: 430px) {
  body {
    background-color: #000;
    align-items: flex-start;
    overflow: hidden;
  }

  .phone-frame {
    width: 100%;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }

  .dynamic-island {
    /* On mobile réel, la Dynamic Island est gérée par l'OS.
       On la garde pour l'espace visuel (status bar zone). */
    width: 120px;
    height: 34px;
  }

  .phone-screen {
    padding: 64px 24px 16px;
  }

  .app-grid {
    --icon-size: calc((100vw - 48px - 3 * 24px) / 4);
    grid-template-columns: repeat(4, var(--icon-size));
    gap: 20px 24px;
    justify-content: start;
  }

  .icon-img {
    width: var(--icon-size);
    height: var(--icon-size);
  }

  .app-icon span {
    font-size: 9px;
  }

  .about-card {
    left: 24px;
    right: 24px;
    width: auto;
    transform: none;
    height: 60px;
  }

  .about-card-avatar {
    height: 60px;
  }

  /* ─ Galerie projet mobile : actif uniquement avec .mobile-open ─ */
  #project-gallery.mobile-open {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 80px 24px 40px;
    gap: 24px;
    background: #111;
    align-items: stretch;
    z-index: 100;
    pointer-events: auto;
  }

  #project-gallery.mobile-open .gallery-item {
    width: 100% !important;
    height: auto !important;
    min-height: 200px;
    border-radius: 16px;
    flex-shrink: 0;
    opacity: 1 !important;
    background: #C5C5C5;
  }

  #mobile-back-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 101;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    display: none;
  }

}

/* ─────────────────────────────────────────────
   ABOUT OVERLAY — MOBILE (hover: none = touch device)
   Même check que le JS isMobile
───────────────────────────────────────────── */
@media (hover: none) {

  /* Overlay : colonne scrollable plein écran */
  #about-overlay {
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    padding: 16px !important;
    gap: 16px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    background: #000 !important;
  }

  /* Override le positionnement absolu desktop */
  .aw {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    transform: none !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
  }

  /* Ordre et hauteurs (padding inclus dans la hauteur grâce à border-box) */
  .aw-profile  { order: 1; aspect-ratio: 1 / 1 !important; height: auto !important; }
  .aw-current  { order: 2; height: 111px !important; }
  .aw-linkedin { order: 3; height: 72px !important; }
  .aw-fwa      { order: 4; height: 300px !important; overflow: visible !important; }
  .aw-awwwards { order: 5; height: 152px !important; }
  .aw-weather  { order: 6; height: 90px !important; }

  /* Typographies mobile */
  .aw-profile-name     { font-size: 24px !important; }
  .aw-profile-title    { font-size: 24px !important; }
  .aw-profile-photo    { width: 100% !important; height: 210px !important; border-radius: 12px;}
  .aw-fwa-number       { font-size: 174px !important; }
  .aw-linkedin-text    { font-size: 24px !important; }
  .aw-fwa-label        { font-size: 16px !important; }
  .aw-ps5-label        { font-size: 16px !important; }
  .aw-ps5-game         { font-size: 16px !important; }
  .aw-weather-location { font-size: 16px !important; }
  .aw-weather-info span { font-size: 16px !important; }
  .aw-current-label    { font-size: 16px !important; }
  #weather-temp        { font-size: 72px !important; }

  /* FWA deck */
  .aw-fwa-deck { width: 100% !important; height: 300px !important; }
  .aw-fwa-card { width: 100% !important; height: 300px !important; }
  .aw-fwa-dots { display: none !important; }

  /* Cacher le curseur custom sur mobile */
  #cursor, #cursor-follow-talk { display: none !important; }
}
