/* Neuralignition "cool" shared styles (one source: ni-lib/shared/ni-cool.css; copied by build.sh).
   Uses only the shared --ni-* tokens so it fits home, portfolio and resources in light and dark. */

/* ---- hover preview clips ---- */
[data-ni-clip] { position: relative; display: block; overflow: hidden; isolation: isolate; }
[data-ni-clip] > img { display: block; }
.ni-clip { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.25s ease; pointer-events: none; background: transparent; }
[data-ni-clip].is-playing .ni-clip { opacity: 1; }
[data-ni-clip]::after, [data-ni-clip]::before { content: ""; position: absolute; z-index: 2; pointer-events: none; transition: opacity 0.2s ease; }
[data-ni-clip]::after { right: 7px; bottom: 7px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0, 0, 0, 0.62); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25); }
[data-ni-clip]::before { z-index: 3; right: 13px; bottom: 12px; width: 8px; height: 10px; background: #fff; clip-path: polygon(0 0, 100% 50%, 0 100%); }
[data-ni-clip].is-playing::after, [data-ni-clip].is-playing::before { opacity: 0; }
@media (hover: none), (prefers-reduced-motion: reduce) { [data-ni-clip]::after, [data-ni-clip]::before { display: none; } }

/* ---- "this is cool" ---- */
.ni-react { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px 0 9px; border: 1px solid var(--ni-ring); border-radius: var(--ni-pill);
  background: var(--ni-chip); color: var(--ni-text); font: 650 12.5px/1 var(--ni-font); cursor: pointer; transition: background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease; }
.ni-react svg { color: var(--ni-muted); transition: color 0.15s ease, transform 0.25s ease; }
.ni-react:hover { background: var(--ni-chip-hover); }
.ni-react:hover svg { color: #ff8a3d; }
.ni-react.is-on { border-color: color-mix(in srgb, #ff7a2f 55%, transparent); background: color-mix(in srgb, #ff7a2f 14%, var(--ni-chip)); }
.ni-react.is-on svg { color: #ff7a2f; }
:root[data-theme="light"] .ni-react.is-on svg { color: #c2410c; }
.ni-react[aria-busy="true"] { opacity: 0.7; cursor: progress; }
.ni-react.is-pop svg { transform: scale(1.35) rotate(-8deg); }
.ni-react-n:empty { display: none; }
.ni-react-n { padding-left: 6px; margin-left: 1px; border-left: 1px solid var(--ni-line); color: var(--ni-muted); font-variant-numeric: tabular-nums; }
.ni-react:focus-visible { outline: 2px solid var(--ni-focus); outline-offset: 2px; }

/* ---- achievements: bar button ---- */
.ni-bar .ni-extra .ni-ach-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 11px; border: 1px solid var(--ni-ring); border-radius: var(--ni-pill);
  background: var(--ni-chip); color: var(--ni-text); font: 650 12.5px var(--ni-font); cursor: pointer; }
.ni-bar .ni-extra .ni-ach-btn:hover { background: var(--ni-chip-hover); }
.ni-ach-btn svg { color: #e9b949; }
:root[data-theme="light"] .ni-ach-btn svg { color: #8a5a00; }
.ni-ach-btn.is-off { color: var(--ni-muted); }
.ni-ach-btn.is-off svg { color: var(--ni-muted); }
.ni-ach-n { font-variant-numeric: tabular-nums; }

/* ---- achievements: drawer ---- */
.ni-ach-dlg { box-sizing: border-box; width: min(420px, calc(100vw - 24px)); max-height: min(700px, calc(100vh - 88px)); max-height: min(700px, calc(100dvh - 88px)); margin: 64px 16px auto auto; overflow: hidden; padding: 18px 18px 14px;
  border: 1px solid var(--ni-ring); border-radius: var(--ni-r-lg); background: var(--ni-menu-bg); color: var(--ni-text); box-shadow: var(--ni-shadow); font: 14px/1.45 var(--ni-font); }
.ni-ach-dlg[open] { display: flex; flex-direction: column; }
.ni-ach-dlg .ni-ach-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 2px; margin: -2px; }
.ni-ach-dlg .ni-ach-foot { flex: none; padding-top: 12px; margin-top: 10px; border-top: 1px solid var(--ni-line); }
.ni-ach-dlg::backdrop { background: rgba(0, 0, 0, 0.45); }
.ni-ach-dlg[open] { animation: ni-ach-in 0.22s ease; }
@keyframes ni-ach-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.ni-ach-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ni-ach-head h2 { margin: 0; font-size: 18px; font-weight: 750; }
.ni-ach-x { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--ni-ring); border-radius: var(--ni-r-sm); background: var(--ni-chip); color: var(--ni-text); cursor: pointer; }
.ni-ach-sum { margin: 4px 0 12px; color: var(--ni-muted); font-size: 13px; }
.ni-ach-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ni-ach-list li { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 6px 10px; border-radius: var(--ni-r); background: var(--ni-chip); box-shadow: inset 0 0 0 1px var(--ni-line); }
.ni-ach-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: color-mix(in srgb, var(--ni-muted) 14%, transparent); color: var(--ni-muted); }
.ni-ach-list .is-got .ni-ach-ic { background: radial-gradient(circle at 30% 25%, #ffe59a, #e9b949 55%, #b9831b); color: #3b2500; box-shadow: 0 0 18px -4px rgba(233, 185, 73, 0.7); }
.ni-ach-tx b { display: block; font-size: 14px; }
.ni-ach-tx small { display: block; color: var(--ni-muted); font-size: 12.5px; }
.ni-ach-list .is-locked .ni-ach-tx b { color: var(--ni-muted); }
.ni-ach-st { color: var(--ni-muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.ni-ach-list .is-got .ni-ach-st { color: var(--ni-ok); }
.ni-ach-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.ni-ach-switch { display: inline-flex; align-items: center; gap: 10px; padding: 6px 4px; border: 0; background: none; color: var(--ni-text); font: 600 13.5px var(--ni-font); cursor: pointer; }
.ni-ach-knob { position: relative; width: 38px; height: 22px; border-radius: 99px; background: color-mix(in srgb, var(--ni-muted) 45%, transparent); transition: background 0.15s ease; }
.ni-ach-knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.15s ease; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35); }
.ni-ach-switch[aria-checked="true"] .ni-ach-knob { background: var(--ni-accent); }
.ni-ach-switch[aria-checked="true"] .ni-ach-knob::after { transform: translateX(16px); }
.ni-ach-reset { height: 32px; padding: 0 12px; border: 1px solid var(--ni-ring); border-radius: var(--ni-pill); background: var(--ni-chip); color: var(--ni-text); font: 600 12.5px var(--ni-font); cursor: pointer; }
.ni-ach-note { margin: 10px 0 0; color: var(--ni-muted); font-size: 12px; }
.ni-ach-dlg.is-off .ni-ach-list { opacity: 0.55; }
.ni-ach-dlg :focus-visible { outline: 2px solid var(--ni-focus); outline-offset: 2px; }
.ni-bridge { display: none !important; }

/* ---- toasts ---- */
.ni-toasts { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: grid; gap: 8px; justify-items: end; pointer-events: none; }
.ni-toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; min-width: 240px; max-width: min(360px, calc(100vw - 32px)); padding: 10px 16px 10px 10px; border: 1px solid var(--ni-ring);
  border-radius: var(--ni-r-lg); background: var(--ni-menu-bg); color: var(--ni-text); box-shadow: var(--ni-shadow); font: 14px/1.3 var(--ni-font); text-align: left; cursor: pointer;
  animation: ni-toast-in 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2); transition: opacity 0.3s ease, transform 0.3s ease; }
.ni-toast.is-out { opacity: 0; transform: translateY(8px); }
.ni-toast-ic { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle at 30% 25%, #ffe59a, #e9b949 55%, #b9831b); color: #3b2500; }
.ni-toast-tx small { display: block; color: var(--ni-muted); font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.ni-toast-tx b { display: block; font-size: 15px; }
.ni-toast:focus-visible { outline: 2px solid var(--ni-focus); outline-offset: 2px; }
@keyframes ni-toast-in { from { opacity: 0; transform: translateY(14px) scale(0.96); } to { opacity: 1; transform: none; } }
@media (max-width: 860px) { .ni-ach-dlg { margin: 64px auto auto; } .ni-toasts { left: 12px; right: 12px; bottom: 12px; justify-items: stretch; } .ni-toast { max-width: none; } }
@media (prefers-reduced-motion: reduce) { .ni-toast, .ni-ach-dlg[open] { animation: none; transition: none; } .ni-react svg, .ni-clip, .ni-ach-knob, .ni-ach-knob::after { transition: none; } }
@media print { .ni-toasts, .ni-ach-btn, .ni-react { display: none !important; } }
