/* =========================================================
   DENTSU DARK AI — interface
   Thème : noir profond, texte blanc, accent bleu glacé.
   ========================================================= */

:root {
  --ink: #06080b;
  --ink-soft: #0a0d12;
  --panel: #0d1016;
  --surface: #12161e;
  --surface-2: #171c26;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.17);
  --text: #f7f9fc;
  --text-soft: #e3e8f0;
  --muted: #9ba6b6;
  --subtle: #6d7889;
  --blue: #5fa8f1;
  --blue-soft: #a8cdf7;
  --ice: #dbe9fb;
  --blue-deep: #174680;

  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --topbar-h: 60px;
  --ease: cubic-bezier(0.2, 0.75, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.is-chat {
  overflow: hidden;
}

::selection {
  background: rgba(95, 168, 241, 0.32);
  color: #fff;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.025em;
}

button,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

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

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  transition: top 160ms var(--ease);
}

.skip-link:focus {
  top: 12px;
}

/* ---------- Ambiance ---------- */

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient-glow {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(100px);
}

.ambient-glow--blue {
  top: -26vh;
  right: -12vw;
  width: 64vw;
  height: 64vw;
  max-width: 820px;
  max-height: 820px;
  background: radial-gradient(circle, rgba(95, 168, 241, 0.19), transparent 66%);
}

.ambient-glow--ice {
  bottom: -30vh;
  left: -20vw;
  width: 56vw;
  height: 56vw;
  max-width: 680px;
  max-height: 680px;
  background: radial-gradient(circle, rgba(23, 70, 128, 0.28), transparent 70%);
}

.ambient-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 76px 76px;
  mask-image: radial-gradient(ellipse 82% 62% at 50% 4%, #000 8%, transparent 76%);
  -webkit-mask-image: radial-gradient(ellipse 82% 62% at 50% 4%, #000 8%, transparent 76%);
}

.ambient-grain {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/></svg>");
}

/* ---------- Barre haute ---------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  height: var(--topbar-h);
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 clamp(14px, 4vw, 30px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(6, 8, 11, 0.66);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
}

.topbar-back {
  display: none;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 11px 0 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  font-size: 12.5px;
}

body.is-chat .topbar-back {
  display: inline-flex;
}

body.is-chat .wordmark {
  display: none;
}

.topbar-back:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
}

.wordmark {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.wordmark-light {
  margin-left: 7px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.06em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
}

.model-chip {
  padding: 5px 10px;
  border: 1px solid rgba(95, 168, 241, 0.28);
  border-radius: 999px;
  background: rgba(95, 168, 241, 0.08);
  color: #cfe4fb;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.icon-button {
  display: inline-flex;
  height: 34px;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.028);
  color: var(--text-soft);
  font-size: 12.5px;
  transition:
    background 160ms var(--ease),
    border-color 160ms var(--ease),
    transform 160ms var(--ease);
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.07);
}

.icon-button:active {
  transform: translateY(1px);
}

.icon-button--accent {
  border-color: rgba(95, 168, 241, 0.34);
  background: rgba(95, 168, 241, 0.12);
  color: #e4f0fe;
}

.icon-button--accent:hover {
  border-color: rgba(95, 168, 241, 0.6);
  background: rgba(95, 168, 241, 0.2);
}

.icon-button--quiet {
  width: 32px;
  justify-content: center;
  padding: 0;
}

/* ---------- Accueil ---------- */

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

.home {
  max-width: 1080px;
  margin: 0 auto;
  padding: calc(var(--topbar-h) + 10px) clamp(16px, 5vw, 36px) 46px;
}

.home-inner {
  display: flex;
  min-height: calc(100dvh - var(--topbar-h) - 10px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 0 26px;
  text-align: center;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-mark {
  position: relative;
  display: grid;
  width: 134px;
  height: 134px;
  place-items: center;
  margin-bottom: 22px;
}

.mark-halo {
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  background: conic-gradient(
    from 200deg,
    rgba(219, 233, 251, 0) 0deg,
    rgba(219, 233, 251, 0.3) 60deg,
    rgba(95, 168, 241, 0.36) 150deg,
    rgba(23, 70, 128, 0) 260deg
  );
  filter: blur(18px);
  opacity: 0.8;
  animation: halo-spin 22s linear infinite;
}

.ddi {
  position: relative;
  width: 128px;
  height: 128px;
  filter: drop-shadow(0 18px 42px rgba(95, 168, 241, 0.2));
}

.ddi-letters {
  animation: mark-breathe 8s ease-in-out infinite;
  transform-origin: 64px 64px;
}

@keyframes halo-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes mark-breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}

.hero-title {
  margin: 0;
  font-size: clamp(1.95rem, 5vw, 3.5rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.hero-line {
  display: inline-block;
  background: linear-gradient(94deg, #ffffff 0%, #dcebfd 42%, #8dc2f6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  max-width: 540px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: clamp(0.92rem, 1.5vw, 1.02rem);
  line-height: 1.65;
  text-wrap: pretty;
}

/* ---------- Saisie d'accueil ---------- */

.hero-composer {
  width: min(100%, 720px);
  margin-top: 30px;
}

.composer {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: linear-gradient(180deg, #141924, #0e1118);
  box-shadow:
    0 26px 64px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition:
    border-color 200ms var(--ease),
    box-shadow 200ms var(--ease);
}

.composer:focus-within {
  border-color: rgba(95, 168, 241, 0.5);
  box-shadow:
    0 26px 70px rgba(0, 0, 0, 0.6),
    0 0 0 3px rgba(95, 168, 241, 0.1);
}

.composer--hero {
  border-radius: 22px;
}

.composer textarea {
  display: block;
  width: 100%;
  max-height: 180px;
  padding: 16px 19px 4px;
  overflow-y: auto;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
  resize: none;
}

.composer textarea::placeholder {
  color: #6f7b8c;
}

.composer textarea:focus {
  outline: none;
}

.composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px 10px;
}

.mode-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.03);
}

.mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--subtle);
  font-size: 11.5px;
  transition:
    background 160ms var(--ease),
    color 160ms var(--ease);
}

.mode:hover {
  color: var(--text-soft);
}

.mode[aria-checked="true"] {
  background: #222a38;
  color: #eaf2fd;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.07) inset;
}

.mode[aria-checked="true"] svg {
  color: var(--blue);
}

.composer-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.counter {
  color: #5e6a7a;
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.send {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(140deg, #cfe6ff, #7ab8f4 45%, #3d84d6);
  color: #06121f;
  box-shadow: 0 6px 20px rgba(95, 168, 241, 0.3);
  transition:
    filter 160ms var(--ease),
    transform 160ms var(--ease),
    opacity 160ms var(--ease);
}

.send--hero {
  width: 40px;
  height: 40px;
  border-radius: 13px;
}

.send:hover:not(:disabled) {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

.send:disabled {
  opacity: 0.28;
  box-shadow: none;
  cursor: not-allowed;
}

.hero-hint {
  margin: 9px 0 0;
  color: #5b6674;
  font-size: 10.8px;
  text-align: center;
}

/* ---------- Invitation d'installation ---------- */

.install-note {
  max-width: 520px;
  margin: 18px auto 0;
  text-align: center;
}

.install-note-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-size: 13px;
  transition:
    border-color 160ms var(--ease),
    background 160ms var(--ease);
  animation: install-pulse 3.4s ease-in-out infinite;
}

.install-note-button:hover {
  border-color: rgba(95, 168, 241, 0.55);
  background: rgba(95, 168, 241, 0.12);
  animation: none;
}

.install-note-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: rgba(95, 168, 241, 0.2);
  color: #dbeafc;
  font-size: 13px;
}

.install-note-copy {
  margin: 8px 0 0;
  color: var(--subtle);
  font-size: 11px;
}

@keyframes install-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(95, 168, 241, 0);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(95, 168, 241, 0.07);
  }
}

/* ---------- Suggestions ---------- */

.suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-top: 20px;
}

.suggestion {
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-size: 12.5px;
  transition:
    color 150ms var(--ease),
    border-color 150ms var(--ease),
    background 150ms var(--ease);
}

.suggestion:hover {
  border-color: rgba(95, 168, 241, 0.42);
  background: rgba(95, 168, 241, 0.08);
  color: #e2eefb;
}

/* ---------- Capacités ---------- */

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 26px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.feature {
  padding: 22px 22px 26px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.017), transparent 72%);
}

.feature h2 {
  margin: 0 0 7px;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.feature p {
  max-width: 34ch;
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.65;
}

.home-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 2px 6px;
  color: var(--subtle);
  font-size: 0.78rem;
}

.home-footer p {
  margin: 0;
}

.footer-note {
  display: block;
  margin-top: 3px;
  color: #59636f;
}

.footer-link {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  transition:
    color 160ms var(--ease),
    border-color 160ms var(--ease);
}

.footer-link:hover {
  border-color: rgba(95, 168, 241, 0.45);
  color: #d8e9fb;
}

/* ---------- Révélation au scroll ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.7s var(--ease),
    transform 0.7s var(--ease);
  transition-delay: calc(var(--delay, 0) * 80ms);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Conversation ---------- */

.chat {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
}

.chat-scroll {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.chat-scroll::-webkit-scrollbar {
  width: 10px;
}

.chat-scroll::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  background-clip: content-box;
}

.messages {
  display: flex;
  width: min(100%, 820px);
  flex-direction: column;
  gap: 28px;
  margin: 0 auto;
  padding: 30px clamp(16px, 4vw, 28px) 220px;
}

.msg {
  animation: msg-in 0.45s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}

@keyframes msg-in {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.msg--user {
  align-self: flex-end;
  max-width: min(86%, 620px);
}

.msg--user .bubble {
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px 16px 6px 16px;
  background: linear-gradient(180deg, #1a2130, #151a24);
  color: #eef3fa;
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.msg--assistant {
  max-width: 100%;
  color: var(--text-soft);
  font-size: 0.965rem;
  line-height: 1.72;
}

.msg--assistant.is-error .bubble {
  padding: 14px 16px;
  border: 1px solid rgba(255, 120, 120, 0.26);
  border-radius: 14px;
  background: rgba(255, 90, 90, 0.07);
  color: #ffc9c9;
}

.prose > *:first-child {
  margin-top: 0;
}

.prose > *:last-child {
  margin-bottom: 0;
}

.prose p {
  margin: 0 0 0.95em;
  overflow-wrap: anywhere;
}

.prose h2,
.prose h3 {
  margin: 1.5em 0 0.55em;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.35;
}

.prose h3 {
  font-size: 0.98rem;
  color: var(--ice);
}

.prose ul,
.prose ol {
  margin: 0 0 1em;
  padding-left: 1.3em;
}

.prose li {
  margin: 0.32em 0;
  padding-left: 0.15em;
}

.prose li::marker {
  color: var(--blue);
}

.prose strong {
  color: #fff;
  font-weight: 600;
}

.prose em {
  color: #d6e7fb;
}

.prose a {
  color: #9ccbf7;
  text-decoration: underline;
  text-decoration-color: rgba(156, 203, 247, 0.4);
  text-underline-offset: 3px;
}

.prose blockquote {
  margin: 1em 0;
  padding: 2px 0 2px 14px;
  border-left: 2px solid rgba(95, 168, 241, 0.5);
  color: var(--muted);
}

.prose hr {
  margin: 1.6em 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.prose code:not(pre code) {
  padding: 0.14em 0.4em;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: #cfe4fb;
  font-family: var(--font-mono);
  font-size: 0.855em;
}

.prose table {
  width: 100%;
  margin: 1em 0;
  border-collapse: collapse;
  font-size: 0.9em;
}

.prose th,
.prose td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.prose th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.85em;
}

.prose .block-in {
  animation: block-in 0.36s var(--ease) both;
}

@keyframes block-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Bloc de code */

.code-block {
  margin: 1.1em 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: #080a0f;
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.024);
}

.code-lang {
  color: var(--subtle);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.code-copy {
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  transition:
    color 140ms var(--ease),
    border-color 140ms var(--ease);
}

.code-copy:hover {
  border-color: rgba(95, 168, 241, 0.42);
  color: #d8e9fb;
}

.code-block pre {
  margin: 0;
  padding: 14px 16px 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12.8px;
  line-height: 1.68;
  tab-size: 2;
}

.code-block code {
  font-family: inherit;
}

.tok-key {
  color: #8fc4ff;
}

.tok-str {
  color: #b9e6c8;
}

.tok-com {
  color: #5f6a7a;
  font-style: italic;
}

.tok-num {
  color: #f2d59a;
}

.tok-fun {
  color: #c7b4ff;
}

.tok-tag {
  color: #8fc4ff;
}

.tok-attr {
  color: #f2d59a;
}

/* Raisonnement */

.reasoning {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.reasoning summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  list-style: none;
}

.reasoning summary::-webkit-details-marker {
  display: none;
}

.reasoning summary::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 10px rgba(95, 168, 241, 0.7);
  content: "";
}

.reasoning[open] summary {
  border-bottom: 1px solid var(--line);
  color: #cfe2f8;
}

.reasoning-body {
  max-height: 280px;
  padding: 12px 14px;
  overflow-y: auto;
  color: #a3afbf;
  font-size: 12.8px;
  line-height: 1.7;
  white-space: pre-wrap;
}

/* Actions sous un message */

.msg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  opacity: 0.74;
  transition: opacity 160ms var(--ease);
}

.msg:hover .msg-actions,
.msg-actions:focus-within {
  opacity: 1;
}

.msg-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--subtle);
  font-size: 11.5px;
  transition:
    background 140ms var(--ease),
    color 140ms var(--ease),
    border-color 140ms var(--ease);
}

.msg-action:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
}

/* Image générée */

.generated {
  margin-top: 4px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.generated img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 640px;
}

.generated-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
}

.generated-prompt {
  flex: 1;
  min-width: 180px;
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

.generated-actions {
  display: flex;
  gap: 6px;
}

.generated-actions a,
.generated-actions button {
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  font-size: 12px;
  text-decoration: none;
}

.generated-actions a:hover,
.generated-actions button:hover {
  border-color: rgba(95, 168, 241, 0.42);
  color: #d8e9fb;
}

/* ---------- Indicateur de réflexion ---------- */

.typing-row {
  width: min(100%, 820px);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 28px) 20px;
}

.thinking {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border: 1px solid rgba(95, 168, 241, 0.2);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(95, 168, 241, 0.09), rgba(23, 70, 128, 0.1));
}

.thinking-dots {
  display: inline-flex;
  gap: 4px;
}

.thinking-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blue-soft);
  animation: dot-pulse 1.25s ease-in-out infinite;
}

.thinking-dots i:nth-child(2) {
  animation-delay: 0.16s;
}

.thinking-dots i:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes dot-pulse {
  0%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  45% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.thinking-label {
  color: #d5e6fa;
  font-size: 12.5px;
  letter-spacing: 0.01em;
}

.thinking-label::after {
  content: "…";
}

.thinking-time {
  color: var(--subtle);
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.thinking-steps {
  margin-top: 8px;
  padding-left: 2px;
  color: var(--subtle);
  font-family: var(--font-mono);
  font-size: 11.5px;
  min-height: 18px;
}

.thinking-steps span {
  animation: step-in 0.4s var(--ease) both;
}

@keyframes step-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Zone de saisie du chat ---------- */

.composer-dock {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  padding: 46px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(
    to top,
    var(--ink) 0%,
    var(--ink) 58%,
    rgba(6, 8, 11, 0.86) 78%,
    rgba(6, 8, 11, 0) 100%
  );
  pointer-events: none;
}

.composer-inner {
  width: min(100%, 860px);
  margin: 0 auto;
  pointer-events: auto;
}

.composer-hint {
  margin: 7px 4px 0;
  color: #56616f;
  font-size: 10.5px;
  text-align: center;
}

/* ---------- Écran de chargement ---------- */

.loading {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 7, 10, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 260ms var(--ease);
}

.loading.is-visible {
  opacity: 1;
}

.loading-inner {
  display: flex;
  width: min(100%, 360px);
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.loading-logo {
  display: grid;
  place-items: center;
  animation: loading-float 2.4s ease-in-out infinite;
}

.loading-logo .ddi {
  width: 92px;
  height: 92px;
}

@keyframes loading-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.loading-title {
  margin: 20px 0 0;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.loading-track {
  position: relative;
  width: 176px;
  height: 2px;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
}

.loading-track span {
  position: absolute;
  top: 0;
  left: 0;
  width: 42%;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--blue-soft), transparent);
  animation: loading-slide 1.25s var(--ease) infinite;
}

@keyframes loading-slide {
  from {
    transform: translateX(-110%);
  }
  to {
    transform: translateX(360%);
  }
}

.loading-step {
  margin: 12px 0 0;
  color: var(--subtle);
  font-family: var(--font-mono);
  font-size: 10.8px;
  letter-spacing: 0.02em;
}

/* ---------- Historique ---------- */

.history-scrim,
.sheet-scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(3, 5, 8, 0.64);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 200ms var(--ease);
}

.history-scrim.is-visible,
.sheet-scrim.is-visible {
  opacity: 1;
}

.history-panel {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 51;
  display: flex;
  width: min(88vw, 350px);
  flex-direction: column;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: #0a0d12;
  transform: translateX(-102%);
  transition: transform 260ms var(--ease);
}

.history-panel.is-open {
  transform: none;
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 12px;
}

.history-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.history-list {
  flex: 1;
  overflow-y: auto;
  padding-top: 6px;
}

.history-empty {
  margin: 10px 6px;
  color: var(--subtle);
  font-size: 12.5px;
  line-height: 1.6;
}

.history-item {
  display: flex;
  width: 100%;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  margin-bottom: 4px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #c9d2df;
  text-align: left;
  transition:
    background 140ms var(--ease),
    border-color 140ms var(--ease);
}

.history-item:hover,
.history-item[aria-current="true"] {
  border-color: var(--line);
  background: var(--surface);
}

.history-item svg {
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--subtle);
}

.history-item-text {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.history-title {
  overflow: hidden;
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-date {
  color: var(--subtle);
  font-size: 10.5px;
}

.history-note {
  margin: 10px 6px 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--subtle);
  font-size: 10.5px;
  line-height: 1.55;
}

/* ---------- À propos ---------- */

.about-panel {
  position: fixed;
  inset: auto 0 0;
  z-index: 51;
  display: flex;
  max-height: 88dvh;
  flex-direction: column;
  border-top: 1px solid var(--line-strong);
  border-radius: 22px 22px 0 0;
  background: #0b0e14;
  box-shadow: 0 -30px 80px rgba(0, 0, 0, 0.6);
  transform: translateY(102%);
  transition: transform 280ms var(--ease);
}

.about-panel.is-open {
  transform: none;
}

.about-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.about-logo .ddi {
  width: 44px;
  height: 44px;
  filter: none;
}

.about-heading {
  min-width: 0;
  flex: 1;
}

.about-heading h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.about-heading p {
  margin: 2px 0 0;
  color: var(--subtle);
  font-size: 11.5px;
}

.about-body {
  overflow-y: auto;
  padding: 6px 18px 28px;
}

.about-facts {
  margin: 12px 0 4px;
}

.about-facts > div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.about-facts dt {
  color: var(--subtle);
  font-size: 12px;
}

.about-facts dd {
  margin: 0;
  color: var(--text-soft);
  font-size: 12.5px;
  text-align: right;
}

.about-mono {
  font-family: var(--font-mono);
  font-size: 11px !important;
}

.about-block {
  margin-top: 22px;
}

.about-block h3 {
  margin: 0 0 7px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
}

.about-block p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12.8px;
  line-height: 1.68;
}

.about-legal {
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  color: #98a4b4 !important;
  font-size: 12px !important;
}

.about-install {
  width: 100%;
  margin-top: 4px;
  padding: 10px;
  border: 1px solid rgba(95, 168, 241, 0.4);
  border-radius: 11px;
  background: rgba(95, 168, 241, 0.14);
  color: #e6f1fe;
  font-size: 13px;
}

.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.about-links a {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 12px;
  text-decoration: none;
}

.about-links a:hover {
  border-color: rgba(95, 168, 241, 0.45);
  color: #d8e9fb;
}

/* ---------- Toast et astuce iOS ---------- */

.toast {
  position: fixed;
  bottom: 186px;
  left: 50%;
  z-index: 80;
  padding: 9px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #171c26;
  color: var(--text);
  font-size: 12.5px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition:
    opacity 200ms var(--ease),
    transform 200ms var(--ease);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.ios-tip {
  position: fixed;
  right: 14px;
  bottom: 14px;
  left: 14px;
  z-index: 81;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #141a24;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

.ios-tip p {
  flex: 1;
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.5;
}

.ios-tip button {
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  font-size: 12px;
}

/* ---------- Écran d'ouverture ---------- */

.intro {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 28px;
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgba(23, 70, 128, 0.28), transparent 70%),
    radial-gradient(circle at 50% 120%, rgba(95, 168, 241, 0.14), transparent 60%),
    #04060a;
  opacity: 1;
  transition: opacity 620ms var(--ease), visibility 620ms;
}

.intro.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.intro-inner {
  display: flex;
  width: min(100%, 720px);
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.intro-stage {
  position: relative;
  display: grid;
  width: 150px;
  height: 150px;
  place-items: center;
}

.intro-orbit {
  position: absolute;
  inset: 0;
  border: 1px dashed rgba(219, 233, 251, 0.18);
  border-radius: 50%;
  animation: intro-orbit 14s linear infinite;
}

.intro-orbit::before {
  position: absolute;
  top: -3px;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #dbe9fb;
  box-shadow: 0 0 12px rgba(219, 233, 251, 0.9);
  content: "";
}

@keyframes intro-orbit {
  to {
    transform: rotate(360deg);
  }
}

.intro-ball {
  position: relative;
  display: block;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, #ffffff 0%, #dbeeff 18%, #8fc6f7 48%, #3f83cf 72%, #14365e 100%);
  box-shadow:
    0 0 0 1px rgba(219, 233, 251, 0.28),
    0 18px 48px rgba(95, 168, 241, 0.35),
    inset -12px -16px 34px rgba(6, 16, 30, 0.55);
  animation:
    intro-roll 1.75s cubic-bezier(0.24, 0.9, 0.24, 1) both,
    intro-glow 3.2s ease-in-out 1.6s infinite;
}

.intro-ball i {
  position: absolute;
  top: 16%;
  left: 22%;
  width: 30%;
  height: 22%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  filter: blur(3px);
  transform: rotate(-28deg);
}

@keyframes intro-roll {
  0% {
    opacity: 0;
    transform: translate3d(-58vw, 26px, 0) rotate(-620deg) scale(0.86);
  }
  62% {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }
  78% {
    transform: translate3d(0, -12px, 0) rotate(0deg) scale(1.03);
  }
  92% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(0.99);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }
}

@keyframes intro-glow {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(219, 233, 251, 0.28),
      0 18px 48px rgba(95, 168, 241, 0.32),
      inset -12px -16px 34px rgba(6, 16, 30, 0.55);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(219, 233, 251, 0.42),
      0 22px 62px rgba(95, 168, 241, 0.5),
      inset -12px -16px 34px rgba(6, 16, 30, 0.55);
  }
}

.intro-shine {
  position: absolute;
  bottom: 6px;
  width: 118px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(95, 168, 241, 0.34), transparent 70%);
  filter: blur(6px);
  animation: intro-shine 1.9s var(--ease) both;
}

@keyframes intro-shine {
  from {
    opacity: 0;
    transform: scaleX(0.2);
  }
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

.intro-title {
  margin: 40px 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 7vw, 4.1rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.045em;
  text-transform: uppercase;
}

.intro-line {
  display: block;
  overflow: hidden;
  padding: 0.04em 0.06em;
}

.intro-line > span {
  display: inline-block;
  transform: translateY(105%);
  animation: intro-rise 0.85s var(--ease) forwards;
}

.intro-line--accent > span {
  background: linear-gradient(96deg, #ffffff 4%, #dbe9fb 38%, #8dc2f6 72%, #4c8fdc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.intro-title .intro-line:first-child > span {
  animation-delay: 0.95s;
}

.intro-title .intro-line--accent > span {
  animation-delay: 1.12s;
}

@keyframes intro-rise {
  to {
    transform: translateY(0);
  }
}

.intro-loader {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin-top: 30px;
  opacity: 0;
  animation: intro-fade 0.5s var(--ease) 1.6s forwards;
}

.intro-ring {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(219, 233, 251, 0.12);
  border-top-color: #dbe9fb;
  border-right-color: rgba(95, 168, 241, 0.75);
  border-radius: 50%;
  animation: intro-spin 0.95s linear infinite;
}

.intro-ring--delay {
  inset: 6px;
  border-width: 1.5px;
  border-top-color: rgba(95, 168, 241, 0.55);
  border-right-color: transparent;
  animation-duration: 1.5s;
  animation-direction: reverse;
}

.intro-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #dbe9fb;
  box-shadow: 0 0 12px rgba(219, 233, 251, 0.9);
}

@keyframes intro-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes intro-fade {
  to {
    opacity: 1;
  }
}

.intro-status {
  margin: 14px 0 0;
  color: #a9c4e2;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  opacity: 0;
  animation: intro-fade 0.5s var(--ease) 1.75s forwards;
}

.intro-meta {
  margin: 26px 0 0;
  color: #4f5c6d;
  font-size: 10.5px;
  letter-spacing: 0.03em;
}

@media (max-width: 560px) {
  .intro-stage {
    width: 124px;
    height: 124px;
  }

  .intro-ball {
    width: 76px;
    height: 76px;
  }

  .intro-title {
    margin-top: 32px;
  }
}

/* ---------- Adaptations ---------- */

@media (min-width: 860px) {
  .about-panel {
    inset: 50% auto auto 50%;
    width: min(92vw, 620px);
    max-height: 84dvh;
    border: 1px solid var(--line-strong);
    border-radius: 20px;
    opacity: 0;
    transform: translate(-50%, -46%);
    transition:
      transform 260ms var(--ease),
      opacity 200ms var(--ease);
  }

  .about-panel.is-open {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

@media (max-width: 820px) {
  .features {
    grid-template-columns: 1fr;
  }

  .feature {
    padding: 18px 18px 22px;
  }
}

@media (max-width: 760px) {
  .home-inner {
    min-height: auto;
    padding-top: 30px;
  }

  .hero-mark {
    width: 108px;
    height: 108px;
    margin-bottom: 18px;
  }

  .ddi {
    width: 104px;
    height: 104px;
  }

  .hero-title {
    font-size: clamp(1.7rem, 8vw, 2.3rem);
  }

  .hero-sub {
    margin-top: 13px;
    font-size: 0.92rem;
  }

  .hero-composer {
    margin-top: 24px;
  }

  .composer textarea {
    padding: 14px 15px 2px;
    font-size: 15.5px;
  }

  .messages {
    gap: 24px;
    padding-top: 20px;
    padding-bottom: 200px;
  }

  .msg--user {
    max-width: 92%;
  }

  .msg--assistant {
    font-size: 0.94rem;
  }

  .composer-dock {
    padding: 38px 12px calc(10px + env(safe-area-inset-bottom));
  }

  .counter {
    display: none;
  }

  .toast {
    bottom: 178px;
  }

  .history-panel {
    width: min(92vw, 340px);
  }
}

@media (max-width: 620px) {
  .icon-button span {
    display: none;
  }

  .icon-button {
    width: 36px;
    justify-content: center;
    padding: 0;
  }

  .model-chip {
    font-size: 9.5px;
    padding: 4px 8px;
  }

  .wordmark-light {
    display: none;
  }

  .home-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .about-facts > div {
    flex-direction: column;
    gap: 2px;
  }

  .about-facts dd {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
