/* ============================================
   STYLES — Ja Face Painting — Direction Confetti
   Mobile first. Tokens from design-tokens.css.
   ============================================ */

/* --- Global overflow guard --- */
html {
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
}

/* --- Header --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  padding: var(--space-sm) 0;
  transition: background-color var(--duration-normal) var(--ease-out),
              padding var(--duration-normal) var(--ease-out);
}

.header--scrolled {
  background-color: rgba(255, 249, 242, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: var(--space-xs) 0;
  box-shadow: 0 1px 8px rgba(45, 43, 63, 0.06);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header__logo img {
  height: 64px;
  width: auto;
  padding: var(--space-xs);
}

.header__right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.header__phone {
  display: none;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  color: var(--color-accent);
  transition: color var(--duration-fast) var(--ease-out);
}

.header__phone:hover,
.header__phone:focus-visible {
  color: var(--color-accent-hover);
}

.header__menu-btn {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-xs);
}

.header__menu-line {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--color-text);
  border-radius: 1px;
  transition: transform var(--duration-normal) var(--ease-in-out),
              opacity var(--duration-normal) var(--ease-in-out);
}

.header__menu-btn[aria-expanded="true"] .header__menu-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.header__menu-btn[aria-expanded="true"] .header__menu-line:nth-child(2) {
  opacity: 0;
}

.header__menu-btn[aria-expanded="true"] .header__menu-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- Mobile Nav --- */
.mobile-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: calc(var(--z-header) - 1);
  background-color: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-normal) var(--ease-out),
              visibility var(--duration-normal) var(--ease-out);
}

.mobile-nav--open {
  opacity: 1;
  visibility: visible;
}

.mobile-nav__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  text-align: center;
}

.mobile-nav__link {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: var(--fw-semibold);
  color: var(--color-text);
  transition: color var(--duration-fast) var(--ease-out);
}

.mobile-nav__link:hover,
.mobile-nav__link:focus-visible {
  color: var(--color-accent);
}

/* --- Hero --- */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: stretch;
  padding-top: 80px;
  padding-bottom: var(--space-xl);
  overflow: hidden;
  position: relative;
}

.hero__inner {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.hero__media {
  height: 30vh;
  min-height: 200px;
  overflow: hidden;
  order: -1;
  border-radius: 60% 40% 55% 45% / 50% 60% 40% 50%;
  margin: var(--space-sm);
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.hero__text {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-lg) 0 var(--space-xl);
}

.hero__title {
  font-size: var(--fs-hero);
}

.hero__accroche {
  color: var(--color-text-muted);
  font-size: var(--fs-body);
  max-width: 45ch;
}

/* --- Confetti (hero only) --- */
.confetti-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.hero__inner {
  position: relative;
  z-index: 1;
}

.confetti {
  position: absolute;
  opacity: 0.5;
  animation: confetti-fall linear infinite;
}

.confetti--circle {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.confetti--diamond {
  width: 11px;
  height: 11px;
  border-radius: 2px;
}

.confetti--star {
  width: 16px;
  height: 16px;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

@keyframes confetti-fall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 0; }
  8% { opacity: 0.5; }
  92% { opacity: 0.5; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* --- Services --- */
.services__inner {
  display: flex;
  flex-direction: column;
}

.service {
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--color-border);
}

.service:first-child {
  border-top: 1px solid var(--color-border);
}

.service__name {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw + 0.5rem, 3rem);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-heading);
  margin-bottom: var(--space-xs);
  overflow-wrap: break-word;
  word-break: break-word;
}

.service__name--rose { color: var(--color-accent); }
.service__name--violet { color: var(--color-violet); }
.service__name--emeraude { color: var(--color-emeraude); }

.service__desc {
  color: var(--color-text-muted);
  font-size: var(--fs-body);
}

/* --- Split sections (Fêtes / Événements) --- */
.split__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.split__media {
  overflow: hidden;
  border-radius: var(--radius-md);
}

.split__media img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.split__text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-md);
}

.split__title {
  font-size: var(--fs-h2);
}

.split__body {
  color: var(--color-text-muted);
  font-size: var(--fs-body);
}

/* --- À propos --- */
.about__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.about__title {
  font-size: var(--fs-h2);
  text-align: center;
}

.about__grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.about__grid p {
  color: var(--color-text-muted);
}

/* --- Galerie --- */
.galerie__title {
  font-size: var(--fs-h2);
  text-align: center;
  margin-bottom: var(--space-xl);
}

.galerie__grid {
  columns: 1;
  column-gap: var(--space-sm);
}

.galerie__img {
  width: 100%;
  height: auto;
  margin-bottom: var(--space-sm);
  border-radius: var(--radius-md);
  break-inside: avoid;
}

/* --- Références --- */
.refs__inner {
  text-align: center;
}

.refs__title {
  font-size: var(--fs-h2);
  margin-bottom: var(--space-lg);
}

.refs__list {
  color: var(--color-text-muted);
  font-size: var(--fs-body);
  max-width: 60ch;
  margin: 0 auto;
  line-height: 2;
}

.refs__list span {
  white-space: nowrap;
}

.refs__list span:not(:last-child)::after {
  content: " \00B7 ";
  color: var(--color-accent);
  margin: 0 0.25rem;
}

/* --- Contact --- */
.contact__header {
  text-align: center;
  margin-bottom: var(--space-xl);
  max-width: 100%;
}

.contact__title {
  font-size: var(--fs-h2);
  margin-bottom: var(--space-sm);
  text-align: center;
}

.contact__subtitle {
  color: var(--color-text-muted);
  font-size: var(--fs-body);
  text-align: center;
  margin-inline: auto;
}

.contact__grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.contact__info {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.contact__business {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: var(--fw-semibold);
}

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

.contact__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--color-text-muted);
  transition: color var(--duration-fast) var(--ease-out);
}

.contact__link--phone {
  color: var(--color-accent);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-h3);
}

.contact__link:hover,
.contact__link:focus-visible {
  color: var(--color-accent);
}

.contact__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  position: relative;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.contact__submit {
  align-self: flex-start;
}

/* --- Form validation --- */
.form-field input,
.form-field textarea {
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}

.form-field--error input,
.form-field--error textarea {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 1px var(--color-accent);
}

.form-field__error {
  font-size: var(--fs-small);
  color: var(--color-accent);
  margin-top: 2px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}

.form-field--error .form-field__error {
  opacity: 1;
  transform: translateY(0);
}

/* --- Form success overlay --- */
.form-success {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  opacity: 0;
  visibility: hidden;
  transform: scale(0.95);
  transition: opacity var(--duration-normal) var(--ease-out),
              visibility var(--duration-normal) var(--ease-out),
              transform var(--duration-normal) var(--ease-out);
}

.form-success--visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.form-success__icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--color-emeraude);
  display: flex;
  align-items: center;
  justify-content: center;
}

.form-success__icon svg {
  width: 32px;
  height: 32px;
  stroke: var(--color-emeraude);
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
}

.form-success--visible .form-success__icon svg {
  animation: checkmark 0.6s var(--ease-out) 0.3s forwards;
}

@keyframes checkmark {
  to { stroke-dashoffset: 0; }
}

.form-success__title {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: var(--fw-semibold);
  text-align: center;
}

.form-success__text {
  color: var(--color-text-muted);
  text-align: center;
  max-width: 35ch;
}

/* --- Footer --- */
.footer {
  position: relative;
  padding: var(--space-xl) 0 var(--space-lg);
  text-align: center;
  overflow: hidden;
}

.footer__line {
  display: block;
  width: 0;
  height: 2px;
  margin: 0 auto var(--space-xl);
  background: linear-gradient(90deg, transparent, var(--color-accent), var(--color-violet), var(--color-emeraude), transparent);
  border-radius: 1px;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.footer__logo {
  height: 80px;
  width: auto;
  padding: var(--space-xs);
  opacity: 0;
  transform: translateY(15px);
}

.footer__quote {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: var(--fw-light);
  color: var(--color-text-muted);
  font-size: var(--fs-body);
  max-width: 45ch;
  line-height: 1.6;
  opacity: 0;
  transform: translateY(15px);
}

.footer__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm) var(--space-md);
  font-size: var(--fs-small);
}

.footer__nav a {
  color: var(--color-text-muted);
  transition: color var(--duration-fast) var(--ease-out);
  opacity: 0;
  transform: translateY(10px);
}

.footer__nav a:hover,
.footer__nav a:focus-visible {
  color: var(--color-accent);
}

.footer__copy {
  font-size: var(--fs-small);
  color: var(--color-text-muted);
  opacity: 0;
  transform: translateY(10px);
}

/* Footer confetti dots */
.footer__confetti {
  position: absolute;
  border-radius: 50%;
  opacity: 0.15;
  pointer-events: none;
}

/* ============================================
   TABLETTE — min-width: 640px
   ============================================ */
@media (min-width: 640px) {
  .galerie__grid {
    columns: 2;
  }

  .form-row {
    flex-direction: row;
    gap: var(--space-md);
  }

  .form-row .form-field {
    flex: 1;
  }
}

/* ============================================
   DESKTOP — min-width: 768px
   ============================================ */
@media (min-width: 768px) {
  .header__phone {
    display: flex;
  }

  .header__logo img {
    height: 72px;
  }

  /* Hero split */
  .hero {
    padding-top: 0;
  }

  .hero__inner {
    flex-direction: row;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0;
  }

  .hero__text {
    width: 45%;
    padding: 120px var(--space-xl) var(--space-3xl) var(--container-pad);
    padding-bottom: clamp(4rem, 10vh, 8rem);
    flex-shrink: 0;
  }

  .hero__media {
    width: 50%;
    height: auto;
    min-height: auto;
    max-height: 60vh;
    order: 0;
    border-radius: 60% 40% 55% 45% / 50% 60% 40% 50%;
    margin: 140px var(--space-xl) var(--space-xl) 0;
  }

  .hero__media img {
    height: 100%;
    max-height: calc(85vh - 80px);
    object-position: center center;
  }

  /* Services oversized */
  .service__name {
    font-size: var(--fs-service);
  }

  .service--right {
    text-align: right;
  }

  .service--right .service__desc {
    margin-left: auto;
  }

  /* Split grid */
  .split__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    align-items: start;
  }

  .split__media img {
    aspect-ratio: auto;
    height: 100%;
    max-height: 450px;
  }

  .split--reverse .split__media {
    order: 1;
  }

  /* À propos grid */
  .about__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }

  /* Galerie */
  .galerie__grid {
    columns: 3;
    column-gap: var(--space-md);
  }

  .galerie__img {
    margin-bottom: var(--space-md);
  }

  /* Contact grid */
  .contact__grid {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: var(--space-xl);
    align-items: start;
  }
}

/* ============================================
   LARGE DESKTOP — min-width: 1024px
   ============================================ */
@media (min-width: 1024px) {
  .hero__text {
    padding-bottom: var(--space-3xl);
  }
}
