/* =============================================
   Le Distributeur de Compliments — Leurimar
   Aesthetic: Soft Romantic Minimalism
   ============================================= */

/* --- CSS Custom Properties --- */
:root {
  --color-bg: #FFF5F5;
  --color-bg-warm: #FFF0F0;
  --color-rose: #FF4D6D;
  --color-rose-deep: #E8365A;
  --color-rose-light: #FF7B93;
  --color-rose-pale: #FFD6DE;
  --color-rose-ghost: #FFEEF2;
  --color-blush: #FFC2D1;
  --color-white: #FFFFFF;
  --color-text: #4A2C3D;
  --color-text-soft: #8B6577;
  --color-text-muted: #C49AAD;

  --font-serif: 'Cormorant Garamond', 'Georgia', serif;
  --font-sans: 'Outfit', 'Helvetica Neue', sans-serif;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-spring: cubic-bezier(0.22, 1.36, 0.36, 1);

  --shadow-soft: 0 4px 24px rgba(255, 77, 109, 0.08);
  --shadow-glow: 0 8px 40px rgba(255, 77, 109, 0.15);
  --shadow-deep: 0 16px 64px rgba(255, 77, 109, 0.12);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
}

/* --- Grain Overlay --- */
.grain-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 128px 128px;
}

/* --- Floating Hearts Background --- */
.floating-hearts {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floating-heart {
  position: absolute;
  color: var(--color-rose-pale);
  opacity: 0;
  animation: floatHeart linear infinite;
  font-size: 1rem;
}

@keyframes floatHeart {
  0% {
    transform: translateY(100vh) translateX(0) rotate(0deg) scale(0.5);
    opacity: 0;
  }
  10% {
    opacity: 0.15;
  }
  50% {
    opacity: 0.25;
  }
  90% {
    opacity: 0.1;
  }
  100% {
    transform: translateY(-10vh) translateX(var(--drift, 30px)) rotate(var(--rotation, 360deg)) scale(1);
    opacity: 0;
  }
}

/* --- Main Container --- */
.container {
  position: relative;
  z-index: 1;
  max-width: 580px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

/* --- Header --- */
.header {
  text-align: center;
  animation: fadeInDown 1s var(--ease-out-expo) both;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
  padding: 0.2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 18px rgba(255, 77, 109, 0.12);
}

.lang-button {
  border: none;
  background: transparent;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-soft);
  cursor: pointer;
  transition: all 0.25s var(--ease-out-expo);
}

.lang-button:hover {
  color: var(--color-rose-deep);
}

.lang-button.active {
  background: linear-gradient(135deg, var(--color-rose) 0%, var(--color-rose-deep) 100%);
  color: var(--color-white);
  box-shadow: 0 3px 10px rgba(255, 77, 109, 0.4);
}

.header-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.ornament-line {
  display: block;
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-rose-pale), transparent);
}

.ornament-heart {
  color: var(--color-rose);
  font-size: 0.55rem;
  animation: pulseHeart 2s ease-in-out infinite;
}

@keyframes pulseHeart {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
}

.title {
  font-family: var(--font-serif);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.title-pre {
  display: block;
  font-size: clamp(0.85rem, 2.5vw, 1rem);
  font-family: var(--font-sans);
  font-weight: 300;
  color: var(--color-text-soft);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.title-main {
  display: block;
  font-size: clamp(2.5rem, 8vw, 3.75rem);
  font-weight: 600;
  color: var(--color-rose);
  line-height: 1.05;
  background: linear-gradient(135deg, var(--color-rose) 0%, var(--color-rose-deep) 50%, var(--color-rose-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.title-sub {
  display: block;
  font-size: clamp(1.1rem, 3.5vw, 1.35rem);
  font-weight: 300;
  color: var(--color-text-soft);
  margin-top: 0.35rem;
  font-style: italic;
}

.title-sub em {
  font-weight: 500;
  color: var(--color-rose);
  -webkit-text-fill-color: var(--color-rose);
  font-style: italic;
}

.subtitle {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--color-text-muted);
  margin-top: 1rem;
  letter-spacing: 0.02em;
}

/* --- Counter Section --- */
.counter-section {
  width: 100%;
  text-align: center;
  animation: fadeInUp 1s var(--ease-out-expo) 0.2s both;
}

.counter-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  background: var(--color-white);
  border: 1px solid var(--color-rose-pale);
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--color-text-soft);
  box-shadow: var(--shadow-soft);
  transition: all 0.4s var(--ease-out-expo);
}

.counter-badge:hover {
  box-shadow: var(--shadow-glow);
  border-color: var(--color-rose-light);
}

.counter-icon {
  color: var(--color-rose);
  font-size: 0.7rem;
  animation: pulseHeart 2s ease-in-out infinite 0.5s;
}

#counterNumber {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-rose);
}

.progress-bar {
  width: 100%;
  max-width: 280px;
  height: 3px;
  background: var(--color-rose-ghost);
  border-radius: 100px;
  margin: 0.85rem auto 0;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-rose), var(--color-rose-light));
  border-radius: 100px;
  transition: width 0.8s var(--ease-out-expo);
}

.progress-label {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  margin-top: 0.4rem;
  font-weight: 300;
  letter-spacing: 0.03em;
}

/* --- Compliment Section --- */
.compliment-section {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeInUp 1s var(--ease-out-expo) 0.4s both;
}

.compliment-card {
  position: relative;
  width: 100%;
  background: var(--color-white);
  border: 1px solid rgba(255, 77, 109, 0.08);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: var(--shadow-soft);
  transition: all 0.6s var(--ease-out-expo);
  overflow: hidden;
}

.compliment-card:hover {
  box-shadow: var(--shadow-deep);
  transform: translateY(-2px);
}

.card-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 77, 109, 0.03) 0%,
    transparent 70%
  );
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.quote-mark {
  position: absolute;
  font-family: var(--font-serif);
  font-size: 4rem;
  font-weight: 600;
  color: var(--color-rose-pale);
  opacity: 0.4;
  line-height: 1;
  user-select: none;
  pointer-events: none;
}

.quote-mark.top {
  top: 0.75rem;
  left: 1.25rem;
}

.quote-mark.bottom {
  bottom: -0.5rem;
  right: 1.25rem;
  transform: rotate(180deg);
}

.compliment-text {
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 3.5vw, 1.4rem);
  font-weight: 400;
  line-height: 1.65;
  color: var(--color-text);
  letter-spacing: 0.005em;
  transition: opacity 0.5s ease, transform 0.5s var(--ease-out-expo);
  max-width: 440px;
}

.compliment-text.fade-out {
  opacity: 0;
  transform: translateY(8px) scale(0.98);
}

.compliment-text.fade-in {
  animation: complimentReveal 0.7s var(--ease-out-expo) both;
}

@keyframes complimentReveal {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.97);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* --- Love Button --- */
.button-section {
  text-align: center;
  animation: fadeInUp 1s var(--ease-out-expo) 0.6s both;
}

.love-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1rem 2.25rem;
  background: linear-gradient(135deg, var(--color-rose) 0%, var(--color-rose-deep) 100%);
  color: var(--color-white);
  border: none;
  border-radius: 100px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.4s var(--ease-out-expo);
  box-shadow:
    0 4px 16px rgba(255, 77, 109, 0.3),
    0 8px 32px rgba(255, 77, 109, 0.15);
  animation: buttonPulse 3s ease-in-out infinite;
}

@keyframes buttonPulse {
  0%, 100% {
    box-shadow:
      0 4px 16px rgba(255, 77, 109, 0.3),
      0 8px 32px rgba(255, 77, 109, 0.15);
  }
  50% {
    box-shadow:
      0 4px 24px rgba(255, 77, 109, 0.4),
      0 12px 48px rgba(255, 77, 109, 0.2);
  }
}

.love-button:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow:
    0 6px 24px rgba(255, 77, 109, 0.4),
    0 16px 56px rgba(255, 77, 109, 0.2);
}

.love-button:active {
  transform: translateY(0) scale(0.97);
  transition-duration: 0.1s;
}

.button-glow {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.15),
    transparent
  );
  transition: none;
}

.love-button:hover .button-glow {
  animation: shimmer 1.5s ease infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

.button-ripple {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.button-ripple.active {
  animation: ripple 0.6s ease-out;
}

@keyframes ripple {
  to {
    width: 300px;
    height: 300px;
    opacity: 0;
  }
}

.button-icon {
  font-size: 0.85rem;
  transition: transform 0.3s var(--ease-spring);
}

.love-button:hover .button-icon {
  transform: scale(1.2);
}

.love-button:active .button-icon {
  animation: heartBeat 0.4s ease;
}

@keyframes heartBeat {
  0% { transform: scale(1); }
  25% { transform: scale(1.4); }
  50% { transform: scale(0.9); }
  75% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.button-hint {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-top: 0.85rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  justify-content: center;
  opacity: 0.7;
}

.button-hint i {
  font-size: 0.65rem;
  animation: pointerBounce 2s ease-in-out infinite;
}

@keyframes pointerBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* --- Footer --- */
.footer {
  text-align: center;
  padding-top: 1rem;
  animation: fadeInUp 1s var(--ease-out-expo) 0.8s both;
}

.footer-hearts {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  color: var(--color-rose-pale);
  font-size: 0.45rem;
}

.footer-hearts i:nth-child(1) { animation: pulseHeart 2s ease-in-out infinite 0s; }
.footer-hearts i:nth-child(2) { animation: pulseHeart 2s ease-in-out infinite 0.3s; }
.footer-hearts i:nth-child(3) { animation: pulseHeart 2s ease-in-out infinite 0.6s; }

.footer p {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  font-weight: 300;
  font-style: italic;
  color: var(--color-text-muted);
}

/* --- Animations --- */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Card pop when compliment changes */
.compliment-card.pop {
  animation: cardPop 0.5s var(--ease-spring);
}

@keyframes cardPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* Counter bump animation */
.counter-badge.bump {
  animation: counterBump 0.4s var(--ease-spring);
}

@keyframes counterBump {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* Milestone celebration */
.compliment-card.milestone {
  border-color: var(--color-rose);
  box-shadow:
    0 0 0 2px rgba(255, 77, 109, 0.1),
    var(--shadow-deep);
}

/* --- Responsive --- */
@media (min-width: 480px) {
  .container {
    padding: 4rem 2rem 2.5rem;
    gap: 2.25rem;
  }

  .compliment-card {
    padding: 3rem 2.5rem;
    min-height: 220px;
  }

  .ornament-line {
    width: 60px;
  }
}

@media (min-width: 768px) {
  .container {
    padding: 5rem 2rem 3rem;
    gap: 2.5rem;
  }

  .compliment-card {
    padding: 3.5rem 3rem;
    min-height: 240px;
    border-radius: 28px;
  }
}

/* --- Accessibility --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .floating-heart {
    display: none;
  }
}

/* --- Selection Color --- */
::selection {
  background: var(--color-rose-pale);
  color: var(--color-rose-deep);
}
