/* Seule différence avec le bundle du design system : l'@import de Google Fonts est retiré, les polices sont dans fonts.css. */

/* Abysse — composants. Préfixe ab-. Lit les variables de tokens.css. */
:root {
  --ab-ease: cubic-bezier(.2, .8, .2, 1);
  --ab-fast: 160ms;
  --ab-med: 240ms;
}

.ab-root {
  background: var(--bg-100);
  color: var(--ink-100);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Button ----------
   Règle unique de survol, « la lumière part du centre » :
   - un voile (::before) s'ouvre depuis le milieu du bouton jusqu'à ses bords ;
   - un halo flou et diffus (--btn-glow) apparaît autour de la pilule ;
   - à l'appui, tout bouton se tasse à 97 % ;
   - même durée et même courbe partout.
   Chaque variante ne fait que poser ses variables. */
.ab-btn {
  --btn-bg: transparent; --btn-fill: var(--fill-100);
  --btn-border: transparent; --btn-border-hover: transparent;
  --btn-ink: var(--ink-100); --btn-ink-hover: var(--ink-100);
  --btn-glow: 0 0 22px var(--halo);
  --btn-open: 340ms;
  position: relative; isolation: isolate; box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: 44px; padding: 0 22px;
  border: 1px solid var(--btn-border); border-radius: var(--radius-pill);
  background: var(--btn-bg); color: var(--btn-ink);
  font: 500 16px/1 var(--font-sans); letter-spacing: 0; white-space: nowrap;
  cursor: pointer; text-decoration: none;
  transition: border-color var(--ab-med) var(--ab-ease), color var(--ab-med) var(--ab-ease), box-shadow var(--ab-med) var(--ab-ease), transform var(--ab-fast) var(--ab-ease);
}
/* le voile qui s'ouvre du centre vers les bords */
.ab-btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: var(--btn-fill); pointer-events: none;
  clip-path: inset(0 50% 0 50% round 999px); opacity: 0;
  transition: clip-path var(--btn-open) var(--ab-ease), opacity var(--btn-open) var(--ab-ease);
}
.ab-btn:hover::before { clip-path: inset(0 0 0 0 round 999px); opacity: 1; }
.ab-btn svg { width: 18px; height: 18px; flex: none; }
.ab-btn:hover { border-color: var(--btn-border-hover); color: var(--btn-ink-hover); box-shadow: var(--btn-glow); }
.ab-btn:active { transform: scale(.97); }
.ab-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.ab-btn--primary { --btn-bg: var(--white); --btn-fill: var(--white-hover); --btn-ink: var(--on-white); --btn-ink-hover: var(--on-white); --btn-glow: 0 0 28px var(--halo-strong); }
.ab-btn--ghost { --btn-bg: var(--fill-100); --btn-fill: var(--fill-100); --btn-border: var(--line-300); --btn-border-hover: var(--line-400); }
.ab-btn--lg { height: 56px; padding: 0 28px; font-size: 19px; }
.ab-btn--lg svg { width: 20px; height: 20px; }
.ab-btn--block { width: 100%; }
.ab-btn[disabled] { opacity: .4; pointer-events: none; }

/* bouton scindé : survoler l'action allume toute la pilule depuis son centre ;
   survoler la flèche n'allume que la flèche */
.ab-split {
  position: relative; isolation: isolate;
  display: inline-flex; align-items: stretch; border-radius: var(--radius-pill); background: var(--white); color: var(--on-white);
  transition: box-shadow var(--ab-med) var(--ab-ease);
}
.ab-split::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--white-hover); pointer-events: none;
  clip-path: inset(0 50% 0 50% round 999px); opacity: 0;
  transition: clip-path 340ms var(--ab-ease), opacity 340ms var(--ab-ease);
}
.ab-split:has(> .ab-btn:first-child:hover)::before { clip-path: inset(0 0 0 0 round 999px); opacity: 1; }
.ab-split:hover { box-shadow: 0 0 28px var(--halo-strong); }
.ab-split .ab-btn { --btn-bg: transparent; --btn-fill: var(--white-hover); --btn-ink: var(--on-white); --btn-ink-hover: var(--on-white); --btn-glow: none; }
.ab-split .ab-btn:first-child::before { display: none; }
.ab-split .ab-btn:first-child { padding-right: 18px; border-radius: var(--radius-pill) 0 0 var(--radius-pill); }
.ab-split .ab-btn:last-child { padding: 0 16px 0 14px; border-radius: 0 var(--radius-pill) var(--radius-pill) 0; }
.ab-split .ab-btn:last-child::after { content: ""; position: absolute; left: 0; top: 30%; bottom: 30%; width: 1px; background: rgba(11, 11, 14, .18); }

/* petits contrôles : même cran de lumière, sans halo */
.ab-icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  border: 0; border-radius: var(--radius-md); background: transparent; color: var(--ink-200); cursor: pointer;
  transition: background var(--ab-fast) var(--ab-ease), color var(--ab-fast) var(--ab-ease), transform var(--ab-fast) var(--ab-ease);
}
.ab-icon-btn:hover { background: var(--fill-200); color: var(--ink-100); }
.ab-icon-btn:active, .ab-side-new:active, .ab-side-item:active, .ab-lang button:active { transform: scale(.97); }
.ab-icon-btn:focus-visible, .ab-side-new:focus-visible, .ab-side-item:focus-visible, .ab-lang button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ab-icon-btn svg { width: 20px; height: 20px; }

/* ---------- Tag ---------- */
.ab-tag {
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px;
  border: 1px solid var(--line-300); border-radius: var(--radius-sm);
  background: var(--fill-200); box-shadow: var(--shadow-inset);
  font: 500 13px/1 var(--font-mono); letter-spacing: .04em; color: var(--ink-200);
}
.ab-tag--solid { background: var(--ink-100); color: var(--on-white); border-color: transparent; box-shadow: none; font-family: var(--font-sans); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; height: 20px; padding: 0 5px; border-radius: 3px; }
.ab-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font: 400 14px/1.4 var(--font-mono); letter-spacing: .32em; text-transform: uppercase; color: var(--ink-300);
}
.ab-eyebrow svg { width: 14px; height: 14px; color: var(--ink-200); }

/* ---------- Navbar (verre) ---------- */
.ab-nav { /* état « défilé » : verre clair, resserré, compact */
  --nav-ease: 480ms var(--ab-ease);
  box-sizing: border-box; display: flex; align-items: center; gap: 12px;
  height: 46px; padding: 0 5px 0 20px; margin-inline: auto;
  max-width: min(1120px, calc(100% - 96px));
  border: 1px solid var(--glass-edge); border-radius: var(--radius-3xl);
  background: var(--glass); box-shadow: var(--shadow-inset), var(--shadow-float);
  -webkit-backdrop-filter: blur(var(--blur-glass)) saturate(170%); backdrop-filter: blur(var(--blur-glass)) saturate(170%);
  transition: max-width var(--nav-ease), height var(--nav-ease), padding var(--nav-ease), background 360ms var(--ab-ease), border-color 360ms var(--ab-ease), box-shadow 360ms var(--ab-ease), -webkit-backdrop-filter 360ms var(--ab-ease), backdrop-filter 360ms var(--ab-ease);
}
/* tout en haut de page : pas de fond, contenu plus large et plus grand (StickyNav pose .is-top) */
.ab-nav.is-top {
  height: 60px; max-width: min(1360px, 100%); padding-inline: 0;
  background: transparent; border-color: transparent; box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.ab-nav__brand { display: flex; align-items: center; gap: 10px; font: 600 17px/1 var(--font-display); color: var(--ink-100); letter-spacing: -.01em; transition: font-size var(--nav-ease); }
.ab-nav.is-top .ab-nav__brand { font-size: 22px; }
.ab-nav__spacer { flex: 1; }
.ab-nav .ab-btn { height: 34px; padding: 0 13px; font-size: 14px; transition: height var(--nav-ease), font-size var(--nav-ease), padding var(--nav-ease), border-color var(--ab-med) var(--ab-ease), color var(--ab-med) var(--ab-ease), box-shadow var(--ab-med) var(--ab-ease), transform var(--ab-fast) var(--ab-ease); }
.ab-nav .ab-btn--ghost { --btn-bg: var(--fill-200); --btn-fill: var(--fill-100); --btn-border: var(--line-350); --btn-border-hover: var(--line-400); }
.ab-nav.is-top .ab-btn { height: 42px; padding: 0 17px; font-size: 16px; }
.ab-nav.is-top .ab-btn--ghost { --btn-bg: var(--fill-100); --btn-fill: var(--fill-100); --btn-border: var(--line-300); --btn-border-hover: var(--line-400); }
.ab-nav .ab-tag { height: 20px; padding: 0 8px; font-size: 11px; transition: height var(--nav-ease), font-size var(--nav-ease); }
.ab-nav.is-top .ab-tag { height: 26px; padding: 0 10px; font-size: 13px; }
.ab-nav .ab-tag--solid { height: 16px; padding: 0 4px; font-size: 9.5px; }
.ab-nav.is-top .ab-tag--solid { height: 20px; padding: 0 5px; font-size: 11px; }
.ab-lang { display: inline-flex; padding: 3px; border: 1px solid var(--line-100); border-radius: var(--radius-pill); background: var(--fill-100); }
.ab-lang button { border: 0; background: transparent; color: var(--ink-300); font: 500 14px/1 var(--font-sans); height: 30px; padding: 0 14px; border-radius: var(--radius-pill); cursor: pointer; }
.ab-lang button { transition: background var(--ab-fast) var(--ab-ease), color var(--ab-fast) var(--ab-ease), transform var(--ab-fast) var(--ab-ease); }
.ab-lang button:hover { background: var(--fill-100); color: var(--ink-100); }
.ab-lang button[aria-pressed="true"] { background: var(--fill-200); color: var(--ink-100); }

/* ---------- Card ---------- */
.ab-card {
  position: relative; overflow: hidden;
  padding: var(--space-12) 52px;
  border: 1px solid var(--line-100); border-radius: var(--radius-2xl);
  background: var(--bg-200);
}
.ab-card__title { margin: 0 0 var(--space-4); font: 500 26px/1.3 var(--font-sans); color: var(--ink-100); }
.ab-card__text { margin: 0; font: 400 20px/1.65 var(--font-sans); color: var(--ink-300); max-width: 34em; }
.ab-card__stage { margin-top: var(--space-12); }

/* ---------- Window (fenêtre d'application) ---------- */
.ab-window {
  display: grid; grid-template-columns: 300px 1fr; overflow: hidden;
  border: 1px solid var(--line-200); border-radius: var(--radius-lg);
  background: var(--bg-300); box-shadow: var(--shadow-window);
}
.ab-window__side { display: flex; flex-direction: column; gap: 6px; padding: 18px 14px; background: var(--bg-400); border-right: 1px solid var(--line-100); }
.ab-window__chrome { display: flex; align-items: center; justify-content: space-between; height: 22px; margin-bottom: 18px; padding: 0 2px; }
.ab-lights { display: flex; gap: var(--space-2); }
.ab-lights i { width: 12px; height: 12px; border-radius: 50%; display: block; }
.ab-lights i:nth-child(1) { background: var(--light-close); }
.ab-lights i:nth-child(2) { background: var(--light-min); }
.ab-lights i:nth-child(3) { background: var(--light-zoom); }
.ab-window__brand { display: flex; align-items: center; gap: 8px; margin: 0 2px 14px; font: 600 21px/1 var(--font-display); color: var(--ink-100); }
.ab-side-item {
  display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 10px;
  border-radius: var(--radius-md); color: var(--ink-200); font: 400 16px/1 var(--font-sans); cursor: pointer;
  transition: background var(--ab-fast) var(--ab-ease), color var(--ab-fast) var(--ab-ease), transform var(--ab-fast) var(--ab-ease);
}
.ab-side-item:hover, .ab-side-item[aria-current="true"] { background: var(--fill-200); color: var(--ink-100); }
.ab-side-item svg { width: 18px; height: 18px; color: var(--ink-300); transition: color var(--ab-fast) var(--ab-ease); }
.ab-side-item:hover svg, .ab-side-item[aria-current="true"] svg { color: var(--ink-200); }
.ab-side-new {
  display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px; margin-bottom: 14px;
  border: 1px solid var(--line-200); border-radius: var(--radius-md); background: var(--fill-100);
  color: var(--ink-100); font: 500 16px/1 var(--font-sans); cursor: pointer;
}
.ab-side-new { transition: background var(--ab-fast) var(--ab-ease), border-color var(--ab-fast) var(--ab-ease), transform var(--ab-fast) var(--ab-ease); }
.ab-side-new:hover { background: var(--fill-200); border-color: var(--line-300); }
.ab-side-section { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; padding: 0 10px; font: 400 15px/1 var(--font-sans); color: var(--ink-300); }
.ab-window__main { display: flex; flex-direction: column; min-width: 0; }
.ab-window__bar { display: flex; align-items: center; justify-content: space-between; height: 58px; padding: 0 24px; border-bottom: 1px solid var(--line-100); font: 500 16px/1 var(--font-sans); color: var(--ink-100); }
.ab-window__body { padding: 28px 88px; display: flex; flex-direction: column; gap: 22px; }

/* messages */
.ab-bubble { align-self: flex-end; max-width: 70%; padding: 14px 20px; border-radius: var(--radius-xl); background: var(--bg-500); font: 400 16px/1.5 var(--font-sans); color: var(--ink-100); }
.ab-thought { display: flex; align-items: center; gap: 6px; padding-bottom: 14px; border-bottom: 1px solid var(--line-100); font: 400 15px/1 var(--font-sans); color: var(--ink-300); }
.ab-answer { margin: 0; font: 400 16px/1.85 var(--font-sans); color: var(--ink-100); }
.ab-answer a { color: inherit; text-decoration: underline dashed var(--ink-300); text-underline-offset: 5px; }
.ab-answer a:hover { text-decoration-color: var(--accent); }

/* ---------- FileTile ---------- */
.ab-file {
  display: flex; align-items: center; gap: 14px; width: 310px; padding: 18px 22px;
  border: 1px solid var(--line-100); border-radius: var(--radius-lg);
  background: var(--bg-300); box-shadow: var(--shadow-float);
}
.ab-file__icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-sm); color: var(--white); font: 700 9px/1 var(--font-sans); letter-spacing: .04em; }
.ab-file__icon--code { background: var(--file-code); }
.ab-file__icon--pdf { background: var(--file-pdf); }
.ab-file__icon--doc { background: var(--file-doc); }
.ab-file__name { font: 500 16px/1.3 var(--font-sans); color: var(--ink-100); }
.ab-file__kind { font: 400 13px/1.4 var(--font-sans); color: var(--ink-300); }

/* ---------- DiffView ---------- */
.ab-diff { overflow: hidden; border: 1px solid var(--line-200); border-radius: var(--radius-lg); background: var(--bg-200); box-shadow: var(--shadow-float); font: 400 14px/1.75 var(--font-mono); }
.ab-diff__tabbar { padding: 12px 12px 0; }
.ab-diff__tab { display: inline-flex; align-items: center; gap: 40px; height: 34px; padding: 0 14px; border-radius: var(--radius-md); background: var(--fill-200); font: 400 15px/1 var(--font-sans); color: var(--ink-100); }
.ab-diff__head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line-100); font: 400 15px/1 var(--font-sans); color: var(--ink-100); }
.ab-diff__head .ab-file__icon { width: 20px; height: 20px; border-radius: 4px; font-size: 8px; }
.ab-diff__stat { margin-left: auto; font-family: var(--font-mono); font-size: 14px; }
.ab-diff__stat b { font-weight: 400; color: var(--success); } .ab-diff__stat s { text-decoration: none; color: var(--danger); margin-left: 6px; }
.ab-diff__hunk { padding: 8px 16px; color: var(--ink-300); }
.ab-diff__row { display: grid; grid-template-columns: 34px 34px 18px 1fr; padding-right: 16px; color: var(--ink-100); white-space: pre; }
.ab-diff__row span:nth-child(-n+2) { text-align: right; padding-right: 8px; color: var(--ink-300); }
.ab-diff__row--add { background: var(--success-bg); box-shadow: inset 3px 0 0 var(--success); }
.ab-diff__row--del { background: var(--danger-bg); box-shadow: inset 3px 0 0 var(--danger); }
.ab-diff__row--add span:nth-child(3) { color: var(--success); }
.ab-diff__row--del span:nth-child(3), .ab-diff__row--del span:first-child { color: var(--danger); }
.ab-tok-fn { color: var(--syntax-fn); } .ab-tok-str { color: var(--syntax-str); } .ab-tok-type { color: var(--syntax-fn); }

/* ---------- Effets ---------- */
.ab-hero { position: relative; overflow: hidden; isolation: isolate; background: var(--abyss-900); }
.ab-hero > canvas.ab-fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; display: block; }
.ab-hero::before { /* grain très léger, donne de la matière à l'eau */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); background-size: 180px 180px; opacity: var(--grain-opacity, .07); mix-blend-mode: overlay;
}
.ab-hero::after { /* fondu long et adouci vers la page */
  content: ""; position: absolute; inset: auto 0 0 0; height: 65%; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, rgba(11, 11, 14, 0) 0%, rgba(11, 11, 14, .08) 20%, rgba(11, 11, 14, .25) 40%, rgba(11, 11, 14, .5) 60%, rgba(11, 11, 14, .78) 80%, var(--bg-100) 100%);
}

.ab-ecosystem { position: relative; overflow: hidden; isolation: isolate; background: var(--bg-100); }
.ab-ecosystem::before { /* une grande nappe bleu ardoise, basse et terne, avec de légères irrégularités */
  content: ""; position: absolute; inset: 0; z-index: -3;
  background:
    radial-gradient(ellipse 30% 30% at 50% 71%, var(--glow-core), transparent 72%),
    radial-gradient(ellipse 22% 28% at 73% 68%, rgba(22, 31, 45, .7), transparent 74%),
    radial-gradient(ellipse 17% 24% at 27% 70%, rgba(13, 23, 34, .85), transparent 72%),
    radial-gradient(ellipse 36% 20% at 46% 52%, rgba(17, 26, 41, .8), transparent 75%),
    radial-gradient(ellipse 60% 54% at 50% 62%, var(--glow-veil), transparent 86%);
}
.ab-grid { /* quadrillage estompé sur les bords, croisements effacés */
  --grid-gap: 6px;
  position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(to bottom, transparent calc(50% - .5px), var(--grid-line) calc(50% - .5px), var(--grid-line) calc(50% + .5px), transparent calc(50% + .5px)),
    linear-gradient(to right, transparent calc(50% - .5px), var(--grid-line) calc(50% - .5px), var(--grid-line) calc(50% + .5px), transparent calc(50% + .5px));
  background-size: var(--grid-step) var(--grid-step); background-position: center center;
  -webkit-mask-image: radial-gradient(ellipse 68% 66% at 50% 48%, #000 15%, rgba(0, 0, 0, .4) 50%, transparent 85%), radial-gradient(circle, transparent var(--grid-gap), #000 calc(var(--grid-gap) + 1px));
  -webkit-mask-size: 100% 100%, var(--grid-step) var(--grid-step);
  -webkit-mask-position: center, center; -webkit-mask-repeat: no-repeat, repeat;
  -webkit-mask-composite: source-in;
  mask-image: radial-gradient(ellipse 68% 66% at 50% 48%, #000 15%, rgba(0, 0, 0, .4) 50%, transparent 85%), radial-gradient(circle, transparent var(--grid-gap), #000 calc(var(--grid-gap) + 1px));
  mask-size: 100% 100%, var(--grid-step) var(--grid-step);
  mask-position: center, center; mask-repeat: no-repeat, repeat;
  mask-composite: intersect;
}
.ab-ecosystem > canvas.ab-fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .ab-btn, .ab-btn::before, .ab-split, .ab-split::before, .ab-side-item, .ab-side-new, .ab-icon-btn, .ab-lang button { transition: none; }
  .ab-btn:active, .ab-icon-btn:active, .ab-side-new:active, .ab-side-item:active, .ab-lang button:active { transform: none; }
}
