/* ==========================================================================
   NOKAZOO.DEV: EDITORIAL SWISS NOIR WITH SUBTLE REFINED ACCENTS
   Clean typography, hairlines, works stage (spiral, grid, circle)
   Full dark/light theme support. Без backdrop-filter и mix-blend-mode:
   на сплошном фоне они ничего не меняют, а каждый кадр пересчитываются
   ========================================================================== */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-display: 'Inter', -apple-system, sans-serif;
  
  /* Noir Theme (Default) */
  --bg-deep: #000000;
  --bg-surface: #070709;
  --bg-card: #0c0c0f;
  --bg-card-hover: #121217;
  --text-main: #FFFFFF;
  --text-muted: #A1A1AA;
  --text-dim: #71717A;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.16);
  --border-strong: rgba(255, 255, 255, 0.8);
  
  --header-bg: rgba(0, 0, 0, 0.90);
  --card-border: rgba(255, 255, 255, 0.12);
  --card-bg: #09090C;
  --tag-bg: #000000;
  --tag-border: rgba(255, 255, 255, 0.12);

  --hero-tree-opacity: 0.52;
  --hero-tree-filter: brightness(1.08) contrast(1.15);

  --color-minori: #E5A823;
  --color-spoton: #E79A06;
  --color-brand: #FFFFFF;
}

/* ==========================================================================
   LIGHT THEME (Blanche Editorial Style)
   ========================================================================== */
html.theme-light, [data-theme="light"] {
  --bg-deep: #FFFFFF;
  --bg-surface: #F4F4F6;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8F8FA;
  --text-main: #09090B;
  --text-muted: #52525B;
  --text-dim: #71717A;

  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-medium: rgba(0, 0, 0, 0.16);
  --border-strong: rgba(0, 0, 0, 0.85);

  --header-bg: rgba(255, 255, 255, 0.92);
  --card-border: rgba(0, 0, 0, 0.12);
  --card-bg: #FFFFFF;
  --tag-bg: #F4F4F5;
  --tag-border: rgba(0, 0, 0, 0.10);

  --hero-tree-opacity: 0.88;
  --hero-tree-filter: invert(1) brightness(0.92) contrast(1.25);

  --color-brand: #09090B;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-deep);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-deep);
  color: var(--text-main);
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Typography Classes */
.font-display { font-family: var(--font-display); }
.font-mono { font-family: var(--font-mono); }
.font-sans { font-family: var(--font-sans); }

/* The title mark has separate original artwork for each theme. */
#hero > .reveal-item { opacity: 1; transform: none; }
.hero-mark {
  position: absolute;
  inset: 0 0 0 auto;
  width: 39%;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.hero-mark video {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  pointer-events: none;
  transition: transform .19s cubic-bezier(.2,.75,.25,1);
}
.hero-mark-control, #minted-token {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: grab;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.hero-mark-control { pointer-events: auto; width: min(100%,32rem); aspect-ratio: 1; mix-blend-mode: screen; }
html.theme-light .hero-mark-control { mix-blend-mode: multiply; }
.hero-mark-control:active, #minted-token:active { cursor: grabbing; }
.hero-mark-control:disabled, #minted-token:disabled { cursor: default; }
.hero-mark-control:focus-visible, #minted-token:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.mark-play-icon {
  position:absolute; right:8%; bottom:8%; width:.55rem; height:.72rem; opacity:0;
  border-inline:2px solid currentColor; transition:opacity .15s; pointer-events:none;
}
.hero-mark-control:not(:disabled):hover .mark-play-icon, .hero-mark-control:focus-visible .mark-play-icon,
.hero-mark-control[aria-pressed="true"] .mark-play-icon { opacity:.7; }
.hero-mark-control[aria-pressed="true"] .mark-play-icon { width:0;height:0;border:0;border-left:.55rem solid currentColor;border-block:.36rem solid transparent; }
#minted-token { width: clamp(16rem, 40vw, 25rem); max-width: 100%; aspect-ratio: 1; margin: 0 auto 1.5rem; scroll-margin-top: 5rem; }
#minted-token img, #minted-token canvas { display:block; width:100%; height:100%; pointer-events:none; }
#minted-token canvas { position:absolute; inset:0; }
#minted-token canvas[hidden], #minted-token:has(canvas:not([hidden])) img { visibility:hidden; }
@media (prefers-reduced-motion: reduce) { .hero-mark video { transition: none; } }
@media (min-width: 901px) {
  #hero > .reveal-item { max-width: 61%; }
}
@media (max-width: 900px) {
  #hero { min-height: auto; gap: 1rem; }
  .hero-mark { position: static; order: 1; width: 100%; }
  .hero-mark-control { width: clamp(11rem, 54vw, 16rem); }
}

/* Input Focus */
input:focus, textarea:focus {
  border-color: var(--text-main) !important;
  outline: none !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* ==========================================================================
   BENTO GRID & REALISTIC MOCKUP CARDS (From Image 2 Reference)
   ========================================================================== */
.bento-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.bento-card:hover {
  border-color: var(--border-medium);
}

/* Radar / Sonar Rings */
.sonar-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

html.theme-light .sonar-ring {
  border-color: rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
   WORKS STAGE: 21 скриншот в трёх раскладках (спираль, сетка, круг)
   Плитки двигает app.js через transform, здесь только вид и размеры.
   ========================================================================== */
.work-stage {
  position: relative;
  height: clamp(540px, 80vh, 780px);
  perspective: 1300px;
  overflow: hidden;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.work-stage.is-dragging {
  cursor: grabbing;
}

.work-world {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

/* WebGL-режим: всё рисует один холст в разрешении экрана, кнопки плиток
   остаются для клавиатуры и экранного диктора, но не видны */
.work-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.work-stage.is-gl .work-world {
  position: absolute;
  inset: auto;
  left: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.work-stage.is-gl .work-tile {
  position: static;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 1;
  will-change: auto;
}

.work-tile {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 240px;
  height: 150px;
  margin: -75px 0 0 -120px;
  padding: 0;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--card-bg);
  cursor: pointer;
  opacity: 0;
  will-change: transform;
  transform-origin: 50% 50%;
  -webkit-tap-highlight-color: transparent;
}

.work-tile.is-portrait {
  width: 112px;
  margin-left: -56px;
}

.work-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  filter: grayscale(1) brightness(0.92);
  transition: filter 0.35s ease;
  pointer-events: none;
}

.work-tile.is-hot img,
.work-tile.is-selected img {
  filter: none;
}

.work-tile.is-selected {
  border-color: var(--text-main);
}

.work-tile:focus-visible {
  outline: 2px solid var(--text-main);
  outline-offset: 3px;
}

.work-modes {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--card-border);
  border-radius: 9999px;
  background: var(--bg-deep);
  font-family: var(--font-mono);
  font-size: 12px;
}

.work-mode {
  padding: 6px 14px;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.work-mode:hover {
  color: var(--text-main);
}

.work-mode.is-active {
  background: var(--text-main);
  color: var(--bg-deep);
  font-weight: 600;
}

.work-mode:focus-visible {
  outline: 2px solid var(--text-main);
  outline-offset: 2px;
}

.work-caption {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 5;
  max-width: min(440px, calc(100% - 32px));
  padding: 12px 14px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: var(--bg-deep);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.work-caption.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.work-caption-cat {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.work-caption-title {
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
}

.work-caption-link {
  display: inline-block;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-main);
  text-decoration: underline;
  text-underline-offset: 4px;
}

@media (max-width: 640px) {
  .work-stage { height: 620px; }
  .work-mode { padding: 6px 12px; }
}

/* ==========================================================================
   MINIMALIST FAQ
   ========================================================================== */
.faq-accordion-item {
  border-bottom: none;
  padding: 0.25rem 0;
}

.faq-accordion-btn {
  width: 100%;
  padding: 1.25rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 400;
  cursor: pointer;
  transition: color 0.15s;
}

.faq-accordion-btn:hover {
  color: var(--text-muted);
}

.faq-accordion-icon {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-dim);
  transition: transform 0.25s ease;
}

.faq-accordion-item.open .faq-accordion-icon {
  transform: rotate(45deg);
  color: var(--text-main);
}

.faq-accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.faq-accordion-item.open .faq-accordion-content {
  max-height: 240px;
  padding-bottom: 1.25rem;
}

/* ==========================================================================
   MOTION REVEAL ON SCROLL
   ========================================================================== */
.reveal-item {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-item.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal-item { opacity: 1; transform: none; transition: none; }
}

/* ==========================================================================
   FOOTER SCROLL-FILL GIANT TEXT
   ========================================================================== */
.footer-fill-text {
  position: relative;
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 0.88;
  display: block;
  width: 100%;
}

.footer-fill-outline,
.footer-fill-solid {
  display: block;
  -webkit-text-stroke: 1.5px var(--border-medium);
}

.footer-fill-outline {
  color: transparent;
}

.footer-fill-clip {
  position: absolute;
  inset: 0;
  overflow: hidden;
  transform: translate3d(0, 100%, 0);
  will-change: transform;
}

.footer-fill-solid {
  color: var(--text-main);
  transform: translate3d(0, -100%, 0);
  will-change: transform;
}

/* ==========================================================================
   LIGHT THEME OVERRIDES (Comprehensive Editorial Inversion)
   ========================================================================== */
html.theme-light body {
  background-color: #FFFFFF !important;
  color: #09090B !important;
}

html.theme-light header {
  background-color: rgba(255, 255, 255, 0.94) !important;
  border-bottom-color: rgba(0, 0, 0, 0.10) !important;
}

html.theme-light footer {
  background-color: #FAFAFA !important;
  border-top-color: rgba(0, 0, 0, 0.10) !important;
}

html.theme-light h1,
html.theme-light h2,
html.theme-light h3,
html.theme-light h4,
html.theme-light .text-white {
  color: #09090B !important;
}

html.theme-light .text-neutral-200,
html.theme-light .text-neutral-300 {
  color: #3F3F46 !important;
}

html.theme-light .text-neutral-400 {
  color: #71717A !important;
}

html.theme-light .text-neutral-500 {
  color: #A1A1AA !important;
}

html.theme-light .bg-black {
  background-color: #FFFFFF !important;
}

html.theme-light .bg-black\/95,
html.theme-light .bg-black\/90,
html.theme-light .bg-black\/85,
html.theme-light .bg-black\/80,
html.theme-light .bg-black\/60 {
  background-color: rgba(255, 255, 255, 0.92) !important;
}

html.theme-light .bg-neutral-950 {
  background-color: #F4F4F6 !important;
}

html.theme-light .bg-neutral-900 {
  background-color: #E4E4E7 !important;
}

html.theme-light .bg-white\/5,
html.theme-light .bg-white\/10 {
  background-color: rgba(0, 0, 0, 0.04) !important;
}

html.theme-light .border-white\/5,
html.theme-light .border-white\/10,
html.theme-light .border-white\/15,
html.theme-light .border-white\/20,
html.theme-light .border-white\/25,
html.theme-light .border-white\/30,
html.theme-light .border-white\/40 {
  border-color: rgba(0, 0, 0, 0.12) !important;
}

html.theme-light .bento-card {
  background-color: #FFFFFF !important;
  border-color: rgba(0, 0, 0, 0.10) !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.05);
}

html.theme-light .bento-card:hover {
  border-color: rgba(0, 0, 0, 0.25) !important;
}

html.theme-light input,
html.theme-light textarea {
  background-color: #FFFFFF !important;
  border-color: rgba(0, 0, 0, 0.16) !important;
  color: #09090B !important;
}

html.theme-light input:focus,
html.theme-light textarea:focus {
  border-color: #09090B !important;
}

/* :not(body): у <body> в light.html те же классы, кнопочная инверсия красила страницу в чёрный */
html.theme-light .bg-white.text-black:not(body) {
  background-color: #09090B !important;
  color: #FFFFFF !important;
}

html.theme-light .hover\:bg-white:hover {
  background-color: #09090B !important;
  color: #FFFFFF !important;
}

html.theme-light img[src*="logo.png"] {
  filter: invert(1);
}

/* Пульс кнопки в шапке. Светится псевдоэлемент через opacity: так анимация
   идёт на видеокарте, а не перерисовывает box-shadow на каждом кадре */
/* Свой вопрос: последняя строка списка, тот же шрифт, цвет и отступы,
   что у вопросов выше; ответ выглядит как раскрытый ответ */
.faq-ask-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0;
}

.faq-ask-input {
  flex: 1;
  min-width: 0;
  padding: 0;
  background: transparent !important;
  border: 0;
  outline: none;
  color: var(--text-main) !important;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.5;
}

.faq-ask-input::placeholder {
  color: var(--text-main);
  opacity: 1;
  transition: color 0.15s;
}

.faq-ask-row:hover .faq-ask-input::placeholder {
  color: var(--text-muted);
}

.faq-ask-input:focus::placeholder {
  color: var(--text-dim);
}

.faq-ask-submit {
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.faq-ask-submit:hover,
.faq-ask-row:focus-within .faq-ask-submit {
  color: var(--text-main);
}

.faq-ask-submit:disabled {
  opacity: 0.4;
  cursor: default;
}

.faq-ask-answer {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.faq-ask-answer:not(:empty) {
  padding-bottom: 1.25rem;
}

.faq-ask-status {
  color: var(--text-dim);
}

.faq-ask-cursor {
  display: inline-block;
  width: 0.5rem;
  height: 0.9rem;
  margin-left: 0.25rem;
  vertical-align: middle;
  background: currentColor;
  animation: pulse 1s steps(2, start) infinite;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Анимации в секциях за экраном стоят (класс ставит app.js, initOffscreenPause) */
.anim-off .em *,
.anim-off .animate-pulse,
.anim-off .spin-slow,
.anim-off [class*="animate-"] {
  animation-play-state: paused;
}

/* Анимированные иконки блока ИИ: в светлой теме чёрный контур на белом,
   GIF нарисованы белым по чёрному, поэтому достаточно инверсии */


/* Основная кнопка: сплошная, без стекла и свечения */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 24px;
  border-radius: 12px;
  background: #FFFFFF;
  color: #000000;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.btn-primary:hover { background: #D4D4D4; }
.btn-primary:active { transform: scale(0.98); }
html.theme-light .btn-primary { background: #09090B; color: #FFFFFF; }
html.theme-light .btn-primary:hover { background: #3F3F46; }

/* Системные поля формы в цвет темы; видимый фокус для клавиатуры */
html { color-scheme: dark; }
html.theme-light { color-scheme: light; }
:focus-visible { outline: 2px solid var(--text-main); outline-offset: 2px; }

/* Страницы услуг */
.svc-list { list-style: none; margin: 0; padding: 0; }
.svc-list li { padding: 12px 0; border-top: 1px solid var(--border-subtle); }


/* Плитки услуг и ботов: эмблема и одна строка */
.svc-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
.svc-tile { display: flex; align-items: center; gap: 16px; }
.svc-emblem { flex: none; width: 64px; height: 64px; }
.svc-body { display: block; min-width: 0; }
.svc-title { display: block; margin: 0 0 4px; font-size: 18px; line-height: 1.3; font-weight: 600; color: var(--text-main); }
.svc-line { display: block; font-size: 14px; line-height: 1.45; color: var(--text-muted); }
a.svc-tile:hover .svc-title { text-decoration: underline; text-underline-offset: 4px; }
@media (min-width: 768px) { .svc-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; } }
@media (min-width: 1024px) { .svc-grid { grid-template-columns: repeat(3, 1fr); } }

/* Эмблемы: только цвет текста и цвет фона, анимация только transform и opacity */
.em { display: block; width: 100%; height: 100%; overflow: visible; }
.em .f { fill: var(--text-main); }
.em .k { fill: var(--bg-deep); }
.em .ks, .em .ls { fill: none; stroke: var(--bg-deep); }
.em .ks { stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.em .ls { stroke-width: 1.5; }

.em-needle { transform-origin: 32px 42px; animation: em-needle 3s ease-in-out infinite; }
.em-bar { transform-origin: 6px 51px; animation: em-bar 3s ease-in-out infinite; }
@keyframes em-needle { 0%, 8% { transform: rotate(-78deg); } 55%, 85% { transform: rotate(78deg); } 100% { transform: rotate(-78deg); } }
@keyframes em-bar { 0%, 8% { transform: scaleX(.05); } 55%, 85% { transform: scaleX(1); } 100% { transform: scaleX(.05); } }

.em-bob { animation: em-bob 2.4s ease-in-out infinite; }
.em-ring { fill: none; stroke: var(--text-main); stroke-width: 2.5; transform-origin: 32px 57px; animation: em-ring 2.4s ease-in-out infinite; }
@keyframes em-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes em-ring { 0% { transform: scale(.35); opacity: 1; } 80%, 100% { transform: scale(1.15); opacity: 0; } }

.em-star { transform-origin: 27px 34px; animation: em-star 2.8s ease-in-out infinite; }
.em-star2 { transform-origin: 50px 14px; animation: em-star2 2.8s ease-in-out infinite; }
@keyframes em-star { 0%, 100% { transform: scale(1); } 50% { transform: scale(.72); } }
@keyframes em-star2 { 0%, 100% { transform: scale(.25) rotate(0); } 50% { transform: scale(1) rotate(90deg); } }

.em-dot { animation: em-dot 1.5s ease-in-out infinite; }
@keyframes em-dot { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-5px); } }

.em-cell { transform-box: fill-box; transform-origin: left center; animation: em-cell 3.6s ease-in-out infinite; }
.em-c1 { animation-delay: .2s; }
.em-c2 { animation-delay: .4s; }
.em-c3 { animation-delay: .6s; }
.em-c4 { animation-delay: .8s; }
.em-c5 { animation-delay: 1s; }
@keyframes em-cell { 0% { transform: scaleX(0); } 12%, 75% { transform: scaleX(1); opacity: 1; } 85%, 100% { transform: scaleX(1); opacity: 0; } }

.em-up { animation: em-up 3.2s ease-in-out infinite; }
@keyframes em-up { 0% { transform: translateY(5px); opacity: 0; } 15%, 80% { transform: translateY(0); opacity: 1; } 92%, 100% { transform: translateY(0); opacity: 0; } }

.em-fly { animation: em-fly 2.6s ease-in-out infinite; }
@keyframes em-fly { 0%, 100% { transform: translate(-3px, 3px); } 50% { transform: translate(3px, -3px); } }

.em-digit { transform-box: fill-box; transform-origin: right center; animation: em-digit 2.4s steps(4) infinite; }
.em-key { animation: em-key 2.4s ease-in-out infinite; }
.em-k1 { animation-delay: .3s; }
.em-k2 { animation-delay: .6s; }
.em-k3 { animation-delay: .9s; }
.em-k4 { animation-delay: 1.2s; }
@keyframes em-digit { 0% { transform: scaleX(.2); } 100% { transform: scaleX(1); } }
@keyframes em-key { 0%, 30%, 100% { opacity: 1; } 15% { opacity: .15; } }

.em-sweep { transform-origin: 32px 32px; animation: em-sweep 2.8s linear infinite; }
.em-blip { animation: em-blip 2.8s ease-in-out infinite; }
@keyframes em-sweep { to { transform: rotate(360deg); } }
@keyframes em-blip { 0%, 60%, 100% { opacity: .1; } 72%, 84% { opacity: 1; } }

.em-drop { animation: em-drop 2.4s ease-in-out infinite; }
.em-drop.em-d3 { animation-delay: 1.2s; }
@keyframes em-drop { 0% { transform: translateY(-2px); opacity: 0; } 15% { opacity: 1; } 60% { transform: translateY(26px); opacity: 1; } 70%, 100% { transform: translateY(26px); opacity: 0; } }

.em-check { stroke-dasharray: 1; animation: em-check 2.8s ease-in-out infinite; }
@keyframes em-check { 0% { stroke-dashoffset: 1; } 30%, 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 1; } }

.em-led { animation: em-led 1.6s steps(2) infinite; }
.em-l1 { animation-delay: .4s; }
.em-l2 { animation-delay: .8s; }
@keyframes em-led { 0% { opacity: 1; } 100% { opacity: .15; } }

.em-dot.em-d2 { animation-delay: .18s; }
.em-dot.em-d3 { animation-delay: .36s; }
.em-up.em-d2 { animation-delay: .25s; }
.em-up.em-d3 { animation-delay: .5s; }
.em-up.em-d4 { animation-delay: .75s; }

@media (prefers-reduced-motion: reduce) {
  .em * { animation: none !important; }
}


/* ==========================================================================
   BENCHO INTERACTIVE COMPONENTS & 3D METALLIC EMBLEM
   ========================================================================== */

/* -- flat panes --------------------------------------------
Set data-surface="flat" on any ancestor and every glass
surface under it becomes a solid fill with a hairline. The
inner buttons already sit on rgba(var(--ink-rgb), 0.05)
with no border, which is what flat wants anyway, so they
need nothing.

The frost is switched off at the element rather than through
a token. A var() holding a url() filter cannot be validated
at parse time, so the browser would treat it as invalid at
computed-value time and drop the property outright - which
breaks the two-declaration fallback the glass depends on. */
/* == stroke =================================================
Whether a component draws a hairline round itself. OFF by
default, which is the change: every glass surface carried
one unconditionally, and a grey line round everything makes
a wall of components look like a wall of boxes rather than
a wall of things.

The line is not load-bearing. A flat pane is a fill against
a different fill and reads on its own; the ring was there
to sharpen an edge that was already there.

Placed ABOVE the glass rules on purpose. Glass draws its
own lit rim, and that rim is the material rather than a
stroke - it is what gives a pane thickness. So glass wins
the border wherever the two meet, and Stroke governs the
drawn line that flat surfaces would otherwise have. */
[data-stroke="on"] .lab::before,
[data-stroke="on"] .gcard::before,
[data-stroke="on"] .gpane::before,
[data-stroke="on"] .gnav::before,
[data-stroke="on"] .gdock::before,
/* the playful blocks. None of them is glass, so none has a
lit rim for the stroke to lose to - the hairline is the
only edge they can have, and it is the whole of what this
control does for them. */
[data-stroke="on"] .esc-btn::before,
[data-stroke="on"] .slo-track::before,
[data-stroke="on"] .sek-skin::before {
  border-color: var(--pane-edge);
}

/* == Seek ===================================================
A search icon that becomes a search field, as one object.

Everything below is width and radius. There is no crossfade
between two components, no second element to keep in sync,
and nothing that animates on a clock of its own - the box
is sprung in JS and every other value here is derived from
how far through that spring it is. That is the whole reason
the transformation reads as continuous: there is only one
number, so nothing can arrive at the wrong time relative to
anything else. */
.sek {
  /* Design Tokens mapped locally */
  --bg: transparent;
  --font-ui: var(--font-sans, Inter, sans-serif);
  --g-blur: 8px;
  --g-sat: 150%;
  --g-bright: 100%;
  --ink: #ffffff;
  --ink-2: #e5e5e5;
  --ink-3: #a3a3a3;
  --ink-4: #737373;
  --ink-5: #525252;
  --ink-rgb: 255, 255, 255;
  --pane: rgba(255, 255, 255, 0.07);
  --pane-edge: rgba(255, 255, 255, 0.15);

  /* the frame is the composition. It never moves, which is
  what gives the magnet a stable home to measure from and
  keeps the object centred at every width. */
  position: relative;
  display: grid;
  place-items: center;
  /* -- THE FRAME IS --frame, and it was not --------------
  Seek.tsx computes --frame and --frameh from the width
  that is actually set - its note explains why at length:
  the wall fits a card by the BOUNDING BOX, so a frame sized
  for the widest the knob goes makes every smaller setting
  draw smaller. It has been publishing those two numbers to
  a stylesheet that ignored them and used a hard 380 x 96.

  Measured on a phone card: the frame reserved 380 for a
  field set to 320, the wall fitted 380 into 260, and the
  shut button - the only thing drawn at rest - came out at
  44px. The 36px of nothing was being paid for in the one
  part of the object you are looking at.

  With the variables wired up the knob does what its own
  comment says it does, and the frame is tight to what is
  set on every screen. */
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: var(--w, 40px);
  height: var(--shut, 40px);
  font-family: var(--font-ui);
  transition: width 0.2s cubic-bezier(0.2, 0, 0, 1);
}

[data-theme="light"] .sek,
.theme-light .sek {
  --bg: #ffffff;
  --ink: #000000;
  --ink-2: #262626;
  --ink-3: #525252;
  --ink-4: #737373;
  --ink-5: #a3a3a3;
  --ink-rgb: 0, 0, 0;
  --pane: rgba(0, 0, 0, 0.05);
  --pane-edge: rgba(0, 0, 0, 0.12);
}

/* -- the object ---------------------------------------------
Width is the state. Height is fixed, so the radius can be
derived from the width rather than animated beside it -
at 44 the corner is 22 and the shape IS a circle, and there
is no frame where the two disagree.

The surface is the quietest thing that still reads as an
object: a low-alpha ink fill and a hairline. No shadow, no
glass, no gradient - at this size any of them would be the
loudest thing on an otherwise empty page. */
.sek-skin {
  position: relative;
  width: var(--w);
  /* --shut, NOT a number. The component sets the closed width
  and the height from one constant precisely so they cannot
  drift, and its own comment says so: "the skin's height and
  the closed width are the same number by definition, and
  two places holding it is two places to get it wrong."
  Hard-coded here at 44 against a --shut of 64, the closed
  state was a 64x44 lozenge - a circle that is not round is
  the one shape everybody notices. */
  height: var(--shut);
  /* -- ONE SHAPE RULE -------------------------------------
  Fully round, at every width. The radius used to
  interpolate 22 -> 13, which was a second thing to keep in
  agreement with the first; a stadium corner needs no
  agreement at all. At --shut wide it is a circle and at 320
  a pill, and those are the same rule rather than two ends
  of a tween. Height is fixed, so it cannot be anything
  else. */
  /* the Corner knob's, and ::before and .sek-hit inherit it */
  border-radius: var(--sek-r, 999px);
  /* -- FLAT, and glass only if asked ----------------------
  --pane is the bench's own material token, so this
  follows the Glass dial rather than deciding for itself:
  at 0 it resolves to a solid board and at 100 to the
  frosted pane. It was a translucent ink wash with an inset
  hairline, which is glass by every visual measure while
  answering to no control - the worst of both, since it
  could not be turned off.

  And it picks up Fill for free. Flat resolves --pane to
  --board, and Fill redeclares --board, so a dark fill
  gives a dark pill without this rule naming a colour. */
  background: var(--pane);
  -webkit-backdrop-filter: blur(var(--g-blur, 2px)) saturate(var(--g-sat, 150%)) brightness(var(--g-bright, 100%));
  backdrop-filter: blur(var(--g-blur, 2px)) saturate(var(--g-sat, 150%)) brightness(var(--g-bright, 100%));
  isolation: isolate;
  /* the magnet, and the press, on one transform - two
  transforms on one element is one of them winning */
  transform: translate(var(--lx), var(--ly)) scale(var(--sk, 1));
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), background 220ms ease;
  /* the field is inside from the first frame; this is what
  keeps it from spilling out of a 44px circle */
  overflow: hidden;
}

/* the edge, and NOTHING until Stroke asks for it. A hairline
nobody switched on is a hairline the control cannot remove,
which is the same bug the background had. */
.sek-skin::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid var(--pane-edge, rgba(255, 255, 255, 0.15));
  pointer-events: none;
  z-index: 2;
}

/* Hover: it comes up a hair and lifts off the ground. Both
are small enough to be felt rather than seen, which is the
point - a hover state you notice is a hover state that has
said too much. */
.sek:not([data-open="true"]) .sek-skin:hover {
  --sk: 1.045;
  /* the surface answers, without drawing an edge it was not
  given - brightness rather than an outline */
  --g-bright: 104%;
}

/* pressed: it yields before it moves. A thing that gives
under a click reads as having been pushed; a thing that
only expands reads as having been triggered.

Two moments, one rule. :active is the button held down -
a click only fires on release, so without it there was
nothing under a finger that stayed. data-press is the 90ms
beat after the click (and after Enter or Space) before it
opens. Both carry the hover rule's own :not([data-open]) and
come after it, so they win on order at equal specificity:
written as .sek[data-press] .sek-skin they were one class
short, and a pointer still over the button - which is where
a pointer is when it clicks - kept the hover's 1.045 and the
squeeze never showed. */
.sek:not([data-open="true"]) .sek-skin:active,
.sek:not([data-open="true"])[data-press="true"] .sek-skin {
  --sk: 0.93;
  transition: transform 160ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* the field is a text target, and the object is a button */
.sek[data-open="true"] .sek-skin { cursor: text; }

/* -- the lens -----------------------------------------------
Fixed to the box's left inset and never animated. At the
shut width that inset centres it; at the open width it is
the field's padding. The lens crossing the page is the box
growing around a mark that stayed still. */
.sek-lens {
  position: absolute;
  left: var(--inset);
  top: 50%;
  width: var(--lens);
  height: var(--lens);
  margin-top: calc(var(--lens) / -2);
  fill: none;
  stroke: var(--ink-3);
  /* 1.5, AND THE NUMBER CANNOT BE COMPARED TO LUCIDE'S.
  Every lucide glyph is drawn on a 24-unit grid; this one is
  drawn on 18. A stroke-width of u paints at u/viewBox of
  the icon's size, so lucide's 2-on-24 is 0.0833 and a 2
  here would be 0.1111 - the same number, a third heavier.
  1.5/18 is 0.0833 exactly, which is the radial menu's
  weight and the nav's.

  The value that stood here was 1.6 (0.0889). That was very
  nearly right; it was changed to 2 on the assumption that
  the two viewBoxes matched, and they never did. */
  stroke-width: 1.5;
  stroke-linecap: round;
  pointer-events: none;
  transition: stroke 220ms ease, stroke-width 220ms ease;
}

.sek-skin:hover .sek-lens { stroke: var(--ink); }

.sek[data-open="true"] .sek-lens { stroke: var(--ink-4); }

/* typing: the lens thickens a hair and darkens. One beat per
burst, not one per keystroke - a mark that flickers at the
rate of your typing is noise wearing the costume of
feedback. */
/* still "a hair", and still the same proportion of the base it
always was - 1.9 was to 1.6 as 1.8 is to 1.5 */
.sek[data-busy="true"] .sek-lens { stroke: var(--ink-2); stroke-width: 1.8; }

/* -- the field ----------------------------------------------
Present from the first frame and revealed by --say, which
is the last third of the width's own progress. It slides a
few pixels as it arrives, from the left, so it reads as
having come out of the lens rather than as having faded up
where it stood. */
.sek-field {
  position: absolute;
  left: calc(var(--inset) + var(--lens) + 11px);
  right: 14px;
  top: 0;
  height: 100%;
  border: 0;
  background: none;
  font: inherit;
  /* 14 is the NAV's size, and the nav's field is 44px tall.
  This pill is --shut, 64, and carrying header type in it
  left the words looking like a caption inside the object
  rather than its content. 18 restores roughly the
  proportion the bar has - 0.28 of the height against the
  bar's 0.32 - on a control that is the whole component
  rather than one item in a row of them. */
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--ink);
  outline: none;
  opacity: var(--say);
  transform: translateX(calc((1 - var(--say)) * -6px));
  /* until it is most of the way open it is not a target, and
  a caret that can be placed in a 44px circle is a caret in
  the wrong place */
  pointer-events: var(--say-hit, none);
}

.sek[data-open="true"] .sek-field { --say-hit: auto; }

.sek-field::placeholder { color: var(--ink-5); }

/* the way in, while there is one */
.sek-hit {
  position: absolute;
  inset: 0;
  border: 0;
  border-radius: inherit;
  background: none;
  cursor: pointer;
}

.sek-hit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px rgba(var(--ink-rgb), 0.4);
}

.sek-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 280px;
  max-width: 90vw;
  background: rgba(14, 14, 18, 0.94);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.7);
  z-index: 100;
}

.theme-light .sek-dropdown,
[data-theme="light"] .sek-dropdown {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.12);
}

.sek-dropdown-title {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.45);
  padding: 4px 8px 6px;
}

.theme-light .sek-dropdown-title,
[data-theme="light"] .sek-dropdown-title {
  color: rgba(0, 0, 0, 0.45);
}

.sek-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-main, #ffffff);
  cursor: pointer;
  transition: background 120ms ease;
  text-align: left;
}

.theme-light .sek-item,
[data-theme="light"] .sek-item {
  color: #111111;
}

.sek-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.theme-light .sek-item:hover,
[data-theme="light"] .sek-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.sek-item-name {
  font-family: var(--font-mono, monospace);
  font-size: 13px;
  font-weight: 600;
}

.sek-item-desc {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

.theme-light .sek-item-desc,
[data-theme="light"] .sek-item-desc {
  color: rgba(0, 0, 0, 0.5);
}

.sek-item-empty {
  padding: 12px;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

.theme-light .sek-item-empty,
[data-theme="light"] .sek-item-empty {
  color: rgba(0, 0, 0, 0.4);
}


/* == ASCII wake ============================================ */
.asc {
  --fill-on: var(--ink, #ffffff);
  --ink: #ffffff;
  position: relative;
  cursor: crosshair;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

[data-theme="light"] .asc,
.theme-light .asc {
  --fill-on: #000000;
  --ink: #000000;
}

.asc-canvas {
  display: block;
  color: var(--fill-on, var(--ink));
}

/* == Emoji reactions ===================================== */
.rxn {
  --card: #18181b;
  --fill-on: #ffffff;
  --fill-slab: #27272a;
  --font-ui: var(--font-sans, Inter, sans-serif);
  --ink: #ffffff;
  --on-slab: #ffffff;
  --pane-edge: rgba(255, 255, 255, 0.15);
  --signal: #60a5fa;
  --slab: #121214;
  position: relative;
  width: 100%;
  max-width: 320px;
  /* the pill needs room above the row; the message gives it.
     No left inset: at 16px the message fills the 300px frame
     itself, so the block sits in the middle of its card while
     everything in it stays left-aligned */
  padding: 8px 0 0 0;
  font-family: var(--font-ui);
  color: var(--fill-on, var(--ink));
  margin: 0 auto;
}

[data-theme="light"] .rxn,
.theme-light .rxn {
  --card: #f4f4f5;
  --fill-on: #17181a;
  --fill-slab: #e4e4e7;
  --ink: #000000;
  --on-slab: #000000;
  --pane-edge: rgba(0, 0, 0, 0.12);
  --signal: #2563eb;
  --slab: #ffffff;
}

/* the name and time on their own line, then the message as a
   pill that hugs its words */
.rxn-msg {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.rxn-who {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 4px;
  font-size: 12px;
  letter-spacing: 0em;
}

.rxn-face {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}

.rxn-who b { font-weight: 500; }

.rxn-who span { color: color-mix(in srgb, var(--fill-on, #17181a) 52%, var(--fill-slab, #ffffff)); }

/* the message's pill, and the picker it turns into: the surface is
   this, its width and corner sprung by the component */
.rxn-morph {
  position: relative;
  /* the words sit in the middle of the pill whatever width the
     spring is at, so a measuring pixel can never pile up on one side */
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--fill-slab, var(--card));
  border-radius: var(--rxn-r);
}

[data-stroke="on"] .rxn-morph { box-shadow: 0 0 0 1px var(--pane-edge); }

.rxn-text {
  display: block;
  width: max-content;
  padding: 0 20px;
  font-size: 14px;
  line-height: 20px;
  white-space: nowrap;
  transform-origin: 50% 50%;
  letter-spacing: -0.01em;
}

.rxn-row {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  margin-top: 8px;
}

.rxn-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--fill-slab, var(--card));
  color: inherit;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 160ms ease, box-shadow 160ms ease;
  letter-spacing: -0.01em;
}

/* the ones you are in carry a coloured edge - the fill stays the
   chip's own */
.rxn-chip[data-mine] {
  background: var(--fill-slab, var(--card));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--signal, #2231dd) 35%, transparent);
  color: var(--signal, #2231dd);
}

/* the signal blue is too deep on a dark chip: a lighter blue there */
[data-theme="dark"] .rxn-chip[data-mine],
[data-fill="dark"] .rxn-chip[data-mine] {
  color: #8c9bff;
  box-shadow: inset 0 0 0 1px rgba(140, 155, 255, 0.4);
}

[data-theme="dark"] [data-fill="light"] .rxn-chip[data-mine] {
  color: var(--signal, #2231dd);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--signal, #2231dd) 35%, transparent);
}

.rxn-chip-e { font-size: 20px; line-height: 1; transition: opacity 160ms ease; letter-spacing: -0.02em; }

.rxn-chip-e[data-landing] { opacity: 0; }

/* -- each emoji's own arrival ------------------------------- */
.rxn-p {
  position: relative;
  display: inline-block;
  font-style: normal;
  line-height: 1;
}

.rxn-p[data-play][data-k="launch"] { animation: rxn-launch 640ms cubic-bezier(0.3, 1.2, 0.4, 1); }

/* its exhaust: a small puff left behind under it */
.rxn-p[data-play][data-k="launch"]::after {
  content: "";
  position: absolute;
  left: 20%;
  top: 70%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--fill-on, #17181a) 20%, transparent);
  animation: rxn-puff 520ms ease-out forwards;
}

.rxn-p[data-play][data-k="flicker"] { animation: rxn-flicker 620ms ease-out; }

.rxn-p[data-play][data-k="confetti"] { animation: rxn-pop 420ms cubic-bezier(0.3, 1.6, 0.4, 1); }

.rxn-bits { position: absolute; left: 50%; top: 50%; pointer-events: none; }

.rxn-bits b {
  position: absolute;
  width: 3px;
  height: 3px;
  margin: -1.5px;
  border-radius: 1px;
  background: var(--c);
  animation: rxn-bit 560ms cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}

.rxn-p[data-play][data-k="glance"] { animation: rxn-glance 700ms ease-in-out; }

.rxn-p[data-play][data-k="tick"] { animation: rxn-tick 460ms cubic-bezier(0.3, 1.6, 0.4, 1); }

.rxn-p[data-play][data-k="beat"] { animation: rxn-beat 620ms ease-in-out; }

.rxn-p[data-play][data-k="nod"] { animation: rxn-nod 520ms cubic-bezier(0.3, 1.4, 0.4, 1); transform-origin: 50% 90%; }

.rxn-p[data-play][data-k="laugh"] { animation: rxn-laugh 560ms ease-in-out; }

.rxn-p[data-play][data-k="wow"] { animation: rxn-wow 520ms cubic-bezier(0.3, 1.5, 0.4, 1); transform-origin: 50% 100%; }

.rxn-p[data-play][data-k="droop"] { animation: rxn-droop 700ms ease-in-out; transform-origin: 50% 100%; }

.rxn-p[data-play][data-k="bow"] { animation: rxn-bow 620ms ease-in-out; transform-origin: 50% 100%; }

@media (prefers-reduced-motion: reduce) {
  .rxn-p[data-play], .rxn-p[data-play]::after, .rxn-bits b { animation: none; }
}

.rxn-count { display: inline-flex; font-variant-numeric: tabular-nums; }

.rxn-col { display: inline-block; height: 1.4em; overflow: hidden; line-height: 1.4em; }

.rxn-strip {
  display: flex;
  flex-direction: column;
  transition: transform 220ms cubic-bezier(0.24, 1.34, 0.38, 1);
}

.rxn-strip > span { height: 1.4em; }

.rxn-add-wrap { display: flex; }

.rxn-add {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--fill-slab, var(--card));
  color: color-mix(in srgb, var(--fill-on, #17181a) 52%, var(--fill-slab, #ffffff));
  cursor: pointer;
  /* a finger holds and slides from here: no scroll, no text
     selection, no system menu getting in the way */
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: color 160ms ease, scale 160ms cubic-bezier(0.24, 1.34, 0.38, 1);
}

.rxn-add:hover, .rxn-add[aria-expanded="true"] { color: var(--fill-on, var(--ink)); scale: 1.06; }

/* the pill floats above the row, from the row's start, so it
   never runs off the block whatever the chips have pushed the
   button to */
/* the emoji row, laid inside the message's pill once it has opened */
.rxn-pill {
  position: absolute;
  z-index: 5;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  /* the same 6px round the row on every side - the emoji's own
     box is its glyph, so the air above and below is the padding
     and nothing else */
  padding: 8px;
}

.rxn-emo {
  display: grid;
  place-items: center;
  width: 34px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.rxn-emo span {
  display: block;
  font-size: 20px;
  line-height: 1;
  transform: scale(var(--s, 1));
  transform-origin: 50% 90%;
  /* still one at a time, but it eases up to size and back with a
     soft settle rather than snapping */
  transition: transform 220ms cubic-bezier(0.24, 1.34, 0.38, 1);
  letter-spacing: -0.02em;
}

.rxn-tip {
  position: absolute;
  bottom: calc(100% + 10px);
  translate: -50% 0;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--slab, #17181a);
  color: var(--on-slab, #fff);
  font-size: 11px;
  font-weight: 400;
  white-space: nowrap;
  pointer-events: none;
  letter-spacing: 0em;
}

.rxn-fly {
  position: absolute;
  z-index: 6;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  display: grid;
  place-items: center;
  font-size: 16px;
  pointer-events: none;
  letter-spacing: -0.01em;
}

@keyframes rxn-launch {
  0% { transform: translate(0, 0) rotate(0); }
  30% { transform: translate(2px, -7px) rotate(-12deg); }
  60% { transform: translate(-1px, 1px) rotate(4deg); }
  100% { transform: translate(0, 0) rotate(0); }
}

@keyframes rxn-puff {
  0% { opacity: 0; transform: scale(0.4); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translate(-5px, 6px) scale(1.6); }
}

@keyframes rxn-flicker {
  0% { transform: scale(1); filter: brightness(1); }
  15% { transform: scale(1.18, 1.1); filter: brightness(1.35); }
  30% { transform: scale(0.94, 1.08); filter: brightness(1); }
  48% { transform: scale(1.1, 0.96); filter: brightness(1.25); }
  66% { transform: scale(0.98, 1.04); }
  100% { transform: scale(1); filter: brightness(1); }
}

@keyframes rxn-pop { 0% { transform: scale(0.7) rotate(-12deg); } 50% { transform: scale(1.18) rotate(6deg); } 100% { transform: none; } }

@keyframes rxn-bit {
  0% { transform: rotate(var(--a)) translateY(0) scale(1); opacity: 1; }
  100% { transform: rotate(var(--a)) translateY(-16px) scale(0.6); opacity: 0; }
}

@keyframes rxn-glance {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2.5px); }
  60% { transform: translateX(2.5px); }
}

@keyframes rxn-tick { 0% { transform: scale(0.6) rotate(-14deg); } 55% { transform: scale(1.2) rotate(4deg); } 100% { transform: none; } }

@keyframes rxn-beat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.26); }
  30% { transform: scale(1); }
  45% { transform: scale(1.18); }
  60% { transform: scale(1); }
}

@keyframes rxn-nod { 0% { transform: rotate(0); } 35% { transform: rotate(-16deg) translateY(-2px); } 100% { transform: rotate(0); } }

@keyframes rxn-laugh {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-10deg); }
  40% { transform: rotate(9deg); }
  60% { transform: rotate(-7deg); }
  80% { transform: rotate(4deg); }
}

@keyframes rxn-wow { 0% { transform: scale(1); } 35% { transform: scale(0.92, 1.22); } 100% { transform: scale(1); } }

@keyframes rxn-droop { 0%, 100% { transform: none; } 40% { transform: translateY(2px) rotate(-8deg) scale(0.96); } }

@keyframes rxn-bow { 0%, 100% { transform: none; } 40% { transform: translateY(2px) scale(1, 0.9); } 60% { transform: translateY(1px) scale(1, 0.95); } }

/* == 3D METALLIC EMBLEM SHOWCASE ========================== */
.metallic-emblem-section {
  position: relative;
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: #000000;
  padding: 5rem 1rem 6rem;
}

.metallic-emblem-backdrop {
  position: absolute;
  inset: 0;
  background-image: url("assets/ui-grid-backdrop.webp");
  background-size: cover;
  background-position: center;
  opacity: 0.45;
  pointer-events: none;
}

.metallic-emblem-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 35%, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.82) 70%, #000000 100%);
  pointer-events: none;
}

[data-theme="light"] .metallic-emblem-section,
.theme-light .metallic-emblem-section {
  background: #ffffff;
  border-top-color: rgba(0, 0, 0, 0.1);
  border-bottom-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .metallic-emblem-overlay,
.theme-light .metallic-emblem-overlay {
  background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.88) 70%, #ffffff 100%);
}

.interactive-lab-card {
  background: rgba(15, 15, 18, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.25rem;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.interactive-lab-card:hover {
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .interactive-lab-card,
.theme-light .interactive-lab-card {
  background: rgba(250, 250, 250, 0.8);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .interactive-lab-card:hover,
.theme-light .interactive-lab-card:hover {
  border-color: rgba(0, 0, 0, 0.22);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.08);
}
