/* CodeBay — modern dual-theme marketplace */

/* ── Light theme (default) ── */
:root,
[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-elevated: #ffffff;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.14);
  --text: #0f172a;
  --muted: #64748b;
  --accent: #6366f1;
  --accent-2: #06b6d4;
  --accent-hover: #4f46e5;
  --accent-grad: linear-gradient(135deg, #6366f1 0%, #ec4899 50%, #06b6d4 100%);
  --accent-soft: rgba(99, 102, 241, 0.1);
  --green: #059669;
  --green-soft: rgba(5, 150, 105, 0.1);
  --warn-soft: rgba(245, 158, 11, 0.12);
  --warn: #d97706;
  --danger-soft: rgba(239, 68, 68, 0.1);
  --danger: #dc2626;
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  --shadow-hover: 0 12px 40px rgba(99, 102, 241, 0.15);
  --header-bg: rgba(255, 255, 255, 0.8);
  --mesh-1: rgba(99, 102, 241, 0.35);
  --mesh-2: rgba(6, 182, 212, 0.28);
  --mesh-3: rgba(168, 85, 247, 0.2);
  --grid-color: rgba(99, 102, 241, 0.04);
}

/* ── Dark theme ── */
[data-theme="dark"] {
  --bg: #070b14;
  --bg-elevated: #0d1320;
  --surface: rgba(13, 19, 32, 0.65);
  --surface-solid: #111827;
  --border: rgba(148, 163, 184, 0.12);
  --border-strong: rgba(148, 163, 184, 0.22);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #818cf8;
  --accent-2: #22d3ee;
  --accent-hover: #a5b4fc;
  --accent-grad: linear-gradient(135deg, #818cf8 0%, #f472b6 50%, #22d3ee 100%);
  --accent-soft: rgba(129, 140, 248, 0.12);
  --green: #34d399;
  --green-soft: rgba(52, 211, 153, 0.12);
  --warn-soft: rgba(251, 191, 36, 0.12);
  --warn: #fbbf24;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --danger: #f87171;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 16px 48px rgba(129, 140, 248, 0.18);
  --header-bg: rgba(7, 11, 20, 0.75);
  --mesh-1: rgba(129, 140, 248, 0.45);
  --mesh-2: rgba(34, 211, 238, 0.35);
  --mesh-3: rgba(192, 132, 252, 0.3);
  --grid-color: rgba(148, 163, 184, 0.04);
}

:root {
  --radius: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.4s ease, color 0.4s ease;
}

/* ── Animated background ── */
.bg-fx {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

#bgCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.bg-fx__mesh {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(ellipse 50% 40% at 15% 20%, var(--mesh-1), transparent 55%),
    radial-gradient(ellipse 45% 35% at 85% 15%, var(--mesh-2), transparent 50%),
    radial-gradient(ellipse 40% 45% at 60% 85%, var(--mesh-3), transparent 55%);
  animation: mesh-drift 18s ease-in-out infinite alternate;
  filter: blur(40px);
}

.bg-fx__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 10%, transparent 75%);
}

@keyframes mesh-drift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(3%, -2%) scale(1.05); }
}

.header, .hero, .catalog, .section, .footer, .project, .admin-app, .login-screen {
  position: relative;
  z-index: 1;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.container--narrow { max-width: 680px; }

h1, h2, h3 {
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.accent {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
}

.btn--sm { padding: 8px 16px; font-size: 0.84rem; }
.btn--lg { padding: 14px 30px; font-size: 1rem; }

.btn--primary {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
}

[data-theme="dark"] .btn--primary {
  box-shadow: 0 4px 24px rgba(129, 140, 248, 0.3);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.45);
}

.btn--ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
  backdrop-filter: blur(12px);
}

.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn--disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Theme toggle ── */
.theme-toggle {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  backdrop-filter: blur(12px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: border-color 0.2s, transform 0.2s;
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--accent);
  transform: scale(1.05);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle__icon--moon { display: none; }
[data-theme="dark"] .theme-toggle__icon--sun { display: none; }
[data-theme="dark"] .theme-toggle__icon--moon { display: block; }

/* ── Header ── */
/* ── Header ── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 14px 0;
  background: transparent;
  border: none;
}

.header__shell {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 60px;
  padding: 8px 12px 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px) saturate(1.5);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.logo__mark {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--accent-grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
  overflow: hidden;
}

.logo__shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.35) 50%, transparent 60%);
  animation: logo-shine 4s ease-in-out infinite;
}

@keyframes logo-shine {
  0%, 100% { transform: translateX(-120%); }
  50% { transform: translateX(120%); }
}

.logo__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.logo__name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.logo__tag {
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.logo--sm .logo__tag { display: none; }

.header__badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--green-soft);
  border: 1px solid rgba(52, 211, 153, 0.25);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--green);
  white-space: nowrap;
}

.header__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

.nav {
  display: flex;
  gap: 28px;
  margin-left: auto;
}

.nav--pills {
  gap: 4px;
  padding: 4px;
  margin-left: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.nav a,
.nav__link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  transition: color 0.15s, background 0.15s;
}

.nav--pills a,
.nav--pills .nav__link {
  padding: 8px 18px;
  border-radius: 10px;
}

.nav--pills a:hover,
.nav--pills .nav__link:hover {
  color: var(--text);
  background: var(--surface);
}

.nav a:hover { color: var(--text); }

.header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header__admin {
  border-color: transparent !important;
  background: var(--accent-soft) !important;
  color: var(--accent) !important;
}

.header__admin[hidden],
.admin-only-link[hidden] {
  display: none !important;
}

.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* ── Hero ── */
.hero {
  padding: 80px 0 40px;
  text-align: center;
}

.hero__center {
  max-width: 720px;
  margin: 0 auto;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  margin-bottom: 28px;
  backdrop-filter: blur(12px);
}

.hero__badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 8px var(--accent-2);
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1.08;
  margin-bottom: 20px;
  letter-spacing: -0.04em;
}

.hero__lead {
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.65;
  max-width: 52ch;
  margin: 0 auto 32px;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* legacy metrics (unused in hero) */
.hero__metrics {
  display: none;
}

/* ── Catalog ── */
.catalog {
  padding: 24px 0 72px;
  position: relative;
  z-index: 1;
}

.catalog__head {
  text-align: center;
  margin-bottom: 32px;
}

.catalog__head h2 {
  font-size: clamp(1.6rem, 3vw, 2rem);
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.catalog__head p {
  color: var(--muted);
  font-size: 1.05rem;
}

.catalog__bar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
}

.search--wide {
  max-width: none;
  flex: none;
  width: 100%;
}

/* ── Sections ── */
.section { padding: 80px 0; }

.section--alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.section__head { margin-bottom: 40px; }

.section__head--center {
  text-align: center;
}

.section__head--center p {
  color: var(--muted);
  margin-top: 8px;
}

.section__head h2 {
  font-size: clamp(1.6rem, 3vw, 2rem);
  letter-spacing: -0.03em;
}

.section__head p { color: var(--muted); }

/* ── Toolbar (legacy) ── */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 28px;
  align-items: center;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-solid);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 11px 18px;
  flex: 1;
  min-width: 220px;
  max-width: 360px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search svg { color: var(--muted); flex-shrink: 0; }

.search input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  width: 100%;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-btn {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-btn:hover {
  color: var(--text);
  background: var(--accent-soft);
}

.filter-btn.is-active {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
}

/* ── Cards ── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}

/* ── Pagination ── */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 40px;
  padding: 18px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
}

.pager__info {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.pager__controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pager__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.pager__btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.pager__btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.pager__pages {
  display: flex;
  gap: 4px;
}

.pager__page {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.pager__page:hover {
  color: var(--text);
  background: var(--bg);
}

.pager__page.is-active {
  background: var(--accent-grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.card {
  position: relative;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s;
}

.card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-grad);
  opacity: 0;
  transition: opacity 0.25s;
  z-index: 2;
}

.card:hover::after {
  opacity: 1;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(99, 102, 241, 0.25);
}

[data-theme="dark"] .card:hover {
  border-color: rgba(129, 140, 248, 0.3);
}

.card__link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--bg) 100%);
  overflow: hidden;
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.card:hover .card__media img { transform: scale(1.04); }

.card__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background:
    radial-gradient(circle at 30% 30%, var(--accent-soft), transparent 50%),
    var(--bg-elevated);
}

.card__badge {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--accent-grad);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card__price-tag {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 7px 14px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  backdrop-filter: blur(8px);
}

[data-theme="light"] .card__price-tag {
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  border: 1px solid var(--border);
}

.card__body { padding: 18px 20px 20px; }

.card__category {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card__title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 4px 0 6px;
  letter-spacing: -0.02em;
}

.card__desc {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.tag {
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
}

.card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  gap: 8px;
  flex-wrap: wrap;
}

.card__sales,
.card__stock {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
}

.card__sales {
  color: var(--green);
  background: var(--green-soft);
}

.stock--unlimited,
.stock--ok {
  color: var(--accent-2);
  background: rgba(6, 182, 212, 0.1);
}

[data-theme="dark"] .stock--unlimited,
[data-theme="dark"] .stock--ok {
  background: rgba(34, 211, 238, 0.12);
}

.stock--low {
  color: var(--warn);
  background: var(--warn-soft);
}

.stock--out {
  color: var(--danger);
  background: var(--danger-soft);
}

.card__price { display: none; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 0;
}

/* ── Flow (how to buy) ── */
.flow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  position: relative;
}

.flow::before {
  content: "";
  position: absolute;
  top: 36px;
  left: 16%;
  right: 16%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
  pointer-events: none;
}

.flow__item {
  text-align: center;
  padding: 0 12px;
  position: relative;
}

.flow__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 20px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  position: relative;
  z-index: 1;
}

.flow__icon svg {
  width: 28px;
  height: 28px;
}

.flow__item:hover .flow__icon {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.flow__item h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.flow__item p {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
  max-width: 28ch;
  margin: 0 auto;
}

/* ── Accordion (FAQ) ── */
.accordion {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.accordion__item {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.accordion__item.is-open {
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: var(--shadow);
}

[data-theme="dark"] .accordion__item.is-open {
  border-color: rgba(129, 140, 248, 0.4);
}

.accordion__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 18px 22px;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: color 0.15s;
}

.accordion__trigger:hover {
  color: var(--accent);
}

.accordion__item.is-open .accordion__trigger {
  color: var(--accent);
}

.accordion__chevron {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 0.3s ease, color 0.2s;
}

.accordion__item.is-open .accordion__chevron {
  transform: rotate(180deg);
  color: var(--accent);
}

.accordion__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
}

.accordion__item.is-open .accordion__panel {
  grid-template-rows: 1fr;
}

.accordion__content {
  overflow: hidden;
}

.accordion__content p {
  padding: 0 22px 20px;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
  border-top: 1px solid transparent;
}

.accordion__item.is-open .accordion__content p {
  border-top-color: var(--border);
  padding-top: 16px;
}

/* legacy */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.step {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: border-color 0.2s, transform 0.2s;
}

.step:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.step__num {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-grad);
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 1rem;
}

.step h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.step p {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ── Project page ── */
.project { padding: 32px 0 72px; }

.back-link {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 24px;
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}

.back-link:hover { color: var(--accent); }

.project__layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  margin-bottom: 28px;
}

.project__gallery,
.project__info {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.project__gallery { padding: 18px; }

.gallery__main {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  aspect-ratio: 16 / 10;
}

.gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: zoom-in;
  transition: transform 0.25s ease;
}

.gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(8, 8, 16, 0.72);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 0.15s, transform 0.15s;
}

.gallery__nav:hover {
  background: rgba(8, 8, 16, 0.9);
  transform: translateY(-50%) scale(1.05);
}

.gallery__nav svg { width: 20px; height: 20px; }

.gallery__nav--prev { left: 12px; }
.gallery__nav--next { right: 12px; }

.gallery__zoom {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 12px;
  background: rgba(8, 8, 16, 0.72);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 0.15s;
}

.gallery__zoom:hover { background: rgba(8, 8, 16, 0.9); }
.gallery__zoom svg { width: 18px; height: 18px; }

.gallery__counter {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 2;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(8, 8, 16, 0.72);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.gallery__thumbs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.gallery__thumb {
  width: 76px;
  height: 54px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  background: var(--bg);
  transition: border-color 0.15s, transform 0.15s;
}

.gallery__thumb:hover { transform: translateY(-1px); }
.gallery__thumb.is-active { border-color: var(--accent); }

.gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery__placeholder {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  border: 2px dashed var(--border-strong);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
}

.gallery-lightbox[hidden] { display: none !important; }

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(4, 4, 10, 0.94);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.gallery-lightbox-open { overflow: hidden; }

.gallery-lightbox__stage {
  flex: 1;
  width: min(100%, 1200px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  cursor: zoom-in;
}

.gallery-lightbox__img {
  max-width: 100%;
  max-height: calc(100vh - 120px);
  object-fit: contain;
  border-radius: 12px;
  transition: transform 0.25s ease;
  transform-origin: center center;
}

.gallery-lightbox__img.is-zoomed {
  cursor: zoom-out;
  transform: scale(1.75);
}

.gallery-lightbox__close,
.gallery-lightbox__nav {
  position: absolute;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: background 0.15s;
}

.gallery-lightbox__close:hover,
.gallery-lightbox__nav:hover { background: rgba(255, 255, 255, 0.16); }

.gallery-lightbox__close {
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.gallery-lightbox__close svg,
.gallery-lightbox__nav svg { width: 22px; height: 22px; }

.gallery-lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.gallery-lightbox__nav--prev { left: 18px; }
.gallery-lightbox__nav--next { right: 18px; }

.gallery-lightbox__bar {
  width: min(100%, 1200px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
}

.gallery-lightbox__counter {
  font-weight: 700;
  color: #fff;
}

.gallery-lightbox__hint {
  text-align: right;
}

.project__info { padding: 32px; }

.project__category {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.project h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin: 8px 0 12px;
}

.project__short {
  color: var(--muted);
  font-size: 1.02rem;
  margin-bottom: 22px;
}

.project__meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.meta-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.meta-card__label {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.meta-card__value {
  font-size: 1.25rem;
  font-weight: 800;
}

.meta-card__value--price {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.project__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.project__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.project__description {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
}

.project__description h2 {
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.prose p {
  color: var(--muted);
  margin-bottom: 8px;
}

.not-found {
  text-align: center;
  padding: 80px 0;
}

.not-found h1 { margin-bottom: 12px; }
.not-found p { color: var(--muted); margin-bottom: 24px; }

/* ── Footer ── */
.footer {
  position: relative;
  margin-top: 48px;
  padding: 0 0 36px;
  overflow: hidden;
}

.footer__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 20% 100%, var(--mesh-1), transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 100%, var(--mesh-3), transparent 55%);
  opacity: 0.6;
}

.footer__grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  padding-top: 8px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.footer__heading {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 16px;
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer__links a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  opacity: 0.75;
  transition: opacity 0.15s, color 0.15s;
}

.footer__links a:hover {
  opacity: 1;
  color: var(--accent);
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.footer__desc {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.65;
  max-width: 36ch;
}

.footer__metrics {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-metric {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.footer-metric strong {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-metric span {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.footer-metric--accent strong {
  -webkit-text-fill-color: var(--green);
  background: none;
  color: var(--green);
}

.footer__bottom {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.82rem;
}

.footer__tagline {
  opacity: 0.7;
}

/* legacy footer */
.footer__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 40px 0 36px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 36px;
}

.footer-stat {
  text-align: center;
  padding: 24px 16px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.2s, transform 0.2s;
}

.footer-stat:hover {
  border-color: rgba(99, 102, 241, 0.35);
  transform: translateY(-2px);
}

[data-theme="dark"] .footer-stat:hover {
  border-color: rgba(129, 140, 248, 0.4);
}

.footer-stat strong {
  display: block;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 8px;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-stat span {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}

.footer__main {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
  align-items: start;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.footer__nav {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 24px;
  justify-items: end;
}

.footer__nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: color 0.15s;
}

.footer__nav a:hover {
  color: var(--accent);
}

/* legacy */
.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.footer__copy,
.footer__note {
  color: var(--muted);
  font-size: 0.82rem;
}

/* ── Admin ── */
.admin-body { min-height: 100vh; }

.login-screen[hidden],
.admin-app[hidden] {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow);
}

.login-card h1 { font-size: 1.5rem; }
.login-card p { color: var(--muted); font-size: 0.9rem; }

.login-card input {
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
}

.login-card input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.login-error { color: var(--danger); font-size: 0.875rem; }

.login-back {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  text-align: center;
  font-weight: 600;
}

.admin-header {
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.admin-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
}

.admin-header__actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.admin-main { padding: 32px 0 64px; }

.admin-title {
  font-size: 1.65rem;
  margin-bottom: 22px;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-solid);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  background: var(--bg-elevated);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--accent-soft); }

.status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 700;
}

.status--pub {
  background: var(--green-soft);
  color: var(--green);
}

.status--draft {
  background: var(--bg-elevated);
  color: var(--muted);
}

.table-actions {
  display: flex;
  gap: 8px;
}

.table-actions button,
.table-actions a {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-strong);
  background: var(--surface-solid);
  color: var(--text);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.table-actions button:hover,
.table-actions a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.table-actions button.danger {
  border-color: transparent;
  background: var(--danger-soft);
  color: var(--danger);
}

.table-actions button.danger:hover {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.btn--danger {
  border-color: transparent !important;
  background: var(--danger-soft) !important;
  color: var(--danger) !important;
}

.btn--danger:hover {
  border-color: var(--danger) !important;
}

.form-head { margin-bottom: 22px; }

.admin-form {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field--full { grid-column: 1 / -1; }

.field--check {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.field span {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.field input,
.field textarea,
.field select {
  padding: 11px 14px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field textarea { resize: vertical; min-height: 120px; }

.upload-section {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.upload-section h3 {
  font-size: 1.15rem;
  margin-bottom: 4px;
}

.hint {
  color: var(--muted);
  font-size: 0.84rem;
  margin-bottom: 14px;
}

.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.screenshot-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 16 / 10;
}

.screenshot-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.screenshot-item__actions {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.15s;
}

.screenshot-item:hover .screenshot-item__actions { opacity: 1; }

.screenshot-item__actions button {
  padding: 6px 10px;
  border-radius: 8px;
  border: none;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.screenshot-item__actions button.danger { background: var(--danger); }

.screenshot-item.is-cover { border-color: var(--accent); }

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.form-status { margin-top: 14px; font-size: 0.9rem; font-weight: 600; }
.form-status--ok { color: var(--green); }
.form-status--err { color: var(--danger); }

.btn--block { width: 100%; }

/* ── Wallet pill (header) ── */
.wallet-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 10px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  backdrop-filter: blur(12px);
  cursor: pointer;
  color: var(--text);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.wallet-pill:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.wallet-pill__icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--accent-grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wallet-pill__icon svg {
  width: 16px;
  height: 16px;
}

.wallet-pill__info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
  text-align: left;
}

.wallet-pill__label {
  font-size: 0.65rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wallet-pill__amount {
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* ── Profile drawer ── */
.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  animation: fade-in 0.25s ease;
}

.drawer-overlay[hidden] { display: none; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100vw);
  z-index: 201;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  box-shadow: -12px 0 48px rgba(0, 0, 0, 0.2);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.drawer.is-open { transform: translateX(0); }

body.drawer-open { overflow: hidden; }

.drawer__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.drawer__head h2 {
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.drawer__sub {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 4px;
}

.drawer__close {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s;
}

.drawer__close:hover { border-color: var(--accent); }
.drawer__close svg { width: 18px; height: 18px; }

.drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 32px;
}

.drawer__section {
  margin-bottom: 28px;
}

.drawer__section h3 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 12px;
}

.drawer__empty {
  color: var(--muted);
  font-size: 0.88rem;
  padding: 12px 0;
}

/* Balance card */
.balance-card {
  position: relative;
  padding: 28px 24px;
  border-radius: 20px;
  background: var(--accent-grad);
  color: #fff;
  overflow: hidden;
  margin-bottom: 28px;
}

.balance-card__glow {
  position: absolute;
  top: -40%;
  right: -20%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  filter: blur(40px);
}

.balance-card__label {
  font-size: 0.78rem;
  opacity: 0.85;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.balance-card__amount {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 8px 0 6px;
  line-height: 1;
}

.balance-card__hint {
  font-size: 0.8rem;
  opacity: 0.75;
}

.topup-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.topup-chip {
  padding: 14px 12px;
  border-radius: 14px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface-solid);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.topup-chip:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  transform: translateY(-1px);
}

.topup-custom {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.topup-custom__hint {
  margin: 10px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
}

.balance-card--compact {
  padding: 18px;
  margin-bottom: 16px;
}

.balance-card--compact .balance-card__amount {
  font-size: 1.5rem;
}

.pay-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface-solid);
  margin-bottom: 16px;
}

.pay-card__head h3 {
  margin: 8px 0 4px;
  font-size: 1.2rem;
}

.pay-card__badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pay-card__sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.pay-card__steps {
  margin: 16px 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.pay-card__id {
  margin: 0 0 14px;
  font-size: 0.82rem;
  color: var(--muted);
}

.pay-card__id code {
  font-family: var(--mono, monospace);
  color: var(--text);
}

.purchase-list,
.tx-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.purchase-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}

.purchase-row:hover { border-color: var(--accent); }

.purchase-row__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.purchase-row__info strong {
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.purchase-row__info span {
  font-size: 0.75rem;
  color: var(--muted);
}

.purchase-row__price {
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.tx-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.tx-row div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tx-row strong { font-size: 0.86rem; }
.tx-row span { font-size: 0.72rem; color: var(--muted); }

.tx-row__sum { font-weight: 800; font-size: 0.9rem; }
.tx--in .tx-row__sum { color: var(--green); }
.tx--out .tx-row__sum { color: var(--danger); }

/* Toast */
.toast-root {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  padding: 14px 20px;
  border-radius: 14px;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-hover);
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.3s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast--ok { border-color: var(--green); color: var(--green); }
.toast--err { border-color: var(--danger); color: var(--danger); }

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── Checkout (project page) ── */
.project__sidebar {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 32px;
  position: sticky;
  top: 88px;
}

.project__sidebar h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 8px 0 10px;
}

.project__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.chip {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
}

.checkout {
  margin-top: 24px;
  padding: 24px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.checkout--owned {
  text-align: center;
  background: var(--green-soft);
  border-color: rgba(52, 211, 153, 0.25);
}

.checkout__badge {
  display: inline-block;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--green);
  margin-bottom: 10px;
}

.checkout__owned-text {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 16px;
  line-height: 1.5;
}

.checkout__price {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.checkout__status--out {
  color: var(--danger);
  font-weight: 700;
}

.checkout__price-row,
.checkout__balance-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.92rem;
}

.checkout__price-row strong,
.checkout__balance-row strong {
  font-size: 1.15rem;
  font-weight: 800;
}

.checkout__progress {
  height: 6px;
  border-radius: 99px;
  background: var(--border);
  overflow: hidden;
  margin: 14px 0 20px;
}

.checkout__progress-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--accent-grad);
  transition: width 0.4s ease;
}

.checkout__note {
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 10px;
}

.checkout .btn + .btn { margin-top: 10px; }

.checkout--auth {
  text-align: center;
}

.checkout__auth-text {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
  margin: 14px 0 18px;
}

/* ── Auth forms ── */
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}

.auth-tab {
  padding: 12px;
  border-radius: 12px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface-solid);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.auth-tab.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field span {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.auth-field input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface-solid);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.auth-hint {
  margin-top: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.account-login-btn {
  white-space: nowrap;
}

.project__gallery,
.project__sidebar {
  align-self: start;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }

  .footer__brand {
    grid-column: 1 / -1;
  }

  .footer__stats {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 32px 0 28px;
  }

  .footer__main {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer__nav {
    justify-items: start;
    grid-template-columns: repeat(2, auto);
    gap: 12px 20px;
  }

  .header__badge { display: none; }

  .nav--pills { display: none; }

  .hero__metrics {
    flex-direction: column;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 280px;
  }

  .metric__sep {
    width: 60%;
    height: 1px;
  }

  .flow::before { display: none; }

  .flow,
  .steps {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .project__layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .hero { padding: 56px 0 32px; }

  .hero__cta {
    flex-direction: column;
    align-items: stretch;
  }

  .hero__cta .btn { width: 100%; }

  .catalog__bar { padding: 16px; }

  .header__shell {
    flex-wrap: wrap;
    border-radius: 16px;
    padding: 10px 12px;
  }

  .header__admin { display: none; }

  .nav, .nav--pills { display: none; }
  .burger { display: flex; }

  .header.nav-open .header__shell {
    flex-wrap: wrap;
  }

  .header.nav-open .nav--pills,
  .header.nav-open .nav {
    display: flex;
    flex-direction: column;
    width: 100%;
    order: 10;
    margin: 8px 0 0;
    padding: 8px;
    position: static;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 14px;
  }

  .pager {
    flex-direction: column;
    gap: 14px;
    padding: 16px;
  }

  .pager__controls {
    width: 100%;
    justify-content: center;
  }

  .form-grid { grid-template-columns: 1fr; }
  .project__meta { grid-template-columns: 1fr; }
  .footer__inner { flex-direction: column; align-items: flex-start; }

  .wallet-pill__label { display: none; }
  .wallet-pill { padding: 8px 12px 8px 8px; }

  .drawer { width: 100vw; }

  .project__sidebar { position: static; }

  .footer__bottom { flex-direction: column; align-items: flex-start; }

  .gallery-lightbox__hint { display: none; }
  .gallery-lightbox__nav--prev { left: 8px; }
  .gallery-lightbox__nav--next { right: 8px; }
  .gallery__nav--prev { left: 8px; }
  .gallery__nav--next { right: 8px; }
}
