:root{
  --sable:#F5EEDA; --creme:#F2E6C9; --text:#2E3D3B; --muted:#5A6A66; --border:#E3D9B9;
  --teal:#0F9A8A; --teal-2:#25C2A0; --gold:#C7B07B; --radius:14px; --shadow:0 8px 26px rgba(0,0,0,.08); --focus:#0F9A8A;
}
*{box-sizing:border-box} html,body{height:100%}
body{margin:0;color:var(--text);background:linear-gradient(180deg,var(--sable) 0%, #F7F1E3 60%, var(--sable) 100%);
  font-family:"Inter", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji"; line-height:1.6;}
h1,h2,h3,.brand__title,.btn{font-family:"Poppins","Inter",ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Arial;letter-spacing:.2px}
a{color:var(--teal);text-decoration:none} a:hover{color:var(--teal-2);text-decoration:underline} :focus{outline:3px solid var(--focus);outline-offset:2px}
.wrap{max-width:1100px;margin-inline:auto;padding:18px}
header.site{background:var(--creme);border-bottom:1px solid var(--border);box-shadow:var(--shadow)}
.header-inner{display:flex;align-items:center;gap:16px;padding:12px 18px}
.brand{display:flex;align-items:center;gap:12px;text-decoration:none;color:var(--text)}
.brand__logo{width:38px;height:38px;display:grid;place-items:center;border-radius:12px;background: radial-gradient(100% 100% at 50% 0%, var(--teal-2), var(--teal));box-shadow: inset 0 0 0 2px #ffffff50}
.brand__title{font-size:1.3rem;font-weight:800}
.brand__subtitle{font-size:.9rem;color:var(--muted)}
@media (min-width:768px){ header.site{position:sticky;top:0;z-index:50} }
nav.site{margin-left:auto}
nav.site ul{list-style:none;display:flex;gap:14px;padding:0;margin:0}
nav.site a{display:inline-block;padding:10px 12px;border-radius:10px;border:1px solid transparent}
nav.site a[aria-current="page"]{background:#ffffffaa;border-color:var(--border)} nav.site a:hover{background:#ffffffcc;text-decoration:none}
main{padding:20px 0} .card{background:var(--creme);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:18px}
.grid{display:grid;gap:18px} @media (min-width:900px){ .grid-2{grid-template-columns:1.2fr 1fr} }
.btn{display:inline-grid;place-items:center;background:linear-gradient(180deg,var(--teal),#0d8678);color:#fff;border:none;border-radius:12px;padding:12px 16px;box-shadow:var(--shadow);font-weight:700}
.btn:hover{filter:brightness(1.05)} .btn.secondary{background:transparent;color:var(--teal);border:1px solid var(--teal)}
footer.site{border-top:1px solid var(--border);margin-top:24px;padding:20px 0;color:var(--muted)}
footer .inner{display:flex;gap:10px;justify-content:space-between;align-items:center}
small.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,"Liberation Mono","Courier New",monospace}
.form{display:grid;gap:12px} label{font-size:.95rem;color:var(--muted)}
textarea,input[type="text"]{border-radius:12px;border:1px solid var(--border);background:#fffaf0;padding:12px 14px;color:var(--text)}
.messages{display:flex;flex-direction:column;gap:12px}
.msg{display:grid;grid-template-columns:auto 1fr;gap:12px;align-items:flex-start}
.avatar{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:var(--teal);color:#fff}
.avatar.user{background:#8A9C97}
.bubble{background:#fffdf5;border:1px solid var(--border);border-radius:12px;padding:12px 14px}
.meta{font-size:.85rem;color:var(--muted);margin-bottom:4px}
.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}


/* === T20IA enhancements appended === */

/* =====================================================================
   T20IA — Ultra High‑Tech UI Enhancements (v1)
   Adds subtle 3D, neon glow, animated borders, streaming chat effects,
   and performance/UX guards. Safe to append after your existing CSS.
   ---------------------------------------------------------------------
   Namespaces used:
   - .t20ia-*: additive utility classes you can drop into markup
   - structural hooks expect minimal mapping (see comments)
   ===================================================================== */

/* ---------- Root tunables ---------- */
:root{
  --t20-teal: #17b6a1;
  --t20-teal-2: #0f9a8a;
  --t20-cream: #f4ead2;
  --t20-ink: #0b1f1d;
  --t20-shadow-1: 0 10px 30px rgba(15,154,138,.18);
  --t20-shadow-2: 0 22px 60px rgba(15,154,138,.28);
  --t20-glow-teal: 0 0 18px rgba(23,182,161,.9), 0 0 36px rgba(23,182,161,.55);
  --t20-glow-cream: 0 0 12px rgba(244,234,210,.75), 0 0 28px rgba(244,234,210,.45);
  --t20-radius-xl: 18px;
  --t20-grid-fg: rgba(23,182,161,.10);
  --t20-grid-bg: rgba(23,182,161,.04);
}

/* ---------- Subtle animated background grid (hero/page) ---------- */
/* Apply to body or container with class .t20ia-grid */
.t20ia-grid{
  position: relative;
  isolation: isolate;
}
.t20ia-grid::before,
.t20ia-grid::after{
  content:""; position: fixed; inset:-2vmax; z-index:-2;
  background:
    radial-gradient(60vmax 60vmax at 10% -10%, rgba(23,182,161,.08), transparent 55%),
    radial-gradient(60vmax 60vmax at 120% 110%, rgba(244,234,210,.08), transparent 55%);
  filter: saturate(1.1);
}
.t20ia-grid::after{
  z-index:-1; opacity:.65;
  background-image:
    linear-gradient(to right, var(--t20-grid-bg) 1px, transparent 1px),
    linear-gradient(to bottom, var(--t20-grid-bg) 1px, transparent 1px);
  background-size: 24px 24px, 24px 24px;
  mask: linear-gradient(180deg, transparent 0%, #000 20%, #000 80%, transparent 100%);
  animation: t20-pan 22s linear infinite;
}
@keyframes t20-pan{ to { transform: translate3d(-24px,-24px,0); } }

/* ---------- Sticky header polish ---------- */
.t20ia-sticky{
  backdrop-filter: blur(6px) saturate(1.03);
  border-bottom: 1px solid rgba(23,182,161,.12);
  box-shadow: 0 6px 24px rgba(0,0,0,.06);
}

/* ---------- Brand / logo chip with neon ring ---------- */
/* Map this class to your logo container */
.t20ia-logo{
  position:relative; border-radius: 999px; overflow: visible;
  box-shadow: inset 0 0 0 1px #ffffff50, var(--t20-shadow-1);
  transition: transform .28s ease, box-shadow .28s ease;
  perspective: 600px; transform-style: preserve-3d;
}
.t20ia-logo::after{
  content:""; position:absolute; inset:-4px; border-radius: 999px;
  border:1px solid rgba(23,182,161,.55);
  box-shadow: var(--t20-glow-teal);
  pointer-events:none;
}
@media (hover:hover){
  .t20ia-logo:hover{ transform: rotateX(6deg) rotateY(-6deg) translateZ(2px); box-shadow: inset 0 0 0 1px #ffffff7a, var(--t20-shadow-2); }
}

/* ---------- Navigation links — neon underline sweep ---------- */
.t20ia-nav a{
  position:relative; overflow:hidden; transform: translateZ(0);
}
.t20ia-nav a::after{
  content:""; position:absolute; left:12px; right:12px; bottom:8px; height:2px;
  background: linear-gradient(90deg,var(--t20-teal-2),var(--t20-teal));
  border-radius:2px; transform-origin:left; transform: scaleX(0);
  transition: transform .22s ease;
  box-shadow: 0 0 8px rgba(23,182,161,.6);
}
@media (hover:hover){ .t20ia-nav a:hover::after{ transform: scaleX(1); } }

/* ---------- Buttons — 3D lift + sheen sweep ---------- */
.t20ia-btn{
  position:relative; isolation:isolate; border-radius: var(--t20-radius-xl);
  box-shadow: var(--t20-shadow-1);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.t20ia-btn::before{
  content:""; position:absolute; inset:-1px; border-radius:inherit;
  background: linear-gradient(115deg,transparent 0%, rgba(255,255,255,.0) 30%, rgba(255,255,255,.35) 48%, rgba(255,255,255,.0) 70%, transparent 100%);
  mix-blend-mode: screen; opacity:.0; transform: translateX(-120%) rotate(8deg);
  transition: transform .6s ease, opacity .3s ease;
}
@media (hover:hover){
  .t20ia-btn:hover{ transform: translateY(-2px); box-shadow: var(--t20-shadow-2); filter: saturate(1.06); }
  .t20ia-btn:hover::before{ opacity:.85; transform: translateX(120%) rotate(8deg); }
}
.t20ia-btn:active{ transform: translateY(0); box-shadow: var(--t20-shadow-1); }

/* ---------- Cards / panels — iridescent edge + micro tilt ---------- */
.t20ia-card{
  position:relative; border-radius: var(--t20-radius-xl);
  transition: transform .25s ease, box-shadow .25s ease;
  box-shadow: 0 10px 30px rgba(0,0,0,.06);
  background-clip: padding-box;
}
.t20ia-card::after{
  content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none;
  background: linear-gradient(#0000,#0000) padding-box,
              linear-gradient(130deg,#ffffffad,rgba(37,194,160,.45),#ffffffad) border-box;
  border:1px solid transparent; opacity:.0; transition: opacity .25s ease;
}
@media (hover:hover){
  .t20ia-card:hover{ transform: translateY(-2px) rotateX(.25deg) rotateY(.25deg); box-shadow: 0 20px 60px rgba(0,0,0,.10); }
  .t20ia-card:hover::after{ opacity:.85; }
}

/* ---------- Avatars / badges — soft radar pulse ---------- */
.t20ia-avatar{ position:relative; z-index:0; }
.t20ia-avatar::after{
  content:""; position:absolute; inset:-3px; border-radius:50%;
  box-shadow: var(--t20-glow-teal); opacity:.0; animation: t20-pulse 2.6s ease-out infinite;
}
@keyframes t20-pulse{
  0%{opacity:.0; transform: scale(.9);}
  25%{opacity:.55;}
  100%{opacity:0; transform: scale(1.35);}
}

/* ---------- Chat: streaming indicator & token shimmer ---------- */
/* Mark the container while the assistant streams tokens: add .t20ia-streaming to the last assistant bubble */
.t20ia-chat .bubble.assistant{
  position: relative;
  background: linear-gradient(180deg,#fffef7, #f6ecd9);
  border-radius: var(--t20-radius-xl);
  box-shadow: 0 10px 30px rgba(0,0,0,.06);
}
/* Animated caret (▌) at the end of streaming text */
.t20ia-chat .bubble.assistant.streaming .content::after{
  content:"▌"; display:inline-block; margin-left:2px;
  animation: t20-caret 1s steps(1,end) infinite;
  color: var(--t20-teal);
}
@keyframes t20-caret{ 50%{opacity:0;} }
/* Shimmer through freshly arrived tokens */
.t20ia-chat .bubble.assistant.streaming .content{
  background:
    linear-gradient(90deg, transparent 0%, rgba(255,255,255,.4) 15%, transparent 30%) no-repeat;
  background-size: 200px 100%;
  animation: t20-token 1.8s ease-in-out infinite;
  -webkit-background-clip: text;
  background-clip: text;
}
@keyframes t20-token{ 0%{ background-position:-220px 0; } 100%{ background-position:220px 0; } }
/* Typing dots for the model */
.t20ia-typing{
  display:inline-flex; gap:4px; align-items:center; margin-left:4px;
}
.t20ia-typing i{
  width:6px; height:6px; border-radius:50%; background: var(--t20-teal); opacity:.35;
  animation: t20-typing 1.2s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(23,182,161,.6);
}
.t20ia-typing i:nth-child(2){ animation-delay:.15s; }
.t20ia-typing i:nth-child(3){ animation-delay:.3s; }
@keyframes t20-typing{
  0%,60%,100%{ transform: translateY(0); opacity:.35;}
  30%{ transform: translateY(-4px); opacity:1;}
}

/* Bubble hover: show timestamp/actions with futuristic border */
.t20ia-chat .bubble:hover{
  outline: 1px solid rgba(23,182,161,.25);
  box-shadow: 0 0 0 1px rgba(23,182,161,.18), var(--t20-shadow-1);
}

/* ---------- Focus rings (keyboard a11y, high‑tech style) ---------- */
:where(a,button,input,textarea,[tabindex]):focus-visible{
  outline: 2px solid rgba(23,182,161,.75) !important;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(23,182,161,.15);
  border-radius: 10px;
}

/* ---------- Prefers Reduced Motion: kill fancy moves ---------- */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{ animation: none !important; transition: none !important; }
}

/* ---------- Optional helpers you can apply in markup ---------- */
.t20ia-glow{ box-shadow: var(--t20-glow-teal); }
.t20ia-glow-cream{ box-shadow: var(--t20-glow-cream); }
.t20ia-tilt{ transform: perspective(600px) rotateX(4deg) rotateY(-4deg); }



/* === T20IA final CSS-only stream & mobile overrides appended === */

/* =====================================================================
   T20IA — CSS-only streaming & mobile polish (no JS required)
   ===================================================================== */

/* Focus ring mobile + iOS tap */
@media (max-width: 480px){
  :where(a,button,input,textarea,[tabindex]):focus-visible{
    outline: 2px solid rgba(23,182,161,.6) !important;
    outline-offset: 1px;
    box-shadow: 0 0 0 3px rgba(23,182,161,.12);
  }
}
* { -webkit-tap-highlight-color: rgba(0,0,0,0); }

/* Corners tighter on small screens to avoid glow bleed */
@media (max-width: 480px){
  .t20ia-card, .t20ia-btn, .t20ia-logo, .bubble{ border-radius: 14px; }
}

/* Nav underline shorter on small devices */
@media (max-width: 480px){
  .t20ia-nav a::after{ left:10px; right:10px; bottom:.35rem; }
}

/* Buttons shadow tuning */
.t20ia-btn{ box-shadow: 0 8px 24px rgba(0,0,0,.10); }
.t20ia-btn:hover{ box-shadow: 0 12px 36px rgba(0,0,0,.14); }
.t20ia-btn:focus-visible{ box-shadow: 0 0 0 2px #e8fff9 inset, 0 0 0 4px rgba(23,182,161,.25); }

/* ===== Chat streaming (CSS only) ===== */
.t20ia-chat .bubble{ position:relative; border-radius:14px; }

/* Mark the last assistant bubble as streaming with .streaming or aria-busy="true" */
.t20ia-chat .bubble.assistant.streaming,
.t20ia-chat .bubble.assistant[aria-busy="true"]{
  box-shadow: 0 0 0 1px rgba(23,182,161,.18) inset, 0 8px 24px rgba(0,0,0,.08);
  background:
    linear-gradient(90deg, rgba(24,185,161,.08), transparent 20% 80%, rgba(24,185,161,.08)),
    #fffaf0;
  background-size: 180px 100%, auto;
  animation: t20-float 6s ease-in-out infinite;
}
@keyframes t20-float{
  0%,100%{ transform: translateY(0); }
  50%{ transform: translateY(-1px); }
}

/* Shimmer through the text while streaming */
.t20ia-chat .bubble.assistant.streaming .content,
.t20ia-chat .bubble.assistant[aria-busy="true"] .content{
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.45) 15%, transparent 30%) no-repeat;
  background-size: 200px 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: t20-token 1.7s ease-in-out infinite;
}
@keyframes t20-token{
  0%{ background-position:-220px 0; }
  100%{ background-position:220px 0; }
}

/* Caret cursor at the end of streaming text */
.t20ia-chat .bubble.assistant.streaming .content::after,
.t20ia-chat .bubble.assistant[aria-busy="true"] .content::after{
  content:"▌"; display:inline-block; margin-left:2px; color:#18b9a1;
  animation: t20-caret 1s steps(1,end) infinite;
}
@keyframes t20-caret{ 50%{ opacity:0; } }

/* Typing dots (optional) */
.t20ia-typing{ display:inline-flex; gap:4px; align-items:center; margin-left:6px; }
.t20ia-typing i{
  width:6px; height:6px; border-radius:50%;
  background:#18b9a1; opacity:.35; box-shadow: 0 0 8px rgba(24,185,161,.5);
  animation: t20-typing 1.2s ease-in-out infinite;
}
.t20ia-typing i:nth-child(2){ animation-delay:.15s; }
.t20ia-typing i:nth-child(3){ animation-delay:.30s; }
@keyframes t20-typing{
  0%,60%,100%{ transform: translateY(0); opacity:.35; }
  30%{ transform: translateY(-4px); opacity:1; }
}

/* Mobile tweaks for streaming */
@media (max-width: 480px){
  .t20ia-chat .bubble.assistant.streaming .content,
  .t20ia-chat .bubble.assistant[aria-busy="true"] .content{
    animation-duration: 2.2s;
    background-size: 160px 100%;
  }
}

/* A11y: reduce motion */
@media (prefers-reduced-motion: reduce){
  .t20ia-chat .bubble.assistant.streaming .content,
  .t20ia-chat .bubble.assistant[aria-busy="true"] .content{
    animation: none !important;
  }
  .t20ia-typing i{ animation: none !important; opacity:.6; }
}



/* === Code blocks responsive fix (T20IA) === */
.code-block{
  max-width: 100%;
  box-sizing: border-box;
  background: #f8f8f8;
  border: 1px solid var(--border,#e5e7eb);
  border-radius: 12px;
  padding: 12px;
  white-space: pre-wrap;       /* autorise les retours à la ligne */
  word-break: break-word;      /* évite les débordements */
  overflow-wrap: anywhere;
  overflow-x: auto;            /* scroll horizontal si besoin */
  margin: .75rem 0;
  font-family: ui-monospace,SFMono-Regular,Menlo,Monaco,"Liberation Mono",Consolas,monospace;
  font-size: .9rem;
  line-height: 1.45;
  color: #1a1a1a;
}

@media (max-width: 480px){
  .code-block{ font-size: .85rem; padding:10px; }
}

