/* Void Term — style Voidlabs (tokens de Void UI) */
html, body { height: 100%; overflow: hidden; }
body { font-size: 14px; }
[hidden] { display: none !important; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.muted { color: var(--muted); }
code { font-family: var(--mono); color: var(--accent-2); background: var(--accent-soft); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
kbd { font: 600 11px var(--mono); color: var(--muted); border: 1px solid var(--border-2); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; background: var(--surface); }
button { font-family: var(--font); }
::selection { background: var(--accent-glow); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(160, 140, 255, .18); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }

/* Composants Void UI repris */
.v-input { padding: 11px 14px; border: 1px solid var(--border-2); border-radius: 10px; background: var(--surface); color: var(--text); font: 600 14px var(--font); outline: none; transition: border-color .15s, box-shadow .15s; width: 100%; }
.v-input::placeholder { color: var(--dim); }
.v-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.v-input--sm { padding: 8px 12px; font-size: 13px; }
select.v-input { appearance: none; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: right 16px center, right 11px center; background-size: 5px 5px; background-repeat: no-repeat; }
.v-btn2 { padding: 10px 18px; border-radius: 999px; font: 600 14px var(--font); cursor: pointer; transition: background .15s, border-color .15s, color .15s, filter .15s; white-space: nowrap; }
.v-btn2--sm { padding: 6px 12px; font-size: 13px; }
.v-btn2--solid { background: var(--grad); color: var(--accent-ink); border: 1px solid var(--accent); }
.v-btn2--solid:hover { filter: brightness(.92); }
.v-btn2--outline { background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(154, 108, 255, .35); }
.v-btn2--ghost { background: transparent; color: var(--text); border: 1px solid var(--border-2); }
.v-btn2--ghost:hover { background: var(--surface-2); }
.v-btn2--danger { background: rgba(239, 68, 68, .1); color: var(--red); border: 1px solid rgba(239, 68, 68, .35); }
.icon-btn { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--muted); font-size: 16px; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.icon-btn.on { color: var(--accent-2); background: var(--accent-soft); border-color: var(--border-2); }
.icon-btn--sm { width: 28px; height: 28px; font-size: 14px; border-radius: 8px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 11px; border: 1px solid var(--border-2); color: var(--muted); }
.badge--ok { color: var(--green); border-color: rgba(74, 222, 128, .35); background: rgba(74, 222, 128, .08); }
.badge--warn { color: var(--orange); border-color: rgba(251, 191, 36, .35); background: rgba(251, 191, 36, .08); }
.badge--err { color: var(--red); border-color: rgba(248, 113, 113, .35); background: rgba(248, 113, 113, .08); }

/* Connexion */
.login { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; overflow: hidden;
  background: radial-gradient(circle at 50% 120%, rgba(95, 232, 240, .08), transparent 50%), var(--bg); }
.login__orb { position: absolute; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, var(--accent-glow), transparent 65%); filter: blur(30px); animation: drift 12s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translate(-80px, -60px); } to { transform: translate(80px, 40px); } }
.login__card { position: relative; width: min(360px, 100%); display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; padding: 32px 28px; border-radius: var(--radius); background: rgba(17, 14, 36, .8); border: 1px solid var(--border-2); backdrop-filter: blur(14px); box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.login__card h1 { margin: 6px 0 0; font: 800 28px var(--font); }
.login__card p { margin: 0 0 8px; }
.login__card .v-btn2 { width: 100%; }
.login__err { color: var(--red); min-height: 1.2em; font-size: 13px; }

/* Mise en page */
.app { display: flex; height: 100%; height: 100dvh; }
.side { width: 270px; flex: none; display: flex; flex-direction: column; background: var(--deep); border-right: 1px solid var(--border); min-height: 0; }
.side__brand { display: flex; align-items: center; gap: 10px; padding: 16px; }
.side__brand b { font: 800 16px var(--font); display: block; line-height: 1.1; }
.side__brand small { color: var(--dim); font-size: 12px; }
.side__brand div { flex: 1; }
.side__close { display: none; }
.side__search { padding: 0 12px 6px; }
.side__section { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 4px; color: var(--dim); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.side__section div { display: flex; gap: 2px; }
.hosts, .snips { list-style: none; margin: 0; padding: 4px 8px; overflow-y: auto; }
.hosts { flex: 1 1 auto; min-height: 80px; }
.snips { flex: 0 1 auto; max-height: 34%; }
.host { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; position: relative; }
.host:hover { background: var(--surface); }
.host__icon { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; font: 800 13px var(--font); color: var(--accent-ink); }
.host__text { flex: 1; min-width: 0; }
.host__name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.host__addr { display: block; font: 12px var(--mono); color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.host__live { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.host__more { opacity: 0; }
.host:hover .host__more, .host:focus-within .host__more { opacity: 1; }
.host__tag { padding: 6px 10px 2px; color: var(--dim); font-size: 11px; }
.snip { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; cursor: pointer; color: var(--muted); }
.snip:hover { background: var(--surface); color: var(--text); }
.snip::before { content: "❯"; color: var(--accent); font-family: var(--mono); }
.snip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty-line { color: var(--dim); font-size: 13px; padding: 6px 10px; }
.side__foot { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.bar { display: flex; align-items: center; gap: 4px; height: 46px; padding: 0 8px; border-bottom: 1px solid var(--border); background: var(--deep); }
.bar__menu { display: none; }
.bar__right { display: flex; gap: 2px; margin-left: auto; }
.tabs { display: flex; gap: 4px; overflow-x: auto; min-width: 0; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 6px 0 12px; border-radius: 9px; border: 1px solid transparent; color: var(--muted); cursor: pointer; white-space: nowrap; max-width: 220px; user-select: none; }
.tab:hover { background: var(--surface); }
.tab.active { background: var(--surface-2); color: var(--text); border-color: var(--border-2); box-shadow: inset 0 -2px 0 var(--accent); }
.tab__dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--dim); }
.tab__dot.ok { background: var(--green); box-shadow: 0 0 6px var(--green); }
.tab__dot.wait { background: var(--orange); animation: blink 1s infinite; }
.tab__dot.off { background: var(--red); }
@keyframes blink { 50% { opacity: .3; } }
.tab__name { overflow: hidden; text-overflow: ellipsis; }
.tab__x { width: 20px; height: 20px; border: 0; border-radius: 6px; background: none; color: var(--dim); cursor: pointer; font-size: 12px; }
.tab__x:hover { background: rgba(248, 113, 113, .15); color: var(--red); }
.tab.drag-over { border-color: var(--accent); }

.stage { position: relative; flex: 1; min-height: 0; display: flex; }
.terms { position: relative; flex: 1; min-width: 0; }
.term { position: absolute; inset: 0; padding: 10px 6px 4px 12px; visibility: hidden; }
.term.active { visibility: visible; }
.term .xterm { height: 100%; }
.term .xterm-viewport { background: transparent !important; }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(7, 6, 15, .72); backdrop-filter: blur(3px); z-index: 5; }
.overlay__box { text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; padding: 24px; }
.overlay__box b { font: 800 18px var(--font); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--accent-soft); border-top-color: var(--accent-2); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Accueil */
.welcome { position: absolute; inset: 0; z-index: 2; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px 16px; overflow-y: auto; }
.welcome__glow { position: absolute; top: 18%; width: 600px; max-width: 100%; height: 300px; background: radial-gradient(ellipse, rgba(154, 108, 255, .22), transparent 70%); pointer-events: none; }
.eyebrow { position: relative; margin: 0; color: var(--accent-2); font-size: 12px; letter-spacing: .3em; }
.welcome__title { position: relative; margin: 10px 0 8px; font: 800 clamp(28px, 5vw, 46px)/1.1 var(--font); letter-spacing: -.02em; }
.welcome p.muted { position: relative; margin: 0 0 24px; }
.quick { position: relative; display: flex; align-items: center; gap: 10px; width: min(520px, 100%); padding: 14px 18px; background: var(--deep); border: 1px solid var(--border-2); border-radius: 14px; transition: border-color .15s, box-shadow .15s; }
.quick:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), 0 0 50px var(--accent-soft); }
.quick__prompt { color: var(--accent); font-family: var(--mono); }
.quick input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--text); font: 15px var(--mono); }
.quick input::placeholder { color: var(--dim); }
.recent { position: relative; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; width: min(680px, 100%); margin-top: 28px; }
.recent__card { display: flex; align-items: center; gap: 10px; padding: 12px; text-align: left; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; transition: border-color .15s, transform .15s; }
.recent__card:hover { border-color: var(--border-2); transform: translateY(-2px); }
.kbds { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin-top: 32px; color: var(--dim); font-size: 12px; }
.kbds kbd { margin-right: 2px; }

/* Recherche */
.find { position: absolute; top: 10px; right: 18px; z-index: 6; display: flex; align-items: center; gap: 4px; padding: 5px 5px 5px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border-2); box-shadow: 0 12px 40px rgba(0, 0, 0, .4); }
.find input { width: 200px; background: none; border: 0; outline: none; color: var(--text); font: 13px var(--mono); }

/* SFTP */
.files { width: 330px; flex: none; display: flex; flex-direction: column; border-left: 1px solid var(--border); background: var(--deep); min-height: 0; position: relative; }
.files__head { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 8px 14px; }
.files__head div { display: flex; gap: 2px; }
.files__path { margin: 0 10px 6px; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--accent-2); font: 12px var(--mono); outline: none; }
.files__path:focus { border-color: var(--accent); }
.files__list { list-style: none; margin: 0; padding: 0 6px 6px; overflow-y: auto; flex: 1; }
.file { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.file:hover { background: var(--surface); }
.file.sel { background: var(--accent-soft); }
.file__ico { text-align: center; color: var(--dim); }
.file.dir .file__ico { color: var(--accent); }
.file__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file__meta { color: var(--dim); font: 11px var(--mono); }
.files__drop { position: absolute; inset: 0; display: none; place-items: center; border: 2px dashed var(--accent); border-radius: 12px; margin: 8px; background: rgba(13, 11, 28, .9); color: var(--accent-2); z-index: 3; pointer-events: none; }
.files.dragging .files__drop { display: grid; }
.files__transfers { padding: 0 10px; }
.transfer { padding: 8px 0; border-top: 1px solid var(--border); font-size: 12px; }
.transfer__bar { height: 4px; margin-top: 6px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.transfer__bar i { display: block; height: 100%; width: 0; background: var(--grad); transition: width .2s; }
.ctx { position: fixed; z-index: 50; min-width: 170px; padding: 5px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border-2); box-shadow: 0 16px 50px rgba(0, 0, 0, .5); }
.ctx button { display: block; width: 100%; text-align: left; padding: 8px 12px; border: 0; border-radius: 8px; background: none; color: var(--text); cursor: pointer; font-size: 13px; }
.ctx button:hover { background: var(--accent-soft); }
.ctx button.danger { color: var(--red); }

/* Touches mobiles */
.keys { display: none; gap: 6px; padding: 6px 8px; overflow-x: auto; background: var(--deep); border-top: 1px solid var(--border); scrollbar-width: none; }
.keys button { flex: none; min-width: 42px; height: 36px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); font: 600 13px var(--mono); }
.keys button.on { background: var(--accent); color: var(--accent-ink); }
.touch .keys { display: flex; }

/* Barre d'état */
.status { display: flex; align-items: center; gap: 10px; height: 26px; padding: 0 12px; border-top: 1px solid var(--border); background: var(--deep); color: var(--muted); font: 11px var(--mono); white-space: nowrap; overflow: hidden; }
.status__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.status.ok .status__dot { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status__sep { width: 1px; height: 12px; background: var(--border-2); }
.status__sep:has(+ span:empty) { display: none; }
.status__grow { flex: 1; }

/* Modale */
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(4, 3, 10, .7); backdrop-filter: blur(6px); animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal__box { width: min(480px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border-2); box-shadow: 0 30px 90px rgba(0, 0, 0, .6); animation: pop .18s; }
.modal--wide .modal__box { width: min(680px, 100%); }
@keyframes pop { from { transform: translateY(8px) scale(.98); } }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 6px; }
.modal__head h3 { margin: 0; font: 800 18px var(--font); }
.modal__body { padding: 10px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 18px; }
.modal__foot .left { margin-right: auto; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { color: var(--muted); font-size: 12px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.row > .narrow { flex: 0 0 96px; }
.seg { display: flex; padding: 3px; border-radius: 10px; background: var(--deep); border: 1px solid var(--border); }
.seg button { flex: 1; padding: 7px; border: 0; border-radius: 7px; background: none; color: var(--muted); cursor: pointer; font-size: 13px; }
.seg button.on { background: var(--surface-2); color: var(--text); box-shadow: 0 0 0 1px var(--border-2); }
.colors { display: flex; gap: 8px; }
.colors button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.colors button.on { border-color: var(--text); }
.fp { font: 13px var(--mono); color: var(--accent-2); word-break: break-all; padding: 10px 12px; border-radius: 10px; background: var(--deep); border: 1px solid var(--border); }
.warn { padding: 10px 12px; border-radius: 10px; background: rgba(248, 113, 113, .08); border: 1px solid rgba(248, 113, 113, .3); color: var(--red); font-size: 13px; }
.check { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.switch { position: relative; width: 40px; height: 22px; flex: none; appearance: none; border-radius: 22px; background: var(--surface-2); border: 1px solid var(--border-2); cursor: pointer; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.switch:checked { background: var(--accent); border-color: var(--accent); }
.switch:checked::after { transform: translateX(18px); background: var(--accent-ink); }
.editor { width: 100%; min-height: 50vh; resize: vertical; padding: 12px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--deep); color: var(--text); font: 13px/1.5 var(--mono); outline: none; tab-size: 2; }
.snip-row { display: grid; grid-template-columns: 1fr 1.6fr auto auto; gap: 6px; align-items: center; }
.list-plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.list-plain li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--deep); border: 1px solid var(--border); font-size: 13px; }
.list-plain li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* Palette */
.palette { position: fixed; inset: 0; z-index: 45; display: flex; justify-content: center; padding: 12vh 16px 16px; background: rgba(4, 3, 10, .55); backdrop-filter: blur(4px); }
.palette__box { width: min(560px, 100%); height: fit-content; max-height: 70vh; display: flex; flex-direction: column; border-radius: 16px; background: var(--surface); border: 1px solid var(--border-2); box-shadow: 0 30px 90px rgba(0, 0, 0, .6), 0 0 60px var(--accent-soft); overflow: hidden; }
.palette input { padding: 16px 18px; background: none; border: 0; border-bottom: 1px solid var(--border); outline: none; color: var(--text); font: 600 15px var(--font); }
.palette ul { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.palette li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; cursor: pointer; }
.palette li.sel { background: var(--accent-soft); }
.palette li small { margin-left: auto; color: var(--dim); font: 11px var(--mono); }
.palette li i { font-style: normal; width: 18px; text-align: center; color: var(--accent); }

/* Toasts */
.toasts { position: fixed; right: 16px; bottom: 40px; z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { max-width: min(360px, calc(100vw - 32px)); padding: 10px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border-2); box-shadow: 0 12px 40px rgba(0, 0, 0, .45); font-size: 13px; animation: pop .2s; }
.toast--err { border-color: rgba(248, 113, 113, .4); color: #ffd0d0; }
.toast--ok { border-color: rgba(74, 222, 128, .4); }

/* Mobile */
@media (max-width: 820px) {
  .side { position: fixed; z-index: 30; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-100%); transition: transform .2s; box-shadow: 20px 0 60px rgba(0, 0, 0, .5); }
  .side.open { transform: none; }
  .side__close, .bar__menu { display: grid; }
  .files { position: absolute; z-index: 8; inset: 0 0 0 auto; width: min(340px, 100%); box-shadow: -20px 0 60px rgba(0, 0, 0, .5); }
  .status .hide-sm, #stTime, #stTime + * { display: none; }
  .host__more { opacity: 1; }
  .row { flex-wrap: wrap; }
  .snip-row { grid-template-columns: 1fr auto auto; }
  .snip-row input:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
}

/* Thème fsociety : rouge et noir, effet cathodique, glitch à l'ouverture */
body[data-theme=fsociety] {
  --bg: #050000; --deep: #0b0202; --surface: #130404; --surface-2: #1c0707;
  --border: rgba(255, 50, 50, .13); --border-2: rgba(255, 50, 50, .3);
  --text: #f5eaea; --muted: #bb9c9c; --dim: #7c5454;
  --accent: #ff2a2a; --accent-2: #ffffff; --grad: linear-gradient(100deg, #ff2a2a, #ffb0b0);
  --accent-ink: #050000; --accent-soft: rgba(255, 42, 42, .1); --accent-glow: rgba(255, 42, 42, .35);
}
body[data-theme=fsociety] img[src$="logo.svg"] { filter: grayscale(1) sepia(1) saturate(7) hue-rotate(-50deg) brightness(.9); }
body[data-theme=fsociety] .welcome__title { font-family: var(--mono); letter-spacing: -.04em; }
body[data-theme=fsociety] .eyebrow { color: var(--accent); }
body[data-theme=fsociety] .tab.active { box-shadow: inset 0 -2px 0 var(--accent), 0 0 18px rgba(255, 42, 42, .15); }

.crt .terms::after, .crt .welcome::after {
  content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, .28) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, .55) 100%);
  animation: crt-flicker 4s infinite steps(1);
}
.crt .terms::before {
  content: ""; position: absolute; left: 0; right: 0; top: -20%; height: 18%; z-index: 4; pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(255, 60, 60, .05), transparent);
  animation: crt-scan 7s linear infinite;
}
.crt .term .xterm-screen { filter: drop-shadow(0 0 2px rgba(255, 40, 40, .45)); }
@keyframes crt-flicker { 0%, 100% { opacity: 1; } 31% { opacity: .86; } 32% { opacity: 1; } 67% { opacity: .92; } 68% { opacity: 1; } }
@keyframes crt-scan { to { top: 110%; } }

body[data-theme=fsociety] .term.glitch { animation: glitch .6s steps(2) 1; }
@keyframes glitch {
  0% { transform: translate(0); filter: none; clip-path: inset(0 0 0 0); }
  10% { transform: translate(-6px, 2px) skewX(-4deg); filter: hue-rotate(-30deg) saturate(3); clip-path: inset(12% 0 58% 0); }
  20% { transform: translate(5px, -2px); filter: invert(.15); clip-path: inset(55% 0 20% 0); }
  30% { transform: translate(-3px, 0) skewX(3deg); clip-path: inset(30% 0 40% 0); }
  45% { transform: translate(4px, 1px); filter: contrast(1.8); clip-path: inset(0 0 75% 0); }
  60% { transform: translate(-2px, -1px); clip-path: inset(70% 0 5% 0); }
  80% { transform: translate(1px, 0); filter: none; clip-path: inset(0 0 0 0); }
  100% { transform: none; filter: none; clip-path: none; }
}
@media (prefers-reduced-motion: reduce) {
  .crt .terms::after, .crt .terms::before, body[data-theme=fsociety] .term.glitch { animation: none; }
}
body[data-theme=fsociety] .welcome__glow { background: radial-gradient(ellipse, rgba(255, 42, 42, .2), transparent 70%); }

/* Animations fsociety (fx.js) */
.fx .welcome > *:not(.fx-rain):not(.welcome__glow):not(.fx-breach) { position: relative; z-index: 1; }
.fx-rain { position: absolute !important; inset: 0; z-index: 0 !important; opacity: .8; pointer-events: none; -webkit-mask-image: radial-gradient(ellipse at center, transparent 18%, #000 70%); mask-image: radial-gradient(ellipse at center, transparent 18%, #000 70%); }
.fx-title { font-family: var(--mono) !important; animation: fx-rgb-title 5s infinite steps(1); }
.fx-caret { display: inline-block; width: .55em; height: .9em; margin-left: .08em; vertical-align: -.06em; background: var(--accent); box-shadow: 0 0 12px var(--accent-glow); animation: fx-blink 1s steps(1) infinite; }
@keyframes fx-blink { 50% { opacity: 0; } }
@keyframes fx-rgb-title {
  0%, 100% { text-shadow: none; transform: none; }
  92% { text-shadow: -3px 0 rgba(255, 0, 60, .9), 3px 0 rgba(0, 255, 255, .6); transform: translateX(2px) skewX(-6deg); }
  94% { text-shadow: 2px 0 rgba(255, 0, 60, .9), -2px 0 rgba(0, 255, 255, .6); transform: translateX(-3px); }
  96% { text-shadow: none; transform: none; }
}
.fx-boot { position: absolute !important; left: 20px; bottom: 16px; margin: 0; text-align: left; font: 11px/1.6 var(--mono); color: var(--dim); pointer-events: none; }
@media (max-width: 700px) { .fx-boot { display: none; } }

.fx-rgb { animation: fx-rgb .38s steps(3) 1; }
@keyframes fx-rgb { 0%, 100% { filter: none; } 33% { filter: drop-shadow(-4px 0 rgba(255, 0, 60, .7)) drop-shadow(4px 0 rgba(0, 255, 255, .45)) contrast(1.3); } 66% { filter: drop-shadow(3px 0 rgba(255, 0, 60, .7)) hue-rotate(-20deg); } }
.fx-tear { position: absolute; inset: 0; z-index: 6; pointer-events: none; overflow: hidden; }
.fx-tear i { position: absolute; left: 0; right: 0; background: rgba(255, 42, 42, .12); backdrop-filter: invert(.2) hue-rotate(-30deg); mix-blend-mode: screen; transform: translateX(var(--dx)); animation: fx-tear .3s steps(2) both; }
@keyframes fx-tear { 0% { transform: translateX(var(--dx)); opacity: 1; } 50% { transform: translateX(calc(var(--dx) * -.6)); } 100% { transform: none; opacity: 0; } }

.fx-breach { position: absolute; inset: 0; z-index: 7; display: grid; place-content: center; justify-items: center; gap: 6px; pointer-events: none; background: rgba(5, 0, 0, .55); font-family: var(--mono); color: var(--accent); text-shadow: 0 0 18px var(--accent-glow); animation: fx-in .15s ease-out; }
.fx-breach b { font-size: clamp(22px, 4vw, 38px); letter-spacing: .18em; }
.fx-breach small { color: var(--muted); letter-spacing: .3em; }
.fx-breach__bar { width: min(320px, 70vw); height: 2px; background: var(--accent); box-shadow: 0 0 12px var(--accent); transform-origin: left; animation: fx-bar .9s cubic-bezier(.2, .8, .2, 1) both; }
.fx-breach.out { opacity: 0; transition: opacity .35s; }
@keyframes fx-bar { from { transform: scaleX(0); } }
@keyframes fx-in { from { opacity: 0; } }

.fx-off { pointer-events: none; z-index: 8; animation: fx-off .5s cubic-bezier(.6, 0, .9, .4) forwards; }
@keyframes fx-off {
  0% { transform: none; filter: brightness(1); }
  45% { transform: scale(1, .006); filter: brightness(4); }
  80% { transform: scale(.25, .006); filter: brightness(6); }
  100% { transform: scale(0, 0); opacity: 0; }
}
body.fx .overlay { background: rgba(5, 0, 0, .78); }
body.fx .overlay__box .muted { font-family: var(--mono); min-height: 1.3em; }
body.fx .welcome:not([hidden]) { animation: fx-on .45s .3s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes fx-on { 0% { transform: scale(0, .004); filter: brightness(5); } 40% { transform: scale(1, .004); filter: brightness(4); } 100% { transform: none; filter: none; } }
@media (prefers-reduced-motion: reduce) { body.fx .welcome, .fx-title, .fx-caret, .fx-off { animation: none !important; } .fx-rain { display: none; } }
.demo-btn { position: relative; margin-top: 18px; }
