/* ============ MODE TUTO ============ */
.tool-fh, .tp-fh { --tool: var(--c-forgehook); }
.tool-af, .tp-af { --tool: var(--c-archiveforge); }
.tool-bt, .tp-bt { --tool: var(--c-bot); }
.tool-rs, .tp-rs { --tool: var(--c-rssdi); }
.tool-hb, .tp-hb { --tool: var(--c-heiphaisbot); }

:root { --c-heiphaisbot: #ec4899; }

.nav-links a.current { color: var(--text-1); }

/* --- En-tête du tuto --- */
.tp-hero { position: relative; padding: 140px 0 70px; overflow: hidden; }
.tp-hero::before {
  content: ""; position: absolute; top: -260px; left: 50%; translate: -50% 0;
  width: 1000px; height: 640px; pointer-events: none;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--tool) 16%, transparent) 0%, transparent 65%);
}
.tp-hero .wrap { display: grid; grid-template-columns: 1fr 1.05fr; gap: 56px; align-items: center; position: relative; }
.tp-crumb { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-3); margin-bottom: 18px; }
.tp-crumb a { color: var(--text-2); }
.tp-crumb a:hover { color: var(--tool); }
.tp-kicker {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 18px;
  font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--tool);
}
.tp-kicker .t-icon { width: 40px; height: 40px; }
.tp-kicker .t-icon svg { width: 21px; height: 21px; }
.tp-hero h1 {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.06;
  font-size: clamp(2.2rem, 4.4vw, 3.6rem); margin-bottom: 20px;
}
.tp-hero h1 span { color: var(--tool); }
.tp-hero .lead { max-width: 560px; }
.tp-facts { display: grid; grid-template-columns: repeat(3, auto); gap: 10px 28px; justify-content: start; margin-top: 8px; }
.tp-facts div { display: flex; flex-direction: column; gap: 2px; }
.tp-facts b { font-family: var(--font-display); font-size: 1.05rem; }
.tp-facts span { font-size: 0.76rem; color: var(--text-3); }

/* --- Sections --- */
.tp-section { padding: 80px 0; }
.tp-section .section-header { margin-bottom: 44px; }
.tp-section .eyebrow { color: var(--tool); }

.uses { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.use {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 26px 24px; position: relative; overflow: hidden;
  transition: border-color var(--t-lg) var(--ease), translate var(--t-lg) var(--ease);
}
.use:hover { border-color: color-mix(in srgb, var(--tool) 40%, transparent); translate: 0 -3px; }
.use::after {
  content: ""; position: absolute; inset: auto -60px -80px auto; width: 200px; height: 200px;
  background: radial-gradient(circle, color-mix(in srgb, var(--tool) 10%, transparent), transparent 70%);
}
.use .n { font-family: var(--font-mono); font-size: 0.72rem; color: var(--tool); margin-bottom: 10px; display: block; }
.use h3 { font-family: var(--font-display); font-size: 1.08rem; margin-bottom: 8px; }
.use p { font-size: 0.9rem; color: var(--text-2); font-weight: 300; }

/* --- Pas à pas : texte qui défile + écran collant --- */
.walk { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 56px; align-items: start; }
.steps { display: flex; flex-direction: column; gap: 22px; padding-bottom: 30vh; }
.step {
  position: relative; padding: 24px 24px 24px 70px;
  border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg-card);
  opacity: 0.45; transition: opacity var(--t-lg) var(--ease), border-color var(--t-lg) var(--ease), background var(--t-lg) var(--ease);
}
.step.active { opacity: 1; border-color: color-mix(in srgb, var(--tool) 45%, transparent); background: color-mix(in srgb, var(--tool) 4%, var(--bg-card)); }
.step .sn {
  position: absolute; left: 22px; top: 22px; width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.82rem; font-weight: 500;
  color: var(--tool); border: 1px solid color-mix(in srgb, var(--tool) 45%, transparent);
  transition: background var(--t-lg) var(--ease), color var(--t-lg) var(--ease);
}
.step.active .sn { background: var(--tool); color: #0a0a0c; }
.step h3 { font-family: var(--font-display); font-size: 1.12rem; margin-bottom: 8px; }
.step p, .step li { font-size: 0.92rem; color: var(--text-2); font-weight: 300; }
.step ul { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.step li { position: relative; padding-left: 18px; }
.step li::before { content: "›"; position: absolute; left: 2px; color: var(--tool); font-weight: 600; }
.step .tip {
  margin-top: 12px; font-size: 0.84rem; color: var(--text-2);
  border-left: 2px solid var(--tool); padding: 6px 12px; background: var(--bg-elevated); border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.step kbd, .k {
  font-family: var(--font-mono); font-size: 0.8em; color: var(--text-1);
  background: var(--bg-overlay); border: 1px solid var(--border-med); border-radius: 5px; padding: 1px 6px;
}

.screen-wrap { position: sticky; top: 96px; }
.screen {
  position: relative; aspect-ratio: 16 / 11; border-radius: var(--r-lg); overflow: hidden;
  background: #0e0e13; border: 1px solid var(--border-med);
  box-shadow: var(--shadow-lg), 0 0 80px color-mix(in srgb, var(--tool) 14%, transparent);
}
.screen-bar {
  position: absolute; top: 0; left: 0; right: 0; height: 36px; z-index: 3;
  display: flex; align-items: center; gap: 7px; padding: 0 14px;
  background: var(--bg-elevated); border-bottom: 1px solid var(--border);
}
.screen-bar i { width: 10px; height: 10px; border-radius: 50%; background: #3d3d4a; }
.screen-bar .screen-label { margin-left: 8px; font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.screen-bar .demo { margin-left: auto; font-family: var(--font-mono); font-size: 0.62rem; color: var(--text-3); border: 1px solid var(--border-med); padding: 1px 6px; border-radius: 4px; }
.screen-dots { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.screen-dots button {
  width: 26px; height: 5px; border-radius: 3px; border: 0; cursor: pointer; background: var(--bg-overlay);
  transition: background var(--t) var(--ease), width var(--t) var(--ease);
}
.screen-dots button.on { background: var(--tool); width: 40px; }
.screen-note { text-align: center; font-size: 0.74rem; color: var(--text-3); margin-top: 10px; }

.scene {
  position: absolute; inset: 36px 0 0 0; padding: 0; display: flex;
  opacity: 0; translate: 0 14px; scale: 0.985; pointer-events: none;
  transition: opacity 450ms var(--ease), translate 550ms var(--ease), scale 550ms var(--ease);
}
.scene.on { opacity: 1; translate: 0 0; scale: 1; pointer-events: auto; }

/* --- Briques d'interface (reconstitutions) --- */
.ui-side { width: 26%; min-width: 110px; background: #121218; border-right: 1px solid var(--border); padding: 12px 8px; display: flex; flex-direction: column; gap: 3px; }
.ui-brand { font-family: var(--font-display); font-weight: 700; font-size: 0.82rem; padding: 4px 8px 12px; color: var(--tool); }
.ui-nav { font-size: 0.7rem; color: var(--text-2); padding: 6px 8px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-nav.on { background: color-mix(in srgb, var(--tool) 16%, transparent); color: var(--text-1); }
.ui-main { flex: 1; min-width: 0; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.ui-title { font-family: var(--font-display); font-size: 0.95rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.ui-title .ui-btn { margin-left: auto; }
.ui-sub { font-size: 0.68rem; color: var(--text-3); margin-top: -6px; }
.ui-row { display: flex; gap: 10px; align-items: center; }
.ui-col { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.ui-label { font-size: 0.62rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }
.ui-field {
  font-size: 0.72rem; color: var(--text-1); background: #17171e; border: 1px solid var(--border-med);
  border-radius: 6px; padding: 6px 9px; min-height: 28px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ui-field.mono { font-family: var(--font-mono); font-size: 0.66rem; }
.ui-field.focus { border-color: var(--tool); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tool) 18%, transparent); }
.ui-area { white-space: normal; min-height: 52px; line-height: 1.45; }
.ui-btn {
  display: inline-flex; align-items: center; gap: 6px; font-size: 0.68rem; font-weight: 500; white-space: nowrap;
  padding: 6px 11px; border-radius: 6px; background: var(--tool); color: #0a0a0c;
}
.ui-btn.ghost { background: transparent; color: var(--text-2); border: 1px solid var(--border-med); }
.ui-chip { font-size: 0.6rem; padding: 2px 7px; border-radius: 99px; border: 1px solid var(--border-med); color: var(--text-2); white-space: nowrap; }
.ui-chip.ok { color: #22c55e; border-color: rgba(34,197,94,0.35); }
.ui-chip.warn { color: #f59e0b; border-color: rgba(245,158,11,0.35); }
.ui-chip.tool { color: var(--tool); border-color: color-mix(in srgb, var(--tool) 40%, transparent); }
.ui-card { background: #15151c; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.ui-list { display: flex; flex-direction: column; gap: 6px; }
.ui-item { display: flex; align-items: center; gap: 8px; font-size: 0.7rem; color: var(--text-2); background: #15151c; border: 1px solid var(--border); border-radius: 7px; padding: 7px 10px; }
.ui-item b { color: var(--text-1); font-weight: 500; }
.ui-item .ui-chip { margin-left: auto; }
.ui-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tool); flex-shrink: 0; }
.ui-dot.ok { background: #22c55e; } .ui-dot.off { background: #4a4a5a; }
.ui-bar { height: 6px; border-radius: 3px; background: var(--bg-overlay); overflow: hidden; }
.ui-bar i { display: block; height: 100%; width: 0; background: var(--tool); border-radius: 3px; }
.ui-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ui-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ui-stat { background: #15151c; border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; }
.ui-stat b { display: block; font-family: var(--font-display); font-size: 1rem; }
.ui-stat span { font-size: 0.6rem; color: var(--text-3); }
.ui-toast {
  position: absolute; right: 14px; bottom: 14px; z-index: 2;
  font-size: 0.7rem; background: #1b1b23; border: 1px solid color-mix(in srgb, var(--tool) 45%, transparent);
  border-radius: 8px; padding: 8px 12px; box-shadow: var(--shadow-md); opacity: 0;
}

/* Aperçu Discord (embed, message, commande) */
.dc { background: #313338; border-radius: 8px; padding: 10px 12px; font-size: 0.72rem; color: #dbdee1; }
.dc-msg { display: flex; gap: 9px; }
.dc-av { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; background: var(--tool); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 0.7rem; font-weight: 700; color: #0a0a0c; }
.dc-name { font-weight: 600; color: #f2f3f5; font-size: 0.74rem; }
.dc-name .tag-bot { margin-left: 4px; }
.dc-embed { margin-top: 5px; border-left: 4px solid var(--tool); background: #2b2d31; border-radius: 4px; padding: 8px 10px; max-width: 100%; }
.dc-embed .et { font-weight: 600; color: #f2f3f5; margin-bottom: 3px; }
.dc-embed .ed { color: #c4c7cc; font-size: 0.68rem; line-height: 1.45; }
.dc-embed .ef { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; font-size: 0.64rem; }
.dc-embed .ef b { display: block; color: #f2f3f5; }
.dc-embed .eft { margin-top: 6px; font-size: 0.6rem; color: #949ba4; }
.dc-input { margin-top: auto; background: #383a40; border-radius: 8px; padding: 8px 12px; font-size: 0.72rem; color: #dbdee1; font-family: var(--font-mono); }
.dc-auto { background: #2b2d31; border-radius: 8px; padding: 6px; display: flex; flex-direction: column; gap: 2px; font-size: 0.68rem; }
.dc-auto div { padding: 5px 8px; border-radius: 5px; display: flex; gap: 8px; }
.dc-auto div.sel { background: #404249; }
.dc-auto b { color: #f2f3f5; font-family: var(--font-mono); font-weight: 500; }
.dc-auto span { color: #949ba4; }

/* --- Animations de scène (relancées par la classe .play) --- */
.caret::after { content: ""; display: inline-block; width: 1px; height: 1em; background: var(--text-1); margin-left: 2px; vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.play .typed { display: inline-block; overflow: hidden; white-space: nowrap; vertical-align: bottom; animation: type 1.6s steps(28) 0.3s both; }
@keyframes type { from { max-width: 0; } to { max-width: 100%; } }
.play .pop { animation: pop 500ms var(--ease) both; }
.play .pop.d1 { animation-delay: 0.5s; } .play .pop.d2 { animation-delay: 0.9s; } .play .pop.d3 { animation-delay: 1.3s; }
.play .pop.d4 { animation-delay: 1.7s; } .play .pop.d5 { animation-delay: 2.1s; } .play .pop.d6 { animation-delay: 2.5s; }
@keyframes pop { from { opacity: 0; translate: 0 8px; scale: 0.97; } to { opacity: 1; translate: 0 0; scale: 1; } }
.play .ui-toast { animation: toast 3.4s var(--ease) 1.4s both; }
@keyframes toast { 0% { opacity: 0; translate: 0 10px; } 12%, 85% { opacity: 1; translate: 0 0; } 100% { opacity: 0; translate: 0 -6px; } }
.play .ui-bar i { animation: fill 2.6s var(--ease) 0.4s both; }
.play .ui-bar.b2 i { animation-delay: 0.9s; } .play .ui-bar.b3 i { animation-delay: 1.4s; }
@keyframes fill { to { width: var(--to, 100%); } }
.ui-bar.p35 i { --to: 35%; } .ui-bar.p60 i { --to: 60%; } .ui-bar.p80 i { --to: 80%; } .ui-bar.p100 i { --to: 100%; }
.play .pulse { animation: glow 1.8s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--tool) 25%, transparent); } }
.play .flow { animation: flow 2.4s var(--ease) infinite; }
@keyframes flow { 0% { translate: -10px 0; opacity: 0; } 30%, 70% { opacity: 1; } 100% { translate: 10px 0; opacity: 0; } }

/* --- Fonctionnalités, sécurité, FAQ --- */
.feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-md); padding: 20px; }
.feat h3 { font-family: var(--font-display); font-size: 0.98rem; margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.feat h3::before { content: "◆"; color: var(--tool); font-size: 0.6rem; }
.feat p { font-size: 0.86rem; color: var(--text-2); font-weight: 300; }

.safe { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.safe .feat h3::before { content: "🔒"; font-size: 0.8rem; }

.faq { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.faq details { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px 20px; }
.faq details[open] { border-color: color-mix(in srgb, var(--tool) 35%, transparent); }
.faq summary { cursor: pointer; font-weight: 500; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--tool); font-family: var(--font-mono); }
.faq details[open] summary::after { content: "–"; }
.faq p { margin-top: 10px; color: var(--text-2); font-size: 0.92rem; font-weight: 300; }

.tp-next { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tp-next a {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px 24px;
  display: flex; flex-direction: column; gap: 4px; transition: border-color var(--t) var(--ease), translate var(--t) var(--ease);
}
.tp-next a:hover { border-color: color-mix(in srgb, var(--tool) 45%, transparent); translate: 0 -2px; }
.tp-next a:last-child { text-align: right; }
.tp-next small { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.1em; }
.tp-next b { font-family: var(--font-display); font-size: 1.1rem; color: var(--tool); }

/* --- Section « Mode tuto » de l'accueil --- */
.tuto-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.tuto-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 10px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 24px 22px 22px;
  transition: border-color var(--t-lg) var(--ease), translate var(--t-lg) var(--ease), box-shadow var(--t-lg) var(--ease);
}
.tuto-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--tool); scale: 0 1; transform-origin: left; transition: scale 600ms var(--ease); }
.tuto-card:hover { border-color: color-mix(in srgb, var(--tool) 40%, transparent); translate: 0 -4px; box-shadow: var(--shadow-md); }
.tuto-card:hover::before { scale: 1 1; }
.tuto-card .t-icon { width: 44px; height: 44px; }
.tuto-card h3 { font-family: var(--font-display); font-size: 1.15rem; }
.tuto-card p { font-size: 0.88rem; color: var(--text-2); font-weight: 300; flex: 1; }
.tuto-card .go { font-size: 0.85rem; color: var(--tool); font-weight: 500; display: inline-flex; gap: 6px; align-items: center; }
.tuto-card .go svg { width: 15px; height: 15px; transition: translate var(--t) var(--ease); }
.tuto-card:hover .go svg { translate: 4px 0; }
.tuto-card .meta { font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-3); }

/* Apparition au défilement */
.t-reveal.pre { opacity: 0; translate: 0 26px; transition: opacity 700ms var(--ease), translate 800ms var(--ease); }
.t-reveal.pre.in { opacity: 1; translate: 0 0; }

@media (max-width: 960px) {
  .tp-hero .wrap, .walk { grid-template-columns: 1fr; gap: 36px; }
  .screen-wrap { position: sticky; top: 70px; z-index: 5; order: -1; }
  .screen { aspect-ratio: 16 / 10; }
  .steps { padding-bottom: 0; }
  .uses, .feats { grid-template-columns: 1fr 1fr; }
  .safe { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .tp-hero { padding: 110px 0 50px; }
  .uses, .feats, .tp-next { grid-template-columns: 1fr; }
  .tp-next a:last-child { text-align: left; }
  .tp-facts { grid-template-columns: 1fr 1fr; }
  .screen { font-size: 0.85em; }
  .ui-side { display: none; }
  .step { padding: 20px 18px 20px 60px; }
  .step .sn { left: 16px; top: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .scene { transition: opacity 200ms linear; translate: none; scale: none; }
  .play .typed, .play .pop, .play .ui-toast, .play .ui-bar i, .play .pulse, .play .flow { animation: none; }
  .ui-bar i { width: var(--to, 100%); }
  .ui-toast { opacity: 1; }
}

/* --- Visuel d'en-tête : le résultat dans Discord --- */
.tp-visual { position: relative; perspective: 1400px; }
.tp-visual > * {
  transform: rotateY(-10deg) rotateX(5deg); box-shadow: var(--shadow-lg), 0 0 70px color-mix(in srgb, var(--tool) 18%, transparent);
  animation: float-card 7s ease-in-out infinite; font-size: 1.12rem;
}
.tp-visual .dc-embed { max-width: none; }
@keyframes float-card { 50% { translate: 0 -10px; } }

/* --- Captures réelles --- */
.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: start; }
.shot { margin: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.shot img { display: block; width: 100%; height: auto; transition: scale 700ms var(--ease); }
.shot a { display: block; overflow: hidden; }
.shot:hover img { scale: 1.04; }
.shot figcaption { padding: 12px 16px; font-size: 0.85rem; color: var(--text-2); }
@media (max-width: 960px) { .shots { grid-template-columns: 1fr; } .tp-visual > * { transform: none; font-size: 1rem; } }
@media (prefers-reduced-motion: reduce) { .tp-visual > * { animation: none; } }

/* Correctifs de mise en page */
.tp-visual { padding-right: 28px; }
.tp-visual > * { transform-origin: 70% 50%; }
@media (max-width: 960px) {
  .tp-visual { padding-right: 0; }
  .screen-wrap {
    background: linear-gradient(180deg, var(--bg-base) 88%, transparent);
    margin: 0 -24px; padding: 10px 24px 16px;
  }
  .screen-note { display: none; }
  .screen-dots { margin-top: 10px; }
}
