:root {
  --night: #141a38;
  --night-deep: #0c1027;
  --surface: #1d2550;
  --ivory: #efe6d2;
  --mist: #a3a8c8;
  --gold: #cfa95e;
  --gold-soft: rgba(207, 169, 94, 0.18);
  --line: rgba(239, 230, 210, 0.12);

  --display: 'Italiana', 'Didot', serif;
  --text: 'Figtree', -apple-system, system-ui, sans-serif;

  --phone-scale: 0.62;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 90% 50% at 50% 0%, #212a5c 0%, transparent 70%),
    var(--night-deep);
  color: var(--ivory);
  font: 400 1rem/1.55 var(--text);
}

a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--ivory); }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* En-tête */

.masthead {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 24px 24px;
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 24px;
}

.wordmark {
  margin: 0;
  font: 400 1.25rem/1 var(--display);
  letter-spacing: 0.08em;
  color: var(--gold);
}

.whoami {
  margin: 0;
  font-size: 0.875rem;
  color: var(--mist);
}

.masthead h1 {
  grid-column: 1 / -1;
  margin: 56px 0 0;
  font: 400 clamp(2.75rem, 8vw, 5.5rem)/1 var(--display);
  letter-spacing: 0.01em;
}

.intro {
  grid-column: 1 / -1;
  max-width: 34em;
  margin: 20px 0 0;
  color: var(--mist);
  font-size: 1.0625rem;
}

.notice {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 24px;
  color: var(--gold);
}

/* Liste des propositions */

.gallery {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px 96px;
}

.empty {
  margin: 48px 0;
  color: var(--mist);
}

.proposal {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 56px;
  padding: 64px 0;
  border-top: 1px solid var(--line);
}

/* La vitrine : le téléphone sous un faisceau de lumière */

.showcase {
  position: relative;
  width: calc(390px * var(--phone-scale) + 28px);
  padding-top: 40px;
}

.showcase::before {
  content: '';
  position: absolute;
  inset: -64px -60px 30px;
  background: radial-gradient(ellipse 45% 70% at 50% 0%, var(--gold-soft) 0%, transparent 75%);
  pointer-events: none;
  animation: light-on 1.4s ease-out both;
  animation-delay: calc(var(--order, 0) * 180ms + 200ms);
}

@keyframes light-on {
  from { opacity: 0; }
  to { opacity: 1; }
}

.phone {
  position: relative;
  width: calc(390px * var(--phone-scale) + 28px);
  height: calc(844px * var(--phone-scale) + 28px);
  padding: 14px;
  border-radius: 44px;
  background: #0a0d1f;
  box-shadow:
    0 0 0 1px rgba(239, 230, 210, 0.14),
    0 40px 80px -30px rgba(0, 0, 0, 0.8);
  transition: opacity 0.4s ease, filter 0.4s ease;
}

.screen {
  display: block;
  width: 390px;
  height: 844px;
  border: 0;
  border-radius: calc(30px / var(--phone-scale));
  background: var(--night);
  transform: scale(var(--phone-scale));
  transform-origin: top left;
}

.plinth {
  height: 10px;
  margin: 28px 12px 0;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, var(--gold-soft) 0%, transparent 70%);
}

.proposal[data-status='ecartee'] .phone {
  opacity: 0.45;
  filter: grayscale(0.7);
}

.proposal[data-status='retenue'] .phone {
  box-shadow:
    0 0 0 1px var(--gold),
    0 0 60px -10px rgba(207, 169, 94, 0.5),
    0 40px 80px -30px rgba(0, 0, 0, 0.8);
}

/* Détails */

.details { max-width: 36em; }

.title {
  margin: 32px 0 0;
  font: 400 clamp(2rem, 5vw, 2.75rem)/1.1 var(--display);
}

.meta {
  margin: 8px 0 0;
  font-size: 0.875rem;
  color: var(--mist);
}

.intent {
  margin: 20px 0 0;
  font-size: 1.0625rem;
}

.open {
  display: inline-block;
  margin-top: 16px;
  font-weight: 500;
}

.status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 32px 0 0;
  padding: 0;
  border: 0;
}

.status legend {
  margin-bottom: 10px;
  font-size: 0.875rem;
  color: var(--mist);
}

.status label {
  position: relative;
  padding: 8px 16px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.9375rem;
  cursor: pointer;
}

.status input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.status label:has(input:checked) {
  border-color: var(--gold);
  background: var(--gold-soft);
}

.status label:has(input:focus-visible) {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.status label:has(input:disabled) { cursor: default; opacity: 0.6; }

.status-note {
  margin: 8px 0 0;
  min-height: 1.4em;
  font-size: 0.8125rem;
  color: var(--mist);
}

/* Discussion */

.thread { margin-top: 32px; }

.thread h3 {
  margin: 0;
  font: 500 1rem/1.4 var(--text);
}

.comments {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}

.comments li {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.comment-head {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 0.8125rem;
  color: var(--mist);
}

.comment-head strong {
  font-weight: 600;
  color: var(--ivory);
}

.comment-body {
  margin: 4px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.comments .no-comment {
  color: var(--mist);
  font-size: 0.9375rem;
}

.reply { margin-top: 16px; }

.reply-label {
  display: grid;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--mist);
}

.reply textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ivory);
  font: inherit;
  font-size: 1rem;
  resize: vertical;
}

.reply textarea:focus-visible { border-color: var(--gold); outline: none; }

.reply-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.reply-hint {
  font-size: 0.8125rem;
  color: var(--mist);
}

.reply button {
  min-height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--gold);
  color: var(--night-deep);
  font: 600 0.9375rem/1 var(--text);
  cursor: pointer;
}

.reply button:disabled { opacity: 0.5; cursor: default; }

.reply-error {
  margin: 8px 0 0;
  font-size: 0.875rem;
  color: #e8a0a0;
}

/* Petits écrans : la vitrine passe au-dessus */

@media (max-width: 820px) {
  :root { --phone-scale: 0.7; }
  .proposal { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 48px 0; }
  .showcase { justify-self: center; }
  .masthead h1 { margin-top: 40px; }
  .reply-hint { display: none; }
  .reply-actions { justify-content: flex-end; }
}

@media (max-width: 380px) {
  :root { --phone-scale: 0.64; }
  .masthead, .gallery, .notice { padding-left: 16px; padding-right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .showcase::before { animation: none; }
  .phone { transition: none; }
}
