/* RESET */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Montserrat", sans-serif;
  background: #0f0f0f;
  color: #e5e5e5;
  scroll-behavior: smooth;
}

/* NAVBAR */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px;
  padding: 20px 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  z-index: 100;
}

.navbar .logo {
  display: flex;
  align-items: center;
  /* keep a reasonable max width container for the logo */
  max-width: auto;
}

/* Constrain the logo image so it never overflows the navbar */
.navbar .logo img {
  display: block;
  width: auto;
  max-height: 200px; /* fits within the navbar's 80px height and vertical padding */
  height: auto;
}

.navbar ul {
  display: flex;
  gap: 30px;
  list-style: none;
}

.navbar a {
  text-decoration: none;
  color: #e5e5e5;
  font-weight: 500;
  transition: 0.3s;
  font-size: 1.4rem;
}

.navbar a:hover {
  color: #8b5cf6;
  transition: ease-in-out 0.2s;
}

/* HERO SECTION */
.hero {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 20px;
  background: radial-gradient(circle at top, #1a1a1a, #000000);
}

.hero h1 {
  font-size: 4rem;
  background: linear-gradient(90deg, #8b5cf6, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h3 {
  font-size: 1.6rem;
  background: linear-gradient(90deg, #8b5cf6, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero h2 {
  font-size: 1.6rem;
  margin-top: 10px;
  color: #bbbbbb;
}

.hero-subtext {
  margin-top: 20px;
  color: #999999;
}

.cta-btn {
  display: inline-block;
  margin-top: 30px;
  padding: 12px 30px;
  border: 1.5px solid #8b5cf6;
  border-radius: 50px;
  text-decoration: none;
  color: #e5e5e5;
  transition: 0.4s;
}

.cta-btn:hover {
  background: #8b5cf6;
  color: white;
  transition: ease-in-out 0.2s;
  transform: translateY(-2px) scale(1.04);
}

/* PROJECTS */
.projects {
  padding: 120px 50px;
  text-align: center;
}

.projects h2 {
  font-size: 2.4rem;
  margin-bottom: 50px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 0.8fr);
  gap: 30px;
}

.project-card {
  padding: 25px;
  background: #1b1b1b;
  border-radius: 12px;
  border: 1.5px solid #3a3a46;
  transition: 0.3s;
  overflow: hidden;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 18px rgba(139, 92, 246, 0.4);
}

/* Ensure project images stay inside the card */
.project-card img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin-top: 12px;
}

/* ABOUT */
.about {
  padding: 120px 50px;
  text-align: center;
}

.about h2 {
  font-size: 2.4rem;
  margin-bottom: 50px;
}

.about-content {
  max-width: 1000px;
  margin: 0 auto;
}

.about-intro {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #bbbbbb;
  padding: 30px;
  background: rgba(139, 92, 246, 0.05);
  border-left: 3px solid #8b5cf6;
  border-radius: 8px;
  text-align: left;
}

/* CONTACT */
.contact {
  padding: 120px;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 0.7fr;
  gap: 60px;
}

.contact h2 {
  font-size: 2.4rem;
  margin-bottom: 40px;
}

/* FORM CARD */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 40px;
  border-radius: 14px;
  background: #131318;
  border: 1px solid #22222a;
  box-shadow: 0 0 18px rgba(139, 92, 246, 0.05);
  position: relative;
}

/* Floating label fields */
.field {
  position: relative;
}

.field input,
.field textarea {
  width: 100%;
  background: #0f0f14;
  border: 1px solid #252530;
  padding: 14px;
  vertical-align: top;
  border-radius: 8px;
  color: #ddd;
  font-size: 1rem;
  transition: border 0.3s;
}

.field input:focus,
.field textarea:focus {
  border-color: #8b5cf6;
}

/* Textarea specific: disable manual resize and keep content starting at top */
.field textarea {
  resize: none;
  overflow: auto;
}

/* Place the floating label for textarea at the top-left (like inputs) */
.field textarea + label {
  left: 14px !important;
  right: auto !important;
  top: 14px !important;
  transform: none;
  text-align: left !important;
}

/* When textarea is focused or has content, keep the label small and pinned to top-left */
.field textarea:focus + label,
.field textarea:not(:placeholder-shown) + label {
  top: -8px !important;
  left: 14px !important;
  right: auto !important;
  font-size: 0.75rem !important;
  background: #131318 !important;
  padding: 0 6px !important;
  color: #999cff !important;
}

.field label {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: #e5e5e5;
  font-size: 0.9rem;
  pointer-events: none;
  transition: 0.2s;
  display: inline-block;
  white-space: nowrap; /* prevent label wrapping onto multiple lines */
  z-index: 2; /* keep label above the textarea content */
}

.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.field textarea:focus + label,
.field textarea:not(:placeholder-shown) + label {
  top: -8px;
  transform: none; /* remove the default translateY so label pins correctly */
  font-size: 0.75rem;
  background: #131318;
  padding: 0 6px;
  color: #999cff;
}

.error {
  color: #ff6a6a;
  font-size: 0.75rem;
  margin-top: 4px;
}

a {
  color: white;
  text-decoration: none;
}

/* Button */
.btn-primary {
  margin-top: 10px;
  padding: 14px 26px;
  border-radius: 50px;
  background: #222;
  border: 1.5px solid #8b5cf6;
  color: white;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  
}

.btn-primary:hover {
  background: #8b5cf6;
  border-color: #8b5cf6;
  transition: ease-in-out 0.2s;
  transform: translateY(-2px) scale(1.02);
}

.btn-primary .btn-loader {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 26px;
  height: 26px;
  opacity: 0;
  animation: spin 1s linear infinite;
}

.btn-primary.sending .btn-content {
  opacity: 0;
}

.btn-primary.sending .btn-loader {
  opacity: 1;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Toast */
.form-toast {
  opacity: 0;
  background: #1f1f27;
  padding: 12px 22px;
  border-radius: 8px;
  border: 1.5px solid #3a3a46;
  color: #aaffaa;
  margin-top: 14px;
  transform: translateY(10px);
  transition: 0.3s;
}

.form-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Form actions: align submit button to the right */
.contact-form .actions {
  position: absolute;
  right: -155px; /* rapproché du bord droit */
  bottom: 35px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}

/* Sur petits écrans, garder le comportement normal (empilement) */
@media (max-width: 600px) {
  .contact-form .actions {
    position: static;
    justify-content: center;
    margin-top: 6px;
  }
}

/* CONTACT — ASIDE PREMIUM */
.contact-aside {
  padding: 40px;
  border-radius: 14px;
  background: #141418;
  border: 1.5px solid #22222a;
  box-shadow: 0 0 18px rgba(139, 92, 246, 0.05);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Title */
.aside-title {
  font-size: 1.6rem;
  font-weight: 600;
  background: linear-gradient(90deg, #8b5cf6, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Subtitle */
.aside-text {
  opacity: 0.8;
  margin-top: -10px;
  font-size: 0.95rem;
  line-height: 1.4;
}

.aside-divider {
  width: 100%;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, #8b5cf6, #ec4899, transparent);
  margin: 8px 0 10px;
  opacity: 0.95;
}

/* List styling */
.aside-infos {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.aside-infos li {
  display: grid;
  /* layout: icon at left spanning two rows, label on the top-right, value on the bottom-right */
  grid-template-columns: 32px 1fr;
  grid-template-rows: auto auto;
  grid-template-areas:
    "icon label"
    "icon value";
  gap: 8px 12px;
}

.aside-infos .icon {
  font-size: 1.3rem;
  opacity: 0.8;
  grid-area: icon;
}

.info-label {
  font-size: 0.85rem;
  opacity: 0.55;
  grid-area: label;
}

.info-value {
  font-size: 1rem;
  font-weight: 500;
  color: #e5e5e5;
  grid-area: value;
  margin-top: 2px;
}

/* Telephone link inside aside: keep on one line and remove underline */
.aside-infos .info-value a {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.aside-infos .info-value a:hover {
  color: #8b5cf6;
  text-decoration: underline;
}

/* CTA */
.aside-cta {
  margin-top: 10px;
  padding: 12px 20px;
  border-radius: 50px;
  background: #1a1a23;
  border: 1.5px solid #8b5cf6;
  display: inline-block;
  text-align: center;
  color: #e5e5ff;
  text-decoration: none;
  font-weight: 500;
  transition: 0.2s ease-in-out;
}

.aside-cta:hover {
  background: #8b5cf6;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.35);
  text-decoration: none;
}

/* FOOTER */
.footer {
  text-align: center;
  padding: 12px;
  background: #0a0a0a;
  border-top: 1.5px solid rgba(255, 255, 255, 0.05);
  margin-top: 80px;
  width: 100%;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
}


/* BUBBLE TRAIL */
/* main bubble hidden */
/* BUBBLE TRAIL - optimized (use CSS variables + transform) */
/* BUBBLE TRAIL - optimized (use CSS variables + transform) */
.bubble {
  position: fixed;
  left: 0;
  top: 0;
  --x: 0;
  --y: 0;
  width: 35px;
  height: 35px;
  background: #8b5cf6;
  border-radius: 50%;
  pointer-events: none;
  mix-blend-mode: difference;
  opacity: 0.75;
  z-index: 9999;
  transform: translate3d(calc(var(--x) * 1px - 50%), calc(var(--y) * 1px - 50%), 0);
  will-change: transform, opacity;
  transition: opacity 300ms linear;
}

/* sizes / opacities dégressifs */
.bubble:nth-child(1) { transform-origin: center; width: 35px; height: 35px; }
.bubble:nth-child(2) { opacity: 0.75; transform-origin: center; transform: translate3d(calc(var(--x) * 1px - 50%), calc(var(--y) * 1px - 50%), 0) scale(0.95); }
.bubble:nth-child(3) { opacity: 0.58; transform-origin: center; transform: translate3d(calc(var(--x) * 1px - 50%), calc(var(--y) * 1px - 50%), 0) scale(0.84); }
.bubble:nth-child(4) { opacity: 0.42; transform-origin: center; transform: translate3d(calc(var(--x) * 1px - 50%), calc(var(--y) * 1px - 50%), 0) scale(0.75); }
.bubble:nth-child(5) { opacity: 0.32; transform-origin: center; transform: translate3d(calc(var(--x) * 1px - 50%), calc(var(--y) * 1px - 50%), 0) scale(0.65); }
.bubble:nth-child(6) { opacity: 0.24; transform-origin: center; transform: translate3d(calc(var(--x) * 1px - 50%), calc(var(--y) * 1px - 50%), 0) scale(0.55); }


/* FADE-IN ANIMATION */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Scroll reveal */
@media (min-width: 1px) {
  body {
    overflow-x: hidden;
  }
}