/* ============================================
   ALIX GATHELIER — PORTFOLIO
   ============================================ */

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

:root {
  --bg: #080808;
  --fg: #f0f0f0;
  --dim: #555;
  --dimmer: #222;
  --border: rgba(255,255,255,0.07);
  --accent: #303c28;
  --font: 'Space Mono', 'Courier New', monospace;
  --nav-h: 56px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  cursor: none;
  overflow-x: hidden;
}

/* ── CURSOR ──────────────────────────────── */

.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 99999;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  will-change: transform;
}

.cursor-dot {
  width: 5px; height: 5px;
  background: var(--fg);
  transition: width 0.2s, height 0.2s, background 0.2s;
}

.cursor-ring {
  width: 34px; height: 34px;
  border: 1px solid rgba(255,255,255,0.25);
  transition: width 0.3s, height 0.3s, border-color 0.3s;
}

.cursor-dot.hover {
  width: 8px; height: 8px;
  background: var(--accent);
}

.cursor-ring.hover {
  width: 50px; height: 50px;
  border-color: rgba(48,60,40,0.5);
}

/* ── BACKGROUND CANVAS ───────────────────── */

#stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  filter: url(#topo-hollow);
}

#canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Ensure all content sits above the background */
#nav, .hero, .about, #projects, #contact {
  position: relative;
  z-index: 2;
}

/* ── NOISE ───────────────────────────────── */

.noise {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.filters { position: absolute; width: 0; height: 0; pointer-events: none; }

/* ── NAV ─────────────────────────────────── */

#nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 40px;
  border-bottom: 1px solid var(--border);
  background: rgba(8,8,8,0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.nav-available {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--accent);
}

.nav-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 0.2em;
  color: var(--fg);
  text-decoration: none;
  white-space: nowrap;
  text-align: center;
  filter: blur(1.8px);
  transition: filter 0.45s ease;
}

.nav-name:hover {
  filter: blur(0px);
}

.nav-links {
  display: flex;
  gap: 32px;
  justify-content: flex-end;
}

.nav-links a {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--dim);
  text-decoration: none;
  transition: color 0.25s;
}

.nav-links a:hover,
.nav-links a.active { color: var(--accent); }

/* ── HERO ────────────────────────────────── */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: calc(var(--nav-h) + 60px) 40px 60px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

/* Availability badge */
.hero-available {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 28px;
}

.available-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.35; transform: scale(0.7); }
}

/* Hero title — morphing name */
.hero-title {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: clamp(56px, 10.5vw, 124px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 0.92;
  margin-bottom: 28px;
}

.name-rotator--hero {
  position: relative;
  height: 1.9em;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: url(#threshold);
}

.hw {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  text-align: center;
  white-space: nowrap;
  animation: morph-name 8s infinite ease-in-out;
}

.hw:nth-child(1) { animation-delay: 0s; }
.hw:nth-child(2) { animation-delay: 4s; }

/* Nav name — morphing */
.nav-name {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: var(--fg);
  text-decoration: none;
  text-align: center;
}

.name-rotator--nav {
  position: relative;
  height: 1.3em;
  width: 18ch;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: url(#threshold);
}

.nw {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  white-space: nowrap;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  animation: morph-name 8s infinite ease-in-out;
}

.nw:nth-child(1) { animation-delay: 0s; }
.nw:nth-child(2) { animation-delay: 4s; }

@keyframes morph-name {
  0%        { opacity: 0;   filter: blur(20px); transform: translate(-50%,-50%) scale(0.85); }
  8%        { opacity: 1;   filter: blur(0px);  transform: translate(-50%,-50%) scale(1); }
  42%       { opacity: 1;   filter: blur(0px);  transform: translate(-50%,-50%) scale(1); }
  50%       { opacity: 0;   filter: blur(20px); transform: translate(-50%,-50%) scale(1.1); }
  100%      { opacity: 0;   filter: blur(20px); transform: translate(-50%,-50%) scale(0.85); }
}

.hero-tagline {
  font-size: 13px;
  color: var(--dim);
  letter-spacing: 0.1em;
  margin-bottom: 20px;
}

/* ── MORPH TEXT ──────────────────────────── */

.morph-container {
  font-size: clamp(0.85rem, 2.2vw, 1.5rem);
  font-weight: 700;
  filter: url(#threshold);
  user-select: none;
  margin-top: 4px;
}

.word-rotator {
  position: relative;
  height: 1.3em;
  min-width: 14ch;
  display: flex;
  justify-content: center;
  align-items: center;
}

.word {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  color: var(--accent);
  white-space: nowrap;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  animation: rotate-words 18s infinite ease-in-out;
}

.word:nth-child(1) { animation-delay: -2.5s; }
.word:nth-child(2) { animation-delay: 0.5s; }
.word:nth-child(3) { animation-delay: 3.5s; }
.word:nth-child(4) { animation-delay: 6.5s; }
.word:nth-child(5) { animation-delay: 9.5s; }
.word:nth-child(6) { animation-delay: 12.5s; }

@keyframes rotate-words {
  0%         { opacity: 0;   filter: blur(20px); transform: translate(-50%,-50%) scale(0.85); }
  4%         { opacity: 0.6; filter: blur(8px); }
  9%, 13%    { opacity: 1;   filter: blur(0);    transform: translate(-50%,-50%) scale(1); }
  16%        { opacity: 0.6; filter: blur(8px); }
  17%, 100%  { opacity: 0;   filter: blur(20px); transform: translate(-50%,-50%) scale(1.1); }
}

/* Mouse scroll indicator */
.hero-scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--dim);
  transition: color 0.25s;
}

.hero-scroll:hover { color: var(--fg); }

.mouse {
  width: 22px; height: 36px;
  border: 1.5px solid currentColor;
  border-radius: 20px;
  position: relative;
}

.wheel {
  width: 2px; height: 5px;
  background: currentColor;
  border-radius: 2px;
  position: absolute;
  top: 7px; left: 50%;
  transform: translateX(-50%);
  animation: scroll-wheel 1.8s ease-in-out infinite;
}

@keyframes scroll-wheel {
  0%   { transform: translateX(-50%) translateY(0);    opacity: 1; }
  100% { transform: translateX(-50%) translateY(14px); opacity: 0; }
}

.scroll-label {
  font-size: 9px;
  letter-spacing: 0.22em;
}

/* ── ABOUT ───────────────────────────────── */

.about {
  padding: 100px 40px;
  border-bottom: 1px solid var(--border);
}

.about-inner {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 80px;
  max-width: 900px;
}

.section-label {
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--dim);
  padding-top: 5px;
}

.about-text {
  font-size: 14px;
  line-height: 1.9;
  color: rgba(240,240,240,0.72);
  margin-bottom: 20px;
}

.about-skills {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 36px;
}

.about-skills li {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid var(--dimmer);
  color: var(--dim);
  padding: 5px 12px;
  transition: color 0.25s, border-color 0.25s;
}

.about-skills li:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ── PROJECTS ────────────────────────────── */

#projects { padding: 0; }

/* Full-width project */
.project--full {
  border-bottom: 1px solid var(--border);
}

/* Paired row */
.projects-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border);
}

.projects-row .project--half:first-child {
  border-right: 1px solid var(--border);
}

/* Video wrap */
.project-video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0d0d0d;
  overflow: hidden;
  cursor: none;
}

.project-video-wrap video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}

.project-video-wrap:hover video {
  transform: scale(1.02);
}

/* Overlay */
.project-overlay {
  position: absolute; inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8,8,8,0.45);
  transition: background 0.35s, opacity 0.35s;
  pointer-events: none;
}

.project-video-wrap.playing .project-overlay {
  background: transparent;
  opacity: 0;
}

.play-hint {
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--fg);
  opacity: 0;
  transition: opacity 0.2s;
}

.project-video-wrap:hover .play-hint { opacity: 1; }

/* Video controls — son + plein écran */
.video-controls {
  position: absolute;
  bottom: 14px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
  z-index: 3;
}

.project-video-wrap:hover .video-controls,
.project-video-wrap.playing .video-controls {
  opacity: 1;
  pointer-events: auto;
}

.btn-sound,
.btn-fs {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(240,240,240,0.7);
  background: rgba(8,8,8,0.65);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 5px 11px;
  cursor: none;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  backdrop-filter: blur(6px);
}

.btn-sound:hover,
.btn-fs:hover {
  color: var(--fg);
  border-color: rgba(255,255,255,0.35);
}

.btn-sound.on {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(48,60,40,0.3);
}

/* Info bar — full-width layout */
.project-info {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 40px;
  gap: 32px;
  border-top: 1px solid var(--border);
}

.project-meta-left {
  display: flex;
  align-items: baseline;
  gap: 18px;
  flex-shrink: 0;
}

.project-num {
  font-size: 10px;
  color: var(--dim);
  letter-spacing: 0.12em;
  transition: color 0.3s;
}

.project:hover .project-num { color: var(--accent); }

.project-title {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: clamp(14px, 2vw, 20px);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.project-meta-right { text-align: right; }

.project-type {
  font-size: 10px;
  color: var(--dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.project-tools {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}

.project-tools li {
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--dim);
  border: 1px solid var(--dimmer);
  padding: 3px 8px;
  text-transform: uppercase;
  transition: color 0.25s, border-color 0.25s;
}

.project:hover .project-tools li {
  color: var(--fg);
  border-color: rgba(255,255,255,0.18);
}

/* Info bar — half-width override */
.project--half .project-info {
  flex-direction: column;
  gap: 10px;
  padding: 18px 22px;
}

.project--half .project-meta-right { text-align: left; }
.project--half .project-tools { justify-content: flex-start; }

.project--half .project-title {
  font-size: clamp(12px, 1.5vw, 16px);
}

/* ── FOOTER ──────────────────────────────── */

#contact { padding: 80px 40px 48px; }

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
  gap: 40px;
}

.footer-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.18em;
  margin-bottom: 8px;
}

.footer-role {
  font-size: 10px;
  color: var(--dim);
  letter-spacing: 0.12em;
}

.footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
}

.footer-link {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--dim);
  text-decoration: none;
  transition: color 0.25s;
  position: relative;
}

.footer-link::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 1px;
  background: var(--fg);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.28s ease;
}

.footer-link:hover { color: var(--fg); }
.footer-link:hover::after { transform: scaleX(1); transform-origin: left; }

.footer-copy {
  font-size: 9px;
  color: var(--dimmer);
  letter-spacing: 0.1em;
}

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */

/* ── Appareils touch : pas de curseur custom ── */
@media (hover: none) {
  body { cursor: auto; }
  .cursor-dot,
  .cursor-ring { display: none; }

  /* Contrôles vidéo toujours visibles sur touch */
  .video-controls {
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  /* Hint play inutile sur touch */
  .play-hint { display: none; }
}

/* ── Tablette paysage — 1024px ─────────────── */
@media (max-width: 1024px) {
  .about-inner { gap: 48px; }
}

/* ── Tablette portrait — 768px ─────────────── */
@media (max-width: 768px) {
  /* Nav */
  #nav {
    display: flex;
    justify-content: space-between;
    padding: 0 24px;
  }
  .nav-available { display: none; }
  .nav-links { gap: 20px; }

  /* Hero */
  .hero { padding: calc(var(--nav-h) + 48px) 24px 80px; }
  .hero-title { font-size: clamp(40px, 9vw, 100px); }
  .word-rotator { min-width: 0; width: 100%; }

  /* About */
  .about { padding: 80px 24px; }
  .about-inner { grid-template-columns: 1fr; gap: 28px; }

  /* Projects — 1 colonne */
  .projects-row { grid-template-columns: 1fr; }
  .projects-row .project--half:first-child {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .project--half .project-info { flex-direction: column; gap: 10px; }
  .project--half .project-meta-right { text-align: left; }
  .project--half .project-tools { justify-content: flex-start; }

  /* Footer */
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 28px; }
  .footer-right { align-items: flex-start; }
  #contact { padding: 72px 24px 40px; }
}

/* ── Mobile — 600px ──────────────────────── */
@media (max-width: 600px) {
  :root { --nav-h: 50px; }

  /* Nav */
  #nav { padding: 0 20px; }
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 9px; letter-spacing: 0.12em; }
  .name-rotator--nav { width: auto; min-width: 0; }
  .nav-name { font-size: 13px; }

  /* Hero */
  .hero { padding: calc(var(--nav-h) + 36px) 20px 80px; }
  .hero-title { font-size: clamp(36px, 9vw, 72px); }
  .hero-tagline { font-size: 11px; letter-spacing: 0.05em; }
  .morph-container { font-size: clamp(0.7rem, 3.5vw, 1rem); }
  .hero-scroll { bottom: 28px; }

  /* About */
  .about { padding: 60px 20px; }
  .about-text { font-size: 13px; }
  .about-skills li { font-size: 9px; padding: 4px 10px; }

  /* Projects */
  .project-info { padding: 16px 20px; }
  .project--full .project-info {
    flex-direction: column;
    gap: 10px;
  }
  .project--full .project-meta-right { text-align: left; }
  .project--full .project-tools { justify-content: flex-start; }
  .project-title { font-size: clamp(13px, 3.5vw, 18px) !important; }
  .project-type { font-size: 9px; }
  .project-tools li { font-size: 8px; padding: 3px 7px; }

  /* Contrôles vidéo */
  .video-controls { left: 10px; right: 10px; bottom: 10px; }
  .btn-sound, .btn-fs { font-size: 8px; padding: 4px 8px; }

  /* Footer */
  #contact { padding: 56px 20px 36px; }
  .footer-name { font-size: 13px; }
  .footer-role { font-size: 9px; }
  .footer-link { font-size: 9px; }
}

/* ── Petit mobile — 480px ───────────────── */
@media (max-width: 480px) {
  :root { --nav-h: 48px; }

  /* Nav */
  #nav { padding: 0 16px; }
  .nav-name { font-size: 12px; }
  .nav-links a { font-size: 8px; letter-spacing: 0.08em; }

  /* Hero */
  .hero { padding: calc(var(--nav-h) + 28px) 16px 72px; }
  .hero-title { font-size: clamp(30px, 8.5vw, 56px); }
  .name-rotator--hero { height: 2em; }
  .hero-tagline { font-size: 10px; }
  .morph-container { font-size: clamp(0.65rem, 3vw, 0.9rem); }

  /* About */
  .about { padding: 48px 16px; }
  .about-text { font-size: 12px; line-height: 1.75; }

  /* Projects */
  .project-info { padding: 14px 16px; }

  /* Footer */
  #contact { padding: 48px 16px 32px; }
  .footer-inner { gap: 24px; }
}
