/* Site de Maxime Péharpré : bordeaux sur crème, mobile d'abord (maquette validée le 2026-09-26). */
:root {
  --bg: #fbf7f3;
  --ink: #1c1716;
  --muted: #62575a;
  --line: #ede4de;
  --wine: #7a1e33;
  --wine-2: #9b2c45;
  --amber: #e7a04b;
  --card: #ffffff;
  --ok: #1e7a4e;
  --ok-bg: rgba(47, 163, 107, 0.12);
  --bot: #f4eeea;
  --focus: #1f5fd1;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body {
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 50% -120px, rgba(155, 44, 69, 0.14), transparent 70%),
    radial-gradient(600px 400px at 100% 100%, rgba(231, 160, 75, 0.1), transparent 70%),
    var(--bg);
}
a {
  color: var(--wine);
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.wrap {
  max-width: 460px;
  margin: 0 auto;
  padding: 28px 20px 32px;
}

/* Profil */
.profile {
  text-align: center;
}
.avatar {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 14px;
}
.avatar::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(from 200deg, var(--wine), var(--amber), var(--wine-2), var(--wine));
}
.avatar img {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg);
}
h1 {
  font-size: 28px;
  letter-spacing: -0.02em;
  font-weight: 750;
  text-wrap: balance;
}
.say {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}
.say b {
  color: var(--wine);
  font-weight: 650;
}
.tagline {
  margin-top: 16px;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 560;
  text-wrap: balance;
}
.meta {
  margin-top: 6px;
  font-size: 14px;
  color: var(--muted);
}
h2 {
  margin: 34px 0 12px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  font-weight: 650;
}

/* Chat */
.chat {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 40px -28px rgba(28, 23, 22, 0.35);
}
.chat-h {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.chat-h img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}
.chat-h .n {
  font-size: 14.5px;
  font-weight: 650;
}
.chat-h .s {
  font-size: 12px;
  color: var(--muted);
}
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2fa36b;
  box-shadow: 0 0 0 3px rgba(47, 163, 107, 0.18);
  margin-right: 6px;
  vertical-align: 1px;
}
.chat[data-available="false"] .dot {
  background: #a3968f;
  box-shadow: none;
}
.badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--wine);
  background: rgba(122, 30, 51, 0.08);
  padding: 4px 8px;
  border-radius: 8px;
}
.back {
  display: none;
  border: 0;
  background: none;
  font-size: 24px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 6px 2px 0;
}
.msgs {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 460px;
  overflow-y: auto;
  scroll-behavior: smooth;
}
.m {
  max-width: 84%;
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.42;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}
.m a {
  color: inherit;
}
.bot {
  background: var(--bot);
  border-bottom-left-radius: 6px;
}
.me {
  align-self: flex-end;
  background: var(--wine);
  color: #fff;
  border-bottom-right-radius: 6px;
}
.human {
  background: #fff;
  border: 1.5px solid var(--ok);
  border-bottom-left-radius: 6px;
}
.who {
  display: block;
  margin-bottom: 3px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ok);
}
.sys {
  align-self: center;
  max-width: 92%;
  text-align: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--ok-bg);
  color: var(--ok);
  font-size: 12.5px;
  font-weight: 600;
}
.thinking {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 84%;
  padding: 10px 14px;
  border-radius: 16px;
  border-bottom-left-radius: 6px;
  background: var(--bot);
  color: var(--muted);
  font-size: 13px;
}
.dots {
  display: inline-flex;
  gap: 3px;
}
.dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--wine-2);
  opacity: 0.35;
  animation: blink 1.2s infinite;
}
.dots i:nth-child(2) {
  animation-delay: 0.2s;
}
.dots i:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes blink {
  50% {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dots i {
    animation: none;
    opacity: 0.7;
  }
  .msgs {
    scroll-behavior: auto;
  }
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 14px;
}
.chip {
  font: inherit;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.chip:hover {
  border-color: var(--wine-2);
}
.form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin: 0 12px 10px;
  padding: 8px 8px 8px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fcfaf8;
}
.form:focus-within {
  border-color: var(--wine-2);
}
.form textarea {
  flex: 1;
  min-height: 24px;
  max-height: 120px;
  border: 0;
  background: transparent;
  resize: none;
  font: inherit;
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink);
  padding: 5px 0;
}
.form textarea:focus {
  outline: none;
}
.form textarea::placeholder {
  color: #8a7e78;
}
.send {
  flex: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: var(--wine);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.send:disabled {
  opacity: 0.45;
  cursor: default;
}
.actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 0 16px 8px;
}
.link-btn {
  border: 0;
  background: none;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--wine);
  cursor: pointer;
  padding: 4px 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link-btn.quiet {
  color: var(--muted);
  font-weight: 500;
}
.err {
  margin: 0 16px 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #fbe9ec;
  color: #7a1e33;
  font-size: 13px;
}
.ai-note {
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
  padding: 0 16px 14px;
}
.ai-note a {
  color: var(--muted);
}
.ts-slot:empty {
  display: none;
}
.ts-slot {
  display: flex;
  justify-content: center;
  padding: 0 12px 10px;
}

/* Ce que je construis */
.builds {
  display: grid;
  gap: 10px;
  list-style: none;
}
.b {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
}
.ico {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 20px;
  background: #f6efea;
}
.b .t {
  font-size: 15px;
  font-weight: 650;
}
.b .d {
  margin-top: 3px;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--muted);
}

/* Réseaux */
.socials {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.soc {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 14.5px;
  font-weight: 620;
  color: var(--ink);
  text-decoration: none;
}
.socials-top {
  margin-top: 28px;
}
.soc:hover {
  border-color: var(--wine-2);
}
footer {
  margin-top: 34px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.7;
}
footer a {
  color: var(--muted);
}
.only-desktop {
  display: none;
}

/* Chat plein écran sur mobile, une fois la conversation lancée */
@media (max-width: 899px) {
  body.chat-open {
    overflow: hidden;
  }
  body.chat-open .chat {
    position: fixed;
    inset: 0;
    z-index: 10;
    border-radius: 0;
    border: 0;
    height: 100dvh;
  }
  body.chat-open .chat .msgs {
    flex: 1;
    max-height: none;
  }
  body.chat-open .back {
    display: block;
  }
  body.chat-open .chips {
    display: none;
  }
}

@media (min-width: 900px) {
  .only-desktop {
    display: grid;
  }
  .only-mobile {
    display: none;
  }
  .wrap {
    max-width: 980px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 56px;
    align-items: start;
    padding-top: 80px;
  }
  .profile {
    text-align: left;
    position: sticky;
    top: 80px;
  }
  .avatar {
    margin: 0 0 18px;
    width: 118px;
    height: 118px;
  }
  h1 {
    font-size: 40px;
  }
  .tagline {
    font-size: 22px;
  }
  .right h2:first-child {
    margin-top: 0;
  }
  footer {
    grid-column: 1 / -1;
  }
}

/* Pages de texte (mentions légales, confidentialité) */
.doc {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px 48px;
  line-height: 1.6;
}
.doc .home {
  font-size: 14px;
  text-decoration: none;
}
.doc h1 {
  margin: 18px 0 6px;
  font-size: 30px;
}
.doc .upd {
  color: var(--muted);
  font-size: 13px;
}
.doc h2 {
  margin: 28px 0 8px;
  font-size: 14px;
}
.doc p,
.doc li {
  font-size: 15px;
}
.doc ul {
  padding-left: 20px;
  display: grid;
  gap: 4px;
}
.doc dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 16px;
  font-size: 15px;
}
.doc dt {
  color: var(--muted);
}
@media (max-width: 520px) {
  .doc dl {
    grid-template-columns: 1fr;
  }
  .doc dd {
    margin-bottom: 8px;
  }
}
