/* ============================================================
   Guillaume Lacroix — spirituel · fullscreen, carousel 3D, un
   univers par réalisation
   ============================================================ */

:root {
  /* Univers par défaut — surchargé par la card centrée */
  --bg: #07070d;
  --bg-soft: #0a0a12;
  --accent: #7b2cbf;
  --accent-2: #00b4d8;
  --text: #f5f5f4;
  --text-soft: #a7a9aa;
  --text-muted: #757575;
  --border: rgba(255, 255, 255, 0.08);
  --font-display: 'Cabinet Grotesk', sans-serif;
  --display-weight: 800;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --theme-transition: 0.7s;
}

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

html, body {
  height: 100%;
  /* clip (et non hidden) : interdit aussi le scroll programmatique
     déclenché par le focus des cards latérales */
  overflow: hidden;
  overflow: clip;
}

body {
  height: 100svh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  color: var(--text);
  font-family: 'General Sans', system-ui, sans-serif;
  font-weight: 300;
  transition:
    background-color var(--theme-transition) var(--ease),
    color var(--theme-transition) var(--ease);
}

::selection { background: var(--accent); color: #fff; }

/* ---------- fond ambiant ---------- */

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.glow {
  position: absolute;
  width: 55vmax;
  height: 55vmax;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.28;
  transition: background-color var(--theme-transition) var(--ease);
}

.glow-a {
  background-color: var(--accent);
  top: -20vmax;
  right: -12vmax;
}

.glow-b {
  background-color: var(--accent-2);
  bottom: -25vmax;
  left: -15vmax;
  opacity: 0.2;
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- header ---------- */

.top {
  position: relative;
  z-index: 10;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(14px, 2.4vh, 24px) clamp(20px, 5vw, 64px);
}

.brand {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
}

.brand-mark { color: var(--accent-2); transition: color var(--theme-transition) var(--ease); }

/* ---------- CTA ---------- */

.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-family: 'General Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px -12px var(--accent);
}

.cta-arrow { transition: transform 0.3s var(--ease); }
.cta:hover .cta-arrow { transform: translateX(4px); }

.cta-big {
  font-size: clamp(14px, 1.6vw, 17px);
  padding: 14px 28px;
}

/* ---------- layout principal ---------- */

main {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 clamp(20px, 5vw, 64px);
}

.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color var(--theme-transition) var(--ease);
}

/* ---------- hero ---------- */

.hero {
  flex: none;
  text-align: center;
  padding-top: clamp(4px, 1.5vh, 18px);
}

.hero-title {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: clamp(26px, 3.4vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin-top: 12px;
  transition: font-family var(--theme-transition) var(--ease);
}

.hero-em {
  font-style: normal;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-sub {
  margin: 10px auto 0;
  max-width: 640px;
  font-size: clamp(13px, 1.2vw, 16px);
  font-weight: 400;
  letter-spacing: 0.006em;
  line-height: 1.6;
  color: color-mix(in srgb, var(--text) 82%, transparent);
  transition: color var(--theme-transition) var(--ease);
}

/* ---------- carousel 3D ---------- */

.stage-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.stage {
  flex: 1;
  min-height: 0;
  position: relative;
  perspective: 1600px;
  touch-action: pan-y;
}

.scene {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  will-change: transform;
}

.work-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(480px, 78vw, 92vh);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  background: color-mix(in srgb, var(--text) 5%, var(--bg));
  will-change: transform;
  transition:
    transform 0.65s var(--ease),
    opacity 0.65s var(--ease),
    filter 0.65s var(--ease),
    box-shadow 0.65s var(--ease),
    border-color 0.65s var(--ease),
    background-color var(--theme-transition) var(--ease);
}

.work-card.is-active {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow:
    0 30px 80px -30px color-mix(in srgb, var(--accent) 60%, transparent),
    0 12px 32px -16px rgba(0, 0, 0, 0.5);
}

.work-card:not(.is-active) {
  filter: brightness(0.55) saturate(0.8);
}

.work-visual {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--card-bg);
}

.work-shot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.work-num {
  position: absolute;
  top: 10px;
  left: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 4px 8px;
  border-radius: 999px;
}

.work-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}

.work-logo {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.work-logo img {
  max-width: 74%;
  max-height: 74%;
  object-fit: contain;
  display: block;
}

.work-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.work-name {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: clamp(16px, 1.5vw, 20px);
  letter-spacing: -0.01em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: font-family var(--theme-transition) var(--ease);
}

.work-activity {
  font-size: 12.5px;
  color: var(--text-soft);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--theme-transition) var(--ease);
}

.work-arrow {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  color: var(--text-muted);
  transition: transform 0.3s var(--ease), color 0.3s var(--ease);
}

.work-card.is-active:hover .work-arrow {
  color: var(--accent);
  transform: translate(3px, -3px);
}

/* ---------- navigation ---------- */

.carousel-nav {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 3vw, 40px);
  padding: clamp(6px, 1.4vh, 14px) 0;
}

.nav-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--text) 6%, transparent);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  transition:
    transform 0.25s var(--ease),
    border-color 0.25s var(--ease),
    color var(--theme-transition) var(--ease),
    background-color var(--theme-transition) var(--ease);
}

.nav-btn:hover {
  transform: scale(1.08);
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
}

.nav-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 220px;
}

.nav-counter {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.25em;
  color: var(--text-muted);
  transition: color var(--theme-transition) var(--ease);
}

.nav-ambiance {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-soft);
  text-align: center;
  transition: color var(--theme-transition) var(--ease);
}

/* ---------- footer ---------- */

.bottom {
  position: relative;
  z-index: 1;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(10px, 2vh, 20px) clamp(20px, 5vw, 64px);
}

.foot-credit {
  font-size: 12px;
  color: var(--text-muted);
  transition: color var(--theme-transition) var(--ease);
}

.foot-hint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: right;
  transition: color var(--theme-transition) var(--ease);
}

/* ---------- modal contact ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

/* une règle d'auteur (.modal { display: grid }) l'emporte toujours sur
   la règle [hidden] { display: none } du navigateur, même à spécificité
   égale — sans ceci la modal reste affichée (invisible) en permanence
   et intercepte tous les clics de la page */
.modal[hidden] {
  display: none;
}

.modal.open { opacity: 1; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-card {
  position: relative;
  width: min(480px, 100%);
  max-height: calc(100svh - 40px);
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: clamp(24px, 4vw, 36px);
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.6);
  transform: translateY(14px) scale(0.98);
  transition:
    transform 0.35s var(--ease),
    background-color var(--theme-transition) var(--ease);
}

.modal.open .modal-card { transform: none; }

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-soft);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}

.modal-close:hover { color: var(--text); border-color: var(--accent); }

.modal-title {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: -0.02em;
}

.modal-sub {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-soft);
}

#contact-form {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.field input,
.field textarea {
  font-family: 'General Sans', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 300;
  color: var(--text);
  background: color-mix(in srgb, var(--text) 5%, transparent);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 14px;
  outline: none;
  resize: vertical;
  transition: border-color 0.25s var(--ease);
}

.field input:focus,
.field textarea:focus {
  border-color: color-mix(in srgb, var(--accent) 65%, transparent);
}

.field ::placeholder { color: var(--text-muted); }

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.modal-send {
  justify-content: center;
  margin-top: 4px;
}

.modal-send:disabled {
  opacity: 0.6;
  pointer-events: none;
}

.form-status {
  min-height: 18px;
  font-size: 13px;
  color: var(--text-soft);
  text-align: center;
}

.form-status.error { color: #e5484d; }

.modal-success {
  margin-top: 26px;
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: clamp(19px, 2.4vw, 24px);
  line-height: 1.45;
  text-align: center;
}

/* ---------- thème clair (univers clairs) ---------- */

body.light { --border: rgba(0, 0, 0, 0.1); }
body.light .glow { opacity: 0.4; }
body.light .glow-b { opacity: 0.3; }
body.light ::selection { color: #fff; }

/* ---------- responsive ---------- */

@media (max-width: 720px) {
  .cta { font-size: 13px; padding: 10px 16px; }
  .glow { filter: blur(90px); }
  .hero-sub { display: none; }
  .work-card { width: min(480px, 84vw); }
  .nav-status { min-width: 0; }
  .nav-ambiance { display: none; }
  .bottom { justify-content: center; }
  .foot-hint { display: none; }
}

@media (max-height: 640px) {
  .hero-sub { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; }
  .scene { transform: none !important; }
}
