/* ────────────────────────────────────────────────────────────────
   AH studio — identité propre : fond encre bleu-nuit, accent ambre
   + menthe, serif "Fraunces" pour les titres, "Plus Jakarta Sans"
   pour le texte courant, "IBM Plex Mono" pour les touches techniques.
   Volontairement différent du site AH Locker (rouge/noir, Manrope +
   JetBrains Mono) : autre palette, autre pairing typographique,
   autre ambiance (ici plus chaleureuse/atelier que sécurité/coffre).
   ──────────────────────────────────────────────────────────────── */

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

:root {
  --bg: #0b0f14;
  --bg-alt: #10161d;
  --surface: #141b23;
  --surface-border: rgba(255, 255, 255, 0.08);
  --ink: #eef2f0;
  --ink-dim: #9aa7b0;
  --ink-faint: #5c6a73;
  --accent: #ffb648;
  --accent-ink: #241604;
  --accent-2: #5eead4;
  --container-max: 1100px;
  --radius: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

.container {
  width: min(90%, var(--container-max));
  margin-inline: auto;
}

.mono-tag {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--accent-2);
  margin-bottom: 0.9rem;
}

/* ── Fond ambiant (remplace l'ancienne photo Unsplash) ───────────── */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient-grid {
  position: absolute;
  inset: -1px;
  background-image: radial-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 90%);
}

.ambient-glow {
  position: absolute;
  width: 46vw;
  height: 46vw;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.28;
  animation: drift 22s ease-in-out infinite;
}

.ambient-glow--amber {
  background: var(--accent);
  top: -12vw;
  left: -8vw;
}

.ambient-glow--teal {
  background: var(--accent-2);
  bottom: -18vw;
  right: -10vw;
  animation-duration: 26s;
  animation-delay: -8s;
}

@keyframes drift {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(4vw, 3vw) scale(1.08);
  }
}

/* ── Header ───────────────────────────────────────────────────────── */
.header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  padding: 1.15rem 0;
  background: linear-gradient(to bottom, rgba(11, 15, 20, 0.9), rgba(11, 15, 20, 0));
  backdrop-filter: blur(6px);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  row-gap: 0.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.3rem;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.logo img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

.logo em {
  font-style: normal;
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 2.2rem;
}

.nav a {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.94rem;
  color: var(--ink);
  position: relative;
  padding-bottom: 3px;
}

.nav-index {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--accent-2);
}

.nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s var(--ease);
}

.nav a:hover::after {
  width: 100%;
}

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 7.5rem;
  z-index: 1;
}

.hero-grid {
  display: flex;
  flex-direction: column;
}

.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--accent-2);
  margin-bottom: 1.4rem;
}

.hero-title {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 16ch;
  margin-bottom: 1.6rem;
}

/* Uniquement les 3 lignes de premier niveau (reveal-1/2/3) — pas les spans
   imbriqués (mot tapé + curseur), sinon chacun devient sa propre ligne. */
.hero-title > span {
  display: block;
}

.hero-typed-wrap {
  color: var(--accent);
  font-style: italic;
  /* Réserve toujours la place de 2 lignes (le mot le plus long force un
     retour à la ligne, le plus court non) pour que le reste du hero ne
     bouge jamais pendant l'animation de la machine à écrire. */
  min-height: calc(2 * 1.08em);
}

.hero-typed-inline {
  display: inline-block;
}

.hero-typed {
  border-bottom: 3px solid rgba(255, 182, 72, 0.35);
}

.hero-caret {
  display: inline-block;
  width: 3px;
  height: 0.85em;
  background: var(--accent);
  margin-left: 4px;
  vertical-align: -0.1em;
  animation: blink 0.9s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.hero-sub {
  max-width: 46ch;
  color: var(--ink-dim);
  font-size: 1.08rem;
  margin-bottom: 2.2rem;
}

.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.9rem 1.7rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.96rem;
  transition:
    transform 0.25s var(--ease),
    box-shadow 0.25s var(--ease),
    background 0.25s var(--ease);
}

.btn svg {
  width: 17px;
  height: 17px;
  transition: transform 0.25s var(--ease);
}

.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 10px 30px rgba(255, 182, 72, 0.18);
}

.btn.primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(255, 182, 72, 0.28);
}

.btn.primary:hover svg {
  transform: translateX(3px);
}

.btn.secondary {
  background: transparent;
  border: 1px solid var(--surface-border);
  color: var(--ink);
}

.btn.secondary:hover {
  border-color: var(--accent-2);
  color: var(--accent-2);
  transform: translateY(-3px);
}

.stack-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  list-style: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  color: var(--ink-faint);
}

.stack-row li {
  position: relative;
  padding-left: 1.05rem;
}

.stack-row li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  translate: 0 -50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-2);
}

.scroll-cue {
  position: absolute;
  bottom: 2.4rem;
  left: 50%;
  translate: -50% 0;
  width: 22px;
  height: 36px;
  border: 1.5px solid var(--surface-border);
  border-radius: 20px;
  display: flex;
  justify-content: center;
  padding-top: 7px;
}

.scroll-cue span {
  width: 3px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent-2);
  animation: scroll-cue 1.6s ease-in-out infinite;
}

@keyframes scroll-cue {
  0% {
    opacity: 0;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* ── Reveal au chargement (hero) ─────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  animation: reveal-up 0.8s var(--ease) forwards;
}

.reveal-1 {
  animation-delay: 0.05s;
}
.reveal-2 {
  animation-delay: 0.16s;
}
.reveal-3 {
  animation-delay: 0.27s;
}
.reveal-4 {
  animation-delay: 0.4s;
}

@keyframes reveal-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Reveal au scroll ─────────────────────────────────────────────── */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.7s var(--ease),
    transform 0.7s var(--ease);
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Projects ─────────────────────────────────────────────────────── */
.projects-section {
  position: relative;
  z-index: 1;
  padding: 7rem 0 5rem;
}

.section-head {
  max-width: 42ch;
  margin-bottom: 3.2rem;
}

.section-head h2 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: clamp(1.9rem, 3.6vw, 2.7rem);
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

.section-head p {
  color: var(--ink-dim);
}

.projects-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--surface-border);
}

.project-card {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  padding: 1.9rem 1.4rem;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--surface-border);
  transition: background 0.3s var(--ease);
  position: relative;
}

.project-card:hover {
  background: var(--surface);
}

.project-index {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  color: var(--ink-faint);
  flex-shrink: 0;
  width: 2ch;
  transition: color 0.3s var(--ease);
}

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

.project-body {
  flex: 1;
  min-width: 0;
}

.project-heading {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.project-heading h3 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 1.4rem;
}

.project-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  border: 1px solid rgba(255, 182, 72, 0.35);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
}

.project-body p {
  color: var(--ink-dim);
  font-size: 0.95rem;
  max-width: 56ch;
  margin-bottom: 0.7rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-tags span {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--ink-faint);
  background: var(--bg-alt);
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
}

.project-arrow {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-dim);
  transition:
    transform 0.3s var(--ease),
    border-color 0.3s var(--ease),
    color 0.3s var(--ease),
    background 0.3s var(--ease);
}

.project-arrow svg {
  width: 17px;
  height: 17px;
}

.project-card:hover .project-arrow {
  transform: translate(3px, -3px);
  border-color: var(--accent);
  color: var(--accent-ink);
  background: var(--accent);
}

/* ── Contact ──────────────────────────────────────────────────────── */
.contact-section {
  position: relative;
  z-index: 1;
  padding: 6rem 0 7rem;
}

.contact-container {
  max-width: 620px;
  text-align: left;
}

.contact-container h2 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: clamp(1.9rem, 3.6vw, 2.7rem);
  margin-bottom: 0.9rem;
  letter-spacing: -0.01em;
}

.contact-container p {
  color: var(--ink-dim);
  margin-bottom: 2rem;
  font-size: 1.05rem;
}

.contact-btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.9rem;
}

/* ── Footer ───────────────────────────────────────────────────────── */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--surface-border);
  padding: 1.6rem 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--ink-faint);
}

.footer .mono-tag {
  margin-bottom: 0;
  color: var(--ink-faint);
}

.social-links {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.social-link {
  display: inline-flex;
  color: var(--ink-faint);
  transition: color 0.2s ease, transform 0.2s ease;
}

.social-link svg {
  width: 18px;
  height: 18px;
}

.social-link:hover {
  color: var(--ink);
  transform: translateY(-2px);
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .logo {
    font-size: 1.05rem;
    gap: 0.45rem;
  }
  .logo img {
    width: 34px;
    height: 34px;
  }
  .nav {
    gap: 0.85rem;
  }
  .nav a {
    font-size: 0.85rem;
  }
  .nav-index {
    display: none;
  }
  .hero-title {
    max-width: none;
  }
  .project-card {
    flex-wrap: wrap;
    gap: 1rem;
  }
  .project-arrow {
    margin-left: auto;
  }
}

/* ── Accessibilité : réduction de mouvement ──────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .ambient-glow,
  .hero-caret,
  .scroll-cue span {
    animation: none;
  }
  .reveal {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .reveal-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
