/* =========================================================================
   THE KNIGHTS OF BD — DESIGN SYSTEM
   Performance rules:
   · no backdrop-filter on large surfaces
   · transforms + opacity only for motion
   · several sections use content-visibility:auto
   ========================================================================= */

:root {
  color-scheme: dark;

  --bg-0: #04040b;
  --bg-1: #070713;
  --bg-2: #0b0b1c;
  --bg-3: #101024;

  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-3: rgba(255, 255, 255, 0.09);

  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);

  --text: #eef0ff;
  --text-soft: #c4c9e8;
  --muted: #8a91b8;

  --cyan: #00e1ff;
  --violet: #6c5ce7;
  --pink: #ff2d85;
  --gold: #ffc857;
  --green: #2ee6a8;
  --red: #ff5c7a;

  --grad-primary: linear-gradient(135deg, #00e1ff 0%, #6c5ce7 55%, #ff2d85 100%);
  --grad-gold: linear-gradient(135deg, #ffe29a 0%, #ffc857 45%, #f79b2e 100%);
  --grad-cyan: linear-gradient(135deg, #7cf5ff 0%, #00c8e6 100%);

  --radius-xl: 24px;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 9px;

  --shadow-lg: 0 40px 90px -40px rgba(0, 0, 0, 0.95);
  --shadow-md: 0 22px 50px -28px rgba(0, 0, 0, 0.9);
  --shadow-glow: 0 0 0 1px rgba(0, 225, 255, 0.22), 0 18px 50px -22px rgba(0, 225, 255, 0.5);

  --font-display: 'Orbitron', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Poppins', 'Segoe UI', system-ui, sans-serif;

  --nav-h: 76px;
  --container: 1180px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ------------------------------- reset -------------------------------- */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 18px);
}

body {
  min-height: 100vh;
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

p {
  text-wrap: pretty;
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(0, 225, 255, 0.3);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ----------------------------- background ----------------------------- */

body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body::before {
  background:
    radial-gradient(60% 55% at 15% -5%, rgba(108, 92, 231, 0.22), transparent 65%),
    radial-gradient(50% 45% at 90% 0%, rgba(0, 225, 255, 0.14), transparent 60%),
    radial-gradient(45% 45% at 50% 110%, rgba(255, 45, 133, 0.12), transparent 65%),
    linear-gradient(180deg, #05050f 0%, #04040b 100%);
}

body::after {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
  opacity: 0.7;
}

#bgCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.75;
}

.shell {
  position: relative;
  z-index: 1;
}

/* ------------------------------- layout ------------------------------- */

.wrap {
  width: min(100% - 40px, var(--container));
  margin-inline: auto;
}

.section {
  padding: clamp(56px, 7vw, 96px) 0;
  content-visibility: auto;
  contain-intrinsic-size: auto 620px;
}

.section--tight {
  padding: clamp(36px, 5vw, 64px) 0;
}

.section-head {
  max-width: 640px;
  margin-bottom: clamp(28px, 4vw, 44px);
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--cyan);
}

.eyebrow::before {
  content: '';
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.section-title {
  margin-top: 14px;
  font-size: clamp(1.75rem, 4vw, 2.65rem);
}

.section-sub {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.98rem;
}

.gradient-text {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.gold-text {
  background: var(--grad-gold);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* -------------------------------- nav --------------------------------- */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 90;
  background: var(--grad-primary);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 80;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(5, 5, 14, 0.86);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.site-nav.is-scrolled {
  background: rgba(5, 5, 14, 0.96);
  border-bottom-color: var(--line);
  box-shadow: 0 18px 40px -30px rgba(0, 0, 0, 0.9);
}

.nav-inner {
  width: min(100% - 40px, var(--container));
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}

.brand__logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(0, 225, 255, 0.35));
}

.brand__text {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.15;
  white-space: nowrap;
}

.brand__text em {
  display: block;
  font-style: normal;
  font-size: 0.66rem;
  letter-spacing: 0.32em;
  color: var(--cyan);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 10px;
}

.nav-links a {
  position: relative;
  padding: 9px 13px;
  border-radius: var(--radius-xs);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-soft);
  transition: color 0.18s ease, background 0.18s ease;
}

.nav-links a:hover {
  color: #fff;
  background: var(--surface);
}

.nav-links a.is-current {
  color: #fff;
}

.nav-links a.is-current::after {
  content: '';
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad-primary);
}

.nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span,
.nav-toggle::before,
.nav-toggle::after {
  content: '';
  display: block;
  width: 17px;
  height: 1.5px;
  background: var(--text-soft);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle.is-active span {
  opacity: 0;
}

.nav-toggle.is-active::before {
  transform: translateY(6.5px) rotate(45deg);
}

.nav-toggle.is-active::after {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* ------------------------------- buttons ------------------------------ */

.btn {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: transform 0.18s var(--ease), box-shadow 0.2s ease, background 0.2s ease,
    border-color 0.2s ease, color 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0) scale(0.985);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn i {
  font-size: 0.95em;
}

.btn-primary {
  border-color: transparent;
  background: var(--grad-primary);
  color: #05050f;
  box-shadow: 0 16px 34px -18px rgba(0, 225, 255, 0.75);
}

.btn-primary:hover {
  box-shadow: 0 22px 46px -18px rgba(108, 92, 231, 0.85);
}

.btn-gold {
  border-color: transparent;
  background: var(--grad-gold);
  color: #1b1300;
  box-shadow: 0 16px 34px -20px rgba(255, 200, 87, 0.8);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text-soft);
}

.btn-ghost:hover {
  color: #fff;
  border-color: rgba(0, 225, 255, 0.45);
  background: rgba(0, 225, 255, 0.06);
}

.btn-danger {
  border-color: rgba(255, 92, 122, 0.35);
  background: rgba(255, 92, 122, 0.12);
  color: #ffb3c1;
}

.btn-danger:hover {
  background: rgba(255, 92, 122, 0.2);
}

.btn-sm {
  min-height: 38px;
  padding: 0 15px;
  font-size: 0.68rem;
  border-radius: var(--radius-xs);
}

.btn-lg {
  min-height: 54px;
  padding: 0 28px;
  font-size: 0.82rem;
}

.btn-block {
  width: 100%;
}

.btn__spinner {
  display: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: currentColor;
  animation: spin 0.7s linear infinite;
}

.btn.is-busy .btn__spinner {
  display: inline-block;
}

.btn.is-busy .btn__label {
  opacity: 0.65;
}

.link-btn {
  align-self: center;
  font-size: 0.82rem;
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: 0.9;
}

.link-btn:hover {
  opacity: 1;
  color: #7cf5ff;
}

/* --------------------------- connection guide -------------------------- */

.ip-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.ip-row {
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.ip-row__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.ip-row__head h3 {
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.ip-row__head .badge {
  font-size: 0.6rem;
}

.ip-row__value {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ip-row__value code {
  flex: 1 1 200px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  font-family: 'Consolas', 'SFMono-Regular', ui-monospace, monospace;
  font-size: 0.82rem;
  color: #d6dbfa;
  overflow-x: auto;
  white-space: nowrap;
}

.ip-note {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 225, 255, 0.18);
  background: rgba(0, 225, 255, 0.05);
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--text-soft);
}

.ip-note i {
  color: var(--cyan);
  margin-right: 6px;
}

.ip-note a {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.versions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 0.78rem;
  color: var(--muted);
}

.versions i {
  color: var(--violet);
}

/* -------------------------------- chips ------------------------------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.74rem;
  color: var(--text-soft);
}

.chip i {
  color: var(--cyan);
  font-size: 0.8em;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge--gold {
  background: rgba(255, 200, 87, 0.14);
  color: var(--gold);
  border: 1px solid rgba(255, 200, 87, 0.3);
}

.badge--cyan {
  background: rgba(0, 225, 255, 0.12);
  color: var(--cyan);
  border: 1px solid rgba(0, 225, 255, 0.28);
}

.badge--green {
  background: rgba(46, 230, 168, 0.12);
  color: var(--green);
  border: 1px solid rgba(46, 230, 168, 0.28);
}

.badge--muted {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--line);
}

/* ------------------------------- auth slot ---------------------------- */

.auth-slot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 92px;
  min-height: 40px;
}

/* Hide both auth variants until Firebase reports a state — stops the login flash */
html:not([data-auth-state]) [data-auth] {
  display: none !important;
}

.auth-skeleton {
  width: 92px;
  height: 38px;
  border-radius: var(--radius-xs);
  background: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0.05) 20%,
    rgba(255, 255, 255, 0.11) 40%,
    rgba(255, 255, 255, 0.05) 60%
  );
  background-size: 240% 100%;
  animation: shimmer 1.4s linear infinite;
}

html[data-auth-state] .auth-skeleton {
  display: none;
}

.user-menu {
  position: relative;
  display: flex;
  align-items: center;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 11px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.user-chip:hover,
.user-menu.is-open .user-chip {
  border-color: rgba(0, 225, 255, 0.4);
  background: rgba(0, 225, 255, 0.07);
}

.user-chip img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-3);
  image-rendering: pixelated;
}

.user-chip span {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.84rem;
  font-weight: 500;
}

.user-chip .fa-chevron-down {
  font-size: 0.6rem;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.user-menu.is-open .fa-chevron-down {
  transform: rotate(180deg);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 240px;
  padding: 8px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: #0b0b1c;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.98);
  transform-origin: top right;
  transition: opacity 0.18s ease, transform 0.18s var(--ease), visibility 0.18s;
  z-index: 10;
}

.user-menu.is-open .user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.user-dropdown__head {
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}

.user-dropdown__head strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.85rem;
}

.user-dropdown__head span {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown a,
.user-dropdown button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-xs);
  font-size: 0.85rem;
  color: var(--text-soft);
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.user-dropdown a i,
.user-dropdown button i {
  width: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.user-dropdown a:hover,
.user-dropdown button:hover {
  background: var(--surface-2);
  color: #fff;
}

.user-dropdown .is-danger {
  color: #ff9fb0;
}

.user-dropdown .is-danger i {
  color: #ff9fb0;
}

.user-dropdown .is-danger:hover {
  background: rgba(255, 92, 122, 0.12);
}

/* ------------------------------- modals ------------------------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 3, 9, 0.78);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s;
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
}

.modal__card {
  position: relative;
  width: min(100%, 560px);
  max-height: min(90vh, 860px);
  overflow-y: auto;
  padding: clamp(24px, 4vw, 34px);
  border-radius: var(--radius-xl);
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #0e0e22 0%, #090916 100%);
  box-shadow: var(--shadow-lg);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.24s var(--ease);
  overscroll-behavior: contain;
}

.modal.is-open .modal__card {
  transform: translateY(0) scale(1);
}

.modal__card--auth {
  width: min(100%, 580px);
}

.modal__card--small {
  width: min(100%, 420px);
  text-align: center;
}

.modal__close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--muted);
  transition: background 0.18s ease, color 0.18s ease;
}

.modal__close:hover {
  background: var(--surface-2);
  color: #fff;
}

.modal::-webkit-scrollbar,
.modal__card::-webkit-scrollbar {
  width: 8px;
}

.modal__card::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 99px;
}

/* -------------------------------- forms ------------------------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field__label {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.92rem;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.field input::placeholder {
  color: #60678c;
}

.field input:hover,
.field select:hover {
  border-color: var(--line-strong);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: rgba(0, 225, 255, 0.55);
  background: rgba(0, 225, 255, 0.04);
  box-shadow: 0 0 0 3px rgba(0, 225, 255, 0.1);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.input-group {
  position: relative;
  display: block;
}

.input-group input {
  padding-right: 46px;
}

.input-group__btn {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-xs);
  color: var(--muted);
  font-size: 0.85rem;
}

.input-group__btn:hover,
.input-group__btn.is-active {
  color: var(--cyan);
  background: rgba(0, 225, 255, 0.08);
}

.form-error {
  padding: 10px 13px;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(255, 92, 122, 0.3);
  background: rgba(255, 92, 122, 0.09);
  color: #ffb3c1;
  font-size: 0.83rem;
  line-height: 1.5;
}

/* -------------------------------- auth -------------------------------- */

.auth__head {
  text-align: center;
  margin-bottom: 22px;
}

.auth__crest {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: linear-gradient(150deg, rgba(0, 225, 255, 0.18), rgba(108, 92, 231, 0.22));
  border: 1px solid rgba(0, 225, 255, 0.25);
  color: var(--cyan);
  font-size: 1.3rem;
}

.auth__head h2 {
  font-size: 1.35rem;
}

.auth__head p {
  margin-top: 8px;
  font-size: 0.86rem;
  color: var(--muted);
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.3);
}

.tab {
  padding: 10px;
  border-radius: var(--radius-xs);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.18s ease, background 0.18s ease;
}

.tab:hover {
  color: var(--text-soft);
}

.tab.is-active {
  background: var(--surface-2);
  color: #fff;
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.auth__form {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.auth__form.is-active {
  display: flex;
}

.auth__legal,
.auth__hint {
  font-size: 0.76rem;
  line-height: 1.55;
  color: var(--muted);
}

.auth__form .link-btn {
  margin-top: 2px;
}

/* ------------------------------ confirms ------------------------------ */

.confirm__title {
  font-size: 1.35rem;
}

.confirm__text {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.confirm__actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}

.confirm__actions .btn {
  flex: 1 1 150px;
}

/* -------------------------------- toast ------------------------------- */

.toast-host {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(380px, calc(100vw - 36px));
  pointer-events: none;
}

.toast {
  position: relative;
  display: grid;
  grid-template-columns: 38px 1fr 30px;
  align-items: start;
  gap: 11px;
  padding: 14px 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: #0c0c1e;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  transition: opacity 0.24s ease, transform 0.24s var(--ease);
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(8px) scale(0.98);
}

.toast__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 1rem;
}

.toast--success .toast__icon {
  background: rgba(46, 230, 168, 0.12);
  color: var(--green);
}

.toast--error .toast__icon {
  background: rgba(255, 92, 122, 0.12);
  color: var(--red);
}

.toast--warning .toast__icon {
  background: rgba(255, 200, 87, 0.12);
  color: var(--gold);
}

.toast--info .toast__icon {
  background: rgba(0, 225, 255, 0.12);
  color: var(--cyan);
}

.toast__title {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.4;
}

.toast__text {
  margin-top: 2px;
  font-size: 0.79rem;
  line-height: 1.5;
  color: var(--muted);
}

.toast__close {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.toast__close:hover {
  background: var(--surface-2);
  color: #fff;
}

.toast__bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  transform-origin: 0 50%;
  background: var(--grad-primary);
  animation: toastbar linear forwards;
}

.toast.is-paused .toast__bar {
  animation-play-state: paused;
}

.toast--success .toast__bar {
  background: linear-gradient(90deg, #2ee6a8, #00e1ff);
}

.toast--error .toast__bar {
  background: linear-gradient(90deg, #ff5c7a, #ff2d85);
}

/* ------------------------------- footer ------------------------------- */

.site-footer {
  position: relative;
  z-index: 1;
  padding: 48px 0 34px;
  border-top: 1px solid var(--line);
  background: rgba(4, 4, 12, 0.7);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 34px;
}

.footer-brand p {
  margin-top: 12px;
  max-width: 34ch;
  font-size: 0.85rem;
  color: var(--muted);
}

.footer-col h4 {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.footer-col a,
.footer-col span {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 0.85rem;
  color: var(--text-soft);
  transition: color 0.18s ease;
}

.footer-col a:hover {
  color: var(--cyan);
}

.footer-col i {
  width: 15px;
  color: var(--muted);
  font-size: 0.8rem;
}

.footer-col code {
  font-family: 'Consolas', ui-monospace, monospace;
  font-size: 0.78rem;
  color: var(--text-soft);
}

.footer-bottom {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
}

.footer-bottom .highlight {
  color: var(--cyan);
}

/* ------------------------------ reveal -------------------------------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s ease, transform 0.6s var(--ease);
}

/* ---------------------------- empty / misc ---------------------------- */

.empty-state {
  padding: 46px 24px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

.empty-state i {
  font-size: 1.7rem;
  color: var(--muted);
}

.empty-state h3 {
  margin-top: 12px;
  font-size: 1.05rem;
}

.empty-state p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.87rem;
}

.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;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: var(--radius-xs);
  background: var(--cyan);
  color: #04141a;
  font-weight: 600;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 12px;
}

/* ----------------------------- animations ----------------------------- */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  from {
    background-position: 120% 0;
  }
  to {
    background-position: -120% 0;
  }
}

@keyframes toastbar {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

@keyframes pulseDot {
  0%,
  100% {
    box-shadow: 0 0 0 0 currentColor;
    opacity: 1;
  }
  50% {
    box-shadow: 0 0 0 5px transparent;
    opacity: 0.7;
  }
}

/* ------------------------------ scrollbar ----------------------------- */

::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

::-webkit-scrollbar-track {
  background: #06060f;
}

::-webkit-scrollbar-thumb {
  background: #22224a;
  border-radius: 99px;
  border: 3px solid #06060f;
}

::-webkit-scrollbar-thumb:hover {
  background: #31316a;
}

/* ------------------------------ responsive ---------------------------- */

@media (max-width: 900px) {
  .nav-links {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px 20px 18px;
    background: #070713;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s var(--ease), visibility 0.2s;
  }

  .nav-links.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav-links a {
    padding: 12px;
    font-size: 0.92rem;
  }

  .nav-links a.is-current::after {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  :root {
    --nav-h: 66px;
  }

  .wrap,
  .nav-inner {
    width: calc(100% - 28px);
  }

  .brand__text {
    font-size: 0.72rem;
  }

  .brand__logo {
    width: 32px;
    height: 32px;
  }

  .nav-actions .btn-store {
    display: none;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .modal {
    padding: 0;
    align-items: flex-end;
  }

  .modal__card {
    width: 100%;
    max-height: 92vh;
    border-radius: 22px 22px 0 0;
    border-bottom: 0;
    transform: translateY(40px);
  }

  .modal.is-open .modal__card {
    transform: translateY(0);
  }

  .toast-host {
    right: 12px;
    left: 12px;
    bottom: 12px;
    width: auto;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .footer-bottom {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
