/* ============================================================
   Le prochain reve : design tokens
   ============================================================ */
:root {
  --rose-tl: #e1aaae;
  --rose-tr: #cd86a6;
  --sand-bl: #d6baa4;
  --slate-br: #848ea2;

  --ink: #241723;
  --ink-60: rgba(36, 23, 35, 0.6);
  --ink-40: rgba(36, 23, 35, 0.4);
  --paper: rgba(255, 253, 253, 0.75);

  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Instrument Sans", system-ui, sans-serif;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  --brick-h: 88px;
  --brick-gap: 9px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  height: 100%;
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--rose-tl);
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; }

.skip-link {
  position: fixed; left: 1rem; top: -100%; z-index: 200;
  padding: 0.6rem 1.1rem; background: #fff; border-radius: 99px;
  font-size: 0.85rem; text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus { top: 1rem; }

/* ============================================================
   Ciel : gradient 4 coins + aurore + nuages + grain + bulles
   ============================================================ */
.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.sky__mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(115% 95% at 0% 0%, var(--rose-tl) 0%, transparent 62%),
    radial-gradient(115% 95% at 100% 0%, var(--rose-tr) 0%, transparent 60%),
    radial-gradient(115% 95% at 0% 100%, var(--sand-bl) 0%, transparent 58%),
    radial-gradient(125% 105% at 100% 100%, var(--slate-br) 0%, transparent 60%),
    linear-gradient(160deg, #e3b0b4, #b992a5);
}

.sky__aurora {
  position: absolute;
  inset: -35%;
  background: conic-gradient(
    from 0deg at 50% 50%,
    rgba(225, 170, 174, 0.55),
    rgba(205, 134, 166, 0.5),
    rgba(132, 142, 162, 0.45),
    rgba(214, 186, 164, 0.55),
    rgba(255, 214, 224, 0.5),
    rgba(225, 170, 174, 0.55)
  );
  filter: blur(80px) saturate(1.08);
  opacity: 0.55;
  animation: aurora-spin 70s linear infinite;
}

@keyframes aurora-spin {
  to { transform: rotate(1turn); }
}

.sky__cloud {
  position: absolute;
  filter: blur(22px);
  opacity: 0.5;
  background:
    radial-gradient(closest-side at 28% 62%, rgba(255, 250, 252, 0.95), transparent),
    radial-gradient(closest-side at 55% 38%, rgba(255, 250, 252, 0.9), transparent),
    radial-gradient(closest-side at 78% 62%, rgba(255, 250, 252, 0.85), transparent);
  animation: cloud-drift var(--drift, 70s) linear infinite alternate;
}

.sky__cloud--a { width: 46vw; height: 15vh; top: 9%;  left: -6%;  --drift: 85s; }
.sky__cloud--b { width: 38vw; height: 13vh; top: 22%; right: -8%; --drift: 65s; opacity: 0.42; }
.sky__cloud--c { width: 34vw; height: 12vh; bottom: 20%; left: 4%; --drift: 75s; opacity: 0.38; }
.sky__cloud--d { width: 30vw; height: 11vh; bottom: 7%; right: 2%; --drift: 95s; opacity: 0.3; }

@keyframes cloud-drift {
  from { transform: translateX(0); }
  to   { transform: translateX(6vw); }
}

.sky__grain {
  position: absolute;
  inset: 0;
  opacity: 0.28;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

.sky__bubbles { position: absolute; inset: 0; }

/* Bulle de savon iridescente */
.bubble {
  position: absolute;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0) 42%),
    radial-gradient(circle at 68% 78%, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 38%),
    conic-gradient(
      from 40deg,
      rgba(255, 170, 200, 0.3),
      rgba(170, 200, 255, 0.28),
      rgba(255, 230, 180, 0.3),
      rgba(205, 175, 255, 0.28),
      rgba(255, 170, 200, 0.3)
    );
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    inset 0 0 14px rgba(255, 255, 255, 0.4),
    0 8px 28px rgba(120, 70, 100, 0.14);
  will-change: transform;
}

/* Bulle contenant une photo (rare : 1 sur 6) */
.bubble--photo {
  overflow: hidden;
  border-color: rgba(255, 255, 255, 0.7);
}

.bubble--photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.bubble--photo::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 26%, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0) 42%),
    conic-gradient(
      from 40deg,
      rgba(255, 170, 200, 0.16),
      rgba(170, 200, 255, 0.14),
      rgba(255, 230, 180, 0.16),
      rgba(205, 175, 255, 0.14),
      rgba(255, 170, 200, 0.16)
    );
  box-shadow: inset 0 0 16px rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

/* ============================================================
   Structure de page
   ============================================================ */
.page {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 100vw;
  padding: clamp(1rem, 2.5vw, 1.75rem) clamp(1rem, 3vw, 2rem);
}

/* --- Topbar --- */
.topbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topbar__left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.topbar__logo {
  width: auto;
  height: 15px;
  opacity: 0.85;
}

.topbar__sep {
  width: 1px;
  height: 16px;
  background: var(--ink-40);
}

.topbar__feat {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-60);
}

.topbar__album {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.topbar__cover {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(90, 50, 70, 0.35);
}

.topbar__album-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-60);
}

/* --- Scene --- */
.scene {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2.6vh, 1.9rem);
  min-height: 0;
  padding-block: clamp(0.75rem, 2vh, 1.5rem);
}

.hero {
  flex-shrink: 0;
  text-align: center;
}

.hero__eyebrow {
  margin: 0 0 0.7rem;
  font-size: clamp(0.64rem, 1vw, 0.76rem);
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-60);
}

.hero__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 6.5vw, 4.8rem);
  line-height: 0.92;
  letter-spacing: -0.015em;
}

.hero__title em {
  font-style: italic;
  background: linear-gradient(115deg, #93435f 10%, #5e6379 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: 0.06em;
}

/* --- Tag commun --- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  padding: 0.42rem 0.95rem;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-60);
  width: fit-content;
}

.tag__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a04e6e;
  box-shadow: 0 0 10px rgba(160, 78, 110, 0.9);
  animation: dot-pulse 2.2s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.35; transform: scale(0.8); }
}

.tag__dot--live {
  background: #2fae6b;
  box-shadow: 0 0 10px rgba(47, 174, 107, 0.95);
}

/* ============================================================
   Board : mur de briques a gauche, nouveaux reves a droite
   ============================================================ */
.board {
  flex: 1;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: clamp(1.5rem, 3.5vw, 3.5rem);
  align-items: stretch;
  width: min(100%, 1240px);
  margin-inline: auto;
  min-height: 0;
}

.board > * { min-width: 0; }

/* --- Le mur (briques) --- */
.wallzone {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 0;
}

.wallzone__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.wallzone__title em {
  font-style: italic;
  background: linear-gradient(115deg, #93435f 10%, #5e6379 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: 0.06em;
}

.bricks {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: var(--brick-h);
  grid-auto-flow: dense;
  gap: var(--brick-gap);
  align-content: start;
  min-height: 0;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, black calc(100% - 28px), transparent);
  -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 28px), transparent);
}

.brick {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.65rem 0.9rem;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 26px rgba(90, 50, 70, 0.12);
  text-align: left;
  overflow: hidden;
}

.brick--half {
  grid-column: span 1;
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.35);
  display: grid;
  place-items: center;
}

.brick--half span {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
  opacity: 0.7;
}

.brick--photo {
  grid-column: span 2;
  grid-row: span 2;
  padding: 0;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.4);
}

.brick--photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.brick__text {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.86rem;
  line-height: 1.28;
  color: rgba(36, 23, 35, 0.85);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.brick__name {
  margin: 0.35rem 0 0;
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-60);
}

/* --- Nouveaux reves (droite) --- */
.latest {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.9rem, 2.2vh, 1.5rem);
  text-align: center;
  min-height: 0;
}

.dream {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 30rem);
  min-height: clamp(9rem, 20vh, 12rem);
}

.dream__mark {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  line-height: 0.6;
  color: rgba(147, 67, 95, 0.45);
  user-select: none;
}

.dream__quote {
  margin: 0.4rem 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.35rem, 2.6vw, 2.05rem);
  line-height: 1.25;
  text-wrap: balance;
}

.dream__quote .w {
  display: inline-block;
  will-change: transform, opacity;
}

.dream__author {
  margin: clamp(0.8rem, 1.8vh, 1.2rem) 0 0;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-60);
}

.dream__timer {
  display: block;
  width: 96px;
  height: 2px;
  margin-top: clamp(0.7rem, 1.6vh, 1rem);
  border-radius: 2px;
  background: rgba(36, 23, 35, 0.14);
  overflow: hidden;
}

.dream__timer > span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #a04e6e, #7a7f96);
  transform: scaleX(0);
  transform-origin: left center;
}

/* Fallback sans GSAP : crossfade doux */
.dream--css .dream__quote,
.dream--css .dream__author {
  transition: opacity 0.7s var(--ease-out);
}
.dream--css.is-swapping .dream__quote,
.dream--css.is-swapping .dream__author {
  opacity: 0;
}

.latest__ask {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  color: var(--ink-60);
}

/* --- CTA --- */
.cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.cta__button {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.95rem 1.9rem;
  border: none;
  border-radius: 99px;
  background: linear-gradient(150deg, #2b1b28, #43293c);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow:
    0 14px 38px rgba(43, 27, 40, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}

.cta__button:hover {
  transform: translateY(-3px);
  box-shadow:
    0 20px 48px rgba(43, 27, 40, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.cta__button:focus-visible {
  outline: 2px solid #93435f;
  outline-offset: 4px;
}

.cta__spark {
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.45s var(--ease-out);
}

.cta__button:hover .cta__spark {
  transform: rotate(120deg) scale(1.15);
}

.cta__count {
  margin: 0;
  min-height: 1.1rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--ink-60);
}

/* --- Footer --- */
.footer {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem 0.8rem;
  padding-top: 1rem;
  font-size: 0.72rem;
  color: var(--ink-60);
}

.footer__logo {
  width: auto;
  height: 20px;
  opacity: 0.75;
}

.footer a { text-decoration-color: var(--ink-40); }

/* ============================================================
   Modal : panneau de partage
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.modal[hidden] { display: none; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(40, 22, 38, 0.4);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.35s var(--ease-out);
}

.modal.is-open .modal__backdrop { opacity: 1; }

.modal__panel {
  position: relative;
  width: min(100%, 27rem);
  padding: clamp(1.6rem, 4vw, 2.2rem);
  border-radius: 26px;
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(28px);
  box-shadow: 0 36px 90px rgba(60, 30, 50, 0.4);
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out);
}

.modal.is-open .modal__panel {
  opacity: 1;
  transform: none;
}

.modal__close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: rgba(36, 23, 35, 0.07);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s;
}

.modal__close:hover { background: rgba(36, 23, 35, 0.14); }
.modal__close:focus-visible { outline: 2px solid #93435f; outline-offset: 2px; }

.modal__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.9rem;
  line-height: 1.05;
}

.modal__title em {
  font-style: italic;
  color: #93435f;
}

.modal__hint {
  margin: 0.5rem 0 1.4rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--ink-60);
}

.field {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.field label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-60);
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.8rem 0.95rem;
  border-radius: 13px;
  border: 1px solid rgba(36, 23, 35, 0.14);
  background: rgba(255, 255, 255, 0.72);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input::placeholder,
.field textarea::placeholder { color: var(--ink-40); }

.field input:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-color: #93435f;
  box-shadow: 0 0 0 3px rgba(147, 67, 95, 0.16);
}

.field textarea { resize: none; min-height: 5.2rem; }

.field__hint {
  margin: 0;
  font-size: 0.72rem;
  text-align: right;
  color: var(--ink-60);
}

.field--hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.modal__submit {
  width: 100%;
  padding: 0.9rem 1.2rem;
  border: none;
  border-radius: 99px;
  background: linear-gradient(150deg, #2b1b28, #43293c);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(43, 27, 40, 0.3);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), opacity 0.2s;
}

.modal__submit:hover { transform: translateY(-2px); }
.modal__submit:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.modal__submit:focus-visible { outline: 2px solid #93435f; outline-offset: 3px; }

.form-status {
  min-height: 1.2rem;
  margin: 0.7rem 0 0;
  font-size: 0.82rem;
  text-align: center;
}

.form-status[data-state="success"] { color: #2e5c40; }
.form-status[data-state="error"]   { color: #8b1e3f; }
.form-status[data-state="loading"] { color: var(--ink-60); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 920px) {
  .page { min-height: auto; }
  .scene { gap: 1.25rem; }

  .board {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .latest { order: -1; }

  .bricks {
    flex: none;
    mask-image: none;
    -webkit-mask-image: none;
  }

  .topbar__album-info { display: none; }
  .sky__cloud--b, .sky__cloud--d { display: none; }
}

@media (max-width: 560px) {
  .topbar__feat { letter-spacing: 0.08em; }
  .hero__eyebrow { letter-spacing: 0.2em; }

  .dream { min-height: 10rem; }
  .dream__quote { font-size: clamp(1.25rem, 5.5vw, 1.55rem); }

  .brick__text { font-size: 0.78rem; }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .sky__aurora, .sky__cloud, .tag__dot { animation: none !important; }
  .bubble { display: none; }

  *, *::before, *::after {
    transition-duration: 0.01ms !important;
  }
}
